*/
#include <linux/config.h>
+#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <acpi/acpi.h>
#include <asm/io.h>
#include <acpi/acpi_bus.h>
+#include <acpi/processor.h>
#include <asm/uaccess.h>
#include <linux/efi.h>
#ifdef ENABLE_DEBUGGER
#include <linux/kdb.h>
+
/* stuff for debugger support */
int acpi_in_debugger;
+EXPORT_SYMBOL(acpi_in_debugger);
+
extern char line_buf[80];
#endif /*ENABLE_DEBUGGER*/
acpi_os_vprintf(fmt, args);
va_end(args);
}
+EXPORT_SYMBOL(acpi_os_printf);
void
acpi_os_vprintf(const char *fmt, va_list args)
{
kfree(ptr);
}
+EXPORT_SYMBOL(acpi_os_free);
acpi_status
acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr)
iounmap(virt);
}
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_os_get_physical_address(void *virt, acpi_physical_address *phys)
{
return AE_OK;
}
+#endif
#define ACPI_MAX_OVERRIDE_LEN 100
*new_val = NULL;
if (!memcmp (init_val->name, "_OS_", 4) && strlen(acpi_os_name)) {
- printk(KERN_INFO PREFIX "Overriding _OS definition %s\n",
+ printk(KERN_INFO PREFIX "Overriding _OS definition to '%s'\n",
acpi_os_name);
*new_val = acpi_os_name;
}
*/
void
-acpi_os_sleep(u32 sec, u32 ms)
+acpi_os_sleep(acpi_integer ms)
{
current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(HZ * sec + (ms * HZ) / 1000);
+ schedule_timeout(((signed long) ms * HZ) / 1000);
}
+EXPORT_SYMBOL(acpi_os_sleep);
void
acpi_os_stall(u32 us)
us -= delay;
}
}
+EXPORT_SYMBOL(acpi_os_stall);
+
+/*
+ * Support ACPI 3.0 AML Timer operand
+ * Returns 64-bit free-running, monotonically increasing timer
+ * with 100ns granularity
+ */
+u64
+acpi_os_get_timer (void)
+{
+ static u64 t;
+
+#ifdef CONFIG_HPET
+ /* TBD: use HPET if available */
+#endif
+
+#ifdef CONFIG_X86_PM_TIMER
+ /* TBD: default to PM timer if HPET was not available */
+#endif
+ if (!t)
+ printk(KERN_ERR PREFIX "acpi_os_get_timer() TBD\n");
+
+ return ++t;
+}
acpi_status
acpi_os_read_port(
return AE_OK;
}
+EXPORT_SYMBOL(acpi_os_read_port);
acpi_status
acpi_os_write_port(
return AE_OK;
}
+EXPORT_SYMBOL(acpi_os_write_port);
acpi_status
acpi_os_read_memory(
return (result ? AE_ERROR : AE_OK);
}
+EXPORT_SYMBOL(acpi_os_read_pci_configuration);
acpi_status
acpi_os_write_pci_configuration (struct acpi_pci_id *pci_id, u32 reg, acpi_integer value, u32 width)
acpi_integer value,
u32 width)
{
- return (AE_SUPPORT);
+ return AE_SUPPORT;
}
acpi_status
void *value,
u32 width)
{
- return (AE_SUPPORT);
+ return AE_SUPPORT;
}
void
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_os_queue_for_execution);
void
acpi_os_wait_events_complete(
{
flush_workqueue(kacpid_wq);
}
+EXPORT_SYMBOL(acpi_os_wait_events_complete);
/*
* Allocate the memory for a spinlock and initialize it.
return_ACPI_STATUS (AE_OK);
}
+EXPORT_SYMBOL(acpi_os_create_semaphore);
/*
return_ACPI_STATUS (AE_OK);
}
+EXPORT_SYMBOL(acpi_os_delete_semaphore);
/*
// TODO: A better timeout algorithm?
{
int i = 0;
- static const int quantum_ms = 1000/HZ;
+ static const int quantum_ms = (HZ>1000)?1:(1000/HZ);
ret = down_trylock(sem);
for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) {
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_os_wait_semaphore);
/*
return_ACPI_STATUS (AE_OK);
}
+EXPORT_SYMBOL(acpi_os_signal_semaphore);
+#ifdef ACPI_FUTURE_USAGE
u32
acpi_os_get_line(char *buffer)
{
return 0;
}
+#endif /* ACPI_FUTURE_USAGE */
/* Assumes no unreadable holes inbetween */
u8
return 1;
}
+#ifdef ACPI_FUTURE_USAGE
u8
acpi_os_writable(void *ptr, acpi_size len)
{
The later may be difficult at early boot when kmap doesn't work yet. */
return 1;
}
+#endif
u32
acpi_os_get_thread_id (void)
printk(KERN_ERR PREFIX "Fatal opcode executed\n");
break;
case ACPI_SIGNAL_BREAKPOINT:
- {
- char *bp_info = (char*) info;
-
- printk(KERN_ERR "ACPI breakpoint: %s\n", bp_info);
- }
+ /*
+ * AML Breakpoint
+ * ACPI spec. says to treat it as a NOP unless
+ * you are debugging. So if/when we integrate
+ * AML debugger into the kernel debugger its
+ * hook will go here. But until then it is
+ * not useful to print anything on breakpoints.
+ */
+ break;
default:
break;
}
return AE_OK;
}
+EXPORT_SYMBOL(acpi_os_signal);
int __init
acpi_os_name_setup(char *str)
__setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
+/*
+ * max_cstate is defined in the base kernel so modules can
+ * change it w/o depending on the state of the processor module.
+ */
+unsigned int max_cstate = ACPI_PROCESSOR_MAX_POWER;
+
+
+EXPORT_SYMBOL(max_cstate);