Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87392
b: refs/heads/master
c: 9a9e0d6
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Mar 15, 2008
1 parent ab99768 commit ac596ef
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 166 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce636452343af0522d2666157dab9c2096f4f996
refs/heads/master: 9a9e0d685553af76cb6ae2af93cca4913e7fcd47
12 changes: 2 additions & 10 deletions trunk/Documentation/acpi/dsdt-override.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
Linux supports two methods of overriding the BIOS DSDT:
Linux supports a method of overriding the BIOS DSDT:

CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel.

CONFIG_ACPI_CUSTOM_DSDT_INITRD adds the image to the initrd.

When to use these methods is described in detail on the
When to use this method is described in detail on the
Linux/ACPI home page:
http://www.lesswatts.org/projects/acpi/overridingDSDT.php

Note that if both options are used, the DSDT supplied
by the INITRD method takes precedence.

Documentation/initramfs-add-dsdt.sh is provided for convenience
for use with the CONFIG_ACPI_CUSTOM_DSDT_INITRD method.
43 changes: 0 additions & 43 deletions trunk/Documentation/acpi/initramfs-add-dsdt.sh

This file was deleted.

3 changes: 0 additions & 3 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ and is between 256 and 4096 characters. It is defined in the file

acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT

acpi_no_initrd_override [KNL,ACPI]
Disable loading custom ACPI tables from the initramfs

acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS
Format: To spoof as Windows 98: ="Microsoft Windows"

Expand Down
11 changes: 0 additions & 11 deletions trunk/drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,6 @@ config ACPI_CUSTOM_DSDT
bool
default ACPI_CUSTOM_DSDT_FILE != ""

config ACPI_CUSTOM_DSDT_INITRD
bool "Read Custom DSDT from initramfs"
depends on BLK_DEV_INITRD
default n
help
This option supports a custom DSDT by optionally loading it from initrd.
See Documentation/acpi/dsdt-override.txt

If you are not using this feature now, but may use it later,
it is safe to say Y here.

config ACPI_BLACKLIST_YEAR
int "Disable ACPI for systems before Jan 1st this year" if X86_32
default 0
Expand Down
84 changes: 0 additions & 84 deletions trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ static DEFINE_SPINLOCK(acpi_res_lock);
#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
static char osi_additional_string[OSI_STRING_LENGTH_MAX];

#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
static int acpi_no_initrd_override;
#endif

/*
* "Ode to _OSI(Linux)"
*
Expand Down Expand Up @@ -324,67 +320,6 @@ acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
return AE_OK;
}

#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
static struct acpi_table_header *acpi_find_dsdt_initrd(void)
{
struct file *firmware_file;
mm_segment_t oldfs;
unsigned long len, len2;
struct acpi_table_header *dsdt_buffer, *ret = NULL;
struct kstat stat;
char *ramfs_dsdt_name = "/DSDT.aml";

printk(KERN_INFO PREFIX "Checking initramfs for custom DSDT\n");

/*
* Never do this at home, only the user-space is allowed to open a file.
* The clean way would be to use the firmware loader.
* But this code must be run before there is any userspace available.
* A static/init firmware infrastructure doesn't exist yet...
*/
if (vfs_stat(ramfs_dsdt_name, &stat) < 0)
return ret;

len = stat.size;
/* check especially against empty files */
if (len <= 4) {
printk(KERN_ERR PREFIX "Failed: DSDT only %lu bytes.\n", len);
return ret;
}

firmware_file = filp_open(ramfs_dsdt_name, O_RDONLY, 0);
if (IS_ERR(firmware_file)) {
printk(KERN_ERR PREFIX "Failed to open %s.\n", ramfs_dsdt_name);
return ret;
}

dsdt_buffer = kmalloc(len, GFP_ATOMIC);
if (!dsdt_buffer) {
printk(KERN_ERR PREFIX "Failed to allocate %lu bytes.\n", len);
goto err;
}

oldfs = get_fs();
set_fs(KERNEL_DS);
len2 = vfs_read(firmware_file, (char __user *)dsdt_buffer, len,
&firmware_file->f_pos);
set_fs(oldfs);
if (len2 < len) {
printk(KERN_ERR PREFIX "Failed to read %lu bytes from %s.\n",
len, ramfs_dsdt_name);
ACPI_FREE(dsdt_buffer);
goto err;
}

printk(KERN_INFO PREFIX "Found %lu byte DSDT in %s.\n",
len, ramfs_dsdt_name);
ret = dsdt_buffer;
err:
filp_close(firmware_file, NULL);
return ret;
}
#endif

acpi_status
acpi_os_table_override(struct acpi_table_header * existing_table,
struct acpi_table_header ** new_table)
Expand All @@ -397,16 +332,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
#ifdef CONFIG_ACPI_CUSTOM_DSDT
if (strncmp(existing_table->signature, "DSDT", 4) == 0)
*new_table = (struct acpi_table_header *)AmlCode;
#endif
#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
if ((strncmp(existing_table->signature, "DSDT", 4) == 0) &&
!acpi_no_initrd_override) {
struct acpi_table_header *initrd_table;

initrd_table = acpi_find_dsdt_initrd();
if (initrd_table)
*new_table = initrd_table;
}
#endif
if (*new_table != NULL) {
printk(KERN_WARNING PREFIX "Override [%4.4s-%8.8s], "
Expand All @@ -418,15 +343,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
return AE_OK;
}

#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
static int __init acpi_no_initrd_override_setup(char *s)
{
acpi_no_initrd_override = 1;
return 1;
}
__setup("acpi_no_initrd_override", acpi_no_initrd_override_setup);
#endif

static irqreturn_t acpi_irq(int irq, void *dev_id)
{
u32 handled;
Expand Down
8 changes: 1 addition & 7 deletions trunk/init/initramfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ static void __init free_initrd(void)
initrd_end = 0;
}

int __init populate_rootfs(void)
static int __init populate_rootfs(void)
{
char *err = unpack_to_rootfs(__initramfs_start,
__initramfs_end - __initramfs_start, 0);
Expand Down Expand Up @@ -577,10 +577,4 @@ int __init populate_rootfs(void)
}
return 0;
}
#ifndef CONFIG_ACPI_CUSTOM_DSDT_INITRD
/*
* if this option is enabled, populate_rootfs() is called _earlier_ in the
* boot sequence. This insures that the ACPI initialisation can find the file.
*/
rootfs_initcall(populate_rootfs);
#endif
7 changes: 0 additions & 7 deletions trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ static inline void mark_rodata_ro(void) { }
extern void tc_init(void);
#endif

#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
extern int populate_rootfs(void);
#else
static inline void populate_rootfs(void) {}
#endif

enum system_states system_state;
EXPORT_SYMBOL(system_state);

Expand Down Expand Up @@ -650,7 +644,6 @@ asmlinkage void __init start_kernel(void)

check_bugs();

populate_rootfs(); /* For DSDT override from initramfs */
acpi_early_init(); /* before LAPIC and SMP init */

/* Do the rest non-__init'ed, we're now alive */
Expand Down

0 comments on commit ac596ef

Please sign in to comment.