aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/acpi/boot.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2006-09-26 04:52:32 -0400
committerAndi Kleen <andi@basil.nowhere.org>2006-09-26 04:52:32 -0400
commit1a3f239ddf9208f2e52d36fef1c1c4518cbbbabe (patch)
treef2ad21f766102540e15ea61145e94be65901e272 /arch/i386/kernel/acpi/boot.c
parent33df0d19ea425d28bd5afb48898af32237fe81af (diff)
[PATCH] i386: Replace i386 open-coded cmdline parsing with
This patch replaces the open-coded early commandline parsing throughout the i386 boot code with the generic mechanism (already used by ppc, powerpc, ia64 and s390). The code was inconsistent with whether it deletes the option from the cmdline or not, meaning some of these will get passed through the environment into init. This transformation is mainly mechanical, but there are some notable parts: 1) Grammar: s/linux never set's it up/linux never sets it up/ 2) Remove hacked-in earlyprintk= option scanning. When someone actually implements CONFIG_EARLY_PRINTK, then they can use early_param(). [AK: actually it is implemented, but I'm adding the early_param it in the next x86-64 patch] 3) Move declaration of generic_apic_probe() from setup.c into asm/apic.h 4) Various parameters now moved into their appropriate files (thanks Andi). 5) All parse functions which examine arg need to check for NULL, except one where it has subtle humor value. AK: readded acpi_sci handling which was completely dropped AK: moved some more variables into acpi/boot.c Cc: len.brown@intel.com Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386/kernel/acpi/boot.c')
-rw-r--r--arch/i386/kernel/acpi/boot.c76
1 files changed, 74 insertions, 2 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index ee003bc0e8b1..87e2ab50b694 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -36,6 +36,8 @@
36#include <asm/io.h> 36#include <asm/io.h>
37#include <asm/mpspec.h> 37#include <asm/mpspec.h>
38 38
39int __initdata acpi_force = 0;
40
39#ifdef CONFIG_X86_64 41#ifdef CONFIG_X86_64
40 42
41extern void __init clustered_apic_check(void); 43extern void __init clustered_apic_check(void);
@@ -860,8 +862,6 @@ static void __init acpi_process_madt(void)
860 return; 862 return;
861} 863}
862 864
863extern int acpi_force;
864
865#ifdef __i386__ 865#ifdef __i386__
866 866
867static int __init disable_acpi_irq(struct dmi_system_id *d) 867static int __init disable_acpi_irq(struct dmi_system_id *d)
@@ -1163,3 +1163,75 @@ int __init acpi_boot_init(void)
1163 1163
1164 return 0; 1164 return 0;
1165} 1165}
1166
1167static int __init parse_acpi(char *arg)
1168{
1169 if (!arg)
1170 return -EINVAL;
1171
1172 /* "acpi=off" disables both ACPI table parsing and interpreter */
1173 if (strcmp(arg, "off") == 0) {
1174 disable_acpi();
1175 }
1176 /* acpi=force to over-ride black-list */
1177 else if (strcmp(arg, "force") == 0) {
1178 acpi_force = 1;
1179 acpi_ht = 1;
1180 acpi_disabled = 0;
1181 }
1182 /* acpi=strict disables out-of-spec workarounds */
1183 else if (strcmp(arg, "strict") == 0) {
1184 acpi_strict = 1;
1185 }
1186 /* Limit ACPI just to boot-time to enable HT */
1187 else if (strcmp(arg, "ht") == 0) {
1188 if (!acpi_force)
1189 disable_acpi();
1190 acpi_ht = 1;
1191 }
1192 /* "acpi=noirq" disables ACPI interrupt routing */
1193 else if (strcmp(arg, "noirq") == 0) {
1194 acpi_noirq_set();
1195 } else {
1196 /* Core will printk when we return error. */
1197 return -EINVAL;
1198 }
1199 return 0;
1200}
1201early_param("acpi", parse_acpi);
1202
1203/* FIXME: Using pci= for an ACPI parameter is a travesty. */
1204static int __init parse_pci(char *arg)
1205{
1206 if (arg && strcmp(arg, "noacpi") == 0)
1207 acpi_disable_pci();
1208 return 0;
1209}
1210early_param("pci", parse_pci);
1211
1212#ifdef CONFIG_X86_IO_APIC
1213static int __init parse_acpi_skip_timer_override(char *arg)
1214{
1215 acpi_skip_timer_override = 1;
1216 return 0;
1217}
1218early_param("acpi_skip_timer_override", parse_acpi_skip_timer_override);
1219#endif /* CONFIG_X86_IO_APIC */
1220
1221static int __init setup_acpi_sci(char *s)
1222{
1223 if (!s)
1224 return -EINVAL;
1225 if (!strcmp(s, "edge"))
1226 acpi_sci_flags.trigger = 1;
1227 else if (!strcmp(s, "level"))
1228 acpi_sci_flags.trigger = 3;
1229 else if (!strcmp(s, "high"))
1230 acpi_sci_flags.polarity = 1;
1231 else if (!strcmp(s, "low"))
1232 acpi_sci_flags.polarity = 3;
1233 else
1234 return -EINVAL;
1235 return 0;
1236}
1237early_param("acpi_sci", setup_acpi_sci);