- Timestamp:
- 2005-08-31T21:51:04Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 33ccb2c
- Parents:
- 94f0ae4
- Location:
- arch/ppc
- Files:
-
- 6 added
- 7 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
arch/ppc/Makefile.inc
r94f0ae4 r393f631 13 13 CPPFLAGS=$(DEFS) -nostdinc -I../include 14 14 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2 15 LFLAGS=-M -no-check-sections - T ../arch/ppc/_link.ld15 LFLAGS=-M -no-check-sections -N -T ../arch/ppc/_link.ld 16 16 17 17 arch_sources= \ … … 19 19 arch/debug/panic.s \ 20 20 arch/fpu_context.c \ 21 arch/ppc.c \ 21 22 arch/dummy.s \ 22 23 arch/start.S \ 23 arch/asm.s \ 24 arch/asm.S \ 25 arch/cpu/cpu.c \ 24 26 arch/mm/frame.c \ 25 27 arch/mm/memory_init.c \ -
arch/ppc/_link.ld
r94f0ae4 r393f631 24 24 *(.data); /* initialized data */ 25 25 *(.sdata); 26 *(.sdata2); 26 27 *(.sbss); 27 28 *(.bss); /* uninitialized static variables */ -
arch/ppc/boot/Makefile
r94f0ae4 r393f631 9 9 cp boot.bin ../../../src/load.bin 10 10 11 CC=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-gcc 11 12 AS=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-as 12 13 LD=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-ld 13 14 14 ASFLAGS= 15 LFLAGS=--oformat=binary -e start 15 CPPFLAGS=$(DEFS) -nostdinc -I../include 16 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2 17 LFLAGS=-no-check-sections -N -T _link.ld 16 18 17 boot.bin: boot.o 18 $(LD) $(LFLAGS) boot.o -o $@19 boot.bin: boot.o main.o 20 $(LD) $(LFLAGS) boot.o main.o -o $@ 19 21 20 boot.o: 21 $(AS) boot.s -o $@ 22 boot.o: boot.S 23 $(CC) $(CFLAGS) -c boot.S -o $@ 24 25 main.o: main.c 26 $(CC) $(CFLAGS) -c main.c -o $@ 22 27 23 28 clean: -
arch/ppc/boot/boot.S
r94f0ae4 r393f631 27 27 # 28 28 29 .text 29 #include <asm/macro.h> 30 31 .section BOOTSTRAP 30 32 31 33 .global start 34 32 35 start: 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 79 79 "mfmsr %%r31\n" 80 80 "rlwimi %0, %%r31, 0, 17, 15\n" 81 "cmpw 0, %0, %%r31\n" 82 "beq 0f\n" 81 83 "mtmsr %0\n" 84 "0:\n" 82 85 : "=r" (pri) 83 86 : "0" (pri) 84 87 : "%r31" 85 88 ); 89 } 90 91 /** Return raw priority level 92 * 93 * Return EE. 94 */ 95 static 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; 86 102 } 87 103 -
arch/ppc/include/context.h
r94f0ae4 r393f631 31 31 32 32 #include <arch/types.h> 33 #include <arch/drivers/ofw.h>34 33 35 34 #define SP_DELTA 8 36 37 #ifdef context_map_stack38 #undef context_map_stack39 #endif40 41 #define context_map_stack(stack, size) \42 ofw_claim((void *) stack, size, 0);43 35 44 36 struct context { -
arch/ppc/src/asm.S
r94f0ae4 r393f631 33 33 .global cpu_halt 34 34 .global cpu_sleep 35 .global memsetb 36 .global memcpy 35 37 36 38 cpu_halt: … … 39 41 cpu_sleep: 40 42 b cpu_sleep 43 44 memsetb: 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 87 memcpy: 88 # TODO 89 blr -
arch/ppc/src/drivers/ofw.c
r94f0ae4 r393f631 42 42 ofw_done(); 43 43 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) 45 45 ofw_stdout = 0; 46 46 } -
arch/ppc/src/dummy.s
r94f0ae4 r393f631 29 29 .text 30 30 31 .global memcpy 32 .global cpu_priority_read 33 .global memsetb 31 .global asm_delay_loop 34 32 .global userspace 35 33 .global before_thread_runs_arch 36 .global cpu_sleep37 .global cpu_identify38 .global cpu_arch_init39 .global cpu_print_report40 .global arch_pre_mm_init41 .global arch_post_mm_init42 .global arch_late_init43 .global calibrate_delay_loop44 .global asm_delay_loop45 34 .global dummy 46 35 47 memcpy:48 cpu_priority_read:49 memsetb:50 36 before_thread_runs_arch: 51 37 userspace: 52 calibrate_delay_loop:53 38 asm_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:61 39 62 40 dummy:
Note:
See TracChangeset
for help on using the changeset viewer.