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/module.h>
29 #include <linux/kernel.h>
30 #include <linux/slab.h>
32 #include <linux/pci.h>
33 #include <linux/smp_lock.h>
34 #include <linux/interrupt.h>
35 #include <linux/kmod.h>
36 #include <linux/delay.h>
37 #include <linux/workqueue.h>
38 #include <linux/nmi.h>
39 #include <linux/kthread.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>
48 #define _COMPONENT ACPI_OS_SERVICES
49 ACPI_MODULE_NAME("osl")
50 #define PREFIX "ACPI: "
52 acpi_osd_exec_callback function;
56 #ifdef CONFIG_ACPI_CUSTOM_DSDT
57 #include CONFIG_ACPI_CUSTOM_DSDT_FILE
60 #ifdef ENABLE_DEBUGGER
61 #include <linux/kdb.h>
63 /* stuff for debugger support */
65 EXPORT_SYMBOL(acpi_in_debugger);
67 extern char line_buf[80];
68 #endif /*ENABLE_DEBUGGER */
70 int acpi_specific_hotkey_enabled = TRUE;
71 EXPORT_SYMBOL(acpi_specific_hotkey_enabled);
73 static unsigned int acpi_irq_irq;
74 static acpi_osd_handler acpi_irq_handler;
75 static void *acpi_irq_context;
76 static struct workqueue_struct *kacpid_wq;
78 acpi_status acpi_os_initialize(void)
83 acpi_status acpi_os_initialize1(void)
86 * Initialize PCI configuration space access, as we'll need to access
87 * it while walking the namespace (bus 0 and root bridges w/ _BBNs).
90 printk(KERN_ERR PREFIX
91 "Access to PCI configuration space unavailable\n");
94 kacpid_wq = create_singlethread_workqueue("kacpid");
100 acpi_status acpi_os_terminate(void)
102 if (acpi_irq_handler) {
103 acpi_os_remove_interrupt_handler(acpi_irq_irq,
107 destroy_workqueue(kacpid_wq);
112 void acpi_os_printf(const char *fmt, ...)
116 acpi_os_vprintf(fmt, args);
120 EXPORT_SYMBOL(acpi_os_printf);
122 void acpi_os_vprintf(const char *fmt, va_list args)
124 static char buffer[512];
126 vsprintf(buffer, fmt, args);
128 #ifdef ENABLE_DEBUGGER
129 if (acpi_in_debugger) {
130 kdb_printf("%s", buffer);
132 printk("%s", buffer);
135 printk("%s", buffer);
140 extern int acpi_in_resume;
141 void *acpi_os_allocate(acpi_size size)
144 return kmalloc(size, GFP_ATOMIC);
146 return kmalloc(size, GFP_KERNEL);
149 void acpi_os_free(void *ptr)
154 EXPORT_SYMBOL(acpi_os_free);
156 acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr)
159 addr->pointer_type = ACPI_PHYSICAL_POINTER;
160 if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
161 addr->pointer.physical = efi.acpi20;
162 else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
163 addr->pointer.physical = efi.acpi;
165 printk(KERN_ERR PREFIX
166 "System description tables not found\n");
170 if (ACPI_FAILURE(acpi_find_root_pointer(flags, addr))) {
171 printk(KERN_ERR PREFIX
172 "System description tables not found\n");
181 acpi_os_map_memory(acpi_physical_address phys, acpi_size size,
182 void __iomem ** virt)
184 if (phys > ULONG_MAX) {
185 printk(KERN_ERR PREFIX "Cannot map memory that high\n");
186 return AE_BAD_PARAMETER;
189 * ioremap checks to ensure this is in reserved space
191 *virt = ioremap((unsigned long)phys, size);
198 EXPORT_SYMBOL_GPL(acpi_os_map_memory);
200 void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
204 EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
206 #ifdef ACPI_FUTURE_USAGE
208 acpi_os_get_physical_address(void *virt, acpi_physical_address * phys)
211 return AE_BAD_PARAMETER;
213 *phys = virt_to_phys(virt);
219 #define ACPI_MAX_OVERRIDE_LEN 100
221 static char acpi_os_name[ACPI_MAX_OVERRIDE_LEN];
224 acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
225 acpi_string * new_val)
227 if (!init_val || !new_val)
228 return AE_BAD_PARAMETER;
231 if (!memcmp(init_val->name, "_OS_", 4) && strlen(acpi_os_name)) {
232 printk(KERN_INFO PREFIX "Overriding _OS definition to '%s'\n",
234 *new_val = acpi_os_name;
241 acpi_os_table_override(struct acpi_table_header * existing_table,
242 struct acpi_table_header ** new_table)
244 if (!existing_table || !new_table)
245 return AE_BAD_PARAMETER;
247 #ifdef CONFIG_ACPI_CUSTOM_DSDT
248 if (strncmp(existing_table->signature, "DSDT", 4) == 0)
249 *new_table = (struct acpi_table_header *)AmlCode;
258 static irqreturn_t acpi_irq(int irq, void *dev_id, struct pt_regs *regs)
260 return (*acpi_irq_handler) (acpi_irq_context) ? IRQ_HANDLED : IRQ_NONE;
264 acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
270 * Ignore the GSI from the core, and use the value in our copy of the
271 * FADT. It may not be the same if an interrupt source override exists
274 gsi = acpi_fadt.sci_int;
275 if (acpi_gsi_to_irq(gsi, &irq) < 0) {
276 printk(KERN_ERR PREFIX "SCI (ACPI GSI %d) not registered\n",
281 acpi_irq_handler = handler;
282 acpi_irq_context = context;
283 if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) {
284 printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
285 return AE_NOT_ACQUIRED;
292 acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler)
295 free_irq(irq, acpi_irq);
296 acpi_irq_handler = NULL;
304 * Running in interpreter thread context, safe to sleep
307 void acpi_os_sleep(acpi_integer ms)
309 schedule_timeout_interruptible(msecs_to_jiffies(ms));
312 EXPORT_SYMBOL(acpi_os_sleep);
314 void acpi_os_stall(u32 us)
322 touch_nmi_watchdog();
327 EXPORT_SYMBOL(acpi_os_stall);
330 * Support ACPI 3.0 AML Timer operand
331 * Returns 64-bit free-running, monotonically increasing timer
332 * with 100ns granularity
334 u64 acpi_os_get_timer(void)
339 /* TBD: use HPET if available */
342 #ifdef CONFIG_X86_PM_TIMER
343 /* TBD: default to PM timer if HPET was not available */
346 printk(KERN_ERR PREFIX "acpi_os_get_timer() TBD\n");
351 acpi_status acpi_os_read_port(acpi_io_address port, u32 * value, u32 width)
360 *(u8 *) value = inb(port);
363 *(u16 *) value = inw(port);
366 *(u32 *) value = inl(port);
375 EXPORT_SYMBOL(acpi_os_read_port);
377 acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
396 EXPORT_SYMBOL(acpi_os_write_port);
399 acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
402 void __iomem *virt_addr;
404 virt_addr = ioremap(phys_addr, width);
410 *(u8 *) value = readb(virt_addr);
413 *(u16 *) value = readw(virt_addr);
416 *(u32 *) value = readl(virt_addr);
428 acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
430 void __iomem *virt_addr;
432 virt_addr = ioremap(phys_addr, width);
436 writeb(value, virt_addr);
439 writew(value, virt_addr);
442 writel(value, virt_addr);
454 acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
455 void *value, u32 width)
460 return AE_BAD_PARAMETER;
476 BUG_ON(!raw_pci_ops);
478 result = raw_pci_ops->read(pci_id->segment, pci_id->bus,
479 PCI_DEVFN(pci_id->device, pci_id->function),
482 return (result ? AE_ERROR : AE_OK);
485 EXPORT_SYMBOL(acpi_os_read_pci_configuration);
488 acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
489 acpi_integer value, u32 width)
507 BUG_ON(!raw_pci_ops);
509 result = raw_pci_ops->write(pci_id->segment, pci_id->bus,
510 PCI_DEVFN(pci_id->device, pci_id->function),
513 return (result ? AE_ERROR : AE_OK);
516 /* TODO: Change code to take advantage of driver model more */
517 static void acpi_os_derive_pci_id_2(acpi_handle rhandle, /* upper bound */
518 acpi_handle chandle, /* current node */
519 struct acpi_pci_id **id,
520 int *is_bridge, u8 * bus_number)
523 struct acpi_pci_id *pci_id = *id;
526 acpi_object_type type;
529 acpi_get_parent(chandle, &handle);
530 if (handle != rhandle) {
531 acpi_os_derive_pci_id_2(rhandle, handle, &pci_id, is_bridge,
534 status = acpi_get_type(handle, &type);
535 if ((ACPI_FAILURE(status)) || (type != ACPI_TYPE_DEVICE))
539 acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
541 if (ACPI_SUCCESS(status)) {
542 pci_id->device = ACPI_HIWORD(ACPI_LODWORD(temp));
543 pci_id->function = ACPI_LOWORD(ACPI_LODWORD(temp));
546 pci_id->bus = *bus_number;
548 /* any nicer way to get bus number of bridge ? */
550 acpi_os_read_pci_configuration(pci_id, 0x0e, &tu8,
552 if (ACPI_SUCCESS(status)
553 && ((tu8 & 0x7f) == 1 || (tu8 & 0x7f) == 2)) {
555 acpi_os_read_pci_configuration(pci_id, 0x18,
557 if (!ACPI_SUCCESS(status)) {
558 /* Certainly broken... FIX ME */
564 acpi_os_read_pci_configuration(pci_id, 0x19,
566 if (ACPI_SUCCESS(status)) {
575 void acpi_os_derive_pci_id(acpi_handle rhandle, /* upper bound */
576 acpi_handle chandle, /* current node */
577 struct acpi_pci_id **id)
580 u8 bus_number = (*id)->bus;
582 acpi_os_derive_pci_id_2(rhandle, chandle, id, &is_bridge, &bus_number);
585 static void acpi_os_execute_deferred(void *context)
587 struct acpi_os_dpc *dpc = NULL;
590 dpc = (struct acpi_os_dpc *)context;
592 printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
596 dpc->function(dpc->context);
603 static int acpi_os_execute_thread(void *context)
605 struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context;
607 dpc->function(dpc->context);
613 /*******************************************************************************
615 * FUNCTION: acpi_os_execute
617 * PARAMETERS: Type - Type of the callback
618 * Function - Function to be executed
619 * Context - Function parameters
623 * DESCRIPTION: Depending on type, either queues function for deferred execution or
624 * immediately executes function on a separate thread.
626 ******************************************************************************/
628 acpi_status acpi_os_execute(acpi_execute_type type,
629 acpi_osd_exec_callback function, void *context)
631 acpi_status status = AE_OK;
632 struct acpi_os_dpc *dpc;
633 struct work_struct *task;
634 struct task_struct *p;
637 return AE_BAD_PARAMETER;
639 * Allocate/initialize DPC structure. Note that this memory will be
640 * freed by the callee. The kernel handles the tq_struct list in a
641 * way that allows us to also free its memory inside the callee.
642 * Because we may want to schedule several tasks with different
643 * parameters we can't use the approach some kernel code uses of
644 * having a static tq_struct.
645 * We can save time and code by allocating the DPC and tq_structs
646 * from the same memory.
648 if (type == OSL_NOTIFY_HANDLER) {
649 dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_KERNEL);
651 dpc = kmalloc(sizeof(struct acpi_os_dpc) +
652 sizeof(struct work_struct), GFP_ATOMIC);
656 dpc->function = function;
657 dpc->context = context;
659 if (type == OSL_NOTIFY_HANDLER) {
660 p = kthread_create(acpi_os_execute_thread, dpc, "kacpid_notify");
664 status = AE_NO_MEMORY;
668 task = (void *)(dpc + 1);
669 INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
670 if (!queue_work(kacpid_wq, task)) {
678 EXPORT_SYMBOL(acpi_os_execute);
680 void acpi_os_wait_events_complete(void *context)
682 flush_workqueue(kacpid_wq);
685 EXPORT_SYMBOL(acpi_os_wait_events_complete);
688 * Allocate the memory for a spinlock and initialize it.
690 acpi_status acpi_os_create_lock(acpi_spinlock * handle)
692 spin_lock_init(*handle);
698 * Deallocate the memory for a spinlock.
700 void acpi_os_delete_lock(acpi_spinlock handle)
706 acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
708 struct semaphore *sem = NULL;
711 sem = acpi_os_allocate(sizeof(struct semaphore));
714 memset(sem, 0, sizeof(struct semaphore));
716 sema_init(sem, initial_units);
718 *handle = (acpi_handle *) sem;
720 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating semaphore[%p|%d].\n",
721 *handle, initial_units));
726 EXPORT_SYMBOL(acpi_os_create_semaphore);
729 * TODO: A better way to delete semaphores? Linux doesn't have a
730 * 'delete_semaphore()' function -- may result in an invalid
731 * pointer dereference for non-synchronized consumers. Should
732 * we at least check for blocked threads and signal/cancel them?
735 acpi_status acpi_os_delete_semaphore(acpi_handle handle)
737 struct semaphore *sem = (struct semaphore *)handle;
741 return AE_BAD_PARAMETER;
743 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle));
751 EXPORT_SYMBOL(acpi_os_delete_semaphore);
754 * TODO: The kernel doesn't have a 'down_timeout' function -- had to
755 * improvise. The process is to sleep for one scheduler quantum
756 * until the semaphore becomes available. Downside is that this
757 * may result in starvation for timeout-based waits when there's
758 * lots of semaphore activity.
760 * TODO: Support for units > 1?
762 acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
764 acpi_status status = AE_OK;
765 struct semaphore *sem = (struct semaphore *)handle;
769 if (!sem || (units < 1))
770 return AE_BAD_PARAMETER;
775 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
776 handle, units, timeout));
782 * A zero timeout value indicates that we shouldn't wait - just
783 * acquire the semaphore if available otherwise return AE_TIME
784 * (a.k.a. 'would block').
787 if (down_trylock(sem))
795 case ACPI_WAIT_FOREVER:
804 // TODO: A better timeout algorithm?
807 static const int quantum_ms = 1000 / HZ;
809 ret = down_trylock(sem);
810 for (i = timeout; (i > 0 && ret != 0); i -= quantum_ms) {
811 schedule_timeout_interruptible(1);
812 ret = down_trylock(sem);
821 if (ACPI_FAILURE(status)) {
822 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
823 "Failed to acquire semaphore[%p|%d|%d], %s",
824 handle, units, timeout,
825 acpi_format_exception(status)));
827 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
828 "Acquired semaphore[%p|%d|%d]", handle,
835 EXPORT_SYMBOL(acpi_os_wait_semaphore);
838 * TODO: Support for units > 1?
840 acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units)
842 struct semaphore *sem = (struct semaphore *)handle;
845 if (!sem || (units < 1))
846 return AE_BAD_PARAMETER;
851 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Signaling semaphore[%p|%d]\n", handle,
859 EXPORT_SYMBOL(acpi_os_signal_semaphore);
861 #ifdef ACPI_FUTURE_USAGE
862 u32 acpi_os_get_line(char *buffer)
865 #ifdef ENABLE_DEBUGGER
866 if (acpi_in_debugger) {
869 kdb_read(buffer, sizeof(line_buf));
871 /* remove the CR kdb includes */
872 chars = strlen(buffer) - 1;
873 buffer[chars] = '\0';
879 #endif /* ACPI_FUTURE_USAGE */
881 /* Assumes no unreadable holes inbetween */
882 u8 acpi_os_readable(void *ptr, acpi_size len)
884 #if defined(__i386__) || defined(__x86_64__)
886 return !__get_user(tmp, (char __user *)ptr)
887 && !__get_user(tmp, (char __user *)ptr + len - 1);
892 #ifdef ACPI_FUTURE_USAGE
893 u8 acpi_os_writable(void *ptr, acpi_size len)
895 /* could do dummy write (racy) or a kernel page table lookup.
896 The later may be difficult at early boot when kmap doesn't work yet. */
901 acpi_status acpi_os_signal(u32 function, void *info)
904 case ACPI_SIGNAL_FATAL:
905 printk(KERN_ERR PREFIX "Fatal opcode executed\n");
907 case ACPI_SIGNAL_BREAKPOINT:
910 * ACPI spec. says to treat it as a NOP unless
911 * you are debugging. So if/when we integrate
912 * AML debugger into the kernel debugger its
913 * hook will go here. But until then it is
914 * not useful to print anything on breakpoints.
924 EXPORT_SYMBOL(acpi_os_signal);
926 static int __init acpi_os_name_setup(char *str)
928 char *p = acpi_os_name;
929 int count = ACPI_MAX_OVERRIDE_LEN - 1;
934 for (; count-- && str && *str; str++) {
935 if (isalnum(*str) || *str == ' ' || *str == ':')
937 else if (*str == '\'' || *str == '"')
948 __setup("acpi_os_name=", acpi_os_name_setup);
952 * empty string disables _OSI
953 * TBD additional string adds to _OSI
955 static int __init acpi_osi_setup(char *str)
957 if (str == NULL || *str == '\0') {
958 printk(KERN_INFO PREFIX "_OSI method disabled\n");
959 acpi_gbl_create_osi_method = FALSE;
962 printk(KERN_ERR PREFIX "_OSI additional string ignored -- %s\n",
969 __setup("acpi_osi=", acpi_osi_setup);
971 /* enable serialization to combat AE_ALREADY_EXISTS errors */
972 static int __init acpi_serialize_setup(char *str)
974 printk(KERN_INFO PREFIX "serialize enabled\n");
976 acpi_gbl_all_methods_serialized = TRUE;
981 __setup("acpi_serialize", acpi_serialize_setup);
984 * Wake and Run-Time GPES are expected to be separate.
985 * We disable wake-GPEs at run-time to prevent spurious
988 * However, if a system exists that shares Wake and
989 * Run-time events on the same GPE this flag is available
990 * to tell Linux to keep the wake-time GPEs enabled at run-time.
992 static int __init acpi_wake_gpes_always_on_setup(char *str)
994 printk(KERN_INFO PREFIX "wake GPEs not disabled\n");
996 acpi_gbl_leave_wake_gpes_disabled = FALSE;
1001 __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
1003 static int __init acpi_hotkey_setup(char *str)
1005 acpi_specific_hotkey_enabled = FALSE;
1009 __setup("acpi_generic_hotkey", acpi_hotkey_setup);
1012 * max_cstate is defined in the base kernel so modules can
1013 * change it w/o depending on the state of the processor module.
1015 unsigned int max_cstate = ACPI_PROCESSOR_MAX_POWER;
1017 EXPORT_SYMBOL(max_cstate);
1020 * Acquire a spinlock.
1022 * handle is a pointer to the spinlock_t.
1025 acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp)
1027 acpi_cpu_flags flags;
1028 spin_lock_irqsave(lockp, flags);
1033 * Release a spinlock. See above.
1036 void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags)
1038 spin_unlock_irqrestore(lockp, flags);
1041 #ifndef ACPI_USE_LOCAL_CACHE
1043 /*******************************************************************************
1045 * FUNCTION: acpi_os_create_cache
1047 * PARAMETERS: name - Ascii name for the cache
1048 * size - Size of each cached object
1049 * depth - Maximum depth of the cache (in objects) <ignored>
1050 * cache - Where the new cache object is returned
1054 * DESCRIPTION: Create a cache object
1056 ******************************************************************************/
1059 acpi_os_create_cache(char *name, u16 size, u16 depth, acpi_cache_t ** cache)
1061 *cache = kmem_cache_create(name, size, 0, 0, NULL, NULL);
1068 /*******************************************************************************
1070 * FUNCTION: acpi_os_purge_cache
1072 * PARAMETERS: Cache - Handle to cache object
1076 * DESCRIPTION: Free all objects within the requested cache.
1078 ******************************************************************************/
1080 acpi_status acpi_os_purge_cache(acpi_cache_t * cache)
1082 (void)kmem_cache_shrink(cache);
1086 /*******************************************************************************
1088 * FUNCTION: acpi_os_delete_cache
1090 * PARAMETERS: Cache - Handle to cache object
1094 * DESCRIPTION: Free all objects within the requested cache and delete the
1097 ******************************************************************************/
1099 acpi_status acpi_os_delete_cache(acpi_cache_t * cache)
1101 (void)kmem_cache_destroy(cache);
1105 /*******************************************************************************
1107 * FUNCTION: acpi_os_release_object
1109 * PARAMETERS: Cache - Handle to cache object
1110 * Object - The object to be released
1114 * DESCRIPTION: Release an object to the specified cache. If cache is full,
1115 * the object is deleted.
1117 ******************************************************************************/
1119 acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
1121 kmem_cache_free(cache, object);
1125 /*******************************************************************************
1127 * FUNCTION: acpi_os_acquire_object
1129 * PARAMETERS: Cache - Handle to cache object
1130 * ReturnObject - Where the object is returned
1134 * DESCRIPTION: Return a zero-filled object.
1136 ******************************************************************************/
1138 void *acpi_os_acquire_object(acpi_cache_t * cache)
1140 void *object = kmem_cache_zalloc(cache, GFP_KERNEL);
1145 /******************************************************************************
1147 * FUNCTION: acpi_os_validate_interface
1149 * PARAMETERS: interface - Requested interface to be validated
1151 * RETURN: AE_OK if interface is supported, AE_SUPPORT otherwise
1153 * DESCRIPTION: Match an interface string to the interfaces supported by the
1154 * host. Strings originate from an AML call to the _OSI method.
1156 *****************************************************************************/
1159 acpi_os_validate_interface (char *interface)
1166 /******************************************************************************
1168 * FUNCTION: acpi_os_validate_address
1170 * PARAMETERS: space_id - ACPI space ID
1171 * address - Physical address
1172 * length - Address length
1174 * RETURN: AE_OK if address/length is valid for the space_id. Otherwise,
1175 * should return AE_AML_ILLEGAL_ADDRESS.
1177 * DESCRIPTION: Validate a system address via the host OS. Used to validate
1178 * the addresses accessed by AML operation regions.
1180 *****************************************************************************/
1183 acpi_os_validate_address (
1185 acpi_physical_address address,