2 #include <arch/intel.h>
18 intel_chip_post_macro(0x13) /* post 12 */
41 /* Push the cpu index and struct cpu */
45 /* push the boot_complete flag */
48 /* Save the stack location */
51 /* Initialize the Interrupt Descriptor table */
54 movl $(0x10 << 16), %eax /* cs selector */
58 movw $0x8E00, %dx /* Interrupt gate - dpl=0, present */
66 /* Load the Interrupt descriptor table */
70 * Now we are finished. Memory is up, data is copied and
71 * bss is cleared. Now we call the main routine and
74 intel_chip_post_macro(0xfe) /* post fe */
76 /* Restore the stack location */
79 /* The boot_complete flag has already been pushed */
83 intel_chip_post_macro(0xee) /* post fe */
88 pushl $0 /* error code */
92 pushl $0 /* error code */
97 pushl $0 /* error code */
102 pushl $0 /* error code */
103 pushl $3 /* vector */
107 pushl $0 /* error code */
108 pushl $4 /* vector */
112 pushl $0 /* error code */
113 pushl $5 /* vector */
117 pushl $0 /* error code */
118 pushl $6 /* vector */
122 pushl $0 /* error code */
123 pushl $7 /* vector */
128 pushl $8 /* vector */
133 pushl $0 /* error code */
134 pushl $9 /* vector */
139 pushl $10 /* vector */
145 pushl $11 /* vector */
151 pushl $12 /* vector */
157 pushl $13 /* vector */
163 pushl $14 /* vector */
168 pushl $0 /* error code */
169 pushl $15 /* vector */
173 pushl $0 /* error code */
174 pushl $16 /* vector */
179 pushl $17 /* vector */
184 pushl $0 /* error code */
185 pushl $18 /* vector */
189 pushl $0 /* error code */
190 pushl $19 /* vector */
193 /* At this point on the stack there is:
203 /* Original stack pointer */
211 pushl %esp /* Pointer to structure on the stack */
213 pop %eax /* Drop the pointer */
219 popl %ebp /* Ignore saved %esp value */
224 addl $8, %esp /* pop of the vector and error code */
228 #if CONFIG_GDB_STUB == 1
230 .globl gdb_stub_breakpoint
232 popl %eax /* Return address */
235 pushl %eax /* Return address */
236 pushl $0 /* No error code */
237 pushl $32 /* vector 32 is user defined */
242 .globl gdt, gdt_end, gdt_limit, idtarg
244 gdt_limit = gdt_end - gdt - 1 /* compute the table limit */
247 .long gdt /* we know the offset */
252 .word 0x0000, 0x0000 /* dummy */
253 .byte 0x00, 0x00, 0x00, 0x00
256 .word 0x0000, 0x0000 /* dummy */
257 .byte 0x00, 0x00, 0x00, 0x00
260 /* flat code segment */
262 .byte 0x00, 0x9b, 0xcf, 0x00
265 /* flat data segment */
267 .byte 0x00, 0x93, 0xcf, 0x00
270 .word 0x0000, 0x0000 /* dummy */
271 .byte 0x00, 0x00, 0x00, 0x00
273 #if defined(CONFIG_LEGACY_VGABIOS) && (CONFIG_LEGACY_VGABIOS == 1)
275 /* 0x00009a00,0000ffffULL, 20h: 16-bit 64k code at 0x00000000 */
276 /* 0x00009200,0000ffffULL 28h: 16-bit 64k data at 0x00000000 */
278 /*16-bit 64k code at 0x00000000 */
283 /*16-bit 64k data at 0x00000000 */
286 #endif // defined(CONFIG_VGABIOS) && (CONFIG_VGABIOS == 1)
290 .word _idt_end - _idt - 1 /* limit */
294 .fill 20, 8, 0 # idt is unitiailzed