diff options
-rw-r--r-- | Documentation/acpi/dsdt-override.txt | 12 | ||||
-rwxr-xr-x | Documentation/acpi/initramfs-add-dsdt.sh | 43 | ||||
-rw-r--r-- | Documentation/kernel-parameters.txt | 3 | ||||
-rw-r--r-- | drivers/acpi/Kconfig | 11 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 84 | ||||
-rw-r--r-- | init/initramfs.c | 8 | ||||
-rw-r--r-- | init/main.c | 7 |
7 files changed, 3 insertions, 165 deletions
diff --git a/Documentation/acpi/dsdt-override.txt b/Documentation/acpi/dsdt-override.txt index 5008f256a2db..febbb1ba4d23 100644 --- a/Documentation/acpi/dsdt-override.txt +++ b/Documentation/acpi/dsdt-override.txt | |||
@@ -1,15 +1,7 @@ | |||
1 | Linux supports two methods of overriding the BIOS DSDT: | 1 | Linux supports a method of overriding the BIOS DSDT: |
2 | 2 | ||
3 | CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel. | 3 | CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel. |
4 | 4 | ||
5 | CONFIG_ACPI_CUSTOM_DSDT_INITRD adds the image to the initrd. | 5 | When to use this method is described in detail on the |
6 | |||
7 | When to use these methods is described in detail on the | ||
8 | Linux/ACPI home page: | 6 | Linux/ACPI home page: |
9 | http://www.lesswatts.org/projects/acpi/overridingDSDT.php | 7 | http://www.lesswatts.org/projects/acpi/overridingDSDT.php |
10 | |||
11 | Note that if both options are used, the DSDT supplied | ||
12 | by the INITRD method takes precedence. | ||
13 | |||
14 | Documentation/initramfs-add-dsdt.sh is provided for convenience | ||
15 | for use with the CONFIG_ACPI_CUSTOM_DSDT_INITRD method. | ||
diff --git a/Documentation/acpi/initramfs-add-dsdt.sh b/Documentation/acpi/initramfs-add-dsdt.sh deleted file mode 100755 index 17ef6e838e14..000000000000 --- a/Documentation/acpi/initramfs-add-dsdt.sh +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # Adds a DSDT file to the initrd (if it's an initramfs) | ||
3 | # first argument is the name of archive | ||
4 | # second argument is the name of the file to add | ||
5 | # The file will be copied as /DSDT.aml | ||
6 | |||
7 | # 20060126: fix "Premature end of file" with some old cpio (Roland Robic) | ||
8 | # 20060205: this time it should really work | ||
9 | |||
10 | # check the arguments | ||
11 | if [ $# -ne 2 ]; then | ||
12 | program_name=$(basename $0) | ||
13 | echo "\ | ||
14 | $program_name: too few arguments | ||
15 | Usage: $program_name initrd-name.img DSDT-to-add.aml | ||
16 | Adds a DSDT file to an initrd (in initramfs format) | ||
17 | |||
18 | initrd-name.img: filename of the initrd in initramfs format | ||
19 | DSDT-to-add.aml: filename of the DSDT file to add | ||
20 | " 1>&2 | ||
21 | exit 1 | ||
22 | fi | ||
23 | |||
24 | # we should check it's an initramfs | ||
25 | |||
26 | tempcpio=$(mktemp -d) | ||
27 | # cleanup on exit, hangup, interrupt, quit, termination | ||
28 | trap 'rm -rf $tempcpio' 0 1 2 3 15 | ||
29 | |||
30 | # extract the archive | ||
31 | gunzip -c "$1" > "$tempcpio"/initramfs.cpio || exit 1 | ||
32 | |||
33 | # copy the DSDT file at the root of the directory so that we can call it "/DSDT.aml" | ||
34 | cp -f "$2" "$tempcpio"/DSDT.aml | ||
35 | |||
36 | # add the file | ||
37 | cd "$tempcpio" | ||
38 | (echo DSDT.aml | cpio --quiet -H newc -o -A -O "$tempcpio"/initramfs.cpio) || exit 1 | ||
39 | cd "$OLDPWD" | ||
40 | |||
41 | # re-compress the archive | ||
42 | gzip -c "$tempcpio"/initramfs.cpio > "$1" | ||
43 | |||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 49318b99e581..622f7849edb9 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -177,9 +177,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
177 | 177 | ||
178 | acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT | 178 | acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT |
179 | 179 | ||
180 | acpi_no_initrd_override [KNL,ACPI] | ||
181 | Disable loading custom ACPI tables from the initramfs | ||
182 | |||
183 | acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS | 180 | acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS |
184 | Format: To spoof as Windows 98: ="Microsoft Windows" | 181 | Format: To spoof as Windows 98: ="Microsoft Windows" |
185 | 182 | ||
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index fbcaa069be86..b4f5e8542829 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -300,17 +300,6 @@ config ACPI_CUSTOM_DSDT | |||
300 | bool | 300 | bool |
301 | default ACPI_CUSTOM_DSDT_FILE != "" | 301 | default ACPI_CUSTOM_DSDT_FILE != "" |
302 | 302 | ||
303 | config ACPI_CUSTOM_DSDT_INITRD | ||
304 | bool "Read Custom DSDT from initramfs" | ||
305 | depends on BLK_DEV_INITRD | ||
306 | default n | ||
307 | help | ||
308 | This option supports a custom DSDT by optionally loading it from initrd. | ||
309 | See Documentation/acpi/dsdt-override.txt | ||
310 | |||
311 | If you are not using this feature now, but may use it later, | ||
312 | it is safe to say Y here. | ||
313 | |||
314 | config ACPI_BLACKLIST_YEAR | 303 | config ACPI_BLACKLIST_YEAR |
315 | int "Disable ACPI for systems before Jan 1st this year" if X86_32 | 304 | int "Disable ACPI for systems before Jan 1st this year" if X86_32 |
316 | default 0 | 305 | default 0 |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 065819ba87c7..a697fb6cf050 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -91,10 +91,6 @@ static DEFINE_SPINLOCK(acpi_res_lock); | |||
91 | #define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ | 91 | #define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ |
92 | static char osi_additional_string[OSI_STRING_LENGTH_MAX]; | 92 | static char osi_additional_string[OSI_STRING_LENGTH_MAX]; |
93 | 93 | ||
94 | #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD | ||
95 | static int acpi_no_initrd_override; | ||
96 | #endif | ||
97 | |||
98 | /* | 94 | /* |
99 | * "Ode to _OSI(Linux)" | 95 | * "Ode to _OSI(Linux)" |
100 | * | 96 | * |
@@ -324,67 +320,6 @@ acpi_os_predefined_override(const struct acpi_predefined_names *init_val, | |||
324 | return AE_OK; | 320 | return AE_OK; |
325 | } | 321 | } |
326 | 322 | ||
327 | #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD | ||
328 | static struct acpi_table_header *acpi_find_dsdt_initrd(void) | ||
329 | { | ||
330 | struct file *firmware_file; | ||
331 | mm_segment_t oldfs; | ||
332 | unsigned long len, len2; | ||
333 | struct acpi_table_header *dsdt_buffer, *ret = NULL; | ||
334 | struct kstat stat; | ||
335 | char *ramfs_dsdt_name = "/DSDT.aml"; | ||
336 | |||
337 | printk(KERN_INFO PREFIX "Checking initramfs for custom DSDT\n"); | ||
338 | |||
339 | /* | ||
340 | * Never do this at home, only the user-space is allowed to open a file. | ||
341 | * The clean way would be to use the firmware loader. | ||
342 | * But this code must be run before there is any userspace available. | ||
343 | * A static/init firmware infrastructure doesn't exist yet... | ||
344 | */ | ||
345 | if (vfs_stat(ramfs_dsdt_name, &stat) < 0) | ||
346 | return ret; | ||
347 | |||
348 | len = stat.size; | ||
349 | /* check especially against empty files */ | ||
350 | if (len <= 4) { | ||
351 | printk(KERN_ERR PREFIX "Failed: DSDT only %lu bytes.\n", len); | ||
352 | return ret; | ||
353 | } | ||
354 | |||
355 | firmware_file = filp_open(ramfs_dsdt_name, O_RDONLY, 0); | ||
356 | if (IS_ERR(firmware_file)) { | ||
357 | printk(KERN_ERR PREFIX "Failed to open %s.\n", ramfs_dsdt_name); | ||
358 | return ret; | ||
359 | } | ||
360 | |||
361 | dsdt_buffer = kmalloc(len, GFP_ATOMIC); | ||
362 | if (!dsdt_buffer) { | ||
363 | printk(KERN_ERR PREFIX "Failed to allocate %lu bytes.\n", len); | ||
364 | goto err; | ||
365 | } | ||
366 | |||
367 | oldfs = get_fs(); | ||
368 | set_fs(KERNEL_DS); | ||
369 | len2 = vfs_read(firmware_file, (char __user *)dsdt_buffer, len, | ||
370 | &firmware_file->f_pos); | ||
371 | set_fs(oldfs); | ||
372 | if (len2 < len) { | ||
373 | printk(KERN_ERR PREFIX "Failed to read %lu bytes from %s.\n", | ||
374 | len, ramfs_dsdt_name); | ||
375 | ACPI_FREE(dsdt_buffer); | ||
376 | goto err; | ||
377 | } | ||
378 | |||
379 | printk(KERN_INFO PREFIX "Found %lu byte DSDT in %s.\n", | ||
380 | len, ramfs_dsdt_name); | ||
381 | ret = dsdt_buffer; | ||
382 | err: | ||
383 | filp_close(firmware_file, NULL); | ||
384 | return ret; | ||
385 | } | ||
386 | #endif | ||
387 | |||
388 | acpi_status | 323 | acpi_status |
389 | acpi_os_table_override(struct acpi_table_header * existing_table, | 324 | acpi_os_table_override(struct acpi_table_header * existing_table, |
390 | struct acpi_table_header ** new_table) | 325 | struct acpi_table_header ** new_table) |
@@ -398,16 +333,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table, | |||
398 | if (strncmp(existing_table->signature, "DSDT", 4) == 0) | 333 | if (strncmp(existing_table->signature, "DSDT", 4) == 0) |
399 | *new_table = (struct acpi_table_header *)AmlCode; | 334 | *new_table = (struct acpi_table_header *)AmlCode; |
400 | #endif | 335 | #endif |
401 | #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD | ||
402 | if ((strncmp(existing_table->signature, "DSDT", 4) == 0) && | ||
403 | !acpi_no_initrd_override) { | ||
404 | struct acpi_table_header *initrd_table; | ||
405 | |||
406 | initrd_table = acpi_find_dsdt_initrd(); | ||
407 | if (initrd_table) | ||
408 | *new_table = initrd_table; | ||
409 | } | ||
410 | #endif | ||
411 | if (*new_table != NULL) { | 336 | if (*new_table != NULL) { |
412 | printk(KERN_WARNING PREFIX "Override [%4.4s-%8.8s], " | 337 | printk(KERN_WARNING PREFIX "Override [%4.4s-%8.8s], " |
413 | "this is unsafe: tainting kernel\n", | 338 | "this is unsafe: tainting kernel\n", |
@@ -418,15 +343,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table, | |||
418 | return AE_OK; | 343 | return AE_OK; |
419 | } | 344 | } |
420 | 345 | ||
421 | #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD | ||
422 | static int __init acpi_no_initrd_override_setup(char *s) | ||
423 | { | ||
424 | acpi_no_initrd_override = 1; | ||
425 | return 1; | ||
426 | } | ||
427 | __setup("acpi_no_initrd_override", acpi_no_initrd_override_setup); | ||
428 | #endif | ||
429 | |||
430 | static irqreturn_t acpi_irq(int irq, void *dev_id) | 346 | static irqreturn_t acpi_irq(int irq, void *dev_id) |
431 | { | 347 | { |
432 | u32 handled; | 348 | u32 handled; |
diff --git a/init/initramfs.c b/init/initramfs.c index c0b1e0533d80..d53fee8d8604 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
@@ -538,7 +538,7 @@ skip: | |||
538 | initrd_end = 0; | 538 | initrd_end = 0; |
539 | } | 539 | } |
540 | 540 | ||
541 | int __init populate_rootfs(void) | 541 | static int __init populate_rootfs(void) |
542 | { | 542 | { |
543 | char *err = unpack_to_rootfs(__initramfs_start, | 543 | char *err = unpack_to_rootfs(__initramfs_start, |
544 | __initramfs_end - __initramfs_start, 0); | 544 | __initramfs_end - __initramfs_start, 0); |
@@ -577,10 +577,4 @@ int __init populate_rootfs(void) | |||
577 | } | 577 | } |
578 | return 0; | 578 | return 0; |
579 | } | 579 | } |
580 | #ifndef CONFIG_ACPI_CUSTOM_DSDT_INITRD | ||
581 | /* | ||
582 | * if this option is enabled, populate_rootfs() is called _earlier_ in the | ||
583 | * boot sequence. This insures that the ACPI initialisation can find the file. | ||
584 | */ | ||
585 | rootfs_initcall(populate_rootfs); | 580 | rootfs_initcall(populate_rootfs); |
586 | #endif | ||
diff --git a/init/main.c b/init/main.c index fbb0167c6b8a..99ce94930b09 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -102,12 +102,6 @@ static inline void mark_rodata_ro(void) { } | |||
102 | extern void tc_init(void); | 102 | extern void tc_init(void); |
103 | #endif | 103 | #endif |
104 | 104 | ||
105 | #ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD | ||
106 | extern int populate_rootfs(void); | ||
107 | #else | ||
108 | static inline void populate_rootfs(void) {} | ||
109 | #endif | ||
110 | |||
111 | enum system_states system_state; | 105 | enum system_states system_state; |
112 | EXPORT_SYMBOL(system_state); | 106 | EXPORT_SYMBOL(system_state); |
113 | 107 | ||
@@ -650,7 +644,6 @@ asmlinkage void __init start_kernel(void) | |||
650 | 644 | ||
651 | check_bugs(); | 645 | check_bugs(); |
652 | 646 | ||
653 | populate_rootfs(); /* For DSDT override from initramfs */ | ||
654 | acpi_early_init(); /* before LAPIC and SMP init */ | 647 | acpi_early_init(); /* before LAPIC and SMP init */ |
655 | 648 | ||
656 | /* Do the rest non-__init'ed, we're now alive */ | 649 | /* Do the rest non-__init'ed, we're now alive */ |