Rev 1899 | Rev 1903 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1899 | Rev 1900 | ||
|---|---|---|---|
| Line 41... | Line 41... | ||
| 41 | /* |
41 | /* |
| 42 | * Here is where the kernel is passed control |
42 | * Here is where the kernel is passed control |
| 43 | * from the boot loader. |
43 | * from the boot loader. |
| 44 | * |
44 | * |
| 45 | * The registers are expected to be in this state: |
45 | * The registers are expected to be in this state: |
| 46 | * - %o0 non-zero for the bootstrup processor, zero for application/secondary processors |
46 | * - %o0 non-zero for the bootstrap processor, zero for application/secondary processors |
| 47 | * - %o1 bootinfo structure address |
47 | * - %o1 bootinfo structure address |
| 48 | * - %o2 bootinfo structure size |
48 | * - %o2 bootinfo structure size |
| 49 | * |
49 | * |
| 50 | * Moreover, we depend on boot having established the |
50 | * Moreover, we depend on boot having established the |
| 51 | * following environment: |
51 | * following environment: |
| Line 54... | Line 54... | ||
| 54 | * - identity mapping for memory stack |
54 | * - identity mapping for memory stack |
| 55 | */ |
55 | */ |
| 56 | 56 | ||
| 57 | .global kernel_image_start |
57 | .global kernel_image_start |
| 58 | kernel_image_start: |
58 | kernel_image_start: |
| 59 | brz %o0, kernel_image_start ! block secondary processors |
- | |
| 60 | nop |
59 | mov %o0, %l7 |
| 61 | 60 | ||
| 62 | /* |
61 | /* |
| 63 | * Setup basic runtime environment. |
62 | * Setup basic runtime environment. |
| 64 | */ |
63 | */ |
| 65 | 64 | ||
| Line 73... | Line 72... | ||
| 73 | 72 | ||
| 74 | /* |
73 | /* |
| 75 | * Copy the bootinfo structure passed from the boot loader |
74 | * Copy the bootinfo structure passed from the boot loader |
| 76 | * to the kernel bootinfo structure. |
75 | * to the kernel bootinfo structure. |
| 77 | */ |
76 | */ |
| - | 77 | brz %l7, 0f ! skip if you are not the bootstrap CPU |
|
| 78 | sethi %hi(bootinfo), %o0 |
78 | sethi %hi(bootinfo), %o0 |
| 79 | call memcpy |
79 | call memcpy |
| 80 | or %o0, %lo(bootinfo), %o0 |
80 | or %o0, %lo(bootinfo), %o0 |
| - | 81 | 0: |
|
| 81 | 82 | ||
| 82 | /* |
83 | /* |
| 83 | * Switch to kernel trap table. |
84 | * Switch to kernel trap table. |
| 84 | */ |
85 | */ |
| 85 | sethi %hi(trap_table), %g1 |
86 | sethi %hi(trap_table), %g1 |
| Line 223... | Line 224... | ||
| 223 | flush %g5 |
224 | flush %g5 |
| 224 | 225 | ||
| 225 | ! set TL back to 0 |
226 | ! set TL back to 0 |
| 226 | wrpr %g0, 0, %tl |
227 | wrpr %g0, 0, %tl |
| 227 | 228 | ||
| - | 229 | brz %l7, 2f ! skip if you are not the bootstrap CPU |
|
| - | 230 | ||
| 228 | call arch_pre_main |
231 | call arch_pre_main |
| 229 | nop |
232 | nop |
| 230 | 233 | ||
| 231 | call main_bsp |
234 | call main_bsp |
| 232 | nop |
235 | nop |