head.S 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. /*
  2. * linux/arch/i386/kernel/head.S -- the 32-bit startup code.
  3. *
  4. * Copyright (C) 1991, 1992 Linus Torvalds
  5. *
  6. * Enhanced CPU detection and feature setting code by Mike Jagdis
  7. * and Martin Mares, November 1997.
  8. */
  9. .text
  10. #include <linux/threads.h>
  11. #include <linux/linkage.h>
  12. #include <asm/segment.h>
  13. #include <asm/page.h>
  14. #include <asm/pgtable.h>
  15. #include <asm/desc.h>
  16. #include <asm/cache.h>
  17. #include <asm/thread_info.h>
  18. #include <asm/asm-offsets.h>
  19. #include <asm/setup.h>
  20. /*
  21. * References to members of the new_cpu_data structure.
  22. */
  23. #define X86 new_cpu_data+CPUINFO_x86
  24. #define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor
  25. #define X86_MODEL new_cpu_data+CPUINFO_x86_model
  26. #define X86_MASK new_cpu_data+CPUINFO_x86_mask
  27. #define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math
  28. #define X86_CPUID new_cpu_data+CPUINFO_cpuid_level
  29. #define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
  30. #define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id
  31. /*
  32. * This is how much memory *in addition to the memory covered up to
  33. * and including _end* we need mapped initially. We need one bit for
  34. * each possible page, but only in low memory, which means
  35. * 2^32/4096/8 = 128K worst case (4G/4G split.)
  36. *
  37. * Modulo rounding, each megabyte assigned here requires a kilobyte of
  38. * memory, which is currently unreclaimed.
  39. *
  40. * This should be a multiple of a page.
  41. */
  42. #define INIT_MAP_BEYOND_END (128*1024)
  43. /*
  44. * 32-bit kernel entrypoint; only used by the boot CPU. On entry,
  45. * %esi points to the real-mode code as a 32-bit pointer.
  46. * CS and DS must be 4 GB flat segments, but we don't depend on
  47. * any particular GDT layout, because we load our own as soon as we
  48. * can.
  49. */
  50. ENTRY(startup_32)
  51. #ifdef CONFIG_PARAVIRT
  52. movl %cs, %eax
  53. testl $0x3, %eax
  54. jnz startup_paravirt
  55. #endif
  56. /*
  57. * Set segments to known values.
  58. */
  59. cld
  60. lgdt boot_gdt_descr - __PAGE_OFFSET
  61. movl $(__BOOT_DS),%eax
  62. movl %eax,%ds
  63. movl %eax,%es
  64. movl %eax,%fs
  65. movl %eax,%gs
  66. /*
  67. * Clear BSS first so that there are no surprises...
  68. * No need to cld as DF is already clear from cld above...
  69. */
  70. xorl %eax,%eax
  71. movl $__bss_start - __PAGE_OFFSET,%edi
  72. movl $__bss_stop - __PAGE_OFFSET,%ecx
  73. subl %edi,%ecx
  74. shrl $2,%ecx
  75. rep ; stosl
  76. /*
  77. * Copy bootup parameters out of the way.
  78. * Note: %esi still has the pointer to the real-mode data.
  79. * With the kexec as boot loader, parameter segment might be loaded beyond
  80. * kernel image and might not even be addressable by early boot page tables.
  81. * (kexec on panic case). Hence copy out the parameters before initializing
  82. * page tables.
  83. */
  84. movl $(boot_params - __PAGE_OFFSET),%edi
  85. movl $(PARAM_SIZE/4),%ecx
  86. cld
  87. rep
  88. movsl
  89. movl boot_params - __PAGE_OFFSET + NEW_CL_POINTER,%esi
  90. andl %esi,%esi
  91. jnz 2f # New command line protocol
  92. cmpw $(OLD_CL_MAGIC),OLD_CL_MAGIC_ADDR
  93. jne 1f
  94. movzwl OLD_CL_OFFSET,%esi
  95. addl $(OLD_CL_BASE_ADDR),%esi
  96. 2:
  97. movl $(saved_command_line - __PAGE_OFFSET),%edi
  98. movl $(COMMAND_LINE_SIZE/4),%ecx
  99. rep
  100. movsl
  101. 1:
  102. /*
  103. * Initialize page tables. This creates a PDE and a set of page
  104. * tables, which are located immediately beyond _end. The variable
  105. * init_pg_tables_end is set up to point to the first "safe" location.
  106. * Mappings are created both at virtual address 0 (identity mapping)
  107. * and PAGE_OFFSET for up to _end+sizeof(page tables)+INIT_MAP_BEYOND_END.
  108. *
  109. * Warning: don't use %esi or the stack in this code. However, %esp
  110. * can be used as a GPR if you really need it...
  111. */
  112. page_pde_offset = (__PAGE_OFFSET >> 20);
  113. movl $(pg0 - __PAGE_OFFSET), %edi
  114. movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
  115. movl $0x007, %eax /* 0x007 = PRESENT+RW+USER */
  116. 10:
  117. leal 0x007(%edi),%ecx /* Create PDE entry */
  118. movl %ecx,(%edx) /* Store identity PDE entry */
  119. movl %ecx,page_pde_offset(%edx) /* Store kernel PDE entry */
  120. addl $4,%edx
  121. movl $1024, %ecx
  122. 11:
  123. stosl
  124. addl $0x1000,%eax
  125. loop 11b
  126. /* End condition: we must map up to and including INIT_MAP_BEYOND_END */
  127. /* bytes beyond the end of our own page tables; the +0x007 is the attribute bits */
  128. leal (INIT_MAP_BEYOND_END+0x007)(%edi),%ebp
  129. cmpl %ebp,%eax
  130. jb 10b
  131. movl %edi,(init_pg_tables_end - __PAGE_OFFSET)
  132. #ifdef CONFIG_SMP
  133. xorl %ebx,%ebx /* This is the boot CPU (BSP) */
  134. jmp 3f
  135. /*
  136. * Non-boot CPU entry point; entered from trampoline.S
  137. * We can't lgdt here, because lgdt itself uses a data segment, but
  138. * we know the trampoline has already loaded the boot_gdt_table GDT
  139. * for us.
  140. */
  141. ENTRY(startup_32_smp)
  142. cld
  143. movl $(__BOOT_DS),%eax
  144. movl %eax,%ds
  145. movl %eax,%es
  146. movl %eax,%fs
  147. movl %eax,%gs
  148. /*
  149. * New page tables may be in 4Mbyte page mode and may
  150. * be using the global pages.
  151. *
  152. * NOTE! If we are on a 486 we may have no cr4 at all!
  153. * So we do not try to touch it unless we really have
  154. * some bits in it to set. This won't work if the BSP
  155. * implements cr4 but this AP does not -- very unlikely
  156. * but be warned! The same applies to the pse feature
  157. * if not equally supported. --macro
  158. *
  159. * NOTE! We have to correct for the fact that we're
  160. * not yet offset PAGE_OFFSET..
  161. */
  162. #define cr4_bits mmu_cr4_features-__PAGE_OFFSET
  163. movl cr4_bits,%edx
  164. andl %edx,%edx
  165. jz 6f
  166. movl %cr4,%eax # Turn on paging options (PSE,PAE,..)
  167. orl %edx,%eax
  168. movl %eax,%cr4
  169. btl $5, %eax # check if PAE is enabled
  170. jnc 6f
  171. /* Check if extended functions are implemented */
  172. movl $0x80000000, %eax
  173. cpuid
  174. cmpl $0x80000000, %eax
  175. jbe 6f
  176. mov $0x80000001, %eax
  177. cpuid
  178. /* Execute Disable bit supported? */
  179. btl $20, %edx
  180. jnc 6f
  181. /* Setup EFER (Extended Feature Enable Register) */
  182. movl $0xc0000080, %ecx
  183. rdmsr
  184. btsl $11, %eax
  185. /* Make changes effective */
  186. wrmsr
  187. 6:
  188. /* This is a secondary processor (AP) */
  189. xorl %ebx,%ebx
  190. incl %ebx
  191. 3:
  192. #endif /* CONFIG_SMP */
  193. /*
  194. * Enable paging
  195. */
  196. movl $swapper_pg_dir-__PAGE_OFFSET,%eax
  197. movl %eax,%cr3 /* set the page table pointer.. */
  198. movl %cr0,%eax
  199. orl $0x80000000,%eax
  200. movl %eax,%cr0 /* ..and set paging (PG) bit */
  201. ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */
  202. 1:
  203. /* Set up the stack pointer */
  204. lss stack_start,%esp
  205. /*
  206. * Initialize eflags. Some BIOS's leave bits like NT set. This would
  207. * confuse the debugger if this code is traced.
  208. * XXX - best to initialize before switching to protected mode.
  209. */
  210. pushl $0
  211. popfl
  212. #ifdef CONFIG_SMP
  213. andl %ebx,%ebx
  214. jz 1f /* Initial CPU cleans BSS */
  215. jmp checkCPUtype
  216. 1:
  217. #endif /* CONFIG_SMP */
  218. /*
  219. * start system 32-bit setup. We need to re-do some of the things done
  220. * in 16-bit mode for the "real" operations.
  221. */
  222. call setup_idt
  223. checkCPUtype:
  224. movl $-1,X86_CPUID # -1 for no CPUID initially
  225. /* check if it is 486 or 386. */
  226. /*
  227. * XXX - this does a lot of unnecessary setup. Alignment checks don't
  228. * apply at our cpl of 0 and the stack ought to be aligned already, and
  229. * we don't need to preserve eflags.
  230. */
  231. movb $3,X86 # at least 386
  232. pushfl # push EFLAGS
  233. popl %eax # get EFLAGS
  234. movl %eax,%ecx # save original EFLAGS
  235. xorl $0x240000,%eax # flip AC and ID bits in EFLAGS
  236. pushl %eax # copy to EFLAGS
  237. popfl # set EFLAGS
  238. pushfl # get new EFLAGS
  239. popl %eax # put it in eax
  240. xorl %ecx,%eax # change in flags
  241. pushl %ecx # restore original EFLAGS
  242. popfl
  243. testl $0x40000,%eax # check if AC bit changed
  244. je is386
  245. movb $4,X86 # at least 486
  246. testl $0x200000,%eax # check if ID bit changed
  247. je is486
  248. /* get vendor info */
  249. xorl %eax,%eax # call CPUID with 0 -> return vendor ID
  250. cpuid
  251. movl %eax,X86_CPUID # save CPUID level
  252. movl %ebx,X86_VENDOR_ID # lo 4 chars
  253. movl %edx,X86_VENDOR_ID+4 # next 4 chars
  254. movl %ecx,X86_VENDOR_ID+8 # last 4 chars
  255. orl %eax,%eax # do we have processor info as well?
  256. je is486
  257. movl $1,%eax # Use the CPUID instruction to get CPU type
  258. cpuid
  259. movb %al,%cl # save reg for future use
  260. andb $0x0f,%ah # mask processor family
  261. movb %ah,X86
  262. andb $0xf0,%al # mask model
  263. shrb $4,%al
  264. movb %al,X86_MODEL
  265. andb $0x0f,%cl # mask mask revision
  266. movb %cl,X86_MASK
  267. movl %edx,X86_CAPABILITY
  268. is486: movl $0x50022,%ecx # set AM, WP, NE and MP
  269. jmp 2f
  270. is386: movl $2,%ecx # set MP
  271. 2: movl %cr0,%eax
  272. andl $0x80000011,%eax # Save PG,PE,ET
  273. orl %ecx,%eax
  274. movl %eax,%cr0
  275. call check_x87
  276. call setup_pda
  277. lgdt cpu_gdt_descr
  278. lidt idt_descr
  279. ljmp $(__KERNEL_CS),$1f
  280. 1: movl $(__KERNEL_DS),%eax # reload all the segment registers
  281. movl %eax,%ss # after changing gdt.
  282. movl $(__USER_DS),%eax # DS/ES contains default USER segment
  283. movl %eax,%ds
  284. movl %eax,%es
  285. xorl %eax,%eax # Clear FS and LDT
  286. movl %eax,%fs
  287. lldt %ax
  288. movl $(__KERNEL_PDA),%eax
  289. mov %eax,%gs
  290. cld # gcc2 wants the direction flag cleared at all times
  291. pushl $0 # fake return address for unwinder
  292. #ifdef CONFIG_SMP
  293. movb ready, %cl
  294. movb $1, ready
  295. cmpb $0,%cl # the first CPU calls start_kernel
  296. jne initialize_secondary # all other CPUs call initialize_secondary
  297. #endif /* CONFIG_SMP */
  298. jmp start_kernel
  299. /*
  300. * We depend on ET to be correct. This checks for 287/387.
  301. */
  302. check_x87:
  303. movb $0,X86_HARD_MATH
  304. clts
  305. fninit
  306. fstsw %ax
  307. cmpb $0,%al
  308. je 1f
  309. movl %cr0,%eax /* no coprocessor: have to set bits */
  310. xorl $4,%eax /* set EM */
  311. movl %eax,%cr0
  312. ret
  313. ALIGN
  314. 1: movb $1,X86_HARD_MATH
  315. .byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */
  316. ret
  317. /*
  318. * Point the GDT at this CPU's PDA. On boot this will be
  319. * cpu_gdt_table and boot_pda; for secondary CPUs, these will be
  320. * that CPU's GDT and PDA.
  321. */
  322. setup_pda:
  323. /* get the PDA pointer */
  324. movl start_pda, %eax
  325. /* slot the PDA address into the GDT */
  326. mov cpu_gdt_descr+2, %ecx
  327. mov %ax, (__KERNEL_PDA+0+2)(%ecx) /* base & 0x0000ffff */
  328. shr $16, %eax
  329. mov %al, (__KERNEL_PDA+4+0)(%ecx) /* base & 0x00ff0000 */
  330. mov %ah, (__KERNEL_PDA+4+3)(%ecx) /* base & 0xff000000 */
  331. ret
  332. /*
  333. * setup_idt
  334. *
  335. * sets up a idt with 256 entries pointing to
  336. * ignore_int, interrupt gates. It doesn't actually load
  337. * idt - that can be done only after paging has been enabled
  338. * and the kernel moved to PAGE_OFFSET. Interrupts
  339. * are enabled elsewhere, when we can be relatively
  340. * sure everything is ok.
  341. *
  342. * Warning: %esi is live across this function.
  343. */
  344. setup_idt:
  345. lea ignore_int,%edx
  346. movl $(__KERNEL_CS << 16),%eax
  347. movw %dx,%ax /* selector = 0x0010 = cs */
  348. movw $0x8E00,%dx /* interrupt gate - dpl=0, present */
  349. lea idt_table,%edi
  350. mov $256,%ecx
  351. rp_sidt:
  352. movl %eax,(%edi)
  353. movl %edx,4(%edi)
  354. addl $8,%edi
  355. dec %ecx
  356. jne rp_sidt
  357. .macro set_early_handler handler,trapno
  358. lea \handler,%edx
  359. movl $(__KERNEL_CS << 16),%eax
  360. movw %dx,%ax
  361. movw $0x8E00,%dx /* interrupt gate - dpl=0, present */
  362. lea idt_table,%edi
  363. movl %eax,8*\trapno(%edi)
  364. movl %edx,8*\trapno+4(%edi)
  365. .endm
  366. set_early_handler handler=early_divide_err,trapno=0
  367. set_early_handler handler=early_illegal_opcode,trapno=6
  368. set_early_handler handler=early_protection_fault,trapno=13
  369. set_early_handler handler=early_page_fault,trapno=14
  370. ret
  371. early_divide_err:
  372. xor %edx,%edx
  373. pushl $0 /* fake errcode */
  374. jmp early_fault
  375. early_illegal_opcode:
  376. movl $6,%edx
  377. pushl $0 /* fake errcode */
  378. jmp early_fault
  379. early_protection_fault:
  380. movl $13,%edx
  381. jmp early_fault
  382. early_page_fault:
  383. movl $14,%edx
  384. jmp early_fault
  385. early_fault:
  386. cld
  387. #ifdef CONFIG_PRINTK
  388. movl $(__KERNEL_DS),%eax
  389. movl %eax,%ds
  390. movl %eax,%es
  391. cmpl $2,early_recursion_flag
  392. je hlt_loop
  393. incl early_recursion_flag
  394. movl %cr2,%eax
  395. pushl %eax
  396. pushl %edx /* trapno */
  397. pushl $fault_msg
  398. #ifdef CONFIG_EARLY_PRINTK
  399. call early_printk
  400. #else
  401. call printk
  402. #endif
  403. #endif
  404. hlt_loop:
  405. hlt
  406. jmp hlt_loop
  407. /* This is the default interrupt "handler" :-) */
  408. ALIGN
  409. ignore_int:
  410. cld
  411. #ifdef CONFIG_PRINTK
  412. pushl %eax
  413. pushl %ecx
  414. pushl %edx
  415. pushl %es
  416. pushl %ds
  417. movl $(__KERNEL_DS),%eax
  418. movl %eax,%ds
  419. movl %eax,%es
  420. cmpl $2,early_recursion_flag
  421. je hlt_loop
  422. incl early_recursion_flag
  423. pushl 16(%esp)
  424. pushl 24(%esp)
  425. pushl 32(%esp)
  426. pushl 40(%esp)
  427. pushl $int_msg
  428. #ifdef CONFIG_EARLY_PRINTK
  429. call early_printk
  430. #else
  431. call printk
  432. #endif
  433. addl $(5*4),%esp
  434. popl %ds
  435. popl %es
  436. popl %edx
  437. popl %ecx
  438. popl %eax
  439. #endif
  440. iret
  441. #ifdef CONFIG_PARAVIRT
  442. startup_paravirt:
  443. cld
  444. movl $(init_thread_union+THREAD_SIZE),%esp
  445. /* We take pains to preserve all the regs. */
  446. pushl %edx
  447. pushl %ecx
  448. pushl %eax
  449. /* paravirt.o is last in link, and that probe fn never returns */
  450. pushl $__start_paravirtprobe
  451. 1:
  452. movl 0(%esp), %eax
  453. pushl (%eax)
  454. movl 8(%esp), %eax
  455. call *(%esp)
  456. popl %eax
  457. movl 4(%esp), %eax
  458. movl 8(%esp), %ecx
  459. movl 12(%esp), %edx
  460. addl $4, (%esp)
  461. jmp 1b
  462. #endif
  463. /*
  464. * Real beginning of normal "text" segment
  465. */
  466. ENTRY(stext)
  467. ENTRY(_stext)
  468. /*
  469. * BSS section
  470. */
  471. .section ".bss.page_aligned","w"
  472. ENTRY(swapper_pg_dir)
  473. .fill 1024,4,0
  474. ENTRY(empty_zero_page)
  475. .fill 4096,1,0
  476. /*
  477. * This starts the data section.
  478. */
  479. .data
  480. ENTRY(start_pda)
  481. .long boot_pda
  482. ENTRY(stack_start)
  483. .long init_thread_union+THREAD_SIZE
  484. .long __BOOT_DS
  485. ready: .byte 0
  486. early_recursion_flag:
  487. .long 0
  488. int_msg:
  489. .asciz "Unknown interrupt or fault at EIP %p %p %p\n"
  490. fault_msg:
  491. .ascii "Int %d: CR2 %p err %p EIP %p CS %p flags %p\n"
  492. .asciz "Stack: %p %p %p %p %p %p %p %p\n"
  493. /*
  494. * The IDT and GDT 'descriptors' are a strange 48-bit object
  495. * only used by the lidt and lgdt instructions. They are not
  496. * like usual segment descriptors - they consist of a 16-bit
  497. * segment size, and 32-bit linear address value:
  498. */
  499. .globl boot_gdt_descr
  500. .globl idt_descr
  501. ALIGN
  502. # early boot GDT descriptor (must use 1:1 address mapping)
  503. .word 0 # 32 bit align gdt_desc.address
  504. boot_gdt_descr:
  505. .word __BOOT_DS+7
  506. .long boot_gdt_table - __PAGE_OFFSET
  507. .word 0 # 32-bit align idt_desc.address
  508. idt_descr:
  509. .word IDT_ENTRIES*8-1 # idt contains 256 entries
  510. .long idt_table
  511. # boot GDT descriptor (later on used by CPU#0):
  512. .word 0 # 32 bit align gdt_desc.address
  513. ENTRY(cpu_gdt_descr)
  514. .word GDT_ENTRIES*8-1
  515. .long cpu_gdt_table
  516. /*
  517. * The boot_gdt_table must mirror the equivalent in setup.S and is
  518. * used only for booting.
  519. */
  520. .align L1_CACHE_BYTES
  521. ENTRY(boot_gdt_table)
  522. .fill GDT_ENTRY_BOOT_CS,8,0
  523. .quad 0x00cf9a000000ffff /* kernel 4GB code at 0x00000000 */
  524. .quad 0x00cf92000000ffff /* kernel 4GB data at 0x00000000 */
  525. /*
  526. * The Global Descriptor Table contains 28 quadwords, per-CPU.
  527. */
  528. .align L1_CACHE_BYTES
  529. ENTRY(cpu_gdt_table)
  530. .quad 0x0000000000000000 /* NULL descriptor */
  531. .quad 0x0000000000000000 /* 0x0b reserved */
  532. .quad 0x0000000000000000 /* 0x13 reserved */
  533. .quad 0x0000000000000000 /* 0x1b reserved */
  534. .quad 0x0000000000000000 /* 0x20 unused */
  535. .quad 0x0000000000000000 /* 0x28 unused */
  536. .quad 0x0000000000000000 /* 0x33 TLS entry 1 */
  537. .quad 0x0000000000000000 /* 0x3b TLS entry 2 */
  538. .quad 0x0000000000000000 /* 0x43 TLS entry 3 */
  539. .quad 0x0000000000000000 /* 0x4b reserved */
  540. .quad 0x0000000000000000 /* 0x53 reserved */
  541. .quad 0x0000000000000000 /* 0x5b reserved */
  542. .quad 0x00cf9a000000ffff /* 0x60 kernel 4GB code at 0x00000000 */
  543. .quad 0x00cf92000000ffff /* 0x68 kernel 4GB data at 0x00000000 */
  544. .quad 0x00cffa000000ffff /* 0x73 user 4GB code at 0x00000000 */
  545. .quad 0x00cff2000000ffff /* 0x7b user 4GB data at 0x00000000 */
  546. .quad 0x0000000000000000 /* 0x80 TSS descriptor */
  547. .quad 0x0000000000000000 /* 0x88 LDT descriptor */
  548. /*
  549. * Segments used for calling PnP BIOS have byte granularity.
  550. * They code segments and data segments have fixed 64k limits,
  551. * the transfer segment sizes are set at run time.
  552. */
  553. .quad 0x00409a000000ffff /* 0x90 32-bit code */
  554. .quad 0x00009a000000ffff /* 0x98 16-bit code */
  555. .quad 0x000092000000ffff /* 0xa0 16-bit data */
  556. .quad 0x0000920000000000 /* 0xa8 16-bit data */
  557. .quad 0x0000920000000000 /* 0xb0 16-bit data */
  558. /*
  559. * The APM segments have byte granularity and their bases
  560. * are set at run time. All have 64k limits.
  561. */
  562. .quad 0x00409a000000ffff /* 0xb8 APM CS code */
  563. .quad 0x00009a000000ffff /* 0xc0 APM CS 16 code (16 bit) */
  564. .quad 0x004092000000ffff /* 0xc8 APM DS data */
  565. .quad 0x00c0920000000000 /* 0xd0 - ESPFIX SS */
  566. .quad 0x00cf92000000ffff /* 0xd8 - PDA */
  567. .quad 0x0000000000000000 /* 0xe0 - unused */
  568. .quad 0x0000000000000000 /* 0xe8 - unused */
  569. .quad 0x0000000000000000 /* 0xf0 - unused */
  570. .quad 0x0000000000000000 /* 0xf8 - GDT entry 31: double-fault TSS */