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 int acpi_specific_hotkey_enabled
= TRUE
;
75 EXPORT_SYMBOL(acpi_specific_hotkey_enabled
);
77 static unsigned int acpi_irq_irq
;
78 static acpi_osd_handler acpi_irq_handler
;
79 static void *acpi_irq_context
;
80 static struct workqueue_struct
*kacpid_wq
;
83 acpi_os_initialize(void)
89 acpi_os_initialize1(void)
92 * Initialize PCI configuration space access, as we'll need to access
93 * it while walking the namespace (bus 0 and root bridges w/ _BBNs).
95 #ifdef CONFIG_ACPI_PCI
97 printk(KERN_ERR PREFIX
"Access to PCI configuration space unavailable\n");
101 kacpid_wq
= create_singlethread_workqueue("kacpid");
108 acpi_os_terminate(void)
110 if (acpi_irq_handler
) {
111 acpi_os_remove_interrupt_handler(acpi_irq_irq
,
115 destroy_workqueue(kacpid_wq
);
121 acpi_os_printf(const char *fmt
,...)
125 acpi_os_vprintf(fmt
, args
);
128 EXPORT_SYMBOL(acpi_os_printf
);
131 acpi_os_vprintf(const char *fmt
, va_list args
)
133 static char buffer
[512];
135 vsprintf(buffer
, fmt
, args
);
137 #ifdef ENABLE_DEBUGGER
138 if (acpi_in_debugger
) {
139 kdb_printf("%s", buffer
);
141 printk("%s", buffer
);
144 printk("%s", buffer
);
148 extern int acpi_in_resume
;
150 acpi_os_allocate(acpi_size size
)
153 return kmalloc(size
, GFP_ATOMIC
);
155 return kmalloc(size
, GFP_KERNEL
);
159 acpi_os_free(void *ptr
)
163 EXPORT_SYMBOL(acpi_os_free
);
166 acpi_os_get_root_pointer(u32 flags
, struct acpi_pointer
*addr
)
169 addr
->pointer_type
= ACPI_PHYSICAL_POINTER
;
171 addr
->pointer
.physical
=
172 (acpi_physical_address
) virt_to_phys(efi
.acpi20
);
174 addr
->pointer
.physical
=
175 (acpi_physical_address
) virt_to_phys(efi
.acpi
);
177 printk(KERN_ERR PREFIX
"System description tables not found\n");
181 if (ACPI_FAILURE(acpi_find_root_pointer(flags
, addr
))) {
182 printk(KERN_ERR PREFIX
"System description tables not found\n");
191 acpi_os_map_memory(acpi_physical_address phys
, acpi_size size
, void __iomem
**virt
)
194 if (EFI_MEMORY_WB
& efi_mem_attributes(phys
)) {
195 *virt
= (void __iomem
*) phys_to_virt(phys
);
197 *virt
= ioremap(phys
, size
);
200 if (phys
> ULONG_MAX
) {
201 printk(KERN_ERR PREFIX
"Cannot map memory that high\n");
202 return AE_BAD_PARAMETER
;
205 * ioremap checks to ensure this is in reserved space
207 *virt
= ioremap((unsigned long) phys
, size
);
217 acpi_os_unmap_memory(void __iomem
*virt
, acpi_size size
)
222 #ifdef ACPI_FUTURE_USAGE
224 acpi_os_get_physical_address(void *virt
, acpi_physical_address
*phys
)
227 return AE_BAD_PARAMETER
;
229 *phys
= virt_to_phys(virt
);
235 #define ACPI_MAX_OVERRIDE_LEN 100
237 static char acpi_os_name
[ACPI_MAX_OVERRIDE_LEN
];
240 acpi_os_predefined_override (const struct acpi_predefined_names
*init_val
,
241 acpi_string
*new_val
)
243 if (!init_val
|| !new_val
)
244 return AE_BAD_PARAMETER
;
247 if (!memcmp (init_val
->name
, "_OS_", 4) && strlen(acpi_os_name
)) {
248 printk(KERN_INFO PREFIX
"Overriding _OS definition to '%s'\n",
250 *new_val
= acpi_os_name
;
257 acpi_os_table_override (struct acpi_table_header
*existing_table
,
258 struct acpi_table_header
**new_table
)
260 if (!existing_table
|| !new_table
)
261 return AE_BAD_PARAMETER
;
263 #ifdef CONFIG_ACPI_CUSTOM_DSDT
264 if (strncmp(existing_table
->signature
, "DSDT", 4) == 0)
265 *new_table
= (struct acpi_table_header
*)AmlCode
;
275 acpi_irq(int irq
, void *dev_id
, struct pt_regs
*regs
)
277 return (*acpi_irq_handler
)(acpi_irq_context
) ? IRQ_HANDLED
: IRQ_NONE
;
281 acpi_os_install_interrupt_handler(u32 gsi
, acpi_osd_handler handler
, void *context
)
286 * Ignore the GSI from the core, and use the value in our copy of the
287 * FADT. It may not be the same if an interrupt source override exists
290 gsi
= acpi_fadt
.sci_int
;
291 if (acpi_gsi_to_irq(gsi
, &irq
) < 0) {
292 printk(KERN_ERR PREFIX
"SCI (ACPI GSI %d) not registered\n",
297 acpi_irq_handler
= handler
;
298 acpi_irq_context
= context
;
299 if (request_irq(irq
, acpi_irq
, SA_SHIRQ
, "acpi", acpi_irq
)) {
300 printk(KERN_ERR PREFIX
"SCI (IRQ%d) allocation failed\n", irq
);
301 return AE_NOT_ACQUIRED
;
309 acpi_os_remove_interrupt_handler(u32 irq
, acpi_osd_handler handler
)
312 free_irq(irq
, acpi_irq
);
313 acpi_irq_handler
= NULL
;
321 * Running in interpreter thread context, safe to sleep
325 acpi_os_sleep(acpi_integer ms
)
327 current
->state
= TASK_INTERRUPTIBLE
;
328 schedule_timeout(((signed long) ms
* HZ
) / 1000);
330 EXPORT_SYMBOL(acpi_os_sleep
);
333 acpi_os_stall(u32 us
)
341 touch_nmi_watchdog();
345 EXPORT_SYMBOL(acpi_os_stall
);
348 * Support ACPI 3.0 AML Timer operand
349 * Returns 64-bit free-running, monotonically increasing timer
350 * with 100ns granularity
353 acpi_os_get_timer (void)
358 /* TBD: use HPET if available */
361 #ifdef CONFIG_X86_PM_TIMER
362 /* TBD: default to PM timer if HPET was not available */
365 printk(KERN_ERR PREFIX
"acpi_os_get_timer() TBD\n");
372 acpi_io_address port
,
384 *(u8
*) value
= inb(port
);
387 *(u16
*) value
= inw(port
);
390 *(u32
*) value
= inl(port
);
398 EXPORT_SYMBOL(acpi_os_read_port
);
402 acpi_io_address port
,
423 EXPORT_SYMBOL(acpi_os_write_port
);
427 acpi_physical_address phys_addr
,
432 void __iomem
*virt_addr
;
436 if (EFI_MEMORY_WB
& efi_mem_attributes(phys_addr
)) {
437 /* HACK ALERT! We can use readb/w/l on real memory too.. */
438 virt_addr
= (void __iomem
*) phys_to_virt(phys_addr
);
441 virt_addr
= ioremap(phys_addr
, width
);
444 virt_addr
= (void __iomem
*) phys_to_virt(phys_addr
);
450 *(u8
*) value
= readb(virt_addr
);
453 *(u16
*) value
= readw(virt_addr
);
456 *(u32
*) value
= readl(virt_addr
);
471 acpi_os_write_memory(
472 acpi_physical_address phys_addr
,
476 void __iomem
*virt_addr
;
480 if (EFI_MEMORY_WB
& efi_mem_attributes(phys_addr
)) {
481 /* HACK ALERT! We can use writeb/w/l on real memory too */
482 virt_addr
= (void __iomem
*) phys_to_virt(phys_addr
);
485 virt_addr
= ioremap(phys_addr
, width
);
488 virt_addr
= (void __iomem
*) phys_to_virt(phys_addr
);
492 writeb(value
, virt_addr
);
495 writew(value
, virt_addr
);
498 writel(value
, virt_addr
);
510 #ifdef CONFIG_ACPI_PCI
513 acpi_os_read_pci_configuration (struct acpi_pci_id
*pci_id
, u32 reg
, void *value
, u32 width
)
518 return AE_BAD_PARAMETER
;
534 BUG_ON(!raw_pci_ops
);
536 result
= raw_pci_ops
->read(pci_id
->segment
, pci_id
->bus
,
537 PCI_DEVFN(pci_id
->device
, pci_id
->function
),
540 return (result
? AE_ERROR
: AE_OK
);
542 EXPORT_SYMBOL(acpi_os_read_pci_configuration
);
545 acpi_os_write_pci_configuration (struct acpi_pci_id
*pci_id
, u32 reg
, acpi_integer value
, u32 width
)
563 BUG_ON(!raw_pci_ops
);
565 result
= raw_pci_ops
->write(pci_id
->segment
, pci_id
->bus
,
566 PCI_DEVFN(pci_id
->device
, pci_id
->function
),
569 return (result
? AE_ERROR
: AE_OK
);
572 /* TODO: Change code to take advantage of driver model more */
574 acpi_os_derive_pci_id_2 (
575 acpi_handle rhandle
, /* upper bound */
576 acpi_handle chandle
, /* current node */
577 struct acpi_pci_id
**id
,
582 struct acpi_pci_id
*pci_id
= *id
;
585 acpi_object_type type
;
588 acpi_get_parent(chandle
, &handle
);
589 if (handle
!= rhandle
) {
590 acpi_os_derive_pci_id_2(rhandle
, handle
, &pci_id
, is_bridge
, bus_number
);
592 status
= acpi_get_type(handle
, &type
);
593 if ( (ACPI_FAILURE(status
)) || (type
!= ACPI_TYPE_DEVICE
) )
596 status
= acpi_evaluate_integer(handle
, METHOD_NAME__ADR
, NULL
, &temp
);
597 if (ACPI_SUCCESS(status
)) {
598 pci_id
->device
= ACPI_HIWORD (ACPI_LODWORD (temp
));
599 pci_id
->function
= ACPI_LOWORD (ACPI_LODWORD (temp
));
602 pci_id
->bus
= *bus_number
;
604 /* any nicer way to get bus number of bridge ? */
605 status
= acpi_os_read_pci_configuration(pci_id
, 0x0e, &tu8
, 8);
606 if (ACPI_SUCCESS(status
) &&
607 ((tu8
& 0x7f) == 1 || (tu8
& 0x7f) == 2)) {
608 status
= acpi_os_read_pci_configuration(pci_id
, 0x18, &tu8
, 8);
609 if (!ACPI_SUCCESS(status
)) {
610 /* Certainly broken... FIX ME */
615 status
= acpi_os_read_pci_configuration(pci_id
, 0x19, &tu8
, 8);
616 if (ACPI_SUCCESS(status
)) {
626 acpi_os_derive_pci_id (
627 acpi_handle rhandle
, /* upper bound */
628 acpi_handle chandle
, /* current node */
629 struct acpi_pci_id
**id
)
632 u8 bus_number
= (*id
)->bus
;
634 acpi_os_derive_pci_id_2(rhandle
, chandle
, id
, &is_bridge
, &bus_number
);
637 #else /*!CONFIG_ACPI_PCI*/
640 acpi_os_write_pci_configuration (
641 struct acpi_pci_id
*pci_id
,
650 acpi_os_read_pci_configuration (
651 struct acpi_pci_id
*pci_id
,
660 acpi_os_derive_pci_id (
661 acpi_handle rhandle
, /* upper bound */
662 acpi_handle chandle
, /* current node */
663 struct acpi_pci_id
**id
)
667 #endif /*CONFIG_ACPI_PCI*/
670 acpi_os_execute_deferred (
673 struct acpi_os_dpc
*dpc
= NULL
;
675 ACPI_FUNCTION_TRACE ("os_execute_deferred");
677 dpc
= (struct acpi_os_dpc
*) context
;
679 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR
, "Invalid (NULL) context.\n"));
683 dpc
->function(dpc
->context
);
691 acpi_os_queue_for_execution(
693 acpi_osd_exec_callback function
,
696 acpi_status status
= AE_OK
;
697 struct acpi_os_dpc
*dpc
;
698 struct work_struct
*task
;
700 ACPI_FUNCTION_TRACE ("os_queue_for_execution");
702 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC
, "Scheduling function [%p(%p)] for deferred execution.\n", function
, context
));
705 return_ACPI_STATUS (AE_BAD_PARAMETER
);
708 * Allocate/initialize DPC structure. Note that this memory will be
709 * freed by the callee. The kernel handles the tq_struct list in a
710 * way that allows us to also free its memory inside the callee.
711 * Because we may want to schedule several tasks with different
712 * parameters we can't use the approach some kernel code uses of
713 * having a static tq_struct.
714 * We can save time and code by allocating the DPC and tq_structs
715 * from the same memory.
718 dpc
= kmalloc(sizeof(struct acpi_os_dpc
)+sizeof(struct work_struct
), GFP_ATOMIC
);
720 return_ACPI_STATUS (AE_NO_MEMORY
);
722 dpc
->function
= function
;
723 dpc
->context
= context
;
725 task
= (void *)(dpc
+1);
726 INIT_WORK(task
, acpi_os_execute_deferred
, (void*)dpc
);
728 if (!queue_work(kacpid_wq
, task
)) {
729 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR
, "Call to queue_work() failed.\n"));
734 return_ACPI_STATUS (status
);
736 EXPORT_SYMBOL(acpi_os_queue_for_execution
);
739 acpi_os_wait_events_complete(
742 flush_workqueue(kacpid_wq
);
744 EXPORT_SYMBOL(acpi_os_wait_events_complete
);
747 * Allocate the memory for a spinlock and initialize it.
750 acpi_os_create_lock (
751 acpi_handle
*out_handle
)
753 spinlock_t
*lock_ptr
;
755 ACPI_FUNCTION_TRACE ("os_create_lock");
757 lock_ptr
= acpi_os_allocate(sizeof(spinlock_t
));
759 spin_lock_init(lock_ptr
);
761 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Creating spinlock[%p].\n", lock_ptr
));
763 *out_handle
= lock_ptr
;
765 return_ACPI_STATUS (AE_OK
);
770 * Deallocate the memory for a spinlock.
773 acpi_os_delete_lock (
776 ACPI_FUNCTION_TRACE ("os_create_lock");
778 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Deleting spinlock[%p].\n", handle
));
780 acpi_os_free(handle
);
786 * Acquire a spinlock.
788 * handle is a pointer to the spinlock_t.
789 * flags is *not* the result of save_flags - it is an ACPI-specific flag variable
790 * that indicates whether we are at interrupt level.
793 acpi_os_acquire_lock (
797 ACPI_FUNCTION_TRACE ("os_acquire_lock");
799 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Acquiring spinlock[%p] from %s level\n", handle
,
800 ((flags
& ACPI_NOT_ISR
) ? "non-interrupt" : "interrupt")));
802 if (flags
& ACPI_NOT_ISR
)
805 spin_lock((spinlock_t
*)handle
);
812 * Release a spinlock. See above.
815 acpi_os_release_lock (
819 ACPI_FUNCTION_TRACE ("os_release_lock");
821 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Releasing spinlock[%p] from %s level\n", handle
,
822 ((flags
& ACPI_NOT_ISR
) ? "non-interrupt" : "interrupt")));
824 spin_unlock((spinlock_t
*)handle
);
826 if (flags
& ACPI_NOT_ISR
)
834 acpi_os_create_semaphore(
839 struct semaphore
*sem
= NULL
;
841 ACPI_FUNCTION_TRACE ("os_create_semaphore");
843 sem
= acpi_os_allocate(sizeof(struct semaphore
));
845 return_ACPI_STATUS (AE_NO_MEMORY
);
846 memset(sem
, 0, sizeof(struct semaphore
));
848 sema_init(sem
, initial_units
);
850 *handle
= (acpi_handle
*)sem
;
852 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Creating semaphore[%p|%d].\n", *handle
, initial_units
));
854 return_ACPI_STATUS (AE_OK
);
856 EXPORT_SYMBOL(acpi_os_create_semaphore
);
860 * TODO: A better way to delete semaphores? Linux doesn't have a
861 * 'delete_semaphore()' function -- may result in an invalid
862 * pointer dereference for non-synchronized consumers. Should
863 * we at least check for blocked threads and signal/cancel them?
867 acpi_os_delete_semaphore(
870 struct semaphore
*sem
= (struct semaphore
*) handle
;
872 ACPI_FUNCTION_TRACE ("os_delete_semaphore");
875 return_ACPI_STATUS (AE_BAD_PARAMETER
);
877 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Deleting semaphore[%p].\n", handle
));
879 acpi_os_free(sem
); sem
= NULL
;
881 return_ACPI_STATUS (AE_OK
);
883 EXPORT_SYMBOL(acpi_os_delete_semaphore
);
887 * TODO: The kernel doesn't have a 'down_timeout' function -- had to
888 * improvise. The process is to sleep for one scheduler quantum
889 * until the semaphore becomes available. Downside is that this
890 * may result in starvation for timeout-based waits when there's
891 * lots of semaphore activity.
893 * TODO: Support for units > 1?
896 acpi_os_wait_semaphore(
901 acpi_status status
= AE_OK
;
902 struct semaphore
*sem
= (struct semaphore
*)handle
;
905 ACPI_FUNCTION_TRACE ("os_wait_semaphore");
907 if (!sem
|| (units
< 1))
908 return_ACPI_STATUS (AE_BAD_PARAMETER
);
911 return_ACPI_STATUS (AE_SUPPORT
);
913 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Waiting for semaphore[%p|%d|%d]\n", handle
, units
, timeout
));
923 * A zero timeout value indicates that we shouldn't wait - just
924 * acquire the semaphore if available otherwise return AE_TIME
925 * (a.k.a. 'would block').
928 if(down_trylock(sem
))
936 case ACPI_WAIT_FOREVER
:
945 // TODO: A better timeout algorithm?
948 static const int quantum_ms
= 1000/HZ
;
950 ret
= down_trylock(sem
);
951 for (i
= timeout
; (i
> 0 && ret
< 0); i
-= quantum_ms
) {
952 current
->state
= TASK_INTERRUPTIBLE
;
954 ret
= down_trylock(sem
);
963 if (ACPI_FAILURE(status
)) {
964 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR
, "Failed to acquire semaphore[%p|%d|%d], %s\n",
965 handle
, units
, timeout
, acpi_format_exception(status
)));
968 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Acquired semaphore[%p|%d|%d]\n", handle
, units
, timeout
));
971 return_ACPI_STATUS (status
);
973 EXPORT_SYMBOL(acpi_os_wait_semaphore
);
977 * TODO: Support for units > 1?
980 acpi_os_signal_semaphore(
984 struct semaphore
*sem
= (struct semaphore
*) handle
;
986 ACPI_FUNCTION_TRACE ("os_signal_semaphore");
988 if (!sem
|| (units
< 1))
989 return_ACPI_STATUS (AE_BAD_PARAMETER
);
992 return_ACPI_STATUS (AE_SUPPORT
);
994 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX
, "Signaling semaphore[%p|%d]\n", handle
, units
));
998 return_ACPI_STATUS (AE_OK
);
1000 EXPORT_SYMBOL(acpi_os_signal_semaphore
);
1002 #ifdef ACPI_FUTURE_USAGE
1004 acpi_os_get_line(char *buffer
)
1007 #ifdef ENABLE_DEBUGGER
1008 if (acpi_in_debugger
) {
1011 kdb_read(buffer
, sizeof(line_buf
));
1013 /* remove the CR kdb includes */
1014 chars
= strlen(buffer
) - 1;
1015 buffer
[chars
] = '\0';
1021 #endif /* ACPI_FUTURE_USAGE */
1023 /* Assumes no unreadable holes inbetween */
1025 acpi_os_readable(void *ptr
, acpi_size len
)
1027 #if defined(__i386__) || defined(__x86_64__)
1029 return !__get_user(tmp
, (char __user
*)ptr
) && !__get_user(tmp
, (char __user
*)ptr
+ len
- 1);
1034 #ifdef ACPI_FUTURE_USAGE
1036 acpi_os_writable(void *ptr
, acpi_size len
)
1038 /* could do dummy write (racy) or a kernel page table lookup.
1039 The later may be difficult at early boot when kmap doesn't work yet. */
1045 acpi_os_get_thread_id (void)
1048 return current
->pid
;
1060 case ACPI_SIGNAL_FATAL
:
1061 printk(KERN_ERR PREFIX
"Fatal opcode executed\n");
1063 case ACPI_SIGNAL_BREAKPOINT
:
1066 * ACPI spec. says to treat it as a NOP unless
1067 * you are debugging. So if/when we integrate
1068 * AML debugger into the kernel debugger its
1069 * hook will go here. But until then it is
1070 * not useful to print anything on breakpoints.
1079 EXPORT_SYMBOL(acpi_os_signal
);
1082 acpi_os_name_setup(char *str
)
1084 char *p
= acpi_os_name
;
1085 int count
= ACPI_MAX_OVERRIDE_LEN
-1;
1090 for (; count
-- && str
&& *str
; str
++) {
1091 if (isalnum(*str
) || *str
== ' ' || *str
== ':')
1093 else if (*str
== '\'' || *str
== '"')
1104 __setup("acpi_os_name=", acpi_os_name_setup
);
1108 * empty string disables _OSI
1109 * TBD additional string adds to _OSI
1112 acpi_osi_setup(char *str
)
1114 if (str
== NULL
|| *str
== '\0') {
1115 printk(KERN_INFO PREFIX
"_OSI method disabled\n");
1116 acpi_gbl_create_osi_method
= FALSE
;
1120 printk(KERN_ERR PREFIX
"_OSI additional string ignored -- %s\n", str
);
1126 __setup("acpi_osi=", acpi_osi_setup
);
1128 /* enable serialization to combat AE_ALREADY_EXISTS errors */
1130 acpi_serialize_setup(char *str
)
1132 printk(KERN_INFO PREFIX
"serialize enabled\n");
1134 acpi_gbl_all_methods_serialized
= TRUE
;
1139 __setup("acpi_serialize", acpi_serialize_setup
);
1142 * Wake and Run-Time GPES are expected to be separate.
1143 * We disable wake-GPEs at run-time to prevent spurious
1146 * However, if a system exists that shares Wake and
1147 * Run-time events on the same GPE this flag is available
1148 * to tell Linux to keep the wake-time GPEs enabled at run-time.
1151 acpi_wake_gpes_always_on_setup(char *str
)
1153 printk(KERN_INFO PREFIX
"wake GPEs not disabled\n");
1155 acpi_gbl_leave_wake_gpes_disabled
= FALSE
;
1160 __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup
);
1163 acpi_hotkey_setup(char *str
)
1165 acpi_specific_hotkey_enabled
= FALSE
;
1169 __setup("acpi_generic_hotkey", acpi_hotkey_setup
);
1172 * max_cstate is defined in the base kernel so modules can
1173 * change it w/o depending on the state of the processor module.
1175 unsigned int max_cstate
= ACPI_PROCESSOR_MAX_POWER
;
1178 EXPORT_SYMBOL(max_cstate
);