diff options
| -rw-r--r-- | Documentation/i386/boot.txt | 26 | ||||
| -rw-r--r-- | arch/x86/boot/header.S | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/e820_64.c | 22 | ||||
| -rw-r--r-- | arch/x86/kernel/head64.c | 20 | ||||
| -rw-r--r-- | arch/x86/kernel/kdebugfs.c | 163 | ||||
| -rw-r--r-- | arch/x86/kernel/setup_64.c | 24 | ||||
| -rw-r--r-- | arch/x86/mm/pat.c | 31 | ||||
| -rw-r--r-- | include/asm-x86/bootparam.h | 14 | ||||
| -rw-r--r-- | include/asm-x86/e820_64.h | 1 |
9 files changed, 301 insertions, 6 deletions
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index 2eb16100bb3f..0fac3465f2e3 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/i386/boot.txt | |||
| @@ -42,6 +42,8 @@ Protocol 2.05: (Kernel 2.6.20) Make protected mode kernel relocatable. | |||
| 42 | Protocol 2.06: (Kernel 2.6.22) Added a field that contains the size of | 42 | Protocol 2.06: (Kernel 2.6.22) Added a field that contains the size of |
| 43 | the boot command line | 43 | the boot command line |
| 44 | 44 | ||
| 45 | Protocol 2.09: (kernel 2.6.26) Added a field of 64-bit physical | ||
| 46 | pointer to single linked list of struct setup_data. | ||
| 45 | 47 | ||
| 46 | **** MEMORY LAYOUT | 48 | **** MEMORY LAYOUT |
| 47 | 49 | ||
| @@ -172,6 +174,8 @@ Offset Proto Name Meaning | |||
| 172 | 0240/8 2.07+ hardware_subarch_data Subarchitecture-specific data | 174 | 0240/8 2.07+ hardware_subarch_data Subarchitecture-specific data |
| 173 | 0248/4 2.08+ payload_offset Offset of kernel payload | 175 | 0248/4 2.08+ payload_offset Offset of kernel payload |
| 174 | 024C/4 2.08+ payload_length Length of kernel payload | 176 | 024C/4 2.08+ payload_length Length of kernel payload |
| 177 | 0250/8 2.09+ setup_data 64-bit physical pointer to linked list | ||
| 178 | of struct setup_data | ||
| 175 | 179 | ||
| 176 | (1) For backwards compatibility, if the setup_sects field contains 0, the | 180 | (1) For backwards compatibility, if the setup_sects field contains 0, the |
| 177 | real value is 4. | 181 | real value is 4. |
| @@ -572,6 +576,28 @@ command line is entered using the following protocol: | |||
| 572 | covered by setup_move_size, so you may need to adjust this | 576 | covered by setup_move_size, so you may need to adjust this |
| 573 | field. | 577 | field. |
| 574 | 578 | ||
| 579 | Field name: setup_data | ||
| 580 | Type: write (obligatory) | ||
| 581 | Offset/size: 0x250/8 | ||
| 582 | Protocol: 2.09+ | ||
| 583 | |||
| 584 | The 64-bit physical pointer to NULL terminated single linked list of | ||
| 585 | struct setup_data. This is used to define a more extensible boot | ||
| 586 | parameters passing mechanism. The definition of struct setup_data is | ||
| 587 | as follow: | ||
| 588 | |||
| 589 | struct setup_data { | ||
| 590 | u64 next; | ||
| 591 | u32 type; | ||
| 592 | u32 len; | ||
| 593 | u8 data[0]; | ||
| 594 | }; | ||
| 595 | |||
| 596 | Where, the next is a 64-bit physical pointer to the next node of | ||
| 597 | linked list, the next field of the last node is 0; the type is used | ||
| 598 | to identify the contents of data; the len is the length of data | ||
| 599 | field; the data holds the real payload. | ||
| 600 | |||
| 575 | 601 | ||
| 576 | **** MEMORY LAYOUT OF THE REAL-MODE CODE | 602 | **** MEMORY LAYOUT OF THE REAL-MODE CODE |
| 577 | 603 | ||
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index 6d2df8d61c54..af86e431acfa 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S | |||
| @@ -120,7 +120,7 @@ _start: | |||
| 120 | # Part 2 of the header, from the old setup.S | 120 | # Part 2 of the header, from the old setup.S |
| 121 | 121 | ||
| 122 | .ascii "HdrS" # header signature | 122 | .ascii "HdrS" # header signature |
| 123 | .word 0x0208 # header version number (>= 0x0105) | 123 | .word 0x0209 # header version number (>= 0x0105) |
| 124 | # or else old loadlin-1.5 will fail) | 124 | # or else old loadlin-1.5 will fail) |
| 125 | .globl realmode_swtch | 125 | .globl realmode_swtch |
| 126 | realmode_swtch: .word 0, 0 # default_switch, SETUPSEG | 126 | realmode_swtch: .word 0, 0 # default_switch, SETUPSEG |
| @@ -227,6 +227,10 @@ hardware_subarch_data: .quad 0 | |||
| 227 | payload_offset: .long input_data | 227 | payload_offset: .long input_data |
| 228 | payload_length: .long input_data_end-input_data | 228 | payload_length: .long input_data_end-input_data |
| 229 | 229 | ||
| 230 | setup_data: .quad 0 # 64-bit physical pointer to | ||
| 231 | # single linked list of | ||
| 232 | # struct setup_data | ||
| 233 | |||
| 230 | # End of setup header ##################################################### | 234 | # End of setup header ##################################################### |
| 231 | 235 | ||
| 232 | .section ".inittext", "ax" | 236 | .section ".inittext", "ax" |
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c index cbd42e51cb08..79f0d52fa99a 100644 --- a/arch/x86/kernel/e820_64.c +++ b/arch/x86/kernel/e820_64.c | |||
| @@ -84,6 +84,28 @@ void __init reserve_early(unsigned long start, unsigned long end, char *name) | |||
| 84 | strncpy(r->name, name, sizeof(r->name) - 1); | 84 | strncpy(r->name, name, sizeof(r->name) - 1); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | void __init free_early(unsigned long start, unsigned long end) | ||
| 88 | { | ||
| 89 | struct early_res *r; | ||
| 90 | int i, j; | ||
| 91 | |||
| 92 | for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) { | ||
| 93 | r = &early_res[i]; | ||
| 94 | if (start == r->start && end == r->end) | ||
| 95 | break; | ||
| 96 | } | ||
| 97 | if (i >= MAX_EARLY_RES || !early_res[i].end) | ||
| 98 | panic("free_early on not reserved area: %lx-%lx!", start, end); | ||
| 99 | |||
| 100 | for (j = i + 1; j < MAX_EARLY_RES && early_res[j].end; j++) | ||
| 101 | ; | ||
| 102 | |||
| 103 | memcpy(&early_res[i], &early_res[i + 1], | ||
| 104 | (j - 1 - i) * sizeof(struct early_res)); | ||
| 105 | |||
| 106 | early_res[j - 1].end = 0; | ||
| 107 | } | ||
| 108 | |||
| 87 | void __init early_res_to_bootmem(void) | 109 | void __init early_res_to_bootmem(void) |
| 88 | { | 110 | { |
| 89 | int i; | 111 | int i; |
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index d31d6b72d60d..e25c57b8aa84 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/string.h> | 11 | #include <linux/string.h> |
| 12 | #include <linux/percpu.h> | 12 | #include <linux/percpu.h> |
| 13 | #include <linux/start_kernel.h> | 13 | #include <linux/start_kernel.h> |
| 14 | #include <linux/io.h> | ||
| 14 | 15 | ||
| 15 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
| 16 | #include <asm/proto.h> | 17 | #include <asm/proto.h> |
| @@ -100,6 +101,24 @@ static void __init reserve_ebda_region(void) | |||
| 100 | reserve_early(lowmem, 0x100000, "BIOS reserved"); | 101 | reserve_early(lowmem, 0x100000, "BIOS reserved"); |
| 101 | } | 102 | } |
| 102 | 103 | ||
| 104 | static void __init reserve_setup_data(void) | ||
| 105 | { | ||
| 106 | struct setup_data *data; | ||
| 107 | unsigned long pa_data; | ||
| 108 | char buf[32]; | ||
| 109 | |||
| 110 | if (boot_params.hdr.version < 0x0209) | ||
| 111 | return; | ||
| 112 | pa_data = boot_params.hdr.setup_data; | ||
| 113 | while (pa_data) { | ||
| 114 | data = early_ioremap(pa_data, sizeof(*data)); | ||
| 115 | sprintf(buf, "setup data %x", data->type); | ||
| 116 | reserve_early(pa_data, pa_data+sizeof(*data)+data->len, buf); | ||
| 117 | pa_data = data->next; | ||
| 118 | early_iounmap(data, sizeof(*data)); | ||
| 119 | } | ||
| 120 | } | ||
| 121 | |||
| 103 | void __init x86_64_start_kernel(char * real_mode_data) | 122 | void __init x86_64_start_kernel(char * real_mode_data) |
| 104 | { | 123 | { |
| 105 | int i; | 124 | int i; |
| @@ -156,6 +175,7 @@ void __init x86_64_start_kernel(char * real_mode_data) | |||
| 156 | #endif | 175 | #endif |
| 157 | 176 | ||
| 158 | reserve_ebda_region(); | 177 | reserve_ebda_region(); |
| 178 | reserve_setup_data(); | ||
| 159 | 179 | ||
| 160 | /* | 180 | /* |
| 161 | * At this point everything still needed from the boot loader | 181 | * At this point everything still needed from the boot loader |
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index 73354302fda7..c03205991718 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c | |||
| @@ -6,23 +6,171 @@ | |||
| 6 | * | 6 | * |
| 7 | * This file is released under the GPLv2. | 7 | * This file is released under the GPLv2. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | #include <linux/debugfs.h> | 9 | #include <linux/debugfs.h> |
| 10 | #include <linux/uaccess.h> | ||
| 11 | #include <linux/stat.h> | 11 | #include <linux/stat.h> |
| 12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
| 13 | #include <linux/io.h> | ||
| 14 | #include <linux/mm.h> | ||
| 13 | 15 | ||
| 14 | #include <asm/setup.h> | 16 | #include <asm/setup.h> |
| 15 | 17 | ||
| 16 | #ifdef CONFIG_DEBUG_BOOT_PARAMS | 18 | #ifdef CONFIG_DEBUG_BOOT_PARAMS |
| 19 | struct setup_data_node { | ||
| 20 | u64 paddr; | ||
| 21 | u32 type; | ||
| 22 | u32 len; | ||
| 23 | }; | ||
| 24 | |||
| 25 | static ssize_t | ||
| 26 | setup_data_read(struct file *file, char __user *user_buf, size_t count, | ||
| 27 | loff_t *ppos) | ||
| 28 | { | ||
| 29 | struct setup_data_node *node = file->private_data; | ||
| 30 | unsigned long remain; | ||
| 31 | loff_t pos = *ppos; | ||
| 32 | struct page *pg; | ||
| 33 | void *p; | ||
| 34 | u64 pa; | ||
| 35 | |||
| 36 | if (pos < 0) | ||
| 37 | return -EINVAL; | ||
| 38 | if (pos >= node->len) | ||
| 39 | return 0; | ||
| 40 | |||
| 41 | if (count > node->len - pos) | ||
| 42 | count = node->len - pos; | ||
| 43 | pa = node->paddr + sizeof(struct setup_data) + pos; | ||
| 44 | pg = pfn_to_page((pa + count - 1) >> PAGE_SHIFT); | ||
| 45 | if (PageHighMem(pg)) { | ||
| 46 | p = ioremap_cache(pa, count); | ||
| 47 | if (!p) | ||
| 48 | return -ENXIO; | ||
| 49 | } else { | ||
| 50 | p = __va(pa); | ||
| 51 | } | ||
| 52 | |||
| 53 | remain = copy_to_user(user_buf, p, count); | ||
| 54 | |||
| 55 | if (PageHighMem(pg)) | ||
| 56 | iounmap(p); | ||
| 57 | |||
| 58 | if (remain) | ||
| 59 | return -EFAULT; | ||
| 60 | |||
| 61 | *ppos = pos + count; | ||
| 62 | |||
| 63 | return count; | ||
| 64 | } | ||
| 65 | |||
| 66 | static int setup_data_open(struct inode *inode, struct file *file) | ||
| 67 | { | ||
| 68 | file->private_data = inode->i_private; | ||
| 69 | return 0; | ||
| 70 | } | ||
| 71 | |||
| 72 | static const struct file_operations fops_setup_data = { | ||
| 73 | .read = setup_data_read, | ||
| 74 | .open = setup_data_open, | ||
| 75 | }; | ||
| 76 | |||
| 77 | static int __init | ||
| 78 | create_setup_data_node(struct dentry *parent, int no, | ||
| 79 | struct setup_data_node *node) | ||
| 80 | { | ||
| 81 | struct dentry *d, *type, *data; | ||
| 82 | char buf[16]; | ||
| 83 | int error; | ||
| 84 | |||
| 85 | sprintf(buf, "%d", no); | ||
| 86 | d = debugfs_create_dir(buf, parent); | ||
| 87 | if (!d) { | ||
| 88 | error = -ENOMEM; | ||
| 89 | goto err_return; | ||
| 90 | } | ||
| 91 | type = debugfs_create_x32("type", S_IRUGO, d, &node->type); | ||
| 92 | if (!type) { | ||
| 93 | error = -ENOMEM; | ||
| 94 | goto err_dir; | ||
| 95 | } | ||
| 96 | data = debugfs_create_file("data", S_IRUGO, d, node, &fops_setup_data); | ||
| 97 | if (!data) { | ||
| 98 | error = -ENOMEM; | ||
| 99 | goto err_type; | ||
| 100 | } | ||
| 101 | return 0; | ||
| 102 | |||
| 103 | err_type: | ||
| 104 | debugfs_remove(type); | ||
| 105 | err_dir: | ||
| 106 | debugfs_remove(d); | ||
| 107 | err_return: | ||
| 108 | return error; | ||
| 109 | } | ||
| 110 | |||
| 111 | static int __init create_setup_data_nodes(struct dentry *parent) | ||
| 112 | { | ||
| 113 | struct setup_data_node *node; | ||
| 114 | struct setup_data *data; | ||
| 115 | int error, no = 0; | ||
| 116 | struct dentry *d; | ||
| 117 | struct page *pg; | ||
| 118 | u64 pa_data; | ||
| 119 | |||
| 120 | d = debugfs_create_dir("setup_data", parent); | ||
| 121 | if (!d) { | ||
| 122 | error = -ENOMEM; | ||
| 123 | goto err_return; | ||
| 124 | } | ||
| 125 | |||
| 126 | pa_data = boot_params.hdr.setup_data; | ||
| 127 | |||
| 128 | while (pa_data) { | ||
| 129 | node = kmalloc(sizeof(*node), GFP_KERNEL); | ||
| 130 | if (!node) { | ||
| 131 | error = -ENOMEM; | ||
| 132 | goto err_dir; | ||
| 133 | } | ||
| 134 | pg = pfn_to_page((pa_data+sizeof(*data)-1) >> PAGE_SHIFT); | ||
| 135 | if (PageHighMem(pg)) { | ||
| 136 | data = ioremap_cache(pa_data, sizeof(*data)); | ||
| 137 | if (!data) { | ||
| 138 | error = -ENXIO; | ||
| 139 | goto err_dir; | ||
| 140 | } | ||
| 141 | } else { | ||
| 142 | data = __va(pa_data); | ||
| 143 | } | ||
| 144 | |||
| 145 | node->paddr = pa_data; | ||
| 146 | node->type = data->type; | ||
| 147 | node->len = data->len; | ||
| 148 | error = create_setup_data_node(d, no, node); | ||
| 149 | pa_data = data->next; | ||
| 150 | |||
| 151 | if (PageHighMem(pg)) | ||
| 152 | iounmap(data); | ||
| 153 | if (error) | ||
| 154 | goto err_dir; | ||
| 155 | no++; | ||
| 156 | } | ||
| 157 | return 0; | ||
| 158 | |||
| 159 | err_dir: | ||
| 160 | debugfs_remove(d); | ||
| 161 | err_return: | ||
| 162 | return error; | ||
| 163 | } | ||
| 164 | |||
| 17 | static struct debugfs_blob_wrapper boot_params_blob = { | 165 | static struct debugfs_blob_wrapper boot_params_blob = { |
| 18 | .data = &boot_params, | 166 | .data = &boot_params, |
| 19 | .size = sizeof(boot_params), | 167 | .size = sizeof(boot_params), |
| 20 | }; | 168 | }; |
| 21 | 169 | ||
| 22 | static int __init boot_params_kdebugfs_init(void) | 170 | static int __init boot_params_kdebugfs_init(void) |
| 23 | { | 171 | { |
| 24 | int error; | ||
| 25 | struct dentry *dbp, *version, *data; | 172 | struct dentry *dbp, *version, *data; |
| 173 | int error; | ||
| 26 | 174 | ||
| 27 | dbp = debugfs_create_dir("boot_params", NULL); | 175 | dbp = debugfs_create_dir("boot_params", NULL); |
| 28 | if (!dbp) { | 176 | if (!dbp) { |
| @@ -41,7 +189,13 @@ static int __init boot_params_kdebugfs_init(void) | |||
| 41 | error = -ENOMEM; | 189 | error = -ENOMEM; |
| 42 | goto err_version; | 190 | goto err_version; |
| 43 | } | 191 | } |
| 192 | error = create_setup_data_nodes(dbp); | ||
| 193 | if (error) | ||
| 194 | goto err_data; | ||
| 44 | return 0; | 195 | return 0; |
| 196 | |||
| 197 | err_data: | ||
| 198 | debugfs_remove(data); | ||
| 45 | err_version: | 199 | err_version: |
| 46 | debugfs_remove(version); | 200 | debugfs_remove(version); |
| 47 | err_dir: | 201 | err_dir: |
| @@ -61,5 +215,4 @@ static int __init arch_kdebugfs_init(void) | |||
| 61 | 215 | ||
| 62 | return error; | 216 | return error; |
| 63 | } | 217 | } |
| 64 | |||
| 65 | arch_initcall(arch_kdebugfs_init); | 218 | arch_initcall(arch_kdebugfs_init); |
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index 17bdf2343095..b04e2c011e1a 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
| @@ -264,6 +264,28 @@ void __attribute__((weak)) __init memory_setup(void) | |||
| 264 | machine_specific_memory_setup(); | 264 | machine_specific_memory_setup(); |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | static void __init parse_setup_data(void) | ||
| 268 | { | ||
| 269 | struct setup_data *data; | ||
| 270 | unsigned long pa_data; | ||
| 271 | |||
| 272 | if (boot_params.hdr.version < 0x0209) | ||
| 273 | return; | ||
| 274 | pa_data = boot_params.hdr.setup_data; | ||
| 275 | while (pa_data) { | ||
| 276 | data = early_ioremap(pa_data, PAGE_SIZE); | ||
| 277 | switch (data->type) { | ||
| 278 | default: | ||
| 279 | break; | ||
| 280 | } | ||
| 281 | #ifndef CONFIG_DEBUG_BOOT_PARAMS | ||
| 282 | free_early(pa_data, pa_data+sizeof(*data)+data->len); | ||
| 283 | #endif | ||
| 284 | pa_data = data->next; | ||
| 285 | early_iounmap(data, PAGE_SIZE); | ||
| 286 | } | ||
| 287 | } | ||
| 288 | |||
| 267 | /* | 289 | /* |
| 268 | * setup_arch - architecture-specific boot-time initializations | 290 | * setup_arch - architecture-specific boot-time initializations |
| 269 | * | 291 | * |
| @@ -316,6 +338,8 @@ void __init setup_arch(char **cmdline_p) | |||
| 316 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); | 338 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); |
| 317 | *cmdline_p = command_line; | 339 | *cmdline_p = command_line; |
| 318 | 340 | ||
| 341 | parse_setup_data(); | ||
| 342 | |||
| 319 | parse_early_param(); | 343 | parse_early_param(); |
| 320 | 344 | ||
| 321 | #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT | 345 | #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 9851265e4d65..e7ca7fc48d12 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <asm/msr.h> | 16 | #include <asm/msr.h> |
| 17 | #include <asm/tlbflush.h> | 17 | #include <asm/tlbflush.h> |
| 18 | #include <asm/processor.h> | 18 | #include <asm/processor.h> |
| 19 | #include <asm/page.h> | ||
| 19 | #include <asm/pgtable.h> | 20 | #include <asm/pgtable.h> |
| 20 | #include <asm/pat.h> | 21 | #include <asm/pat.h> |
| 21 | #include <asm/e820.h> | 22 | #include <asm/e820.h> |
| @@ -477,6 +478,33 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | |||
| 477 | return vma_prot; | 478 | return vma_prot; |
| 478 | } | 479 | } |
| 479 | 480 | ||
| 481 | #ifdef CONFIG_NONPROMISC_DEVMEM | ||
| 482 | /* This check is done in drivers/char/mem.c in case of NONPROMISC_DEVMEM*/ | ||
| 483 | static inline int range_is_allowed(unsigned long pfn, unsigned long size) | ||
| 484 | { | ||
| 485 | return 1; | ||
| 486 | } | ||
| 487 | #else | ||
| 488 | static inline int range_is_allowed(unsigned long pfn, unsigned long size) | ||
| 489 | { | ||
| 490 | u64 from = ((u64)pfn) << PAGE_SHIFT; | ||
| 491 | u64 to = from + size; | ||
| 492 | u64 cursor = from; | ||
| 493 | |||
| 494 | while (cursor < to) { | ||
| 495 | if (!devmem_is_allowed(pfn)) { | ||
| 496 | printk(KERN_INFO | ||
| 497 | "Program %s tried to access /dev/mem between %Lx->%Lx.\n", | ||
| 498 | current->comm, from, to); | ||
| 499 | return 0; | ||
| 500 | } | ||
| 501 | cursor += PAGE_SIZE; | ||
| 502 | pfn++; | ||
| 503 | } | ||
| 504 | return 1; | ||
| 505 | } | ||
| 506 | #endif /* CONFIG_NONPROMISC_DEVMEM */ | ||
| 507 | |||
| 480 | int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | 508 | int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, |
| 481 | unsigned long size, pgprot_t *vma_prot) | 509 | unsigned long size, pgprot_t *vma_prot) |
| 482 | { | 510 | { |
| @@ -485,6 +513,9 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | |||
| 485 | unsigned long ret_flags; | 513 | unsigned long ret_flags; |
| 486 | int retval; | 514 | int retval; |
| 487 | 515 | ||
| 516 | if (!range_is_allowed(pfn, size)) | ||
| 517 | return 0; | ||
| 518 | |||
| 488 | if (file->f_flags & O_SYNC) { | 519 | if (file->f_flags & O_SYNC) { |
| 489 | flags = _PAGE_CACHE_UC; | 520 | flags = _PAGE_CACHE_UC; |
| 490 | } | 521 | } |
diff --git a/include/asm-x86/bootparam.h b/include/asm-x86/bootparam.h index 51151356840f..e8659909e5f6 100644 --- a/include/asm-x86/bootparam.h +++ b/include/asm-x86/bootparam.h | |||
| @@ -9,6 +9,17 @@ | |||
| 9 | #include <asm/ist.h> | 9 | #include <asm/ist.h> |
| 10 | #include <video/edid.h> | 10 | #include <video/edid.h> |
| 11 | 11 | ||
| 12 | /* setup data types */ | ||
| 13 | #define SETUP_NONE 0 | ||
| 14 | |||
| 15 | /* extensible setup data list node */ | ||
| 16 | struct setup_data { | ||
| 17 | u64 next; | ||
| 18 | u32 type; | ||
| 19 | u32 len; | ||
| 20 | u8 data[0]; | ||
| 21 | }; | ||
| 22 | |||
| 12 | struct setup_header { | 23 | struct setup_header { |
| 13 | __u8 setup_sects; | 24 | __u8 setup_sects; |
| 14 | __u16 root_flags; | 25 | __u16 root_flags; |
| @@ -46,6 +57,9 @@ struct setup_header { | |||
| 46 | __u32 cmdline_size; | 57 | __u32 cmdline_size; |
| 47 | __u32 hardware_subarch; | 58 | __u32 hardware_subarch; |
| 48 | __u64 hardware_subarch_data; | 59 | __u64 hardware_subarch_data; |
| 60 | __u32 payload_offset; | ||
| 61 | __u32 payload_length; | ||
| 62 | __u64 setup_data; | ||
| 49 | } __attribute__((packed)); | 63 | } __attribute__((packed)); |
| 50 | 64 | ||
| 51 | struct sys_desc_table { | 65 | struct sys_desc_table { |
diff --git a/include/asm-x86/e820_64.h b/include/asm-x86/e820_64.h index f478c57eb060..b5e02e379af3 100644 --- a/include/asm-x86/e820_64.h +++ b/include/asm-x86/e820_64.h | |||
| @@ -48,6 +48,7 @@ extern struct e820map e820; | |||
| 48 | extern void update_e820(void); | 48 | extern void update_e820(void); |
| 49 | 49 | ||
| 50 | extern void reserve_early(unsigned long start, unsigned long end, char *name); | 50 | extern void reserve_early(unsigned long start, unsigned long end, char *name); |
| 51 | extern void free_early(unsigned long start, unsigned long end); | ||
| 51 | extern void early_res_to_bootmem(void); | 52 | extern void early_res_to_bootmem(void); |
| 52 | 53 | ||
| 53 | #endif/*!__ASSEMBLY__*/ | 54 | #endif/*!__ASSEMBLY__*/ |
