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 <linux/kthread.h>
41 #include <acpi/acpi.h>
43 #include <acpi/acpi_bus.h>
44 #include <acpi/processor.h>
45 #include <asm/uaccess.h>
47 #include <linux/efi.h>
49 #define _COMPONENT ACPI_OS_SERVICES
50 ACPI_MODULE_NAME("osl")
51 #define PREFIX "ACPI: "
53 acpi_osd_exec_callback function;
57 #ifdef CONFIG_ACPI_CUSTOM_DSDT
58 #include CONFIG_ACPI_CUSTOM_DSDT_FILE
61 #ifdef ENABLE_DEBUGGER
62 #include <linux/kdb.h>
64 /* stuff for debugger support */
66 EXPORT_SYMBOL(acpi_in_debugger);
68 extern char line_buf[80];
69 #endif /*ENABLE_DEBUGGER */
71 int acpi_specific_hotkey_enabled = TRUE;
72 EXPORT_SYMBOL(acpi_specific_hotkey_enabled);
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;
79 acpi_status acpi_os_initialize(void)
84 acpi_status acpi_os_initialize1(void)
87 * Initialize PCI configuration space access, as we'll need to access
88 * it while walking the namespace (bus 0 and root bridges w/ _BBNs).
91 printk(KERN_ERR PREFIX
92 "Access to PCI configuration space unavailable\n");
95 kacpid_wq = create_singlethread_workqueue("kacpid");
101 acpi_status acpi_os_terminate(void)
103 if (acpi_irq_handler) {
104 acpi_os_remove_interrupt_handler(acpi_irq_irq,
108 destroy_workqueue(kacpid_wq);
113 void acpi_os_printf(const char *fmt, ...)
117 acpi_os_vprintf(fmt, args);
121 EXPORT_SYMBOL(acpi_os_printf);
123 void acpi_os_vprintf(const char *fmt, va_list args)
125 static char buffer[512];
127 vsprintf(buffer, fmt, args);
129 #ifdef ENABLE_DEBUGGER
130 if (acpi_in_debugger) {
131 kdb_printf("%s", buffer);
133 printk("%s", buffer);
136 printk("%s", buffer);
141 extern int acpi_in_resume;
142 void *acpi_os_allocate(acpi_size size)
145 return kmalloc(size, GFP_ATOMIC);
147 return kmalloc(size, GFP_KERNEL);
150 acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr)
153 addr->pointer_type = ACPI_PHYSICAL_POINTER;
154 if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
155 addr->pointer.physical = efi.acpi20;
156 else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
157 addr->pointer.physical = efi.acpi;
159 printk(KERN_ERR PREFIX
160 "System description tables not found\n");
164 if (ACPI_FAILURE(acpi_find_root_pointer(flags, addr))) {
165 printk(KERN_ERR PREFIX
166 "System description tables not found\n");
175 acpi_os_map_memory(acpi_physical_address phys, acpi_size size,
176 void __iomem ** virt)
178 if (phys > ULONG_MAX) {
179 printk(KERN_ERR PREFIX "Cannot map memory that high\n");
180 return AE_BAD_PARAMETER;
183 * ioremap checks to ensure this is in reserved space
185 *virt = ioremap((unsigned long)phys, size);
192 EXPORT_SYMBOL_GPL(acpi_os_map_memory);
194 void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
198 EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
200 #ifdef ACPI_FUTURE_USAGE
202 acpi_os_get_physical_address(void *virt, acpi_physical_address * phys)
205 return AE_BAD_PARAMETER;
207 *phys = virt_to_phys(virt);
213 #define ACPI_MAX_OVERRIDE_LEN 100
215 static char acpi_os_name[ACPI_MAX_OVERRIDE_LEN];
218 acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
219 acpi_string * new_val)
221 if (!init_val || !new_val)
222 return AE_BAD_PARAMETER;
225 if (!memcmp(init_val->name, "_OS_", 4) && strlen(acpi_os_name)) {
226 printk(KERN_INFO PREFIX "Overriding _OS definition to '%s'\n",
228 *new_val = acpi_os_name;
235 acpi_os_table_override(struct acpi_table_header * existing_table,
236 struct acpi_table_header ** new_table)
238 if (!existing_table || !new_table)
239 return AE_BAD_PARAMETER;
241 #ifdef CONFIG_ACPI_CUSTOM_DSDT
242 if (strncmp(existing_table->signature, "DSDT", 4) == 0)
243 *new_table = (struct acpi_table_header *)AmlCode;
252 static irqreturn_t acpi_irq(int irq, void *dev_id, struct pt_regs *regs)
254 return (*acpi_irq_handler) (acpi_irq_context) ? IRQ_HANDLED : IRQ_NONE;
258 acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
264 * Ignore the GSI from the core, and use the value in our copy of the
265 * FADT. It may not be the same if an interrupt source override exists
268 gsi = acpi_fadt.sci_int;
269 if (acpi_gsi_to_irq(gsi, &irq) < 0) {
270 printk(KERN_ERR PREFIX "SCI (ACPI GSI %d) not registered\n",
275 acpi_irq_handler = handler;
276 acpi_irq_context = context;
277 if (request_irq(irq, acpi_irq, SA_SHIRQ, "acpi", acpi_irq)) {
278 printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
279 return AE_NOT_ACQUIRED;
286 acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler)
289 free_irq(irq, acpi_irq);
290 acpi_irq_handler = NULL;
298 * Running in interpreter thread context, safe to sleep
301 void acpi_os_sleep(acpi_integer ms)
303 schedule_timeout_interruptible(msecs_to_jiffies(ms));
306 EXPORT_SYMBOL(acpi_os_sleep);
308 void acpi_os_stall(u32 us)
316 touch_nmi_watchdog();
321 EXPORT_SYMBOL(acpi_os_stall);
324 * Support ACPI 3.0 AML Timer operand
325 * Returns 64-bit free-running, monotonically increasing timer
326 * with 100ns granularity
328 u64 acpi_os_get_timer(void)
333 /* TBD: use HPET if available */
336 #ifdef CONFIG_X86_PM_TIMER
337 /* TBD: default to PM timer if HPET was not available */
340 printk(KERN_ERR PREFIX "acpi_os_get_timer() TBD\n");
345 acpi_status acpi_os_read_port(acpi_io_address port, u32 * value, u32 width)
354 *(u8 *) value = inb(port);
357 *(u16 *) value = inw(port);
360 *(u32 *) value = inl(port);
369 EXPORT_SYMBOL(acpi_os_read_port);
371 acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
390 EXPORT_SYMBOL(acpi_os_write_port);
393 acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
396 void __iomem *virt_addr;
398 virt_addr = ioremap(phys_addr, width);
404 *(u8 *) value = readb(virt_addr);
407 *(u16 *) value = readw(virt_addr);
410 *(u32 *) value = readl(virt_addr);
422 acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
424 void __iomem *virt_addr;
426 virt_addr = ioremap(phys_addr, width);
430 writeb(value, virt_addr);
433 writew(value, virt_addr);
436 writel(value, virt_addr);
448 acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
449 void *value, u32 width)
454 return AE_BAD_PARAMETER;
470 BUG_ON(!raw_pci_ops);
472 result = raw_pci_ops->read(pci_id->segment, pci_id->bus,
473 PCI_DEVFN(pci_id->device, pci_id->function),
476 return (result ? AE_ERROR : AE_OK);
479 EXPORT_SYMBOL(acpi_os_read_pci_configuration);
482 acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
483 acpi_integer value, u32 width)
501 BUG_ON(!raw_pci_ops);
503 result = raw_pci_ops->write(pci_id->segment, pci_id->bus,
504 PCI_DEVFN(pci_id->device, pci_id->function),
507 return (result ? AE_ERROR : AE_OK);
510 /* TODO: Change code to take advantage of driver model more */
511 static void acpi_os_derive_pci_id_2(acpi_handle rhandle, /* upper bound */
512 acpi_handle chandle, /* current node */
513 struct acpi_pci_id **id,
514 int *is_bridge, u8 * bus_number)
517 struct acpi_pci_id *pci_id = *id;
520 acpi_object_type type;
523 acpi_get_parent(chandle, &handle);
524 if (handle != rhandle) {
525 acpi_os_derive_pci_id_2(rhandle, handle, &pci_id, is_bridge,
528 status = acpi_get_type(handle, &type);
529 if ((ACPI_FAILURE(status)) || (type != ACPI_TYPE_DEVICE))
533 acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
535 if (ACPI_SUCCESS(status)) {
536 pci_id->device = ACPI_HIWORD(ACPI_LODWORD(temp));
537 pci_id->function = ACPI_LOWORD(ACPI_LODWORD(temp));
540 pci_id->bus = *bus_number;
542 /* any nicer way to get bus number of bridge ? */
544 acpi_os_read_pci_configuration(pci_id, 0x0e, &tu8,
546 if (ACPI_SUCCESS(status)
547 && ((tu8 & 0x7f) == 1 || (tu8 & 0x7f) == 2)) {
549 acpi_os_read_pci_configuration(pci_id, 0x18,
551 if (!ACPI_SUCCESS(status)) {
552 /* Certainly broken... FIX ME */
558 acpi_os_read_pci_configuration(pci_id, 0x19,
560 if (ACPI_SUCCESS(status)) {
569 void acpi_os_derive_pci_id(acpi_handle rhandle, /* upper bound */
570 acpi_handle chandle, /* current node */
571 struct acpi_pci_id **id)
574 u8 bus_number = (*id)->bus;
576 acpi_os_derive_pci_id_2(rhandle, chandle, id, &is_bridge, &bus_number);
579 static void acpi_os_execute_deferred(void *context)
581 struct acpi_os_dpc *dpc = NULL;
584 dpc = (struct acpi_os_dpc *)context;
586 printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
590 dpc->function(dpc->context);
597 static int acpi_os_execute_thread(void *context)
599 struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context;
601 dpc->function(dpc->context);
607 /*******************************************************************************
609 * FUNCTION: acpi_os_execute
611 * PARAMETERS: Type - Type of the callback
612 * Function - Function to be executed
613 * Context - Function parameters
617 * DESCRIPTION: Depending on type, either queues function for deferred execution or
618 * immediately executes function on a separate thread.
620 ******************************************************************************/
622 acpi_status acpi_os_execute(acpi_execute_type type,
623 acpi_osd_exec_callback function, void *context)
625 acpi_status status = AE_OK;
626 struct acpi_os_dpc *dpc;
627 struct work_struct *task;
628 struct task_struct *p;
631 return AE_BAD_PARAMETER;
633 * Allocate/initialize DPC structure. Note that this memory will be
634 * freed by the callee. The kernel handles the tq_struct list in a
635 * way that allows us to also free its memory inside the callee.
636 * Because we may want to schedule several tasks with different
637 * parameters we can't use the approach some kernel code uses of
638 * having a static tq_struct.
639 * We can save time and code by allocating the DPC and tq_structs
640 * from the same memory.
642 if (type == OSL_NOTIFY_HANDLER) {
643 dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_KERNEL);
645 dpc = kmalloc(sizeof(struct acpi_os_dpc) +
646 sizeof(struct work_struct), GFP_ATOMIC);
650 dpc->function = function;
651 dpc->context = context;
653 if (type == OSL_NOTIFY_HANDLER) {
654 p = kthread_create(acpi_os_execute_thread, dpc, "kacpid_notify");
658 status = AE_NO_MEMORY;
662 task = (void *)(dpc + 1);
663 INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
664 if (!queue_work(kacpid_wq, task)) {
672 EXPORT_SYMBOL(acpi_os_execute);
674 void acpi_os_wait_events_complete(void *context)
676 flush_workqueue(kacpid_wq);
679 EXPORT_SYMBOL(acpi_os_wait_events_complete);
682 * Allocate the memory for a spinlock and initialize it.
684 acpi_status acpi_os_create_lock(acpi_spinlock * handle)
686 spin_lock_init(*handle);
692 * Deallocate the memory for a spinlock.
694 void acpi_os_delete_lock(acpi_spinlock handle)
700 acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
702 struct semaphore *sem = NULL;
705 sem = acpi_os_allocate(sizeof(struct semaphore));
708 memset(sem, 0, sizeof(struct semaphore));
710 sema_init(sem, initial_units);
712 *handle = (acpi_handle *) sem;
714 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating semaphore[%p|%d].\n",
715 *handle, initial_units));
720 EXPORT_SYMBOL(acpi_os_create_semaphore);
723 * TODO: A better way to delete semaphores? Linux doesn't have a
724 * 'delete_semaphore()' function -- may result in an invalid
725 * pointer dereference for non-synchronized consumers. Should
726 * we at least check for blocked threads and signal/cancel them?
729 acpi_status acpi_os_delete_semaphore(acpi_handle handle)
731 struct semaphore *sem = (struct semaphore *)handle;
735 return AE_BAD_PARAMETER;
737 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle));
745 EXPORT_SYMBOL(acpi_os_delete_semaphore);
748 * TODO: The kernel doesn't have a 'down_timeout' function -- had to
749 * improvise. The process is to sleep for one scheduler quantum
750 * until the semaphore becomes available. Downside is that this
751 * may result in starvation for timeout-based waits when there's
752 * lots of semaphore activity.
754 * TODO: Support for units > 1?
756 acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
758 acpi_status status = AE_OK;
759 struct semaphore *sem = (struct semaphore *)handle;
763 if (!sem || (units < 1))
764 return AE_BAD_PARAMETER;
769 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
770 handle, units, timeout));
776 * A zero timeout value indicates that we shouldn't wait - just
777 * acquire the semaphore if available otherwise return AE_TIME
778 * (a.k.a. 'would block').
781 if (down_trylock(sem))
789 case ACPI_WAIT_FOREVER:
798 // TODO: A better timeout algorithm?
801 static const int quantum_ms = 1000 / HZ;
803 ret = down_trylock(sem);
804 for (i = timeout; (i > 0 && ret != 0); i -= quantum_ms) {
805 schedule_timeout_interruptible(1);
806 ret = down_trylock(sem);
815 if (ACPI_FAILURE(status)) {
816 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
817 "Failed to acquire semaphore[%p|%d|%d], %s",
818 handle, units, timeout,
819 acpi_format_exception(status)));
821 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
822 "Acquired semaphore[%p|%d|%d]", handle,
829 EXPORT_SYMBOL(acpi_os_wait_semaphore);
832 * TODO: Support for units > 1?
834 acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units)
836 struct semaphore *sem = (struct semaphore *)handle;
839 if (!sem || (units < 1))
840 return AE_BAD_PARAMETER;
845 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Signaling semaphore[%p|%d]\n", handle,
853 EXPORT_SYMBOL(acpi_os_signal_semaphore);
855 #ifdef ACPI_FUTURE_USAGE
856 u32 acpi_os_get_line(char *buffer)
859 #ifdef ENABLE_DEBUGGER
860 if (acpi_in_debugger) {
863 kdb_read(buffer, sizeof(line_buf));
865 /* remove the CR kdb includes */
866 chars = strlen(buffer) - 1;
867 buffer[chars] = '\0';
873 #endif /* ACPI_FUTURE_USAGE */
875 /* Assumes no unreadable holes inbetween */
876 u8 acpi_os_readable(void *ptr, acpi_size len)
878 #if defined(__i386__) || defined(__x86_64__)
880 return !__get_user(tmp, (char __user *)ptr)
881 && !__get_user(tmp, (char __user *)ptr + len - 1);
886 #ifdef ACPI_FUTURE_USAGE
887 u8 acpi_os_writable(void *ptr, acpi_size len)
889 /* could do dummy write (racy) or a kernel page table lookup.
890 The later may be difficult at early boot when kmap doesn't work yet. */
895 acpi_status acpi_os_signal(u32 function, void *info)
898 case ACPI_SIGNAL_FATAL:
899 printk(KERN_ERR PREFIX "Fatal opcode executed\n");
901 case ACPI_SIGNAL_BREAKPOINT:
904 * ACPI spec. says to treat it as a NOP unless
905 * you are debugging. So if/when we integrate
906 * AML debugger into the kernel debugger its
907 * hook will go here. But until then it is
908 * not useful to print anything on breakpoints.
918 EXPORT_SYMBOL(acpi_os_signal);
920 static int __init acpi_os_name_setup(char *str)
922 char *p = acpi_os_name;
923 int count = ACPI_MAX_OVERRIDE_LEN - 1;
928 for (; count-- && str && *str; str++) {
929 if (isalnum(*str) || *str == ' ' || *str == ':')
931 else if (*str == '\'' || *str == '"')
942 __setup("acpi_os_name=", acpi_os_name_setup);
946 * empty string disables _OSI
947 * TBD additional string adds to _OSI
949 static int __init acpi_osi_setup(char *str)
951 if (str == NULL || *str == '\0') {
952 printk(KERN_INFO PREFIX "_OSI method disabled\n");
953 acpi_gbl_create_osi_method = FALSE;
956 printk(KERN_ERR PREFIX "_OSI additional string ignored -- %s\n",
963 __setup("acpi_osi=", acpi_osi_setup);
965 /* enable serialization to combat AE_ALREADY_EXISTS errors */
966 static int __init acpi_serialize_setup(char *str)
968 printk(KERN_INFO PREFIX "serialize enabled\n");
970 acpi_gbl_all_methods_serialized = TRUE;
975 __setup("acpi_serialize", acpi_serialize_setup);
978 * Wake and Run-Time GPES are expected to be separate.
979 * We disable wake-GPEs at run-time to prevent spurious
982 * However, if a system exists that shares Wake and
983 * Run-time events on the same GPE this flag is available
984 * to tell Linux to keep the wake-time GPEs enabled at run-time.
986 static int __init acpi_wake_gpes_always_on_setup(char *str)
988 printk(KERN_INFO PREFIX "wake GPEs not disabled\n");
990 acpi_gbl_leave_wake_gpes_disabled = FALSE;
995 __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
997 static int __init acpi_hotkey_setup(char *str)
999 acpi_specific_hotkey_enabled = FALSE;
1003 __setup("acpi_generic_hotkey", acpi_hotkey_setup);
1006 * max_cstate is defined in the base kernel so modules can
1007 * change it w/o depending on the state of the processor module.
1009 unsigned int max_cstate = ACPI_PROCESSOR_MAX_POWER;
1011 EXPORT_SYMBOL(max_cstate);
1014 * Acquire a spinlock.
1016 * handle is a pointer to the spinlock_t.
1019 acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp)
1021 acpi_cpu_flags flags;
1022 spin_lock_irqsave(lockp, flags);
1027 * Release a spinlock. See above.
1030 void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags)
1032 spin_unlock_irqrestore(lockp, flags);
1035 #ifndef ACPI_USE_LOCAL_CACHE
1037 /*******************************************************************************
1039 * FUNCTION: acpi_os_create_cache
1041 * PARAMETERS: name - Ascii name for the cache
1042 * size - Size of each cached object
1043 * depth - Maximum depth of the cache (in objects) <ignored>
1044 * cache - Where the new cache object is returned
1048 * DESCRIPTION: Create a cache object
1050 ******************************************************************************/
1053 acpi_os_create_cache(char *name, u16 size, u16 depth, acpi_cache_t ** cache)
1055 *cache = kmem_cache_create(name, size, 0, 0, NULL, NULL);
1062 /*******************************************************************************
1064 * FUNCTION: acpi_os_purge_cache
1066 * PARAMETERS: Cache - Handle to cache object
1070 * DESCRIPTION: Free all objects within the requested cache.
1072 ******************************************************************************/
1074 acpi_status acpi_os_purge_cache(acpi_cache_t * cache)
1076 (void)kmem_cache_shrink(cache);
1080 /*******************************************************************************
1082 * FUNCTION: acpi_os_delete_cache
1084 * PARAMETERS: Cache - Handle to cache object
1088 * DESCRIPTION: Free all objects within the requested cache and delete the
1091 ******************************************************************************/
1093 acpi_status acpi_os_delete_cache(acpi_cache_t * cache)
1095 (void)kmem_cache_destroy(cache);
1099 /*******************************************************************************
1101 * FUNCTION: acpi_os_release_object
1103 * PARAMETERS: Cache - Handle to cache object
1104 * Object - The object to be released
1108 * DESCRIPTION: Release an object to the specified cache. If cache is full,
1109 * the object is deleted.
1111 ******************************************************************************/
1113 acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
1115 kmem_cache_free(cache, object);
1119 /*******************************************************************************
1121 * FUNCTION: acpi_os_acquire_object
1123 * PARAMETERS: Cache - Handle to cache object
1124 * ReturnObject - Where the object is returned
1128 * DESCRIPTION: Return a zero-filled object.
1130 ******************************************************************************/
1132 void *acpi_os_acquire_object(acpi_cache_t * cache)
1134 void *object = kmem_cache_zalloc(cache, GFP_KERNEL);
1139 /******************************************************************************
1141 * FUNCTION: acpi_os_validate_interface
1143 * PARAMETERS: interface - Requested interface to be validated
1145 * RETURN: AE_OK if interface is supported, AE_SUPPORT otherwise
1147 * DESCRIPTION: Match an interface string to the interfaces supported by the
1148 * host. Strings originate from an AML call to the _OSI method.
1150 *****************************************************************************/
1153 acpi_os_validate_interface (char *interface)
1160 /******************************************************************************
1162 * FUNCTION: acpi_os_validate_address
1164 * PARAMETERS: space_id - ACPI space ID
1165 * address - Physical address
1166 * length - Address length
1168 * RETURN: AE_OK if address/length is valid for the space_id. Otherwise,
1169 * should return AE_AML_ILLEGAL_ADDRESS.
1171 * DESCRIPTION: Validate a system address via the host OS. Used to validate
1172 * the addresses accessed by AML operation regions.
1174 *****************************************************************************/
1177 acpi_os_validate_address (
1179 acpi_physical_address address,