Changeset 493 for soft/giet_vm/giet_boot/boot_entry.S
- Timestamp:
- Feb 8, 2015, 12:30:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_boot/boot_entry.S
r490 r493 1 1 /* 2 * file : boot .S2 * file : boot_entry.S 3 3 * date : 01/17/2014 4 4 * author : Cesar Fuguet & Alain Greiner & Hao Liu … … 19 19 * to the boot_init() fuction defined in the boot.c file. 20 20 * 21 * - each processor [x][y][0] uses a larger stack: 1,25 Kbytes.22 * - Other processors use a smaller stack: 256bytes.23 * => the SEG_BOOT_STACK_SIZE cannot be smaller 512 Kytes.24 * (256*(1024+256) + (1024 - 256) * 256 = 512 Kbytes = 0x80000)21 * - each processor P[x,y,0] uses a larger stack: 1,25 Kbytes. 22 * - Other processors use a smaller stack: 0,25 Kbytes. 23 * => the SEG_BOOT_STACK_SIZE cannot be smaller than 24 * 256 * (1024 + 256) + (1024 - 256) * 256 = 512 Kbytes 25 25 */ 26 26 … … 38 38 boot_entry: 39 39 40 41 /* All processors compute proc_id = (cluster_id * NBPROCS) + lpid */42 /* where cluster_id = (x * Y_SIZE) + y */43 40 /* The (x,y,lpid) values are obtained from the processor CP0 register, */ 44 /* where proc_xyl == (((x<<4) + y) * NB_PROCS_MAX) + lpid */ 45 /* (proc_id is a "continuous" index, while proc_xyl is a "fixed format" index */ 46 41 /* where proc_id == (((x<<Y_WIDTH) + y)<<P_WIDTH) + lpid (fixed format) */ 42 /* The continuous cluster index is computed as cluster_id = (x * Y_SIZE) + y */ 47 43 48 44 mfc0 k0, CP0_PROCID 49 andi k0, k0, 0xFFF /* k0 <= proc_ xyl*/45 andi k0, k0, 0xFFF /* k0 <= proc_id */ 50 46 andi t1, k0, ((1<<P_WIDTH)-1) /* t1 <= lpid */ 51 47 srl t2, k0, P_WIDTH /* t2 <= cluster_xy */ … … 54 50 la t6, Y_SIZE /* t6 <= Y_SIZE */ 55 51 multu t3, t6 56 mflo t5 52 mflo t5 /* t5 <= x * Y_SIZE */ 57 53 addu t5, t5, t4 /* t5 <= cluster_id */ 58 li t6, 0x100 * (NB_PROCS_MAX - 1) + 0x500 /* stack size per cluster */ 54 55 /* All processors initializes stack pointer, depending on x,y,lpid */ 56 /* Processors P[x,y,0] : stack size = 1,25 Kbytes */ 57 /* Other processors : stack size = 0,25 Kbytes 58 /* In each cluster, the total stack size is NB_PROCS_MAX-1)*0x100 + 0x500 */ 59 60 li t6, (NB_PROCS_MAX-1) * 0x100 + 0x500 /* t6 <= cluster_size */ 59 61 multu t6, t5 60 mflo t7 61 62 /* All processors initializes stack pointer, depending on proc_id */ 63 64 la k0, SEG_BOOT_STACK_BASE 65 addu k0, k0, t7 66 li k1, 0x500 /* k1 <= local P0 stack size == 1,25 Kbytes */ 67 addu sp, k0, k1 /* P0 stack from base to (base + stack size * cluster_id + 1,25K ) */ 68 69 li k1, 0x100 /* k1 <= Pi stack size == 256 bytes */ 70 multu k1, t1 71 mflo k0 /* k0 <= 256 * proc_id */ 72 addu sp, sp, k0 /* Pi stacks from base + stack size * cluster_id + 1,25K + proc_id*256 */ 73 62 mflo t7 /* t7 <= cluster_size * cluster_id */ 63 la k0, SEG_BOOT_STACK_BASE 64 addu k0, k0, t7 /* k0 <= stack base in cluster */ 65 li k1, 0x500 /* k1 <= 1,25 Kbytes */ 66 addu sp, k0, k1 /* P[x,y,0] stack top */ 67 li k1, 0x100 /* k1 <= 0,25 bytes */ 68 multu k1, t1 69 mflo k0 /* k0 <= 256 * lpid */ 70 addu sp, sp, k0 /* P[x,y,lpid] stack top */ 74 71 75 72 /* All processors jump to the boot_init function */
Note: See TracChangeset
for help on using the changeset viewer.