Changeset 96e0748d in mainline for kernel/arch
- Timestamp:
- 2009-02-17T22:47:27Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f89979b
- Parents:
- e662a5f
- Location:
- kernel/arch
- Files:
-
- 2 deleted
- 15 edited
-
arm32/include/arch.h (modified) (2 diffs)
-
arm32/include/asm/boot.h (modified) (2 diffs)
-
arm32/include/boot.h (deleted)
-
arm32/src/arm32.c (modified) (2 diffs)
-
arm32/src/start.S (modified) (2 diffs)
-
ia64/include/arch.h (modified) (1 diff)
-
mips32/include/arch.h (modified) (2 diffs)
-
mips32/include/asm/boot.h (modified) (1 diff)
-
mips32/include/boot.h (deleted)
-
mips32/src/mips32.c (modified) (2 diffs)
-
mips32/src/smp/smp.c (modified) (2 diffs)
-
mips32/src/start.S (modified) (5 diffs)
-
ppc32/include/arch.h (modified) (2 diffs)
-
ppc32/include/boot/boot.h (modified) (2 diffs)
-
ppc32/src/boot/boot.S (modified) (2 diffs)
-
ppc32/src/ppc32.c (modified) (2 diffs)
-
sparc64/include/arch.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/arch.h
re662a5f r96e0748d 27 27 */ 28 28 29 /** @addtogroup arm32 29 /** @addtogroup arm32 30 30 * @{ 31 31 */ … … 37 37 #define KERN_arm32_ARCH_H_ 38 38 39 #define TASKMAP_MAX_RECORDS 32 40 #define CPUMAP_MAX_RECORDS 32 41 42 #include <typedefs.h> 43 44 typedef struct { 45 uintptr_t addr; 46 uint32_t size; 47 } utask_t; 48 49 typedef struct { 50 uint32_t cnt; 51 utask_t tasks[TASKMAP_MAX_RECORDS]; 52 } bootinfo_t; 53 54 extern void arch_pre_main(void *entry, bootinfo_t *bootinfo); 55 39 56 #endif 40 57 -
kernel/arch/arm32/include/asm/boot.h
re662a5f r96e0748d 27 27 */ 28 28 29 /** @addtogroup arm32 29 /** @addtogroup arm32 30 30 * @{ 31 31 */ … … 40 40 #define TEMP_STACK_SIZE 0x100 41 41 42 #ifndef __ASM__43 44 /** Kernel entry point.45 *46 * Implemented in assembly. Copies boot_bootinfo (declared as bootinfo in47 * boot/arch/arm32/loader/main.c) to #bootinfo struct. Then jumps to48 * #arch_pre_main and #main_bsp.49 *50 * @param entry Entry point address (not used).51 * @param boot_bootinfo Struct holding information about loaded tasks.52 * @param bootinfo_size Size of the bootinfo structure.53 */54 extern void kernel_image_start(void *entry, void *boot_bootinfo,55 unsigned int bootinfo_size);56 57 #endif58 59 42 #endif 60 43 -
kernel/arch/arm32/src/arm32.c
re662a5f r96e0748d 35 35 36 36 #include <arch.h> 37 #include <arch/boot.h>38 37 #include <config.h> 39 38 #include <arch/console.h> … … 49 48 #include <arch/machine.h> 50 49 #include <userspace.h> 51 52 /** Information about loaded tasks. */ 53 bootinfo_t bootinfo; 50 #include <macros.h> 54 51 55 52 /** Performs arm32 specific initialization before main_bsp() is called. */ 56 void arch_pre_main(void )53 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo) 57 54 { 58 55 unsigned int i; 59 60 init.cnt = bootinfo .cnt;61 62 for (i = 0; i < bootinfo.cnt; ++i) {63 init.tasks[i].addr = bootinfo .tasks[i].addr;64 init.tasks[i].size = bootinfo .tasks[i].size;56 57 init.cnt = bootinfo->cnt; 58 59 for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); ++i) { 60 init.tasks[i].addr = bootinfo->tasks[i].addr; 61 init.tasks[i].size = bootinfo->tasks[i].size; 65 62 } 66 67 63 } 68 64 -
kernel/arch/arm32/src/start.S
re662a5f r96e0748d 41 41 bic r3, r3, #0x1f 42 42 orr r3, r3, #0x13 43 msr cpsr_c, r3 43 msr cpsr_c, r3 44 44 45 45 ldr sp, =temp_stack 46 47 cmp r2, #048 beq bootinfo_end49 50 ldr r3, =bootinfo51 52 bootinfo_loop:53 ldr r4, [r1]54 str r4, [r3]55 56 add r1, r1, #457 add r3, r3, #458 add r2, r2, #-459 60 cmp r2, #061 bne bootinfo_loop62 46 63 bootinfo_end:64 65 47 bl arch_pre_main 66 48 67 49 bl main_bsp 68 50 … … 75 57 supervisor_sp: 76 58 .space 4 77 -
kernel/arch/ia64/include/arch.h
re662a5f r96e0748d 40 40 #include <arch/ski/ski.h> 41 41 42 extern void arch_pre_main(void); 43 42 44 #endif 43 45 -
kernel/arch/mips32/include/arch.h
re662a5f r96e0748d 27 27 */ 28 28 29 /** @addtogroup mips32 29 /** @addtogroup mips32 30 30 * @{ 31 31 */ … … 36 36 #define KERN_mips32_ARCH_H_ 37 37 38 #define TASKMAP_MAX_RECORDS 32 39 #define CPUMAP_MAX_RECORDS 32 40 41 #include <typedefs.h> 42 43 extern count_t cpu_count; 44 45 typedef struct { 46 uintptr_t addr; 47 uint32_t size; 48 } utask_t; 49 50 typedef struct { 51 uint32_t cpumap; 52 uint32_t cnt; 53 utask_t tasks[TASKMAP_MAX_RECORDS]; 54 } bootinfo_t; 55 56 extern void arch_pre_main(void *entry, bootinfo_t *bootinfo); 57 38 58 #endif 39 59 -
kernel/arch/mips32/include/asm/boot.h
re662a5f r96e0748d 27 27 */ 28 28 29 /** @addtogroup mips32 29 /** @addtogroup mips32 30 30 * @{ 31 31 */ -
kernel/arch/mips32/src/mips32.c
re662a5f r96e0748d 34 34 35 35 #include <arch.h> 36 #include <arch/boot.h>37 36 #include <arch/cp0.h> 38 37 #include <arch/exception.h> … … 59 58 #include <arch/asm/regname.h> 60 59 61 /* Size of the code jumping to the exception handler code 62 * - J+NOP 63 */ 64 #define EXCEPTION_JUMP_SIZE 865 66 #define TLB_EXC ((char *) 0x80000000)67 #define NORM_EXC ((char *) 0x80000180)68 #define CACHE_EXC ((char *) 0x80000100)60 /* Size of the code jumping to the exception handler code 61 * - J+NOP 62 */ 63 #define EXCEPTION_JUMP_SIZE 8 64 65 #define TLB_EXC ((char *) 0x80000000) 66 #define NORM_EXC ((char *) 0x80000180) 67 #define CACHE_EXC ((char *) 0x80000100) 69 68 70 69 71 70 /* Why the linker moves the variable 64K away in assembler 72 * when not in .text section ???????? 73 */ 71 * when not in .text section? 72 */ 73 74 /* Stack pointer saved when entering user mode */ 74 75 uintptr_t supervisor_sp __attribute__ ((section (".text"))); 75 /* Stack pointer saved when entering user mode */ 76 /* TODO: How do we do it on SMP system???? */ 77 bootinfo_t bootinfo __attribute__ ((section (".text"))); 78 79 void arch_pre_main(void) 76 77 count_t cpu_count = 0; 78 79 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo) 80 80 { 81 81 /* Setup usermode */ 82 init.cnt = bootinfo.cnt; 83 84 uint32_t i; 85 86 for (i = 0; i < bootinfo.cnt; i++) { 87 init.tasks[i].addr = bootinfo.tasks[i].addr; 88 init.tasks[i].size = bootinfo.tasks[i].size; 82 init.cnt = bootinfo->cnt; 83 84 count_t i; 85 for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) { 86 init.tasks[i].addr = bootinfo->tasks[i].addr; 87 init.tasks[i].size = bootinfo->tasks[i].size; 88 } 89 90 for (i = 0; i < CPUMAP_MAX_RECORDS; i++) { 91 if ((bootinfo->cpumap & (1 << i)) != 0) 92 cpu_count++; 89 93 } 90 94 } -
kernel/arch/mips32/src/smp/smp.c
re662a5f r96e0748d 33 33 */ 34 34 35 #include <config.h> 35 36 #include <smp/smp.h> 37 #include <arch/arch.h> 36 38 37 39 #ifdef CONFIG_SMP … … 39 41 void smp_init(void) 40 42 { 43 config.cpu_count = cpu_count; 41 44 } 42 45 -
kernel/arch/mips32/src/start.S
re662a5f r96e0748d 32 32 #include <arch/context_offset.h> 33 33 #include <arch/stack.h> 34 34 35 35 .text 36 36 … … 153 153 # Move $k0 (superveisor_sp) 154 154 lw $k0, 0($k0) 155 1: 155 1: 156 156 .endm 157 157 158 158 .org 0x0 159 159 kernel_image_start: … … 162 162 ori $sp, $sp, %lo(end_stack) 163 163 164 /* Not sure about this, but might 165 be needed for PIC code */ 166 lui $gp, 0x8000 167 164 168 /* $a1 contains physical address of bootinfo_t */ 165 /* $a2 contains size of bootinfo_t */166 167 beq $a2, $0, bootinfo_end168 169 /* Not sure about this, but might be needed for PIC code???? */170 lui $gp, 0x8000171 172 lui $a3, %hi(bootinfo)173 ori $a3, $a3, %lo(bootinfo)174 175 bootinfo_loop:176 177 lw $v0, 0($a1)178 sw $v0, 0($a3)179 180 addi $a1, $a1, 4181 addi $a3, $a3, 4182 addi $a2, $a2, -4183 184 bgtz $a2, bootinfo_loop185 nop186 187 bootinfo_end:188 169 189 170 jal arch_pre_main … … 206 187 exception_entry: 207 188 j exception_handler 208 nop 209 189 nop 190 210 191 exception_handler: 211 192 KERNEL_STACK_TO_K0 … … 216 197 mfc0 $k0, $cause 217 198 218 sra $k0, $k0, 0x2 # cp0_exc_cause() part 1219 andi $k0, $k0, 0x1f # cp0_exc_cause() part 2220 sub $k0, 8 # 8 = SYSCALL199 sra $k0, $k0, 0x2 # cp0_exc_cause() part 1 200 andi $k0, $k0, 0x1f # cp0_exc_cause() part 2 201 sub $k0, 8 # 8 = SYSCALL 221 202 222 203 beqz $k0, syscall_shortcut 223 add $k0, 8 # Revert $k0 back to correct exc number204 add $k0, 8 # Revert $k0 back to correct exc number 224 205 225 206 REGISTERS_STORE_AND_EXC_RESET $sp 226 207 227 208 move $a1, $sp 228 jal exc_dispatch # exc_dispatch(excno, register_space)209 jal exc_dispatch # exc_dispatch(excno, register_space) 229 210 move $a0, $k0 230 211 -
kernel/arch/ppc32/include/arch.h
re662a5f r96e0748d 27 27 */ 28 28 29 /** @addtogroup ppc32 29 /** @addtogroup ppc32 30 30 * @{ 31 31 */ … … 36 36 #define KERN_ppc32_ARCH_H_ 37 37 38 #include <arch/drivers/cuda.h> 38 extern void arch_pre_main(void); 39 39 40 40 #endif -
kernel/arch/ppc32/include/boot/boot.h
re662a5f r96e0748d 27 27 */ 28 28 29 /** @addtogroup ppc32 29 /** @addtogroup ppc32 30 30 * @{ 31 31 */ … … 36 36 #define KERN_ppc32_BOOT_H_ 37 37 38 #define BOOT_OFFSET 0x800038 #define BOOT_OFFSET 0x8000 39 39 40 40 /* Temporary stack size for boot process */ 41 #define TEMP_STACK_SIZE 0x100041 #define TEMP_STACK_SIZE 0x1000 42 42 43 #define TASKMAP_MAX_RECORDS 3244 #define MEMMAP_MAX_RECORDS 3243 #define TASKMAP_MAX_RECORDS 32 44 #define MEMMAP_MAX_RECORDS 32 45 45 46 46 #ifndef __ASM__ -
kernel/arch/ppc32/src/boot/boot.S
re662a5f r96e0748d 34 34 .global kernel_image_start 35 35 kernel_image_start: 36 36 37 37 # load temporal kernel stack 38 38 … … 53 53 54 54 addis r3, r3, 0x8000 55 55 56 56 lis r31, bootinfo@ha 57 57 addi r31, r31, bootinfo@l # r31 = bootinfo -
kernel/arch/ppc32/src/ppc32.c
re662a5f r96e0748d 46 46 #include <ddi/irq.h> 47 47 #include <arch/drivers/pic.h> 48 #include <macros.h> 48 49 49 #define IRQ_COUNT 6450 #define IRQ_COUNT 64 50 51 51 52 bootinfo_t bootinfo; … … 53 54 void arch_pre_main(void) 54 55 { 55 /* Setup usermode */56 56 init.cnt = bootinfo.taskmap.count; 57 57 58 58 uint32_t i; 59 59 60 for (i = 0; i < bootinfo.taskmap.count; i++) {60 for (i = 0; i < min3(bootinfo.taskmap.count, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) { 61 61 init.tasks[i].addr = PA2KA(bootinfo.taskmap.tasks[i].addr); 62 62 init.tasks[i].size = bootinfo.taskmap.tasks[i].size; -
kernel/arch/sparc64/include/arch.h
re662a5f r96e0748d 46 46 #define NWINDOWS 8 /** Number of register window sets. */ 47 47 48 #ifndef __ASM__ 49 50 extern void arch_pre_main(void); 51 52 #endif /* __ASM__ */ 53 48 54 #endif 49 55
Note:
See TracChangeset
for help on using the changeset viewer.
