2 * acpi_osl.c - OS-dependent functions ($Revision: 83 $)
4 * Copyright (C) 2000 Andrew Henroid
5 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
6 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28 #include <linux/config.h>
29 #include <linux/module.h>
30 #include <linux/kernel.h>
31 #include <linux/slab.h>
33 #include <linux/pci.h>
34 #include <linux/smp_lock.h>
35 #include <linux/interrupt.h>
36 #include <linux/kmod.h>
37 #include <linux/delay.h>
38 #include <linux/workqueue.h>
39 #include <linux/nmi.h>
40 #include <acpi/acpi.h>
42 #include <acpi/acpi_bus.h>
43 #include <acpi/processor.h>
44 #include <asm/uaccess.h>
46 #include <linux/efi.h>
49 #define _COMPONENT ACPI_OS_SERVICES
50 ACPI_MODULE_NAME ("osl")
52 #define PREFIX "ACPI: "
56 acpi_osd_exec_callback function
;
60 #ifdef CONFIG_ACPI_CUSTOM_DSDT
61 #include CONFIG_ACPI_CUSTOM_DSDT_FILE
64 #ifdef ENABLE_DEBUGGER
65 #include <linux/kdb.h>
67 /* stuff for debugger support */
69 EXPORT_SYMBOL(acpi_in_debugger
);
71 extern char line_buf
[80];
72 #endif /*ENABLE_DEBUGGER*/
74 static unsigned int acpi_irq_irq
;
75 static acpi_osd_handler acpi_irq_handler
;
76 static void *acpi_irq_context
;
77 static struct workqueue_struct
*kacpid_wq
;
80 acpi_os_initialize(void)
86 acpi_os_initialize1(void)
89 * Initialize PCI configuration space access, as we'll need to access
90 * it while walking the namespace (bus 0 and root bridges w/ _BBNs).
92 #ifdef CONFIG_ACPI_PCI
94 printk(KERN_ERR PREFIX
"Access to PCI configuration space unavailable\n");
98 kacpid_wq
= create_singlethread_workqueue("kacpid");
105 acpi_os_terminate(void)
107 if (acpi_irq_handler
) {
108 acpi_os_remove_interrupt_handler(acpi_irq_irq
,
112 destroy_workqueue(kacpid_wq
);
118 acpi_os_printf(const char *fmt
,...)
122 acpi_os_vprintf(fmt
, args
);
125 EXPORT_SYMBOL(acpi_os_printf
);
128 acpi_os_vprintf(const char *fmt
, va_list args
)
130 static char buffer
[512];
132 vsprintf(buffer
, fmt
, args
);
134 #ifdef ENABLE_DEBUGGER
135 if (acpi_in_debugger
) {
136 kdb_printf("%s", buffer
);
138 printk("%s", buffer
);
141 printk("%s", buffer
);
146 acpi_os_allocate(acpi_size size
)
148 return kmalloc(size
, GFP_KERNEL
);
152 acpi_os_free(void *ptr
)
156 EXPORT_SYMBOL(acpi_os_free
);
159 acpi_os_get_root_pointer(u32 flags
, struct acpi_pointer
*addr
)
162 addr
->pointer_type
= ACPI_PHYSICAL_POINTER
;
164 addr
->pointer
.physical
=
165 (acpi_physical_address
) virt_to_phys(efi
.acpi20
);
167 addr
->pointer
.physical
=
168 (acpi_physical_address
) virt_to_phys(efi
.acpi
);
170 printk(KERN_ERR PREFIX
"System description tables not found\n");
174 if (ACPI_FAILURE(acpi_find_root_pointer(flags
, addr
))) {
175 printk(KERN_ERR PREFIX
"System description tables not found\n");
184 acpi_os_map_memory(acpi_physical_address phys
, acpi_size size
, void __iomem
**virt
)
187 if (EFI_MEMORY_WB
& efi_mem_attributes(phys
)) {
188 *virt
= (void __iomem
*) phys_to_virt(phys
);
190 *virt
= ioremap(phys
, size
);
193 if (phys
> ULONG_MAX
) {
194 printk(KERN_ERR PREFIX
"Cannot map memory that high\n");
195 return AE_BAD_PARAMETER
;
198 * ioremap checks to ensure this is in reserved space
200 *virt
= ioremap((unsigned long) phys
, size
);
210 acpi_os_unmap_memory(void __iomem
*virt
, acpi_size size
)
215 #ifdef ACPI_FUTURE_USAGE
217 acpi_os_get_physical_address(void *virt
, acpi_physical_address
*phys
)
220 return AE_BAD_PARAMETER
;
222 *phys
= virt_to_phys(virt
);
228 #define ACPI_MAX_OVERRIDE_LEN 100
230 static char acpi_os_name
[ACPI_MAX_OVERRIDE_LEN
];
233 acpi_os_predefined_override (const struct acpi_predefined_names
*init_val
,
234 acpi_string
*new_val
)
236 if (!init_val
|| !new_val
)
237 return AE_BAD_PARAMETER
;
240 if (!memcmp (init_val
->name
, "_OS_", 4) && strlen(acpi_os_name
)) {
241 printk(KERN_INFO PREFIX
"Overriding _OS definition to '%s'\n",
243 *new_val
= acpi_os_name
;
250 acpi_os_table_override (struct acpi_table_header
*existing_table
,
251 struct acpi_table_header
**new_table
)
253 if (!existing_table
|| !new_table
)
254 return AE_BAD_PARAMETER
;
256 #ifdef CONFIG_ACPI_CUSTOM_DSDT
257 if (strncmp(existing_table
->signature
, "DSDT", 4) == 0)
258 *new_table
= (struct acpi_table_header
*)AmlCode
;
268 acpi_irq(int irq
, void *dev_id
, struct pt_regs
*regs
)
270 return (*acpi_irq_handler
)(acpi_irq_context
) ? IRQ_HANDLED
: IRQ_NONE
;
274 acpi_os_install_interrupt_handler(u32 gsi
, acpi_osd_handler handler
, void *context
)
279 * Ignore the GSI from the core, and use the value in our copy of the
280 * FADT. It may not be the same if an interrupt source override exists
283 gsi
= acpi_fadt
.sci_int
;
284 if (acpi_gsi_to_irq(gsi
, &irq
) < 0) {
285 printk(KERN_ERR PREFIX
"SCI (ACPI GSI %d) not registered\n",
290 acpi_irq_handler
= handler
;
291 acpi_irq_context
= context
;
292 if (request_irq(irq
, acpi_irq
, SA_SHIRQ
, "acpi", acpi_irq
)) {
293 printk(KERN_ERR PREFIX
"SCI (IRQ%d) allocation failed\n", irq
);
294 return AE_NOT_ACQUIRED
;
302 acpi_os_remove_interrupt_handler(u32 irq
, acpi_osd_handler handler
)
305 free_irq(irq
, acpi_irq
);
306 acpi_irq_handler
= NULL
;
314 * Running in interpreter thread context, safe to sleep
318 acpi_os_sleep(acpi_integer ms
)
320 current
->state
= TASK_INTERRUPTIBLE
;
321 schedule_timeout(((signed long) ms
* HZ
) / 1000);
323 EXPORT_SYMBOL(acpi_os_sleep
);
326 acpi_os_stall(u32 us
)
334 touch_nmi_watchdog();
338 EXPORT_SYMBOL(acpi_os_stall
);
341 * Support ACPI 3.0 AML Timer operand
342 * Returns 64-bit free-running, monotonically increasing timer
343 * with 100ns granularity
346 acpi_os_get_timer (void)
351 /* TBD: use HPET if available */
354 #ifdef CONFIG_X86_PM_TIMER
355 /* TBD: default to PM timer if HPET was not available */
358 printk(KERN_ERR PREFIX
"acpi_os_get_timer() TBD\n");
365 acpi_io_address port
,
377 *(u8
*) value
= inb(port
);
380 *(u16
*) value
= inw(port
);
383 *(u32
*) value
= inl(port
);
391 EXPORT_SYMBOL(acpi_os_read_port
);
395 acpi_io_address port
,
416 EXPORT_SYMBOL(acpi_os_write_port
);
420 acpi_physical_address phys_addr
,
425 void __iomem
*virt_addr
;
429 if (EFI_MEMORY_WB
& efi_mem_attributes(phys_addr
)) {
430 /* HACK ALERT! We can use readb/w/l on real memory too.. */
431 virt_addr
= (void __iomem
*) phys_to_virt(phys_addr
);
434 virt_addr
= ioremap(phys_addr
, width
);
437 virt_addr
= (void __iomem
*) phys_to_virt(phys_addr
);
443 *(u8
*) value
= readb(virt_addr
);
446 *(u16
*) value
= readw(virt_addr
);
449 *(u32
*) value
= readl(virt_addr
);
464 acpi_os_write_memory(
465 acpi_physical_address phys_addr
,
469 void __iomem
*virt_addr
;
473 if (EFI_MEMORY_WB
& efi_mem_attributes(phys_addr
)) {
474 /* HACK ALERT! We can use writeb/w/l on real memory too */
475 virt_addr
= (void __iomem
*) phys_to_virt(phys_addr
);
478 virt_addr
= ioremap(phys_addr
, width
);
481 virt_addr
= (void __iomem
*) phys_to_virt(phys_addr
);
485 writeb(value
, virt_addr
);
488 writew(value
, virt_addr
);
491 writel(value
, virt_addr
);
503 #ifdef CONFIG_ACPI_PCI
506 acpi_os_read_pci_configuration (struct acpi_pci_id
*pci_id
, u32 reg
, void *value
, u32 width
)
511 return AE_BAD_PARAMETER
;
527 BUG_ON(!raw_pci_ops
);
529 result
= raw_pci_ops
->read(pci_id
->segment
, pci_id
->bus
,
530 PCI_DEVFN(pci_id
->device
, pci_id
->function
),
533 return (result
? AE_ERROR
: AE_OK
);
535 EXPORT_SYMBOL(acpi_os_read_pci_configuration
);
538 acpi_os_write_pci_configuration (struct acpi_pci_id
*pci_id
, u32 reg
, acpi_integer value
, u32 width
)
556 BUG_ON(!raw_pci_ops
);
558 result
= raw_pci_ops
->write(pci_id
->segment
, pci_id
->bus
,
559 PCI_DEVFN(pci_id
->device
, pci_id
->function
),
562 return (result
? AE_ERROR
: AE_OK
);
565 /* TODO: Change code to take advantage of driver model more */
567 acpi_os_derive_pci_id_2 (
568 acpi_handle rhandle
, /* upper bound */
569 acpi_handle chandle
, /* current node */
570 struct acpi_pci_id
**id
,
575 struct acpi_pci_id
*pci_id
= *id
;
578 acpi_object_type type
;
581 acpi_get_parent(chandle
, &handle
);
582 if (handle
!= rhandle
) {
583 acpi_os_derive_pci_id_2(rhandle
, handle
, &pci_id
, is_bridge
, bus_number
);
585 status
= acpi_get_type(handle
, &type
);
586 if ( (ACPI_FAILURE(status
)) || (type
!= ACPI_TYPE_DEVICE
) )
589 status
= acpi_evaluate_integer(handle
, METHOD_NAME__ADR
, NULL
, &temp
);
590 if (ACPI_SUCCESS(status
)) {
591 pci_id
->device
= ACPI_HIWORD (ACPI_LODWORD (temp
));
592 pci_id
->function
= ACPI_LOWORD (ACPI_LODWORD (temp
));
595 pci_id
->bus
= *bus_number
;
597 /* any nicer way to get bus number of bridge ? */
598 status
= acpi_os_read_pci_configuration(pci_id
, 0x0e, &tu8
, 8);
599 if (ACPI_SUCCESS(status
) &&
600 ((tu8
& 0x7f) == 1 || (tu8
& 0x7f) == 2)) {
601 status
= acpi_os_read_pci_configuration(pci_id
, 0x18, &tu8
, 8);
602 if (!ACPI_SUCCESS(status
)) {
603 /* Certainly broken... FIX ME */
608 status
= acpi_os_read_pci_configuration(pci_id
, 0x19, &tu8
, 8);
609 if (ACPI_SUCCESS(status
)) {
619 acpi_os_derive_pci_id (
620 acpi_handle rhandle
, /* upper bound */
621 acpi_handle chandle
, /* current node */
622 struct acpi_pci_id
**id
)
625 u8 bus_number
= (*id
)->bus
;
627 acpi_os_derive_pci_id_2(rhandle
, chandle
, id
, &is_bridge
, &bus_number
);
630 #else /*!CONFIG_ACPI_PCI*/
633 acpi_os_write_pci_configuration (
634 struct acpi_pci_id
*pci_id
,
643 acpi_os_read_pci_configuration (
644 struct acpi_pci_id
*pci_id
,
653 acpi_os_derive_pci_id (
654 acpi_handle rhandle
, /* upper bound */
655 acpi_handle chandle
, /* current node */
656 struct acpi_pci_id
**id
)
660 #endif /*CONFIG_ACPI_PCI*/
663 acpi_os_execute_deferred (
666 struct acpi_os_dpc
*dpc
= NULL
;
668 ACPI_FUNCTION_TRACE ("os_execute_deferred");
670 dpc
= (struct acpi_os_dpc
*) context
;
672 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR
, "Invalid (NULL) context.\n"));
676 dpc
->function(dpc
->context
);
684 acpi_os_queue_for_execution(
686 acpi_osd_exec_callback function
,
689 acpi_status status
= AE_OK
;
690 struct acpi_os_dpc
*dpc
;
691 struct work_struct
*task
;
693 ACPI_FUNCTION_TRACE ("os_queue_for_execution");
695 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "Scheduling function [%p(%p)] for deferred execution.\n", function
, context
));
698 return_ACPI_STATUS (AE_BAD_PARAMETER
);
701 * Allocate/initialize DPC structure. Note that this memory will be
702 * freed by the callee. The kernel handles the tq_struct list in a
703 * way that allows us to also free its memory inside the callee.
704 * Because we may want to schedule several tasks with different
705 * parameters we can't use the approach some kernel code uses of
706 * having a static tq_struct.
707 * We can save time and code by allocating the DPC and tq_structs
708 * from the same memory.
711 dpc
= kmalloc(sizeof(struct acpi_os_dpc
)+sizeof(struct work_struct
), GFP_ATOMIC
);
713 return_ACPI_STATUS (AE_NO_MEMORY
);
715 dpc
->function
= function
;
716 dpc
->context
= context
;
718 task
= (void *)(dpc
+1);
719 INIT_WORK(task
, acpi_os_execute_deferred
, (void*)dpc
);
721 if (!queue_work(kacpid_wq
, task
)) {
722 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR
, "Call to queue_work() failed.\n"));
727 return_ACPI_STATUS (status
);
729 EXPORT_SYMBOL(acpi_os_queue_for_execution
);
732 acpi_os_wait_events_complete(
735 flush_workqueue(kacpid_wq
);
737 EXPORT_SYMBOL(acpi_os_wait_events_complete
);
740 * Allocate the memory for a spinlock and initialize it.
743 acpi_os_create_lock (
744 acpi_handle
*out_handle
)
746 spinlock_t
*lock_ptr
;
748 ACPI_FUNCTION_TRACE ("os_create_lock");
750 lock_ptr
= acpi_os_allocate(sizeof(spinlock_t
));
752 spin_lock_init(lock_ptr
);
754 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Creating spinlock[%p].\n", lock_ptr
));
756 *out_handle
= lock_ptr
;
758 return_ACPI_STATUS (AE_OK
);
763 * Deallocate the memory for a spinlock.
766 acpi_os_delete_lock (
769 ACPI_FUNCTION_TRACE ("os_create_lock");
771 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Deleting spinlock[%p].\n", handle
));
773 acpi_os_free(handle
);
779 * Acquire a spinlock.
781 * handle is a pointer to the spinlock_t.
782 * flags is *not* the result of save_flags - it is an ACPI-specific flag variable
783 * that indicates whether we are at interrupt level.
786 acpi_os_acquire_lock (
790 ACPI_FUNCTION_TRACE ("os_acquire_lock");
792 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Acquiring spinlock[%p] from %s level\n", handle
,
793 ((flags
& ACPI_NOT_ISR
) ? "non-interrupt" : "interrupt")));
795 if (flags
& ACPI_NOT_ISR
)
798 spin_lock((spinlock_t
*)handle
);
805 * Release a spinlock. See above.
808 acpi_os_release_lock (
812 ACPI_FUNCTION_TRACE ("os_release_lock");
814 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Releasing spinlock[%p] from %s level\n", handle
,
815 ((flags
& ACPI_NOT_ISR
) ? "non-interrupt" : "interrupt")));
817 spin_unlock((spinlock_t
*)handle
);
819 if (flags
& ACPI_NOT_ISR
)
827 acpi_os_create_semaphore(
832 struct semaphore
*sem
= NULL
;
834 ACPI_FUNCTION_TRACE ("os_create_semaphore");
836 sem
= acpi_os_allocate(sizeof(struct semaphore
));
838 return_ACPI_STATUS (AE_NO_MEMORY
);
839 memset(sem
, 0, sizeof(struct semaphore
));
841 sema_init(sem
, initial_units
);
843 *handle
= (acpi_handle
*)sem
;
845 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Creating semaphore[%p|%d].\n", *handle
, initial_units
));
847 return_ACPI_STATUS (AE_OK
);
849 EXPORT_SYMBOL(acpi_os_create_semaphore
);
853 * TODO: A better way to delete semaphores? Linux doesn't have a
854 * 'delete_semaphore()' function -- may result in an invalid
855 * pointer dereference for non-synchronized consumers. Should
856 * we at least check for blocked threads and signal/cancel them?
860 acpi_os_delete_semaphore(
863 struct semaphore
*sem
= (struct semaphore
*) handle
;
865 ACPI_FUNCTION_TRACE ("os_delete_semaphore");
868 return_ACPI_STATUS (AE_BAD_PARAMETER
);
870 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Deleting semaphore[%p].\n", handle
));
872 acpi_os_free(sem
); sem
= NULL
;
874 return_ACPI_STATUS (AE_OK
);
876 EXPORT_SYMBOL(acpi_os_delete_semaphore
);
880 * TODO: The kernel doesn't have a 'down_timeout' function -- had to
881 * improvise. The process is to sleep for one scheduler quantum
882 * until the semaphore becomes available. Downside is that this
883 * may result in starvation for timeout-based waits when there's
884 * lots of semaphore activity.
886 * TODO: Support for units > 1?
889 acpi_os_wait_semaphore(
894 acpi_status status
= AE_OK
;
895 struct semaphore
*sem
= (struct semaphore
*)handle
;
898 ACPI_FUNCTION_TRACE ("os_wait_semaphore");
900 if (!sem
|| (units
< 1))
901 return_ACPI_STATUS (AE_BAD_PARAMETER
);
904 return_ACPI_STATUS (AE_SUPPORT
);
906 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Waiting for semaphore[%p|%d|%d]\n", handle
, units
, timeout
));
916 * A zero timeout value indicates that we shouldn't wait - just
917 * acquire the semaphore if available otherwise return AE_TIME
918 * (a.k.a. 'would block').
921 if(down_trylock(sem
))
929 case ACPI_WAIT_FOREVER
:
938 // TODO: A better timeout algorithm?
941 static const int quantum_ms
= 1000/HZ
;
943 ret
= down_trylock(sem
);
944 for (i
= timeout
; (i
> 0 && ret
< 0); i
-= quantum_ms
) {
945 current
->state
= TASK_INTERRUPTIBLE
;
947 ret
= down_trylock(sem
);
956 if (ACPI_FAILURE(status
)) {
957 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR
, "Failed to acquire semaphore[%p|%d|%d], %s\n",
958 handle
, units
, timeout
, acpi_format_exception(status
)));
961 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Acquired semaphore[%p|%d|%d]\n", handle
, units
, timeout
));
964 return_ACPI_STATUS (status
);
966 EXPORT_SYMBOL(acpi_os_wait_semaphore
);
970 * TODO: Support for units > 1?
973 acpi_os_signal_semaphore(
977 struct semaphore
*sem
= (struct semaphore
*) handle
;
979 ACPI_FUNCTION_TRACE ("os_signal_semaphore");
981 if (!sem
|| (units
< 1))
982 return_ACPI_STATUS (AE_BAD_PARAMETER
);
985 return_ACPI_STATUS (AE_SUPPORT
);
987 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Signaling semaphore[%p|%d]\n", handle
, units
));
991 return_ACPI_STATUS (AE_OK
);
993 EXPORT_SYMBOL(acpi_os_signal_semaphore
);
995 #ifdef ACPI_FUTURE_USAGE
997 acpi_os_get_line(char *buffer
)
1000 #ifdef ENABLE_DEBUGGER
1001 if (acpi_in_debugger
) {
1004 kdb_read(buffer
, sizeof(line_buf
));
1006 /* remove the CR kdb includes */
1007 chars
= strlen(buffer
) - 1;
1008 buffer
[chars
] = '\0';
1014 #endif /* ACPI_FUTURE_USAGE */
1016 /* Assumes no unreadable holes inbetween */
1018 acpi_os_readable(void *ptr
, acpi_size len
)
1020 #if defined(__i386__) || defined(__x86_64__)
1022 return !__get_user(tmp
, (char __user
*)ptr
) && !__get_user(tmp
, (char __user
*)ptr
+ len
- 1);
1027 #ifdef ACPI_FUTURE_USAGE
1029 acpi_os_writable(void *ptr
, acpi_size len
)
1031 /* could do dummy write (racy) or a kernel page table lookup.
1032 The later may be difficult at early boot when kmap doesn't work yet. */
1038 acpi_os_get_thread_id (void)
1041 return current
->pid
;
1053 case ACPI_SIGNAL_FATAL
:
1054 printk(KERN_ERR PREFIX
"Fatal opcode executed\n");
1056 case ACPI_SIGNAL_BREAKPOINT
:
1059 * ACPI spec. says to treat it as a NOP unless
1060 * you are debugging. So if/when we integrate
1061 * AML debugger into the kernel debugger its
1062 * hook will go here. But until then it is
1063 * not useful to print anything on breakpoints.
1072 EXPORT_SYMBOL(acpi_os_signal
);
1075 acpi_os_name_setup(char *str
)
1077 char *p
= acpi_os_name
;
1078 int count
= ACPI_MAX_OVERRIDE_LEN
-1;
1083 for (; count
-- && str
&& *str
; str
++) {
1084 if (isalnum(*str
) || *str
== ' ' || *str
== ':')
1086 else if (*str
== '\'' || *str
== '"')
1097 __setup("acpi_os_name=", acpi_os_name_setup
);
1101 * empty string disables _OSI
1102 * TBD additional string adds to _OSI
1105 acpi_osi_setup(char *str
)
1107 if (str
== NULL
|| *str
== '\0') {
1108 printk(KERN_INFO PREFIX
"_OSI method disabled\n");
1109 acpi_gbl_create_osi_method
= FALSE
;
1113 printk(KERN_ERR PREFIX
"_OSI additional string ignored -- %s\n", str
);
1119 __setup("acpi_osi=", acpi_osi_setup
);
1121 /* enable serialization to combat AE_ALREADY_EXISTS errors */
1123 acpi_serialize_setup(char *str
)
1125 printk(KERN_INFO PREFIX
"serialize enabled\n");
1127 acpi_gbl_all_methods_serialized
= TRUE
;
1132 __setup("acpi_serialize", acpi_serialize_setup
);
1135 * Wake and Run-Time GPES are expected to be separate.
1136 * We disable wake-GPEs at run-time to prevent spurious
1139 * However, if a system exists that shares Wake and
1140 * Run-time events on the same GPE this flag is available
1141 * to tell Linux to keep the wake-time GPEs enabled at run-time.
1144 acpi_wake_gpes_always_on_setup(char *str
)
1146 printk(KERN_INFO PREFIX
"wake GPEs not disabled\n");
1148 acpi_gbl_leave_wake_gpes_disabled
= FALSE
;
1153 __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup
);
1156 * max_cstate is defined in the base kernel so modules can
1157 * change it w/o depending on the state of the processor module.
1159 unsigned int max_cstate
= ACPI_PROCESSOR_MAX_POWER
;
1162 EXPORT_SYMBOL(max_cstate
);