Changeset 393f631 in mainline for arch/ppc


Ignore:
Timestamp:
2005-08-31T21:51:04Z (20 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
33ccb2c
Parents:
94f0ae4
Message:

many PPC stuff, platform dependent arch.h header files

Location:
arch/ppc
Files:
6 added
7 edited
2 moved

Legend:

Unmodified
Added
Removed
  • arch/ppc/Makefile.inc

    r94f0ae4 r393f631  
    1313CPPFLAGS=$(DEFS) -nostdinc -I../include
    1414CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2
    15 LFLAGS=-M -no-check-sections -T ../arch/ppc/_link.ld
     15LFLAGS=-M -no-check-sections -N -T ../arch/ppc/_link.ld
    1616
    1717arch_sources= \
     
    1919        arch/debug/panic.s \
    2020        arch/fpu_context.c \
     21        arch/ppc.c \
    2122        arch/dummy.s \
    2223        arch/start.S \
    23         arch/asm.s \
     24        arch/asm.S \
     25        arch/cpu/cpu.c \
    2426        arch/mm/frame.c \
    2527        arch/mm/memory_init.c \
  • arch/ppc/_link.ld

    r94f0ae4 r393f631  
    2424                *(.data);               /* initialized data */
    2525                *(.sdata);
     26                *(.sdata2);
    2627                *(.sbss);
    2728                *(.bss);                /* uninitialized static variables */   
  • arch/ppc/boot/Makefile

    r94f0ae4 r393f631  
    99        cp boot.bin ../../../src/load.bin
    1010
     11CC=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-gcc
    1112AS=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-as
    1213LD=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-ld
    1314
    14 ASFLAGS=
    15 LFLAGS=--oformat=binary -e start
     15CPPFLAGS=$(DEFS) -nostdinc -I../include
     16CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2
     17LFLAGS=-no-check-sections -N -T _link.ld
    1618
    17 boot.bin: boot.o
    18         $(LD) $(LFLAGS) boot.o -o $@
     19boot.bin: boot.o main.o
     20        $(LD) $(LFLAGS) boot.o main.o -o $@
    1921
    20 boot.o:
    21         $(AS) boot.s -o $@
     22boot.o: boot.S
     23        $(CC) $(CFLAGS) -c boot.S -o $@
     24
     25main.o: main.c
     26        $(CC) $(CFLAGS) -c main.c -o $@
    2227
    2328clean:
  • arch/ppc/boot/boot.S

    r94f0ae4 r393f631  
    2727#
    2828
    29 .text
     29#include <asm/macro.h>
     30
     31.section BOOTSTRAP
    3032
    3133.global start
     34
    3235start:
    33                
     36        lis r4, ofw@ha
     37        addi r4, r4, ofw@l
     38        stw r5, 0(r4)
     39       
     40        bl init
     41       
     42        b bootstrap
  • arch/ppc/include/asm.h

    r94f0ae4 r393f631  
    7979                "mfmsr %%r31\n"
    8080                "rlwimi  %0, %%r31, 0, 17, 15\n"
     81                "cmpw 0, %0, %%r31\n"
     82                "beq 0f\n"
    8183                "mtmsr %0\n"
     84                "0:\n"
    8285                : "=r" (pri)
    8386                : "0" (pri)
    8487                : "%r31"
    8588        );
     89}
     90
     91/** Return raw priority level
     92 *
     93 * Return EE.
     94 */
     95static inline pri_t cpu_priority_read(void) {
     96        pri_t v;
     97        __asm__ volatile (
     98                "mfmsr %0\n"
     99                : "=r" (v)
     100        );
     101        return v;
    86102}
    87103
  • arch/ppc/include/context.h

    r94f0ae4 r393f631  
    3131
    3232#include <arch/types.h>
    33 #include <arch/drivers/ofw.h>
    3433
    3534#define SP_DELTA        8
    36 
    37 #ifdef context_map_stack
    38 #undef context_map_stack
    39 #endif
    40 
    41 #define context_map_stack(stack, size) \
    42         ofw_claim((void *) stack, size, 0);
    4335
    4436struct context {
  • arch/ppc/src/asm.S

    r94f0ae4 r393f631  
    3333.global cpu_halt
    3434.global cpu_sleep
     35.global memsetb
     36.global memcpy
    3537
    3638cpu_halt:
     
    3941cpu_sleep:
    4042        b cpu_sleep
     43
     44memsetb:
     45        rlwimi r5, r5, 8, 16, 23
     46        rlwimi r5, r5, 16, 0, 15
     47       
     48        addi r14, r3, -4
     49       
     50        cmplwi 0, r4, 4
     51        blt 7f
     52       
     53        stwu r5, 4(r14)
     54        beqlr
     55       
     56        andi. r15, r14, 3
     57        add r4, r15, r4
     58        subf r14, r15, r14
     59        srwi r15, r4, 2
     60        mtctr r15
     61       
     62        bdz 6f
     63       
     64        1:
     65                stwu r5, 4(r14)
     66                bdnz 1b
     67       
     68        6:
     69       
     70        andi. r4, r4, 3
     71       
     72        7:
     73       
     74        cmpwi 0, r4, 0
     75        beqlr
     76       
     77        mtctr r4
     78        addi r6, r6, 3
     79       
     80        8:
     81       
     82        stbu r5, 1(r14)
     83        bdnz 8b
     84       
     85        blr
     86
     87memcpy:
     88        # TODO
     89        blr
  • arch/ppc/src/drivers/ofw.c

    r94f0ae4 r393f631  
    4242                ofw_done();
    4343       
    44         if (ofw_call("getprop", 4, 1, ofw_chosen, "stdout", &ofw_stdout, sizeof(ofw_stdout)) <= 0)
     44        if (ofw_get_property(ofw_chosen, "stdout", &ofw_stdout, sizeof(ofw_stdout)) <= 0)
    4545                ofw_stdout = 0;
    4646}
  • arch/ppc/src/dummy.s

    r94f0ae4 r393f631  
    2929.text
    3030
    31 .global memcpy
    32 .global cpu_priority_read
    33 .global memsetb
     31.global asm_delay_loop
    3432.global userspace
    3533.global before_thread_runs_arch
    36 .global cpu_sleep
    37 .global cpu_identify
    38 .global cpu_arch_init
    39 .global cpu_print_report
    40 .global arch_pre_mm_init
    41 .global arch_post_mm_init
    42 .global arch_late_init
    43 .global calibrate_delay_loop
    44 .global asm_delay_loop
    4534.global dummy
    4635
    47 memcpy:
    48 cpu_priority_read:
    49 memsetb:
    5036before_thread_runs_arch:
    5137userspace:
    52 calibrate_delay_loop:
    5338asm_delay_loop:
    54 cpu_identify:
    55 cpu_arch_init:
    56 cpu_print_report:
    57 arch_pre_mm_init:
    58 arch_post_mm_init:
    59 arch_late_init:
    60 calibrate_delay_loop:
    6139
    6240dummy:
Note: See TracChangeset for help on using the changeset viewer.