diff options
-rw-r--r-- | Documentation/i386/boot.txt | 34 | ||||
-rw-r--r-- | arch/x86/kernel/asm-offsets_32.c | 7 | ||||
-rw-r--r-- | include/asm-x86/bootparam.h | 9 |
3 files changed, 47 insertions, 3 deletions
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index 35985b34d5a6..2f75e750e4f5 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/i386/boot.txt | |||
@@ -168,6 +168,8 @@ Offset Proto Name Meaning | |||
168 | 0234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not | 168 | 0234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not |
169 | 0235/3 N/A pad2 Unused | 169 | 0235/3 N/A pad2 Unused |
170 | 0238/4 2.06+ cmdline_size Maximum size of the kernel command line | 170 | 0238/4 2.06+ cmdline_size Maximum size of the kernel command line |
171 | 023C/4 2.07+ hardware_subarch Hardware subarchitecture | ||
172 | 0240/8 2.07+ hardware_subarch_data Subarchitecture-specific data | ||
171 | 173 | ||
172 | (1) For backwards compatibility, if the setup_sects field contains 0, the | 174 | (1) For backwards compatibility, if the setup_sects field contains 0, the |
173 | real value is 4. | 175 | real value is 4. |
@@ -204,7 +206,7 @@ boot loaders can ignore those fields. | |||
204 | 206 | ||
205 | The byte order of all fields is littleendian (this is x86, after all.) | 207 | The byte order of all fields is littleendian (this is x86, after all.) |
206 | 208 | ||
207 | Field name: setup_secs | 209 | Field name: setup_sects |
208 | Type: read | 210 | Type: read |
209 | Offset/size: 0x1f1/1 | 211 | Offset/size: 0x1f1/1 |
210 | Protocol: ALL | 212 | Protocol: ALL |
@@ -356,6 +358,13 @@ Protocol: 2.00+ | |||
356 | - If 0, the protected-mode code is loaded at 0x10000. | 358 | - If 0, the protected-mode code is loaded at 0x10000. |
357 | - If 1, the protected-mode code is loaded at 0x100000. | 359 | - If 1, the protected-mode code is loaded at 0x100000. |
358 | 360 | ||
361 | Bit 6 (write): KEEP_SEGMENTS | ||
362 | Protocol: 2.07+ | ||
363 | - if 0, reload the segment registers in the 32bit entry point. | ||
364 | - if 1, do not reload the segment registers in the 32bit entry point. | ||
365 | Assume that %cs %ds %ss %es are all set to flat segments with | ||
366 | a base of 0 (or the equivalent for their environment). | ||
367 | |||
359 | Bit 7 (write): CAN_USE_HEAP | 368 | Bit 7 (write): CAN_USE_HEAP |
360 | Set this bit to 1 to indicate that the value entered in the | 369 | Set this bit to 1 to indicate that the value entered in the |
361 | heap_end_ptr is valid. If this field is clear, some setup code | 370 | heap_end_ptr is valid. If this field is clear, some setup code |
@@ -480,6 +489,29 @@ Protocol: 2.06+ | |||
480 | cmdline_size characters. With protocol version 2.05 and earlier, the | 489 | cmdline_size characters. With protocol version 2.05 and earlier, the |
481 | maximum size was 255. | 490 | maximum size was 255. |
482 | 491 | ||
492 | Field name: hardware_subarch | ||
493 | Type: write | ||
494 | Offset/size: 0x23c/4 | ||
495 | Protocol: 2.07+ | ||
496 | |||
497 | In a paravirtualized environment the hardware low level architectural | ||
498 | pieces such as interrupt handling, page table handling, and | ||
499 | accessing process control registers needs to be done differently. | ||
500 | |||
501 | This field allows the bootloader to inform the kernel we are in one | ||
502 | one of those environments. | ||
503 | |||
504 | 0x00000000 The default x86/PC environment | ||
505 | 0x00000001 lguest | ||
506 | 0x00000002 Xen | ||
507 | |||
508 | Field name: hardware_subarch_data | ||
509 | Type: write | ||
510 | Offset/size: 0x240/8 | ||
511 | Protocol: 2.07+ | ||
512 | |||
513 | A pointer to data that is specific to hardware subarch | ||
514 | |||
483 | 515 | ||
484 | **** THE KERNEL COMMAND LINE | 516 | **** THE KERNEL COMMAND LINE |
485 | 517 | ||
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c index f1b7cdda82b3..f8764716b0c0 100644 --- a/arch/x86/kernel/asm-offsets_32.c +++ b/arch/x86/kernel/asm-offsets_32.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/fixmap.h> | 15 | #include <asm/fixmap.h> |
16 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
17 | #include <asm/thread_info.h> | 17 | #include <asm/thread_info.h> |
18 | #include <asm/bootparam.h> | ||
18 | #include <asm/elf.h> | 19 | #include <asm/elf.h> |
19 | 20 | ||
20 | #include <xen/interface/xen.h> | 21 | #include <xen/interface/xen.h> |
@@ -146,4 +147,10 @@ void foo(void) | |||
146 | OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode); | 147 | OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode); |
147 | OFFSET(LGUEST_PAGES_regs, lguest_pages, regs); | 148 | OFFSET(LGUEST_PAGES_regs, lguest_pages, regs); |
148 | #endif | 149 | #endif |
150 | |||
151 | BLANK(); | ||
152 | OFFSET(BP_scratch, boot_params, scratch); | ||
153 | OFFSET(BP_loadflags, boot_params, hdr.loadflags); | ||
154 | OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); | ||
155 | OFFSET(BP_version, boot_params, hdr.version); | ||
149 | } | 156 | } |
diff --git a/include/asm-x86/bootparam.h b/include/asm-x86/bootparam.h index ef67b59dbdb9..dc031cf44633 100644 --- a/include/asm-x86/bootparam.h +++ b/include/asm-x86/bootparam.h | |||
@@ -28,8 +28,9 @@ struct setup_header { | |||
28 | u16 kernel_version; | 28 | u16 kernel_version; |
29 | u8 type_of_loader; | 29 | u8 type_of_loader; |
30 | u8 loadflags; | 30 | u8 loadflags; |
31 | #define LOADED_HIGH 0x01 | 31 | #define LOADED_HIGH (1<<0) |
32 | #define CAN_USE_HEAP 0x80 | 32 | #define KEEP_SEGMENTS (1<<6) |
33 | #define CAN_USE_HEAP (1<<7) | ||
33 | u16 setup_move_size; | 34 | u16 setup_move_size; |
34 | u32 code32_start; | 35 | u32 code32_start; |
35 | u32 ramdisk_image; | 36 | u32 ramdisk_image; |
@@ -41,6 +42,10 @@ struct setup_header { | |||
41 | u32 initrd_addr_max; | 42 | u32 initrd_addr_max; |
42 | u32 kernel_alignment; | 43 | u32 kernel_alignment; |
43 | u8 relocatable_kernel; | 44 | u8 relocatable_kernel; |
45 | u8 _pad2[3]; | ||
46 | u32 cmdline_size; | ||
47 | u32 hardware_subarch; | ||
48 | u64 hardware_subarch_data; | ||
44 | } __attribute__((packed)); | 49 | } __attribute__((packed)); |
45 | 50 | ||
46 | struct sys_desc_table { | 51 | struct sys_desc_table { |