In some cases, entire files turned out unnecessary. Of what remains, move whatever possible into .init.*, and some data items into .data.read_mostly. Signed-off-by: Jan Beulich --- 2011-02-10.orig/xen/arch/ia64/linux-xen/acpi.c +++ 2011-02-10/xen/arch/ia64/linux-xen/acpi.c @@ -165,8 +165,6 @@ int platform_intr_list[ACPI_MAX_PLATFORM [0 ... ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1 }; -enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC; - /* * Interrupt routing API for device drivers. Provides interrupt vector for * a generic platform event. Currently only CPEI is implemented. --- 2011-02-10.orig/xen/arch/ia64/linux-xen/acpi_numa.c +++ 2011-02-10/xen/arch/ia64/linux-xen/acpi_numa.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #ifndef XEN --- 2011-02-10.orig/xen/arch/x86/acpi/boot.c +++ 2011-02-10/xen/arch/x86/acpi/boot.c @@ -43,7 +43,6 @@ #include #include -int sbf_port; #define CONFIG_ACPI_PCI #define BAD_MADT_ENTRY(entry, end) ( \ @@ -64,36 +63,24 @@ bool_t __initdata acpi_ht = 1; /* enable bool_t __initdata acpi_lapic; bool_t __initdata acpi_ioapic; -u8 acpi_sci_flags __initdata; -int acpi_sci_override_gsi __initdata; bool_t acpi_skip_timer_override __initdata; #ifdef CONFIG_X86_LOCAL_APIC static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; #endif -u32 acpi_smi_cmd; -u8 acpi_enable_value, acpi_disable_value; +u32 __read_mostly acpi_smi_cmd; +u8 __read_mostly acpi_enable_value; +u8 __read_mostly acpi_disable_value; -#ifndef __HAVE_ARCH_CMPXCHG -#warning ACPI uses CMPXCHG, i486 and later hardware -#endif - -u32 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] = +u32 __read_mostly x86_acpiid_to_apicid[MAX_MADT_ENTRIES] = {[0 ... MAX_MADT_ENTRIES - 1] = BAD_APICID }; -EXPORT_SYMBOL(x86_acpiid_to_apicid); /* -------------------------------------------------------------------------- Boot-time Configuration -------------------------------------------------------------------------- */ /* - * The default interrupt routing model is PIC (8259). This gets - * overriden if IOAPICs are enumerated (below). - */ -enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; - -/* * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, * to map the target physical address. The problem is that set_fixmap() * provides a single page, and it is possible that the page is not @@ -333,21 +320,6 @@ acpi_parse_nmi_src(struct acpi_subtable_ #endif /* CONFIG_X86_IO_APIC */ -static int __init acpi_parse_sbf(struct acpi_table_header *table) -{ - struct acpi_table_boot *sb; - - sb = (struct acpi_table_boot *)table; - if (!sb) { - printk(KERN_WARNING PREFIX "Unable to map SBF\n"); - return -ENODEV; - } - - sbf_port = sb->cmos_index; /* Save CMOS port */ - - return 0; -} - #ifdef CONFIG_HPET_TIMER static int __init acpi_parse_hpet(struct acpi_table_header *table) @@ -360,18 +332,9 @@ static int __init acpi_parse_hpet(struct return -1; } -#if 0/*def CONFIG_X86_64*/ - vxtime.hpet_address = hpet_tbl->address.address; - + hpet_address = hpet_tbl->address.address; printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", - hpet_tbl->id, vxtime.hpet_address); -#else /* X86 */ - { - hpet_address = hpet_tbl->address.address; - printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", - hpet_tbl->id, hpet_address); - } -#endif /* X86 */ + hpet_tbl->id, hpet_address); return 0; } @@ -563,7 +526,7 @@ static int __init acpi_parse_madt_lapic_ } #endif /* CONFIG_X86_LOCAL_APIC */ -#if defined(CONFIG_X86_IO_APIC) /*&& defined(CONFIG_ACPI_INTERPRETER)*/ +#ifdef CONFIG_X86_IO_APIC /* * Parse IOAPIC related entries in MADT * returns 0 on success, < 0 on error @@ -615,15 +578,6 @@ static int __init acpi_parse_madt_ioapic return count; } -#ifdef CONFIG_ACPI_INTERPRETER - /* - * If BIOS did not supply an INT_SRC_OVR for the SCI - * pretend we got one so we can set the SCI flags. - */ - if (!acpi_sci_override_gsi) - acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0); -#endif - /* Fill in identity legacy mapings where no override */ mp_config_acpi_legacy_irqs(); @@ -643,7 +597,7 @@ static inline int acpi_parse_madt_ioapic { return -1; } -#endif /* !(CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER) */ +#endif /* !CONFIG_X86_IO_APIC */ static void __init acpi_process_madt(void) @@ -666,7 +620,6 @@ static void __init acpi_process_madt(voi */ error = acpi_parse_madt_ioapic_entries(); if (!error) { - acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; acpi_irq_balance_set(NULL); acpi_ioapic = 1; @@ -911,8 +864,6 @@ static struct dmi_system_id __initdata a * acpi_lapic = 1 if LAPIC found * acpi_ioapic = 1 if IOAPIC found * if (acpi_lapic && acpi_ioapic) smp_found_config = 1; - * if acpi_blacklisted() acpi_disabled = 1; - * acpi_irq_model=... * ... * * return value: (currently ignored) @@ -944,22 +895,6 @@ int __init acpi_boot_table_init(void) return error; } - acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); - - /* - * blacklist may disable ACPI entirely - */ - error = acpi_blacklisted(); - if (error) { - if (acpi_force) { - printk(KERN_WARNING PREFIX "acpi=force override\n"); - } else { - printk(KERN_WARNING PREFIX "Disabling ACPI support\n"); - disable_acpi(); - return error; - } - } - return 0; } @@ -972,8 +907,6 @@ int __init acpi_boot_init(void) if (acpi_disabled && !acpi_ht) return 1; - acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); - /* * set sci_int and PM timer address */ --- 2011-02-10.orig/xen/drivers/acpi/hwregs.c +++ 2011-02-10/xen/drivers/acpi/hwregs.c @@ -64,7 +64,8 @@ ACPI_MODULE_NAME("hwregs") * DESCRIPTION: Map register_id into a register bitmask. * ******************************************************************************/ -struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) +static struct acpi_bit_register_info * +acpi_hw_get_bit_register_info(u32 register_id) { ACPI_FUNCTION_ENTRY(); @@ -91,7 +92,7 @@ struct acpi_bit_register_info *acpi_hw_g * ******************************************************************************/ -acpi_status acpi_get_register_unlocked(u32 register_id, u32 * return_value) +acpi_status acpi_get_register(u32 register_id, u32 * return_value) { u32 register_value = 0; struct acpi_bit_register_info *bit_reg_info; @@ -129,16 +130,6 @@ acpi_status acpi_get_register_unlocked(u return_ACPI_STATUS(status); } -acpi_status acpi_get_register(u32 register_id, u32 * return_value) -{ - acpi_status status; - //acpi_cpu_flags flags; - //flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); - status = acpi_get_register_unlocked(register_id, return_value); - //acpi_os_release_lock(acpi_gbl_hardware_lock, flags); - return status; -} - /******************************************************************************* * * FUNCTION: acpi_set_register @@ -157,7 +148,6 @@ acpi_status acpi_set_register(u32 regist u32 register_value = 0; struct acpi_bit_register_info *bit_reg_info; acpi_status status; - //acpi_cpu_flags lock_flags; ACPI_FUNCTION_TRACE_U32(acpi_set_register, register_id); @@ -170,8 +160,6 @@ acpi_status acpi_set_register(u32 regist return_ACPI_STATUS(AE_BAD_PARAMETER); } - //lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); - /* Always do a register read first so we can insert the new bits */ status = acpi_hw_register_read(bit_reg_info->parent_register, @@ -276,8 +264,6 @@ acpi_status acpi_set_register(u32 regist unlock_and_exit: - //acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); - /* Normalize the value that was read */ ACPI_DEBUG_EXEC(register_value = --- 2011-02-10.orig/xen/drivers/acpi/numa.c +++ 2011-02-10/xen/drivers/acpi/numa.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #define ACPI_NUMA 0x80000000 --- 2011-02-10.orig/xen/drivers/acpi/osl.c +++ 2011-02-10/xen/drivers/acpi/osl.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -43,27 +42,12 @@ #define _COMPONENT ACPI_OS_SERVICES ACPI_MODULE_NAME("osl") -#define PREFIX "ACPI: " -struct acpi_os_dpc { - acpi_osd_exec_callback function; - void *context; -}; #ifdef CONFIG_ACPI_CUSTOM_DSDT #include CONFIG_ACPI_CUSTOM_DSDT_FILE #endif -#ifdef ENABLE_DEBUGGER -#include - -/* stuff for debugger support */ -int acpi_in_debugger; -EXPORT_SYMBOL(acpi_in_debugger); - -extern char line_buf[80]; -#endif /*ENABLE_DEBUGGER */ - -void acpi_os_printf(const char *fmt, ...) +void __init acpi_os_printf(const char *fmt, ...) { va_list args; va_start(args, fmt); @@ -71,7 +55,7 @@ void acpi_os_printf(const char *fmt, ... va_end(args); } -void acpi_os_vprintf(const char *fmt, va_list args) +void __init acpi_os_vprintf(const char *fmt, va_list args) { static char buffer[512]; @@ -103,17 +87,15 @@ acpi_physical_address __init acpi_os_get } } -void __iomem * +void __iomem *__init acpi_os_map_memory(acpi_physical_address phys, acpi_size size) { return __acpi_map_table((unsigned long)phys, size); } -EXPORT_SYMBOL_GPL(acpi_os_map_memory); -void acpi_os_unmap_memory(void __iomem * virt, acpi_size size) +void __init acpi_os_unmap_memory(void __iomem * virt, acpi_size size) { } -EXPORT_SYMBOL_GPL(acpi_os_unmap_memory); acpi_status acpi_os_read_port(acpi_io_address port, u32 * value, u32 width) { @@ -136,8 +118,6 @@ acpi_status acpi_os_read_port(acpi_io_ad return AE_OK; } -EXPORT_SYMBOL(acpi_os_read_port); - acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width) { if (width <= 8) { @@ -153,8 +133,6 @@ acpi_status acpi_os_write_port(acpi_io_a return AE_OK; } -EXPORT_SYMBOL(acpi_os_write_port); - acpi_status acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width) { @@ -209,26 +187,3 @@ acpi_os_write_memory(acpi_physical_addre return AE_OK; } - -/* - * Acquire a spinlock. - * - * handle is a pointer to the spinlock_t. - */ - -acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp) -{ - acpi_cpu_flags flags; - spin_lock_irqsave(lockp, flags); - return flags; -} - -/* - * Release a spinlock. See above. - */ - -void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags) -{ - spin_unlock_irqrestore(lockp, flags); -} - --- 2011-02-10.orig/xen/drivers/acpi/tables.c +++ 2011-02-10/xen/drivers/acpi/tables.c @@ -269,7 +269,7 @@ acpi_table_parse_madt(enum acpi_madt_typ * Scan the ACPI System Descriptor Table (STD) for a table matching @id, * run @handler on it. Return 0 if table found, return on if not. */ -int acpi_table_parse(char *id, acpi_table_handler handler) +int __init acpi_table_parse(char *id, acpi_table_handler handler) { struct acpi_table_header *table = NULL; @@ -324,7 +324,6 @@ static void __init check_multiple_madt(v int __init acpi_table_init(void) { - acpi_ut_init_globals(); acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); check_multiple_madt(); return 0; --- 2011-02-10.orig/xen/drivers/acpi/tables/tbinstal.c +++ 2011-02-10/xen/drivers/acpi/tables/tbinstal.c @@ -43,7 +43,6 @@ #include #include -#include #include #define _COMPONENT ACPI_TABLES @@ -60,7 +59,7 @@ ACPI_MODULE_NAME("tbinstal") * DESCRIPTION: this function is called to verify and map table * *****************************************************************************/ -acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc) +acpi_status __init acpi_tb_verify_table(struct acpi_table_desc *table_desc) { acpi_status status = AE_OK; --- 2011-02-10.orig/xen/drivers/acpi/tables/tbutils.c +++ 2011-02-10/xen/drivers/acpi/tables/tbutils.c @@ -49,10 +49,6 @@ #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME("tbutils") -/* Local prototypes */ -static acpi_physical_address -acpi_tb_get_root_table_entry(u8 * table_entry, - acpi_native_uint table_entry_size); /******************************************************************************* * * FUNCTION: acpi_tb_check_xsdt @@ -68,7 +64,7 @@ acpi_tb_get_root_table_entry(u8 * table_ * DESCRIPTION: validate XSDT ******************************************************************************/ -static acpi_status +static acpi_status __init acpi_tb_check_xsdt(acpi_physical_address address) { struct acpi_table_header *table; @@ -115,29 +111,6 @@ acpi_tb_check_xsdt(acpi_physical_address /******************************************************************************* * - * FUNCTION: acpi_tb_tables_loaded - * - * PARAMETERS: None - * - * RETURN: TRUE if required ACPI tables are loaded - * - * DESCRIPTION: Determine if the minimum required ACPI tables are present - * (FADT, FACS, DSDT) - * - ******************************************************************************/ - -u8 acpi_tb_tables_loaded(void) -{ - - if (acpi_gbl_root_table_list.count >= 3) { - return (TRUE); - } - - return (FALSE); -} - -/******************************************************************************* - * * FUNCTION: acpi_tb_print_table_header * * PARAMETERS: Address - Table physical address @@ -202,7 +175,8 @@ acpi_tb_print_table_header(acpi_physical * ******************************************************************************/ -acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) +acpi_status __init +acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) { u8 checksum; @@ -309,13 +283,6 @@ acpi_tb_install_table(acpi_physical_addr acpi_tb_print_table_header(address, table); - if (table_index == ACPI_TABLE_INDEX_DSDT) { - - /* Global integer width is based upon revision of the DSDT */ - - acpi_ut_set_integer_width(table->revision); - } - unmap_and_exit: acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); } @@ -337,7 +304,7 @@ acpi_tb_install_table(acpi_physical_addr * ******************************************************************************/ -static acpi_physical_address +static acpi_physical_address __init acpi_tb_get_root_table_entry(u8 * table_entry, acpi_native_uint table_entry_size) { --- 2011-02-10.orig/xen/drivers/acpi/tables/tbxface.c +++ 2011-02-10/xen/drivers/acpi/tables/tbxface.c @@ -45,7 +45,6 @@ #include #include #include -#include #include #define _COMPONENT ACPI_TABLES @@ -164,7 +163,7 @@ acpi_initialize_tables(struct acpi_table * DESCRIPTION: Finds and verifies an ACPI table. * *****************************************************************************/ -acpi_status +acpi_status __init acpi_get_table(char *signature, acpi_native_uint instance, struct acpi_table_header **out_table) { @@ -198,14 +197,10 @@ acpi_get_table(char *signature, *out_table = acpi_gbl_root_table_list.tables[i].pointer; } - /*if (!acpi_gbl_permanent_mmap)*/ { - acpi_gbl_root_table_list.tables[i].pointer = NULL; - } + acpi_gbl_root_table_list.tables[i].pointer = NULL; return (status); } return (AE_NOT_FOUND); } - -ACPI_EXPORT_SYMBOL(acpi_get_table) --- 2011-02-10.orig/xen/drivers/acpi/tables/tbxfroot.c +++ 2011-02-10/xen/drivers/acpi/tables/tbxfroot.c @@ -52,8 +52,6 @@ ACPI_MODULE_NAME("tbxfroot") /* Local prototypes */ static u8 *acpi_tb_scan_memory_for_rsdp(u8 * start_address, u32 length); -static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp); - /******************************************************************************* * * FUNCTION: acpi_tb_validate_rsdp @@ -66,7 +64,7 @@ static acpi_status acpi_tb_validate_rsdp * ******************************************************************************/ -static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) +static acpi_status __init acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) { ACPI_FUNCTION_ENTRY(); --- 2011-02-10.orig/xen/drivers/acpi/utilities/utglobal.c +++ 2011-02-10/xen/drivers/acpi/utilities/utglobal.c @@ -44,10 +44,10 @@ #define DEFINE_ACPI_GLOBALS #include +#include #include #include #include -#include ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) #define _COMPONENT ACPI_UTILITIES @@ -55,53 +55,6 @@ ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) /******************************************************************************* * - * Static global variable initialization. - * - ******************************************************************************/ -/* - * We want the debug switches statically initialized so they - * are already set when the debugger is entered. - */ -/* Debug switch - level and trace mask */ -u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT; - -/* Debug switch - layer (component) mask */ - -u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; -u32 acpi_gbl_nesting_level = 0; - -/* Debugger globals */ - -u8 acpi_gbl_db_terminate_threads = FALSE; -u8 acpi_gbl_abort_method = FALSE; -u8 acpi_gbl_method_executing = FALSE; - -/* System flags */ - -u32 acpi_gbl_startup_flags = 0; - -/* System starts uninitialized */ - -u8 acpi_gbl_shutdown = TRUE; - -const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT] = { - "\\_S0_", - "\\_S1_", - "\\_S2_", - "\\_S3_", - "\\_S4_", - "\\_S5_" -}; - -const char *acpi_gbl_highest_dstate_names[4] = { - "_S1D", - "_S2D", - "_S3D", - "_S4D" -}; - -/******************************************************************************* - * * FUNCTION: acpi_format_exception * * PARAMETERS: Status - The acpi_status code to be formatted @@ -114,7 +67,7 @@ const char *acpi_gbl_highest_dstate_name * ******************************************************************************/ -const char *acpi_format_exception(acpi_status status) +const char *__init acpi_format_exception(acpi_status status) { const char *exception = NULL; @@ -135,106 +88,6 @@ const char *acpi_format_exception(acpi_s return (ACPI_CAST_PTR(const char, exception)); } -ACPI_EXPORT_SYMBOL(acpi_format_exception) - -/******************************************************************************* - * - * Namespace globals - * - ******************************************************************************/ -/* - * Predefined ACPI Names (Built-in to the Interpreter) - * - * NOTES: - * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run - * during the initialization sequence. - * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to - * perform a Notify() operation on it. - */ -const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = { - {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, - {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, - {"_SB_", ACPI_TYPE_DEVICE, NULL}, - {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, - {"_TZ_", ACPI_TYPE_THERMAL, NULL}, - {"_REV", ACPI_TYPE_INTEGER, (char *)ACPI_CA_SUPPORT_LEVEL}, - {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, - {"_GL_", ACPI_TYPE_MUTEX, (char *)1}, - -#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) - {"_OSI", ACPI_TYPE_METHOD, (char *)1}, -#endif - - /* Table terminator */ - - {NULL, ACPI_TYPE_ANY, NULL} -}; - -/* - * Properties of the ACPI Object Types, both internal and external. - * The table is indexed by values of acpi_object_type - */ -const u8 acpi_gbl_ns_properties[] = { - ACPI_NS_NORMAL, /* 00 Any */ - ACPI_NS_NORMAL, /* 01 Number */ - ACPI_NS_NORMAL, /* 02 String */ - ACPI_NS_NORMAL, /* 03 Buffer */ - ACPI_NS_NORMAL, /* 04 Package */ - ACPI_NS_NORMAL, /* 05 field_unit */ - ACPI_NS_NEWSCOPE, /* 06 Device */ - ACPI_NS_NORMAL, /* 07 Event */ - ACPI_NS_NEWSCOPE, /* 08 Method */ - ACPI_NS_NORMAL, /* 09 Mutex */ - ACPI_NS_NORMAL, /* 10 Region */ - ACPI_NS_NEWSCOPE, /* 11 Power */ - ACPI_NS_NEWSCOPE, /* 12 Processor */ - ACPI_NS_NEWSCOPE, /* 13 Thermal */ - ACPI_NS_NORMAL, /* 14 buffer_field */ - ACPI_NS_NORMAL, /* 15 ddb_handle */ - ACPI_NS_NORMAL, /* 16 Debug Object */ - ACPI_NS_NORMAL, /* 17 def_field */ - ACPI_NS_NORMAL, /* 18 bank_field */ - ACPI_NS_NORMAL, /* 19 index_field */ - ACPI_NS_NORMAL, /* 20 Reference */ - ACPI_NS_NORMAL, /* 21 Alias */ - ACPI_NS_NORMAL, /* 22 method_alias */ - ACPI_NS_NORMAL, /* 23 Notify */ - ACPI_NS_NORMAL, /* 24 Address Handler */ - ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Desc */ - ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 26 Resource Field */ - ACPI_NS_NEWSCOPE, /* 27 Scope */ - ACPI_NS_NORMAL, /* 28 Extra */ - ACPI_NS_NORMAL, /* 29 Data */ - ACPI_NS_NORMAL /* 30 Invalid */ -}; - -/* Hex to ASCII conversion table */ - -static const char acpi_gbl_hex_to_ascii[] = { - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' -}; - -/******************************************************************************* - * - * FUNCTION: acpi_ut_hex_to_ascii_char - * - * PARAMETERS: Integer - Contains the hex digit - * Position - bit position of the digit within the - * integer (multiple of 4) - * - * RETURN: The converted Ascii character - * - * DESCRIPTION: Convert a hex digit to an Ascii character - * - ******************************************************************************/ - -char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position) -{ - - return (acpi_gbl_hex_to_ascii[(integer >> position) & 0xF]); -} - /****************************************************************************** * * Event and Hardware globals @@ -313,28 +166,7 @@ struct acpi_bit_register_info acpi_gbl_b ACPI_BITMASK_ARB_DISABLE} }; -struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = { - /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, - ACPI_BITREG_TIMER_ENABLE, - ACPI_BITMASK_TIMER_STATUS, - ACPI_BITMASK_TIMER_ENABLE}, - /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, - ACPI_BITREG_GLOBAL_LOCK_ENABLE, - ACPI_BITMASK_GLOBAL_LOCK_STATUS, - ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, - /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, - ACPI_BITREG_POWER_BUTTON_ENABLE, - ACPI_BITMASK_POWER_BUTTON_STATUS, - ACPI_BITMASK_POWER_BUTTON_ENABLE}, - /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, - ACPI_BITREG_SLEEP_BUTTON_ENABLE, - ACPI_BITMASK_SLEEP_BUTTON_STATUS, - ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, - /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, - ACPI_BITREG_RT_CLOCK_ENABLE, - ACPI_BITMASK_RT_CLOCK_STATUS, - ACPI_BITMASK_RT_CLOCK_ENABLE}, -}; +#ifdef ACPI_DEBUG_OUTPUT /******************************************************************************* * @@ -350,7 +182,7 @@ struct acpi_fixed_event_info acpi_gbl_fi /* Region type decoding */ -const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { +static const char *const acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { "SystemMemory", "SystemIO", "PCI_Config", @@ -361,7 +193,7 @@ const char *acpi_gbl_region_types[ACPI_N "DataTable" }; -char *acpi_ut_get_region_name(u8 space_id) +const char *acpi_ut_get_region_name(u8 space_id) { if (space_id >= ACPI_USER_REGION_BEGIN) { @@ -373,369 +205,4 @@ char *acpi_ut_get_region_name(u8 space_i return (ACPI_CAST_PTR(char, acpi_gbl_region_types[space_id])); } -/******************************************************************************* - * - * FUNCTION: acpi_ut_get_event_name - * - * PARAMETERS: None. - * - * RETURN: Status - * - * DESCRIPTION: Translate a Event ID into a name string (Debug only) - * - ******************************************************************************/ - -/* Event type decoding */ - -static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = { - "PM_Timer", - "GlobalLock", - "PowerButton", - "SleepButton", - "RealTimeClock", -}; - -char *acpi_ut_get_event_name(u32 event_id) -{ - - if (event_id > ACPI_EVENT_MAX) { - return ("InvalidEventID"); - } - - return (ACPI_CAST_PTR(char, acpi_gbl_event_types[event_id])); -} - -/******************************************************************************* - * - * FUNCTION: acpi_ut_get_type_name - * - * PARAMETERS: None. - * - * RETURN: Status - * - * DESCRIPTION: Translate a Type ID into a name string (Debug only) - * - ******************************************************************************/ - -/* - * Elements of acpi_gbl_ns_type_names below must match - * one-to-one with values of acpi_object_type - * - * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; - * when stored in a table it really means that we have thus far seen no - * evidence to indicate what type is actually going to be stored for this entry. - */ -static const char acpi_gbl_bad_type[] = "UNDEFINED"; - -/* Printable names of the ACPI object types */ - -static const char *acpi_gbl_ns_type_names[] = { - /* 00 */ "Untyped", - /* 01 */ "Integer", - /* 02 */ "String", - /* 03 */ "Buffer", - /* 04 */ "Package", - /* 05 */ "FieldUnit", - /* 06 */ "Device", - /* 07 */ "Event", - /* 08 */ "Method", - /* 09 */ "Mutex", - /* 10 */ "Region", - /* 11 */ "Power", - /* 12 */ "Processor", - /* 13 */ "Thermal", - /* 14 */ "BufferField", - /* 15 */ "DdbHandle", - /* 16 */ "DebugObject", - /* 17 */ "RegionField", - /* 18 */ "BankField", - /* 19 */ "IndexField", - /* 20 */ "Reference", - /* 21 */ "Alias", - /* 22 */ "MethodAlias", - /* 23 */ "Notify", - /* 24 */ "AddrHandler", - /* 25 */ "ResourceDesc", - /* 26 */ "ResourceFld", - /* 27 */ "Scope", - /* 28 */ "Extra", - /* 29 */ "Data", - /* 30 */ "Invalid" -}; - -char *acpi_ut_get_type_name(acpi_object_type type) -{ - - if (type > ACPI_TYPE_INVALID) { - return (ACPI_CAST_PTR(char, acpi_gbl_bad_type)); - } - - return (ACPI_CAST_PTR(char, acpi_gbl_ns_type_names[type])); -} - -char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc) -{ - - if (!obj_desc) { - return ("[NULL Object Descriptor]"); - } - - return (acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE(obj_desc))); -} - -/******************************************************************************* - * - * FUNCTION: acpi_ut_get_descriptor_name - * - * PARAMETERS: Object - An ACPI object - * - * RETURN: Pointer to a string - * - * DESCRIPTION: Validate object and return the descriptor type - * - ******************************************************************************/ - -/* Printable names of object descriptor types */ - -static const char *acpi_gbl_desc_type_names[] = { - /* 00 */ "Invalid", - /* 01 */ "Cached", - /* 02 */ "State-Generic", - /* 03 */ "State-Update", - /* 04 */ "State-Package", - /* 05 */ "State-Control", - /* 06 */ "State-RootParseScope", - /* 07 */ "State-ParseScope", - /* 08 */ "State-WalkScope", - /* 09 */ "State-Result", - /* 10 */ "State-Notify", - /* 11 */ "State-Thread", - /* 12 */ "Walk", - /* 13 */ "Parser", - /* 14 */ "Operand", - /* 15 */ "Node" -}; - -char *acpi_ut_get_descriptor_name(void *object) -{ - - if (!object) { - return ("NULL OBJECT"); - } - - if (ACPI_GET_DESCRIPTOR_TYPE(object) > ACPI_DESC_TYPE_MAX) { - return (ACPI_CAST_PTR(char, acpi_gbl_bad_type)); - } - - return (ACPI_CAST_PTR(char, - acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE - (object)])); - -} - -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) -/* - * Strings and procedures used for debug only - */ - -/******************************************************************************* - * - * FUNCTION: acpi_ut_get_mutex_name - * - * PARAMETERS: mutex_id - The predefined ID for this mutex. - * - * RETURN: String containing the name of the mutex. Always returns a valid - * pointer. - * - * DESCRIPTION: Translate a mutex ID into a name string (Debug only) - * - ******************************************************************************/ - -char *acpi_ut_get_mutex_name(u32 mutex_id) -{ - - if (mutex_id > ACPI_MAX_MUTEX) { - return ("Invalid Mutex ID"); - } - - return (acpi_gbl_mutex_names[mutex_id]); -} - -/******************************************************************************* - * - * FUNCTION: acpi_ut_get_notify_name - * - * PARAMETERS: notify_value - Value from the Notify() request - * - * RETURN: String corresponding to the Notify Value. - * - * DESCRIPTION: Translate a Notify Value to a notify namestring. - * - ******************************************************************************/ - -/* Names for Notify() values, used for debug output */ - -static const char *acpi_gbl_notify_value_names[] = { - "Bus Check", - "Device Check", - "Device Wake", - "Eject Request", - "Device Check Light", - "Frequency Mismatch", - "Bus Mode Mismatch", - "Power Fault", - "Capabilities Check", - "Device PLD Check", - "Reserved", - "System Locality Update" -}; - -const char *acpi_ut_get_notify_name(u32 notify_value) -{ - - if (notify_value <= ACPI_NOTIFY_MAX) { - return (acpi_gbl_notify_value_names[notify_value]); - } else if (notify_value <= ACPI_MAX_SYS_NOTIFY) { - return ("Reserved"); - } else { /* Greater or equal to 0x80 */ - - return ("**Device Specific**"); - } -} #endif - -/******************************************************************************* - * - * FUNCTION: acpi_ut_valid_object_type - * - * PARAMETERS: Type - Object type to be validated - * - * RETURN: TRUE if valid object type, FALSE otherwise - * - * DESCRIPTION: Validate an object type - * - ******************************************************************************/ - -u8 acpi_ut_valid_object_type(acpi_object_type type) -{ - - if (type > ACPI_TYPE_LOCAL_MAX) { - - /* Note: Assumes all TYPEs are contiguous (external/local) */ - - return (FALSE); - } - - return (TRUE); -} - -/******************************************************************************* - * - * FUNCTION: acpi_ut_init_globals - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Init library globals. All globals that require specific - * initialization should be initialized here! - * - ******************************************************************************/ - -void acpi_ut_init_globals(void) -{ -#if 0 - acpi_status status; -#endif - u32 i; - - ACPI_FUNCTION_TRACE(ut_init_globals); - -#if 0 - /* Create all memory caches */ - - status = acpi_ut_create_caches(); - if (ACPI_FAILURE(status)) { - return; - } -#endif - - /* Mutex locked flags */ - - for (i = 0; i < ACPI_NUM_MUTEX; i++) { - acpi_gbl_mutex_info[i].mutex = NULL; - acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED; - acpi_gbl_mutex_info[i].use_count = 0; - } - - for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++) { - acpi_gbl_owner_id_mask[i] = 0; - } - acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; /* Last ID is never valid */ - - /* GPE support */ - - acpi_gbl_gpe_xrupt_list_head = NULL; - acpi_gbl_gpe_fadt_blocks[0] = NULL; - acpi_gbl_gpe_fadt_blocks[1] = NULL; - - /* Global handlers */ - - acpi_gbl_system_notify.handler = NULL; - acpi_gbl_device_notify.handler = NULL; - acpi_gbl_exception_handler = NULL; - acpi_gbl_init_handler = NULL; - /*acpi_gbl_table_handler = NULL;*/ - - /* Global Lock support */ - - acpi_gbl_global_lock_semaphore = NULL; - acpi_gbl_global_lock_mutex = NULL; - acpi_gbl_global_lock_acquired = FALSE; - acpi_gbl_global_lock_handle = 0; - - /* Miscellaneous variables */ - - acpi_gbl_cm_single_step = FALSE; - acpi_gbl_db_terminate_threads = FALSE; - acpi_gbl_shutdown = FALSE; - acpi_gbl_ns_lookup_count = 0; - acpi_gbl_ps_find_count = 0; - acpi_gbl_acpi_hardware_present = TRUE; - acpi_gbl_last_owner_id_index = 0; - acpi_gbl_next_owner_id_offset = 0; - acpi_gbl_trace_method_name = 0; - acpi_gbl_trace_dbg_level = 0; - acpi_gbl_trace_dbg_layer = 0; - acpi_gbl_debugger_configuration = DEBUGGER_THREADING; - acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; - - /* Hardware oriented */ - - acpi_gbl_events_initialized = FALSE; - acpi_gbl_system_awake_and_running = TRUE; - - /* Namespace */ - - acpi_gbl_root_node = NULL; - acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME; - acpi_gbl_root_node_struct.descriptor_type = ACPI_DESC_TYPE_NAMED; - acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE; - acpi_gbl_root_node_struct.child = NULL; - acpi_gbl_root_node_struct.peer = NULL; - acpi_gbl_root_node_struct.object = NULL; - acpi_gbl_root_node_struct.flags = ANOBJ_END_OF_PEER_LIST; - -#ifdef ACPI_DEBUG_OUTPUT - acpi_gbl_lowest_stack_pointer = ACPI_CAST_PTR(acpi_size, ACPI_SIZE_MAX); -#endif - -#ifdef ACPI_DBG_TRACK_ALLOCATIONS - acpi_gbl_display_final_mem_stats = FALSE; -#endif - - return_VOID; -} - -ACPI_EXPORT_SYMBOL(acpi_dbg_level) - ACPI_EXPORT_SYMBOL(acpi_dbg_layer) --- 2011-02-10.orig/xen/drivers/acpi/utilities/utmisc.c +++ 2011-02-10/xen/drivers/acpi/utilities/utmisc.c @@ -61,7 +61,7 @@ ACPI_MODULE_NAME("utmisc") * an ASCII string. * ******************************************************************************/ -const char *acpi_ut_validate_exception(acpi_status status) +const char *__init acpi_ut_validate_exception(acpi_status status) { acpi_status sub_status; const char *exception = NULL; @@ -122,40 +122,6 @@ const char *acpi_ut_validate_exception(a /******************************************************************************* * - * FUNCTION: acpi_ut_set_integer_width - * - * PARAMETERS: Revision From DSDT header - * - * RETURN: None - * - * DESCRIPTION: Set the global integer bit width based upon the revision - * of the DSDT. For Revision 1 and 0, Integers are 32 bits. - * For Revision 2 and above, Integers are 64 bits. Yes, this - * makes a difference. - * - ******************************************************************************/ - -void acpi_ut_set_integer_width(u8 revision) -{ - - if (revision < 2) { - - /* 32-bit case */ - - acpi_gbl_integer_bit_width = 32; - acpi_gbl_integer_nybble_width = 8; - acpi_gbl_integer_byte_width = 4; - } else { - /* 64-bit case (ACPI 2.0+) */ - - acpi_gbl_integer_bit_width = 64; - acpi_gbl_integer_nybble_width = 16; - acpi_gbl_integer_byte_width = 8; - } -} - -/******************************************************************************* - * * FUNCTION: acpi_ut_error, acpi_ut_warning, acpi_ut_info * * PARAMETERS: module_name - Caller's module name (for error output) @@ -168,7 +134,7 @@ void acpi_ut_set_integer_width(u8 revisi * ******************************************************************************/ -void ACPI_INTERNAL_VAR_XFACE +void ACPI_INTERNAL_VAR_XFACE __init acpi_ut_error(char *module_name, u32 line_number, char *format, ...) { va_list args; @@ -181,23 +147,7 @@ acpi_ut_error(char *module_name, u32 lin va_end(args); } -void ACPI_INTERNAL_VAR_XFACE -acpi_ut_exception(char *module_name, - u32 line_number, acpi_status status, char *format, ...) -{ - va_list args; - - acpi_os_printf("ACPI Exception (%s-%04d): %s, ", module_name, - line_number, acpi_format_exception(status)); - - va_start(args, format); - acpi_os_vprintf(format, args); - acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); -} - -EXPORT_SYMBOL(acpi_ut_exception); - -void ACPI_INTERNAL_VAR_XFACE +void ACPI_INTERNAL_VAR_XFACE __init acpi_ut_warning(char *module_name, u32 line_number, char *format, ...) { va_list args; @@ -211,7 +161,7 @@ acpi_ut_warning(char *module_name, u32 l va_end(args); } -void ACPI_INTERNAL_VAR_XFACE +void ACPI_INTERNAL_VAR_XFACE __init acpi_ut_info(char *module_name, u32 line_number, char *format, ...) { va_list args; --- 2011-02-10.orig/xen/drivers/passthrough/vtd/dmar.c +++ 2011-02-10/xen/drivers/passthrough/vtd/dmar.c @@ -46,6 +46,7 @@ LIST_HEAD_READ_MOSTLY(acpi_rmrr_units); static LIST_HEAD_READ_MOSTLY(acpi_atsr_units); static LIST_HEAD_READ_MOSTLY(acpi_rhsa_units); +static struct acpi_table_header *__read_mostly dmar_table; static u64 __read_mostly igd_drhd_address; void dmar_scope_add_buses(struct dmar_scope *scope, u16 sec_bus, u16 sub_bus) @@ -681,6 +682,7 @@ static int __init acpi_parse_dmar(struct u8 dmar_host_address_width; int ret = 0; + dmar_table = table; dmar = (struct acpi_table_dmar *)table; if ( !iommu_enabled ) @@ -772,22 +774,8 @@ int __init acpi_dmar_init(void) return parse_dmar_table(acpi_parse_dmar); } -static struct acpi_table_header *get_dmar(void) -{ - struct acpi_table_header *dmar_table = NULL; - unsigned long flags; - - /* Disabling IRQs avoids cross-CPU TLB flush in map_pages_to_xen(). */ - local_irq_save(flags); - acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_table); - local_irq_restore(flags); - - return dmar_table; -} - void acpi_dmar_reinstate(void) { - struct acpi_table_header *dmar_table = get_dmar(); if ( dmar_table == NULL ) return; dmar_table->signature[0] = 'D'; @@ -796,7 +784,6 @@ void acpi_dmar_reinstate(void) void acpi_dmar_zap(void) { - struct acpi_table_header *dmar_table = get_dmar(); if ( dmar_table == NULL ) return; dmar_table->signature[0] = 'X'; --- 2011-02-10.orig/xen/include/acpi/acexcep.h +++ 2011-02-10/xen/include/acpi/acexcep.h @@ -189,7 +189,7 @@ * String versions of the exception codes above * These strings must match the corresponding defines exactly */ -char const *acpi_gbl_exception_names_env[] = { +char const *__initdata acpi_gbl_exception_names_env[] = { "AE_OK", "AE_ERROR", "AE_NO_ACPI_TABLES", @@ -224,7 +224,7 @@ char const *acpi_gbl_exception_names_env "AE_OWNER_ID_LIMIT" }; -char const *acpi_gbl_exception_names_pgm[] = { +char const *__initdata acpi_gbl_exception_names_pgm[] = { "AE_BAD_PARAMETER", "AE_BAD_CHARACTER", "AE_BAD_PATHNAME", @@ -236,7 +236,7 @@ char const *acpi_gbl_exception_names_pgm "AE_BAD_DECIMAL_CONSTANT" }; -char const *acpi_gbl_exception_names_tbl[] = { +char const *__initdata acpi_gbl_exception_names_tbl[] = { "AE_BAD_SIGNATURE", "AE_BAD_HEADER", "AE_BAD_CHECKSUM", @@ -245,7 +245,7 @@ char const *acpi_gbl_exception_names_tbl "AE_INVALID_TABLE_LENGTH" }; -char const *acpi_gbl_exception_names_aml[] = { +char const *__initdata acpi_gbl_exception_names_aml[] = { "AE_AML_ERROR", "AE_AML_PARSE", "AE_AML_BAD_OPCODE", @@ -282,7 +282,7 @@ char const *acpi_gbl_exception_names_aml "AE_AML_ILLEGAL_ADDRESS" }; -char const *acpi_gbl_exception_names_ctrl[] = { +char const *__initdata acpi_gbl_exception_names_ctrl[] = { "AE_CTRL_RETURN_VALUE", "AE_CTRL_PENDING", "AE_CTRL_TERMINATE", --- 2011-02-10.orig/xen/include/acpi/acglobal.h +++ 2011-02-10/xen/include/acpi/acglobal.h @@ -60,74 +60,6 @@ /***************************************************************************** * - * Runtime configuration (static defaults that can be overriden at runtime) - * - ****************************************************************************/ - -/* - * Enable "slack" in the AML interpreter? Default is FALSE, and the - * interpreter strictly follows the ACPI specification. Setting to TRUE - * allows the interpreter to ignore certain errors and/or bad AML constructs. - * - * Currently, these features are enabled by this flag: - * - * 1) Allow "implicit return" of last value in a control method - * 2) Allow access beyond the end of an operation region - * 3) Allow access to uninitialized locals/args (auto-init to integer 0) - * 4) Allow ANY object type to be a source operand for the Store() operator - * 5) Allow unresolved references (invalid target name) in package objects - * 6) Enable warning messages for behavior that is not ACPI spec compliant - */ -ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); - -/* - * Automatically serialize ALL control methods? Default is FALSE, meaning - * to use the Serialized/not_serialized method flags on a per method basis. - * Only change this if the ASL code is poorly written and cannot handle - * reentrancy even though methods are marked "NotSerialized". - */ -ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); - -/* - * Create the predefined _OSI method in the namespace? Default is TRUE - * because ACPI CA is fully compatible with other ACPI implementations. - * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior. - */ -ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE); - -/* - * Disable wakeup GPEs during runtime? Default is TRUE because WAKE and - * RUNTIME GPEs should never be shared, and WAKE GPEs should typically only - * be enabled just before going to sleep. - */ -ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE); - -/***************************************************************************** - * - * Debug support - * - ****************************************************************************/ - -/* Runtime configuration of debug print levels */ - -extern u32 acpi_dbg_level; -extern u32 acpi_dbg_layer; - -/* Procedure nesting level for debug output */ - -extern u32 acpi_gbl_nesting_level; - -/* Support for dynamic control method tracing mechanism */ - -ACPI_EXTERN u32 acpi_gbl_original_dbg_level; -ACPI_EXTERN u32 acpi_gbl_original_dbg_layer; -ACPI_EXTERN acpi_name acpi_gbl_trace_method_name; -ACPI_EXTERN u32 acpi_gbl_trace_dbg_level; -ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer; -ACPI_EXTERN u32 acpi_gbl_trace_flags; - -/***************************************************************************** - * * ACPI Table globals * ****************************************************************************/ @@ -140,109 +72,18 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags; */ ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list; ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT; -extern acpi_native_uint acpi_gbl_permanent_mmap; /* These addresses are calculated from FADT address values */ ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable; ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; -/* - * Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is - * determined by the revision of the DSDT: If the DSDT revision is less than - * 2, use only the lower 32 bits of the internal 64-bit Integer. - */ -ACPI_EXTERN u8 acpi_gbl_integer_bit_width; -ACPI_EXTERN u8 acpi_gbl_integer_byte_width; -ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; - -/***************************************************************************** - * - * Mutual exlusion within ACPICA subsystem - * - ****************************************************************************/ - -/* - * Predefined mutex objects. This array contains the - * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. - * (The table maps local handles to the real OS handles) - */ -ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX]; - -/* - * Global lock semaphore works in conjunction with the actual HW global lock - */ -ACPI_EXTERN acpi_mutex acpi_gbl_global_lock_mutex; -ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore; - -/* - * Spinlocks are used for interfaces that can be possibly called at - * interrupt level - */ -ACPI_EXTERN spinlock_t _acpi_gbl_gpe_lock; /* For GPE data structs and registers */ -ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock; /* For ACPI H/W except GPE registers */ -#define acpi_gbl_gpe_lock &_acpi_gbl_gpe_lock -#define acpi_gbl_hardware_lock &_acpi_gbl_hardware_lock - /***************************************************************************** * * Miscellaneous globals * ****************************************************************************/ -#ifdef ACPI_DBG_TRACK_ALLOCATIONS - -/* Lists for tracking memory allocations */ - -ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; -ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; -ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats; -#endif - -/* Object caches */ - -ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; - -/* Global handlers */ - -ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; -ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; -ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; -ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; -ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; - -/* Misc */ - -ACPI_EXTERN u32 acpi_gbl_original_mode; -ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; -ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; -ACPI_EXTERN u32 acpi_gbl_ps_find_count; -ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS]; -ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; -ACPI_EXTERN u16 acpi_gbl_global_lock_handle; -ACPI_EXTERN u8 acpi_gbl_last_owner_id_index; -ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset; -ACPI_EXTERN u8 acpi_gbl_debugger_configuration; -ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; -ACPI_EXTERN u8 acpi_gbl_step_to_next_call; -ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present; -ACPI_EXTERN u8 acpi_gbl_global_lock_present; -ACPI_EXTERN u8 acpi_gbl_events_initialized; -ACPI_EXTERN u8 acpi_gbl_system_awake_and_running; - -extern u8 acpi_gbl_shutdown; -extern u32 acpi_gbl_startup_flags; -extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; -extern const char *acpi_gbl_highest_dstate_names[4]; -extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; -extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; - -/* Exception codes */ - #ifndef DEFINE_ACPI_GLOBALS extern char const *acpi_gbl_exception_names_env[]; @@ -255,127 +96,11 @@ extern char const *acpi_gbl_exception_na /***************************************************************************** * - * Namespace globals - * - ****************************************************************************/ - -#define NUM_NS_TYPES ACPI_TYPE_INVALID+1 - -#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) -#define NUM_PREDEFINED_NAMES 10 -#else -#define NUM_PREDEFINED_NAMES 9 -#endif - -ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct; -ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node; -ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device; - -extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; -extern const struct acpi_predefined_names - acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES]; - -#ifdef ACPI_DEBUG_OUTPUT -ACPI_EXTERN u32 acpi_gbl_current_node_count; -ACPI_EXTERN u32 acpi_gbl_current_node_size; -ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; -ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer; -ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer; -ACPI_EXTERN u32 acpi_gbl_deepest_nesting; -#endif - -/***************************************************************************** - * - * Interpreter globals - * - ****************************************************************************/ - -ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list; - -/* Control method single step flag */ - -ACPI_EXTERN u8 acpi_gbl_cm_single_step; - -/***************************************************************************** - * * Hardware globals * ****************************************************************************/ extern struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG]; -ACPI_EXTERN u8 acpi_gbl_sleep_type_a; -ACPI_EXTERN u8 acpi_gbl_sleep_type_b; - -/***************************************************************************** - * - * Event and GPE globals - * - ****************************************************************************/ - -extern struct acpi_fixed_event_info - acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS]; -ACPI_EXTERN struct acpi_fixed_event_handler - acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; -ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; -ACPI_EXTERN struct acpi_gpe_block_info -*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; - -/***************************************************************************** - * - * Debugger globals - * - ****************************************************************************/ - -ACPI_EXTERN u8 acpi_gbl_db_output_flags; - -#ifdef ACPI_DISASSEMBLER - -ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; -ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; -#endif - -#ifdef ACPI_DEBUGGER - -extern u8 acpi_gbl_method_executing; -extern u8 acpi_gbl_abort_method; -extern u8 acpi_gbl_db_terminate_threads; - -ACPI_EXTERN int optind; -ACPI_EXTERN char *optarg; - -ACPI_EXTERN u8 acpi_gbl_db_opt_tables; -ACPI_EXTERN u8 acpi_gbl_db_opt_stats; -ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; - -ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; -ACPI_EXTERN char acpi_gbl_db_line_buf[80]; -ACPI_EXTERN char acpi_gbl_db_parsed_buf[80]; -ACPI_EXTERN char acpi_gbl_db_scope_buf[40]; -ACPI_EXTERN char acpi_gbl_db_debug_filename[40]; -ACPI_EXTERN u8 acpi_gbl_db_output_to_file; -ACPI_EXTERN char *acpi_gbl_db_buffer; -ACPI_EXTERN char *acpi_gbl_db_filename; -ACPI_EXTERN u32 acpi_gbl_db_debug_level; -ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; -ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr; -ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; - -/* - * Statistic globals - */ -ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1]; -ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1]; -ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; -ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; -ACPI_EXTERN u32 acpi_gbl_num_nodes; -ACPI_EXTERN u32 acpi_gbl_num_objects; - -ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree; -ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; -ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; -ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; - -#endif /* ACPI_DEBUGGER */ #endif /* __ACGLOBAL_H__ */ --- 2011-02-10.orig/xen/include/acpi/achware.h +++ 2011-02-10/xen/include/acpi/achware.h @@ -44,32 +44,9 @@ #ifndef __ACHWARE_H__ #define __ACHWARE_H__ -/* PM Timer ticks per second (HZ) */ - -#define PM_TIMER_FREQUENCY 3579545 - -/* Values for the _SST reserved method */ - -#define ACPI_SST_INDICATOR_OFF 0 -#define ACPI_SST_WORKING 1 -#define ACPI_SST_WAKING 2 -#define ACPI_SST_SLEEPING 3 -#define ACPI_SST_SLEEP_CONTEXT 4 - -/* Prototypes */ - -/* - * hwacpi - high level functions - */ -acpi_status acpi_hw_set_mode(u32 mode); - -u32 acpi_hw_get_mode(void); - /* * hwregs - ACPI Register I/O */ -struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id); - acpi_status acpi_hw_register_read(u32 register_id, u32 * return_value); @@ -82,50 +59,4 @@ acpi_hw_low_level_read(u32 width, acpi_status acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg); -acpi_status acpi_hw_clear_acpi_status(void); - -/* - * hwgpe - GPE support - */ -acpi_status -acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info); - -acpi_status -acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, - struct acpi_gpe_block_info *gpe_block); - -acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info); - -acpi_status -acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, - struct acpi_gpe_block_info *gpe_block); - -#ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info, - acpi_event_status * event_status); -#endif /* ACPI_FUTURE_USAGE */ - -acpi_status acpi_hw_disable_all_gpes(void); - -acpi_status acpi_hw_enable_all_runtime_gpes(void); - -acpi_status acpi_hw_enable_all_wakeup_gpes(void); - -acpi_status -acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, - struct acpi_gpe_block_info *gpe_block); - -#ifdef ACPI_FUTURE_USAGE -/* - * hwtimer - ACPI Timer prototypes - */ -acpi_status acpi_get_timer_resolution(u32 * resolution); - -acpi_status acpi_get_timer(u32 * ticks); - -acpi_status -acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed); -#endif /* ACPI_FUTURE_USAGE */ - #endif /* __ACHWARE_H__ */ --- 2011-02-10.orig/xen/include/acpi/aclocal.h +++ 2011-02-10/xen/include/acpi/aclocal.h @@ -46,176 +46,18 @@ /* acpisrc:struct_defs -- for acpisrc conversion */ -#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ -#define ACPI_DO_NOT_WAIT 0 -#define ACPI_SERIALIZED 0xFF - -typedef u32 acpi_mutex_handle; -#define ACPI_GLOBAL_LOCK (acpi_semaphore) (-1) - -/* Total number of aml opcodes defined */ - -#define AML_NUM_OPCODES 0x7F - -/* Forward declarations */ - -struct acpi_walk_state; -struct acpi_obj_mutex; -union acpi_parse_object; - -/***************************************************************************** - * - * Mutex typedefs and structs - * - ****************************************************************************/ - -/* - * Predefined handles for the mutex objects used within the subsystem - * All mutex objects are automatically created by acpi_ut_mutex_initialize. - * - * The acquire/release ordering protocol is implied via this list. Mutexes - * with a lower value must be acquired before mutexes with a higher value. - * - * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names - * table below also! - */ -#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ -#define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */ -#define ACPI_MTX_TABLES 2 /* Data for ACPI tables */ -#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ -#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ -#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ -#define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */ -#define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */ - -#define ACPI_MAX_MUTEX 7 -#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 - -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) -#ifdef DEFINE_ACPI_GLOBALS - -/* Debug names for the mutexes above */ - -static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = { - "ACPI_MTX_Interpreter", - "ACPI_MTX_Tables", - "ACPI_MTX_Namespace", - "ACPI_MTX_Events", - "ACPI_MTX_Caches", - "ACPI_MTX_Memory", - "ACPI_MTX_CommandComplete", - "ACPI_MTX_CommandReady" -}; - -#endif -#endif - -/* - * Predefined handles for spinlocks used within the subsystem. - * These spinlocks are created by acpi_ut_mutex_initialize - */ -#define ACPI_LOCK_GPES 0 -#define ACPI_LOCK_HARDWARE 1 - -#define ACPI_MAX_LOCK 1 -#define ACPI_NUM_LOCK ACPI_MAX_LOCK+1 - -/* Owner IDs are used to track namespace nodes for selective deletion */ - -typedef u8 acpi_owner_id; -#define ACPI_OWNER_ID_MAX 0xFF - -/* This Thread ID means that the mutex is not in use (unlocked) */ - -#define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0 - -/* Table for the global mutexes */ - -struct acpi_mutex_info { - acpi_mutex mutex; - u32 use_count; - acpi_thread_id thread_id; -}; - -/* Lock flag parameter for various interfaces */ - -#define ACPI_MTX_DO_NOT_LOCK 0 -#define ACPI_MTX_LOCK 1 - -/* Field access granularities */ - -#define ACPI_FIELD_BYTE_GRANULARITY 1 -#define ACPI_FIELD_WORD_GRANULARITY 2 -#define ACPI_FIELD_DWORD_GRANULARITY 4 -#define ACPI_FIELD_QWORD_GRANULARITY 8 - -#define ACPI_ENTRY_NOT_FOUND NULL - /***************************************************************************** * * Namespace typedefs and structs * ****************************************************************************/ -/* Operational modes of the AML interpreter/scanner */ - -typedef enum { - ACPI_IMODE_LOAD_PASS1 = 0x01, - ACPI_IMODE_LOAD_PASS2 = 0x02, - ACPI_IMODE_EXECUTE = 0x03 -} acpi_interpreter_mode; - union acpi_name_union { u32 integer; char ascii[4]; }; /* - * The Namespace Node describes a named object that appears in the AML. - * descriptor_type is used to differentiate between internal descriptors. - * - * The node is optimized for both 32-bit and 64-bit platforms: - * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. - * - * Note: The descriptor_type and Type fields must appear in the identical - * position in both the struct acpi_namespace_node and union acpi_operand_object - * structures. - */ -struct acpi_namespace_node { - union acpi_operand_object *object; /* Interpreter object */ - u8 descriptor_type; /* Differentiate object descriptor types */ - u8 type; /* ACPI Type associated with this name */ - u8 flags; /* Miscellaneous flags */ - acpi_owner_id owner_id; /* Node creator */ - union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ - struct acpi_namespace_node *child; /* First child */ - struct acpi_namespace_node *peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */ - - /* - * The following fields are used by the ASL compiler and disassembler only - */ -#ifdef ACPI_LARGE_NAMESPACE_NODE - union acpi_parse_object *op; - u32 value; - u32 length; -#endif -}; - -/* Namespace Node flags */ - -#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ -#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */ -#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ -#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ -#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ - -#define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */ -#define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */ -#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* i_aSL only: Method has at least one return value */ -#define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */ -#define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */ - -/* * ACPI Table Descriptor. One per ACPI table */ struct acpi_table_desc { @@ -223,7 +65,6 @@ struct acpi_table_desc { struct acpi_table_header *pointer; u32 length; /* Length fixed at 32 bits */ union acpi_name_union signature; - acpi_owner_id owner_id; u8 flags; }; @@ -255,465 +96,12 @@ struct acpi_internal_rsdt { #define ACPI_TABLE_INDEX_DSDT (0) #define ACPI_TABLE_INDEX_FACS (1) -struct acpi_find_context { - char *search_for; - acpi_handle *list; - u32 *count; -}; - -struct acpi_ns_search_data { - struct acpi_namespace_node *node; -}; - -/* - * Predefined Namespace items - */ -struct acpi_predefined_names { - char *name; - u8 type; - char *val; -}; - -/* Object types used during package copies */ - -#define ACPI_COPY_TYPE_SIMPLE 0 -#define ACPI_COPY_TYPE_PACKAGE 1 - -/* Info structure used to convert external<->internal namestrings */ - -struct acpi_namestring_info { - char *external_name; - char *next_external_char; - char *internal_name; - u32 length; - u32 num_segments; - u32 num_carats; - u8 fully_qualified; -}; - -/* Field creation info */ - -struct acpi_create_field_info { - struct acpi_namespace_node *region_node; - struct acpi_namespace_node *field_node; - struct acpi_namespace_node *register_node; - struct acpi_namespace_node *data_register_node; - u32 bank_value; - u32 field_bit_position; - u32 field_bit_length; - u8 field_flags; - u8 attribute; - u8 field_type; -}; - -typedef -acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); - -/* - * Bitmapped ACPI types. Used internally only - */ -#define ACPI_BTYPE_ANY 0x00000000 -#define ACPI_BTYPE_INTEGER 0x00000001 -#define ACPI_BTYPE_STRING 0x00000002 -#define ACPI_BTYPE_BUFFER 0x00000004 -#define ACPI_BTYPE_PACKAGE 0x00000008 -#define ACPI_BTYPE_FIELD_UNIT 0x00000010 -#define ACPI_BTYPE_DEVICE 0x00000020 -#define ACPI_BTYPE_EVENT 0x00000040 -#define ACPI_BTYPE_METHOD 0x00000080 -#define ACPI_BTYPE_MUTEX 0x00000100 -#define ACPI_BTYPE_REGION 0x00000200 -#define ACPI_BTYPE_POWER 0x00000400 -#define ACPI_BTYPE_PROCESSOR 0x00000800 -#define ACPI_BTYPE_THERMAL 0x00001000 -#define ACPI_BTYPE_BUFFER_FIELD 0x00002000 -#define ACPI_BTYPE_DDB_HANDLE 0x00004000 -#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 -#define ACPI_BTYPE_REFERENCE 0x00010000 -#define ACPI_BTYPE_RESOURCE 0x00020000 - -#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) - -#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) -#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) -#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) -#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ -#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF - -/***************************************************************************** - * - * Event typedefs and structs - * - ****************************************************************************/ - -/* Dispatch info for each GPE -- either a method or handler, cannot be both */ - -struct acpi_handler_info { - acpi_event_handler address; /* Address of handler, if any */ - void *context; /* Context to be passed to handler */ - struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */ -}; - -union acpi_gpe_dispatch_info { - struct acpi_namespace_node *method_node; /* Method node for this GPE level */ - struct acpi_handler_info *handler; -}; - -/* - * Information about a GPE, one per each GPE in an array. - * NOTE: Important to keep this struct as small as possible. - */ -struct acpi_gpe_event_info { - union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ - struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ - u8 flags; /* Misc info about this GPE */ - u8 gpe_number; /* This GPE */ -}; - -/* Information about a GPE register pair, one per each status/enable pair in an array */ - -struct acpi_gpe_register_info { - struct acpi_generic_address status_address; /* Address of status reg */ - struct acpi_generic_address enable_address; /* Address of enable reg */ - u8 enable_for_wake; /* GPEs to keep enabled when sleeping */ - u8 enable_for_run; /* GPEs to keep enabled when running */ - u8 base_gpe_number; /* Base GPE number for this register */ -}; - -/* - * Information about a GPE register block, one per each installed block -- - * GPE0, GPE1, and one per each installed GPE Block Device. - */ -struct acpi_gpe_block_info { - struct acpi_namespace_node *node; - struct acpi_gpe_block_info *previous; - struct acpi_gpe_block_info *next; - struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */ - struct acpi_gpe_register_info *register_info; /* One per GPE register pair */ - struct acpi_gpe_event_info *event_info; /* One for each GPE */ - struct acpi_generic_address block_address; /* Base address of the block */ - u32 register_count; /* Number of register pairs in block */ - u8 block_base_number; /* Base GPE number for this block */ -}; - -/* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ - -struct acpi_gpe_xrupt_info { - struct acpi_gpe_xrupt_info *previous; - struct acpi_gpe_xrupt_info *next; - struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */ - u32 interrupt_number; /* System interrupt number */ -}; - -struct acpi_gpe_walk_info { - struct acpi_namespace_node *gpe_device; - struct acpi_gpe_block_info *gpe_block; -}; - -typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info * - gpe_xrupt_info, - struct acpi_gpe_block_info * - gpe_block); - -/* Information about each particular fixed event */ - -struct acpi_fixed_event_handler { - acpi_event_handler handler; /* Address of handler. */ - void *context; /* Context to be passed to handler */ -}; - -struct acpi_fixed_event_info { - u8 status_register_id; - u8 enable_register_id; - u16 status_bit_mask; - u16 enable_bit_mask; -}; - -/* Information used during field processing */ - -struct acpi_field_info { - u8 skip_field; - u8 field_flag; - u32 pkg_length; -}; - -/***************************************************************************** - * - * Generic "state" object for stacks - * - ****************************************************************************/ - -#define ACPI_CONTROL_NORMAL 0xC0 -#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 -#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 -#define ACPI_CONTROL_PREDICATE_FALSE 0xC3 -#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 - -#define ACPI_STATE_COMMON \ - void *next; \ - u8 descriptor_type; /* To differentiate various internal objs */\ - u8 flags; \ - u16 value; \ - u16 state; - - /* There are 2 bytes available here until the next natural alignment boundary */ - -struct acpi_common_state { -ACPI_STATE_COMMON}; - -/* - * Update state - used to traverse complex objects such as packages - */ -struct acpi_update_state { - ACPI_STATE_COMMON union acpi_operand_object *object; -}; - -/* - * Pkg state - used to traverse nested package structures - */ -struct acpi_pkg_state { - ACPI_STATE_COMMON u16 index; - union acpi_operand_object *source_object; - union acpi_operand_object *dest_object; - struct acpi_walk_state *walk_state; - void *this_target_obj; - u32 num_packages; -}; - -/* - * Control state - one per if/else and while constructs. - * Allows nesting of these constructs - */ -struct acpi_control_state { - ACPI_STATE_COMMON u16 opcode; - union acpi_parse_object *predicate_op; - u8 *aml_predicate_start; /* Start of if/while predicate */ - u8 *package_end; /* End of if/while block */ -}; - -/* - * Scope state - current scope during namespace lookups - */ -struct acpi_scope_state { - ACPI_STATE_COMMON struct acpi_namespace_node *node; -}; - -struct acpi_pscope_state { - ACPI_STATE_COMMON u32 arg_count; /* Number of fixed arguments */ - union acpi_parse_object *op; /* Current op being parsed */ - u8 *arg_end; /* Current argument end */ - u8 *pkg_end; /* Current package end */ - u32 arg_list; /* Next argument to parse */ -}; - -/* - * Thread state - one per thread across multiple walk states. Multiple walk - * states are created when there are nested control methods executing. - */ -struct acpi_thread_state { - ACPI_STATE_COMMON u8 current_sync_level; /* Mutex Sync (nested acquire) level */ - struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ - union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ - acpi_thread_id thread_id; /* Running thread ID */ -}; - -/* - * Result values - used to accumulate the results of nested - * AML arguments - */ -struct acpi_result_values { - ACPI_STATE_COMMON u8 num_results; - u8 last_insert; - union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS]; -}; - -typedef -acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state, - union acpi_parse_object ** out_op); - -typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); - -/* - * Notify info - used to pass info to the deferred notify - * handler/dispatcher. - */ -struct acpi_notify_info { - ACPI_STATE_COMMON struct acpi_namespace_node *node; - union acpi_operand_object *handler_obj; -}; - -/* Generic state is union of structs above */ - -union acpi_generic_state { - struct acpi_common_state common; - struct acpi_control_state control; - struct acpi_update_state update; - struct acpi_scope_state scope; - struct acpi_pscope_state parse_scope; - struct acpi_pkg_state pkg; - struct acpi_thread_state thread; - struct acpi_result_values results; - struct acpi_notify_info notify; -}; - -/***************************************************************************** - * - * Interpreter typedefs and structs - * - ****************************************************************************/ - -typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state); - -/***************************************************************************** - * - * Parser typedefs and structs - * - ****************************************************************************/ - -/* - * AML opcode, name, and argument layout - */ -struct acpi_opcode_info { -#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) - char *name; /* Opcode name (disassembler/debug only) */ -#endif - u32 parse_args; /* Grammar/Parse time arguments */ - u32 runtime_args; /* Interpret time arguments */ - u16 flags; /* Misc flags */ - u8 object_type; /* Corresponding internal object type */ - u8 class; /* Opcode class */ - u8 type; /* Opcode type */ -}; - -union acpi_parse_value { - acpi_integer integer; /* Integer constant (Up to 64 bits) */ - struct uint64_struct integer64; /* Structure overlay for 2 32-bit Dwords */ - u32 size; /* bytelist or field size */ - char *string; /* NULL terminated string */ - u8 *buffer; /* buffer or string */ - char *name; /* NULL terminated string */ - union acpi_parse_object *arg; /* arguments and contained ops */ -}; - -#define ACPI_PARSE_COMMON \ - union acpi_parse_object *parent; /* Parent op */\ - u8 descriptor_type; /* To differentiate various internal objs */\ - u8 flags; /* Type of Op */\ - u16 aml_opcode; /* AML opcode */\ - u32 aml_offset; /* Offset of declaration in AML */\ - union acpi_parse_object *next; /* Next op */\ - struct acpi_namespace_node *node; /* For use by interpreter */\ - union acpi_parse_value value; /* Value or args associated with the opcode */\ - ACPI_DISASM_ONLY_MEMBERS (\ - u8 disasm_flags; /* Used during AML disassembly */\ - u8 disasm_opcode; /* Subtype used for disassembly */\ - char aml_op_name[16]) /* Op name (debug only) */ - -#define ACPI_DASM_BUFFER 0x00 -#define ACPI_DASM_RESOURCE 0x01 -#define ACPI_DASM_STRING 0x02 -#define ACPI_DASM_UNICODE 0x03 -#define ACPI_DASM_EISAID 0x04 -#define ACPI_DASM_MATCHOP 0x05 -#define ACPI_DASM_LNOT_PREFIX 0x06 -#define ACPI_DASM_LNOT_SUFFIX 0x07 -#define ACPI_DASM_IGNORE 0x08 - -/* - * Generic operation (for example: If, While, Store) - */ -struct acpi_parse_obj_common { -ACPI_PARSE_COMMON}; - -/* - * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions), - * and bytelists. - */ -struct acpi_parse_obj_named { - ACPI_PARSE_COMMON u8 *path; - u8 *data; /* AML body or bytelist data */ - u32 length; /* AML length */ - u32 name; /* 4-byte name or zero if no name */ -}; - -/* This version is used by the i_aSL compiler only */ - -#define ACPI_MAX_PARSEOP_NAME 20 - -struct acpi_parse_obj_asl { - ACPI_PARSE_COMMON union acpi_parse_object *child; - union acpi_parse_object *parent_method; - char *filename; - char *external_name; - char *namepath; - char name_seg[4]; - u32 extra_value; - u32 column; - u32 line_number; - u32 logical_line_number; - u32 logical_byte_offset; - u32 end_line; - u32 end_logical_line; - u32 acpi_btype; - u32 aml_length; - u32 aml_subtree_length; - u32 final_aml_length; - u32 final_aml_offset; - u32 compile_flags; - u16 parse_opcode; - u8 aml_opcode_length; - u8 aml_pkg_len_bytes; - u8 extra; - char parse_op_name[ACPI_MAX_PARSEOP_NAME]; -}; - -union acpi_parse_object { - struct acpi_parse_obj_common common; - struct acpi_parse_obj_named named; - struct acpi_parse_obj_asl asl; -}; - -/* - * Parse state - one state per parser invocation and each control - * method. - */ -struct acpi_parse_state { - u8 *aml_start; /* First AML byte */ - u8 *aml; /* Next AML byte */ - u8 *aml_end; /* (last + 1) AML byte */ - u8 *pkg_start; /* Current package begin */ - u8 *pkg_end; /* Current package end */ - union acpi_parse_object *start_op; /* Root of parse tree */ - struct acpi_namespace_node *start_node; - union acpi_generic_state *scope; /* Current scope */ - union acpi_parse_object *start_scope; - u32 aml_size; -}; - -/* Parse object flags */ - -#define ACPI_PARSEOP_GENERIC 0x01 -#define ACPI_PARSEOP_NAMED 0x02 -#define ACPI_PARSEOP_DEFERRED 0x04 -#define ACPI_PARSEOP_BYTELIST 0x08 -#define ACPI_PARSEOP_IN_CACHE 0x80 - -/* Parse object disasm_flags */ - -#define ACPI_PARSEOP_IGNORE 0x01 -#define ACPI_PARSEOP_PARAMLIST 0x02 -#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 -#define ACPI_PARSEOP_SPECIAL 0x10 - /***************************************************************************** * * Hardware (ACPI registers) and PNP * ****************************************************************************/ -#define PCI_ROOT_HID_STRING "PNP0A03" -#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" - struct acpi_bit_register_info { u8 parent_register; u8 bit_position; @@ -814,152 +202,4 @@ struct acpi_bit_register_info { #define ACPI_ADDRESS_TYPE_IO_RANGE 1 #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 -/* Resource descriptor types and masks */ - -#define ACPI_RESOURCE_NAME_LARGE 0x80 -#define ACPI_RESOURCE_NAME_SMALL 0x00 - -#define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ -#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ -#define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ - -/* - * Small resource descriptor "names" as defined by the ACPI specification. - * Note: Bits 2:0 are used for the descriptor length - */ -#define ACPI_RESOURCE_NAME_IRQ 0x20 -#define ACPI_RESOURCE_NAME_DMA 0x28 -#define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30 -#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 -#define ACPI_RESOURCE_NAME_IO 0x40 -#define ACPI_RESOURCE_NAME_FIXED_IO 0x48 -#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50 -#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 -#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 -#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 -#define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70 -#define ACPI_RESOURCE_NAME_END_TAG 0x78 - -/* - * Large resource descriptor "names" as defined by the ACPI specification. - * Note: includes the Large Descriptor bit in bit[7] - */ -#define ACPI_RESOURCE_NAME_MEMORY24 0x81 -#define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82 -#define ACPI_RESOURCE_NAME_RESERVED_L1 0x83 -#define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84 -#define ACPI_RESOURCE_NAME_MEMORY32 0x85 -#define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86 -#define ACPI_RESOURCE_NAME_ADDRESS32 0x87 -#define ACPI_RESOURCE_NAME_ADDRESS16 0x88 -#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 -#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A -#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B -#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B - -/***************************************************************************** - * - * Miscellaneous - * - ****************************************************************************/ - -#define ACPI_ASCII_ZERO 0x30 - -/***************************************************************************** - * - * Debugger - * - ****************************************************************************/ - -struct acpi_db_method_info { - acpi_handle main_thread_gate; - acpi_handle thread_complete_gate; - u32 *threads; - u32 num_threads; - u32 num_created; - u32 num_completed; - - char *name; - u32 flags; - u32 num_loops; - char pathname[128]; - char **args; - - /* - * Arguments to be passed to method for the command - * Threads - - * the Number of threads, ID of current thread and - * Index of current thread inside all them created. - */ - char init_args; - char *arguments[4]; - char num_threads_str[11]; - char id_of_thread_str[11]; - char index_of_thread_str[11]; -}; - -struct acpi_integrity_info { - u32 nodes; - u32 objects; -}; - -#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 -#define ACPI_DB_CONSOLE_OUTPUT 0x02 -#define ACPI_DB_DUPLICATE_OUTPUT 0x03 - -/***************************************************************************** - * - * Debug - * - ****************************************************************************/ - -/* Entry for a memory allocation (debug only) */ - -#define ACPI_MEM_MALLOC 0 -#define ACPI_MEM_CALLOC 1 -#define ACPI_MAX_MODULE_NAME 16 - -#define ACPI_COMMON_DEBUG_MEM_HEADER \ - struct acpi_debug_mem_block *previous; \ - struct acpi_debug_mem_block *next; \ - u32 size; \ - u32 component; \ - u32 line; \ - char module[ACPI_MAX_MODULE_NAME]; \ - u8 alloc_type; - -struct acpi_debug_mem_header { -ACPI_COMMON_DEBUG_MEM_HEADER}; - -struct acpi_debug_mem_block { - ACPI_COMMON_DEBUG_MEM_HEADER u64 user_space; -}; - -#define ACPI_MEM_LIST_GLOBAL 0 -#define ACPI_MEM_LIST_NSNODE 1 -#define ACPI_MEM_LIST_MAX 1 -#define ACPI_NUM_MEM_LISTS 2 - -struct acpi_memory_list { - char *list_name; - void *list_head; - u16 object_size; - u16 max_depth; - u16 current_depth; - u16 link_offset; - -#ifdef ACPI_DBG_TRACK_ALLOCATIONS - - /* Statistics for debug memory tracking only */ - - u32 total_allocated; - u32 total_freed; - u32 max_occupied; - u32 total_size; - u32 current_total_size; - u32 requests; - u32 hits; -#endif -}; - #endif /* __ACLOCAL_H__ */ --- 2011-02-10.orig/xen/include/acpi/acmacros.h +++ 2011-02-10/xen/include/acpi/acmacros.h @@ -431,7 +431,6 @@ */ #define ACPI_INFO(plist) acpi_ut_info plist #define ACPI_WARNING(plist) acpi_ut_warning plist -#define ACPI_EXCEPTION(plist) acpi_ut_exception plist #define ACPI_ERROR(plist) acpi_ut_error plist #define ACPI_ERROR_NAMESPACE(s,e) acpi_ns_report_error (AE_INFO, s, e); #define ACPI_ERROR_METHOD(s,n,p,e) acpi_ns_report_method_error (AE_INFO, s, n, p, e); @@ -442,7 +441,6 @@ #define ACPI_INFO(plist) #define ACPI_WARNING(plist) -#define ACPI_EXCEPTION(plist) #define ACPI_ERROR(plist) #define ACPI_ERROR_NAMESPACE(s,e) #define ACPI_ERROR_METHOD(s,n,p,e) @@ -595,16 +593,6 @@ #define ACPI_DEBUG_ONLY_MEMBERS(a) a; #define _VERBOSE_STRUCTURES -/* Stack and buffer dumping */ - -#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) -#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__) - -#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) -#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) -#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) -#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) - /* * Master debug print macros * Print iff: @@ -633,13 +621,6 @@ #define ACPI_FUNCTION_STATUS_EXIT(s) do { } while(0) #define ACPI_FUNCTION_VALUE_EXIT(s) do { } while(0) #define ACPI_FUNCTION_ENTRY() do { } while(0) -#define ACPI_DUMP_STACK_ENTRY(a) do { } while(0) -#define ACPI_DUMP_OPERANDS(a,b,c,d,e) do { } while(0) -#define ACPI_DUMP_ENTRY(a,b) do { } while(0) -#define ACPI_DUMP_TABLES(a,b) do { } while(0) -#define ACPI_DUMP_PATHNAME(a,b,c,d) do { } while(0) -#define ACPI_DUMP_RESOURCE_LIST(a) do { } while(0) -#define ACPI_DUMP_BUFFER(a,b) do { } while(0) #define ACPI_DEBUG_PRINT(pl) do { } while(0) #define ACPI_DEBUG_PRINT_RAW(pl) do { } while(0) @@ -652,56 +633,4 @@ #endif -/* - * Some code only gets executed when the debugger is built in. - * Note that this is entirely independent of whether the - * DEBUG_PRINT stuff (set by ACPI_DEBUG_OUTPUT) is on, or not. - */ -#ifdef ACPI_DEBUGGER -#define ACPI_DEBUGGER_EXEC(a) a -#else -#define ACPI_DEBUGGER_EXEC(a) -#endif - -#ifdef ACPI_DEBUG_OUTPUT -/* - * 1) Set name to blanks - * 2) Copy the object name - */ -#define ACPI_ADD_OBJECT_NAME(a,b) ACPI_MEMSET (a->common.name, ' ', sizeof (a->common.name));\ - ACPI_STRNCPY (a->common.name, acpi_gbl_ns_type_names[b], sizeof (a->common.name)) -#else - -#define ACPI_ADD_OBJECT_NAME(a,b) -#endif - -/* - * Memory allocation tracking (DEBUG ONLY) - */ -#ifndef ACPI_DBG_TRACK_ALLOCATIONS - -/* Memory allocation */ - -#ifndef ACPI_ALLOCATE -#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) -#endif -#ifndef ACPI_ALLOCATE_ZEROED -#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) -#endif -#ifndef ACPI_FREE -#define ACPI_FREE(a) acpio_os_free(a) -#endif -#define ACPI_MEM_TRACKING(a) - -#else - -/* Memory allocation */ - -#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) -#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) -#define ACPI_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) -#define ACPI_MEM_TRACKING(a) a - -#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ - #endif /* ACMACROS_H */ --- 2011-02-10.orig/xen/include/acpi/acnamesp.h +++ /dev/null @@ -1,305 +0,0 @@ -/****************************************************************************** - * - * Name: acnamesp.h - Namespace subcomponent prototypes and defines - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2008, Intel Corp. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#ifndef __ACNAMESP_H__ -#define __ACNAMESP_H__ - -/* To search the entire name space, pass this as search_base */ - -#define ACPI_NS_ALL ((acpi_handle)0) - -/* - * Elements of acpi_ns_properties are bit significant - * and should be one-to-one with values of acpi_object_type - */ -#define ACPI_NS_NORMAL 0 -#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ -#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ - -/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ - -#define ACPI_NS_NO_UPSEARCH 0 -#define ACPI_NS_SEARCH_PARENT 0x01 -#define ACPI_NS_DONT_OPEN_SCOPE 0x02 -#define ACPI_NS_NO_PEER_SEARCH 0x04 -#define ACPI_NS_ERROR_IF_FOUND 0x08 -#define ACPI_NS_PREFIX_IS_SCOPE 0x10 -#define ACPI_NS_EXTERNAL 0x20 -#define ACPI_NS_TEMPORARY 0x40 - -/* Flags for acpi_ns_walk_namespace */ - -#define ACPI_NS_WALK_NO_UNLOCK 0 -#define ACPI_NS_WALK_UNLOCK 0x01 -#define ACPI_NS_WALK_TEMP_NODES 0x02 - -/* - * nsinit - Namespace initialization - */ -acpi_status acpi_ns_initialize_objects(void); - -acpi_status acpi_ns_initialize_devices(void); - -/* - * nsload - Namespace loading - */ -acpi_status acpi_ns_load_namespace(void); - -acpi_status -acpi_ns_load_table(acpi_native_uint table_index, - struct acpi_namespace_node *node); - -/* - * nswalk - walk the namespace - */ -acpi_status -acpi_ns_walk_namespace(acpi_object_type type, - acpi_handle start_object, - u32 max_depth, - u32 flags, - acpi_walk_callback user_function, - void *context, void **return_value); - -struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct acpi_namespace_node - *parent, struct acpi_namespace_node - *child); - -/* - * nsparse - table parsing - */ -acpi_status -acpi_ns_parse_table(acpi_native_uint table_index, - struct acpi_namespace_node *start_node); - -acpi_status -acpi_ns_one_complete_parse(acpi_native_uint pass_number, - acpi_native_uint table_index, - struct acpi_namespace_node *start_node); - -/* - * nsaccess - Top-level namespace access - */ -acpi_status acpi_ns_root_initialize(void); - -acpi_status -acpi_ns_lookup(union acpi_generic_state *scope_info, - char *name, - acpi_object_type type, - acpi_interpreter_mode interpreter_mode, - u32 flags, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node **ret_node); - -/* - * nsalloc - Named object allocation/deallocation - */ -struct acpi_namespace_node *acpi_ns_create_node(u32 name); - -void acpi_ns_delete_node(struct acpi_namespace_node *node); - -void -acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_handle); - -void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id); - -void acpi_ns_detach_object(struct acpi_namespace_node *node); - -void acpi_ns_delete_children(struct acpi_namespace_node *parent); - -int acpi_ns_compare_names(char *name1, char *name2); - -/* - * nsdump - Namespace dump/print utilities - */ -#ifdef ACPI_FUTURE_USAGE -void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth); -#endif /* ACPI_FUTURE_USAGE */ - -void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level); - -void -acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component); - -void acpi_ns_print_pathname(u32 num_segments, char *pathname); - -acpi_status -acpi_ns_dump_one_object(acpi_handle obj_handle, - u32 level, void *context, void **return_value); - -#ifdef ACPI_FUTURE_USAGE -void -acpi_ns_dump_objects(acpi_object_type type, - u8 display_type, - u32 max_depth, - acpi_owner_id owner_id, acpi_handle start_handle); -#endif /* ACPI_FUTURE_USAGE */ - -/* - * nseval - Namespace evaluation functions - */ -acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info); - -/* - * nsnames - Name and Scope manipulation - */ -u32 acpi_ns_opens_scope(acpi_object_type type); - -void -acpi_ns_build_external_path(struct acpi_namespace_node *node, - acpi_size size, char *name_buffer); - -char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node); - -char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state); - -acpi_status -acpi_ns_handle_to_pathname(acpi_handle target_handle, - struct acpi_buffer *buffer); - -u8 -acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for); - -acpi_status -acpi_ns_get_node(struct acpi_namespace_node *prefix_node, - char *external_pathname, - u32 flags, struct acpi_namespace_node **out_node); - -acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node); - -/* - * nsobject - Object management for namespace nodes - */ -acpi_status -acpi_ns_attach_object(struct acpi_namespace_node *node, - union acpi_operand_object *object, acpi_object_type type); - -union acpi_operand_object *acpi_ns_get_attached_object(struct - acpi_namespace_node - *node); - -union acpi_operand_object *acpi_ns_get_secondary_object(union - acpi_operand_object - *obj_desc); - -acpi_status -acpi_ns_attach_data(struct acpi_namespace_node *node, - acpi_object_handler handler, void *data); - -acpi_status -acpi_ns_detach_data(struct acpi_namespace_node *node, - acpi_object_handler handler); - -acpi_status -acpi_ns_get_attached_data(struct acpi_namespace_node *node, - acpi_object_handler handler, void **data); - -/* - * nssearch - Namespace searching and entry - */ -acpi_status -acpi_ns_search_and_enter(u32 entry_name, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node *node, - acpi_interpreter_mode interpreter_mode, - acpi_object_type type, - u32 flags, struct acpi_namespace_node **ret_node); - -acpi_status -acpi_ns_search_one_scope(u32 entry_name, - struct acpi_namespace_node *node, - acpi_object_type type, - struct acpi_namespace_node **ret_node); - -void -acpi_ns_install_node(struct acpi_walk_state *walk_state, - struct acpi_namespace_node *parent_node, - struct acpi_namespace_node *node, acpi_object_type type); - -/* - * nsutils - Utility functions - */ -u8 acpi_ns_valid_root_prefix(char prefix); - -acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node); - -u32 acpi_ns_local(acpi_object_type type); - -void -acpi_ns_report_error(char *module_name, - u32 line_number, - char *internal_name, acpi_status lookup_status); - -void -acpi_ns_report_method_error(char *module_name, - u32 line_number, - char *message, - struct acpi_namespace_node *node, - char *path, acpi_status lookup_status); - -void acpi_ns_print_node_pathname(struct acpi_namespace_node *node, char *msg); - -acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info); - -void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info); - -acpi_status acpi_ns_internalize_name(char *dotted_name, char **converted_name); - -acpi_status -acpi_ns_externalize_name(u32 internal_name_length, - char *internal_name, - u32 * converted_name_length, char **converted_name); - -struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle); - -acpi_handle acpi_ns_convert_entry_to_handle(struct acpi_namespace_node *node); - -void acpi_ns_terminate(void); - -struct acpi_namespace_node *acpi_ns_get_parent_node(struct acpi_namespace_node - *node); - -struct acpi_namespace_node *acpi_ns_get_next_valid_node(struct - acpi_namespace_node - *node); - -#endif /* __ACNAMESP_H__ */ --- 2011-02-10.orig/xen/include/acpi/acobject.h +++ /dev/null @@ -1,422 +0,0 @@ - -/****************************************************************************** - * - * Name: acobject.h - Definition of union acpi_operand_object (Internal object only) - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2007, R. Byron Moore - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#ifndef _ACOBJECT_H -#define _ACOBJECT_H - -/* acpisrc:struct_defs -- for acpisrc conversion */ - -/* - * The union acpi_operand_object is used to pass AML operands from the dispatcher - * to the interpreter, and to keep track of the various handlers such as - * address space handlers and notify handlers. The object is a constant - * size in order to allow it to be cached and reused. - * - * Note: The object is optimized to be aligned and will not work if it is - * byte-packed. - */ -#if ACPI_MACHINE_WIDTH == 64 -#pragma pack(8) -#else -#pragma pack(4) -#endif - -/******************************************************************************* - * - * Common Descriptors - * - ******************************************************************************/ - -/* - * Common area for all objects. - * - * descriptor_type is used to differentiate between internal descriptors, and - * must be in the same place across all descriptors - * - * Note: The descriptor_type and Type fields must appear in the identical - * position in both the struct acpi_namespace_node and union acpi_operand_object - * structures. - */ -#define ACPI_OBJECT_COMMON_HEADER \ - union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ - u8 descriptor_type; /* To differentiate various internal objs */\ - u8 type; /* acpi_object_type */\ - u16 reference_count; /* For object deletion management */\ - u8 flags; - /* - * Note: There are 3 bytes available here before the - * next natural alignment boundary (for both 32/64 cases) - */ - -/* Values for Flag byte above */ - -#define AOPOBJ_AML_CONSTANT 0x01 -#define AOPOBJ_STATIC_POINTER 0x02 -#define AOPOBJ_DATA_VALID 0x04 -#define AOPOBJ_OBJECT_INITIALIZED 0x08 -#define AOPOBJ_SETUP_COMPLETE 0x10 -#define AOPOBJ_SINGLE_DATUM 0x20 -#define AOPOBJ_INVALID 0x40 /* Used if host OS won't allow an op_region address */ - -/****************************************************************************** - * - * Basic data types - * - *****************************************************************************/ - -struct acpi_object_common { -ACPI_OBJECT_COMMON_HEADER}; - -struct acpi_object_integer { - ACPI_OBJECT_COMMON_HEADER u8 fill[3]; /* Prevent warning on some compilers */ - acpi_integer value; -}; - -/* - * Note: The String and Buffer object must be identical through the Pointer - * and length elements. There is code that depends on this. - * - * Fields common to both Strings and Buffers - */ -#define ACPI_COMMON_BUFFER_INFO(_type) \ - _type *pointer; \ - u32 length; - -struct acpi_object_string { /* Null terminated, ASCII characters only */ - ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(char) /* String in AML stream or allocated string */ -}; - -struct acpi_object_buffer { - ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(u8) /* Buffer in AML stream or allocated buffer */ - u32 aml_length; - u8 *aml_start; - struct acpi_namespace_node *node; /* Link back to parent node */ -}; - -struct acpi_object_package { - ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Link back to parent node */ - union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ - u8 *aml_start; - u32 aml_length; - u32 count; /* # of elements in package */ -}; - -/****************************************************************************** - * - * Complex data types - * - *****************************************************************************/ - -struct acpi_object_event { - ACPI_OBJECT_COMMON_HEADER acpi_semaphore os_semaphore; /* Actual OS synchronization object */ -}; - -struct acpi_object_mutex { - ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ - u16 acquisition_depth; /* Allow multiple Acquires, same thread */ - struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ - acpi_mutex os_mutex; /* Actual OS synchronization object */ - union acpi_operand_object *prev; /* Link for list of acquired mutexes */ - union acpi_operand_object *next; /* Link for list of acquired mutexes */ - struct acpi_namespace_node *node; /* Containing namespace node */ - u8 original_sync_level; /* Owner's original sync level (0-15) */ -}; - -struct acpi_object_region { - ACPI_OBJECT_COMMON_HEADER u8 space_id; - struct acpi_namespace_node *node; /* Containing namespace node */ - union acpi_operand_object *handler; /* Handler for region access */ - union acpi_operand_object *next; - acpi_physical_address address; - u32 length; -}; - -struct acpi_object_method { - ACPI_OBJECT_COMMON_HEADER u8 method_flags; - u8 param_count; - u8 sync_level; - union acpi_operand_object *mutex; - u8 *aml_start; - ACPI_INTERNAL_METHOD implementation; - u32 aml_length; - u8 thread_count; - acpi_owner_id owner_id; -}; - -/****************************************************************************** - * - * Objects that can be notified. All share a common notify_info area. - * - *****************************************************************************/ - -/* - * Common fields for objects that support ASL notifications - */ -#define ACPI_COMMON_NOTIFY_INFO \ - union acpi_operand_object *system_notify; /* Handler for system notifies */\ - union acpi_operand_object *device_notify; /* Handler for driver notifies */\ - union acpi_operand_object *handler; /* Handler for Address space */ - -struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ -ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; - -struct acpi_object_device { - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO struct acpi_gpe_block_info *gpe_block; -}; - -struct acpi_object_power_resource { - ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 system_level; - u32 resource_order; -}; - -struct acpi_object_processor { - ACPI_OBJECT_COMMON_HEADER - /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */ - u8 proc_id; - u8 length; - ACPI_COMMON_NOTIFY_INFO acpi_io_address address; -}; - -struct acpi_object_thermal_zone { -ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; - -/****************************************************************************** - * - * Fields. All share a common header/info field. - * - *****************************************************************************/ - -/* - * Common bitfield for the field objects - * "Field Datum" -- a datum from the actual field object - * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field - */ -#define ACPI_COMMON_FIELD_INFO \ - u8 field_flags; /* Access, update, and lock bits */\ - u8 attribute; /* From access_as keyword */\ - u8 access_byte_width; /* Read/Write size in bytes */\ - struct acpi_namespace_node *node; /* Link back to parent node */\ - u32 bit_length; /* Length of field in bits */\ - u32 base_byte_offset; /* Byte offset within containing object */\ - u32 value; /* Value to store into the Bank or Index register */\ - u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ - u8 access_bit_width; /* Read/Write size in bits (8-64) */ - -struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ - ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Parent Operation Region object (REGION/BANK fields only) */ -}; - -struct acpi_object_region_field { - ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */ -}; - -struct acpi_object_bank_field { - ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */ - union acpi_operand_object *bank_obj; /* bank_select Register object */ -}; - -struct acpi_object_index_field { - ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO - /* - * No "RegionObj" pointer needed since the Index and Data registers - * are each field definitions unto themselves. - */ - union acpi_operand_object *index_obj; /* Index register */ - union acpi_operand_object *data_obj; /* Data register */ -}; - -/* The buffer_field is different in that it is part of a Buffer, not an op_region */ - -struct acpi_object_buffer_field { - ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *buffer_obj; /* Containing Buffer object */ -}; - -/****************************************************************************** - * - * Objects for handlers - * - *****************************************************************************/ - -struct acpi_object_notify_handler { - ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Parent device */ - acpi_notify_handler handler; - void *context; -}; - -struct acpi_object_addr_handler { - ACPI_OBJECT_COMMON_HEADER u8 space_id; - u8 handler_flags; - acpi_adr_space_handler handler; - struct acpi_namespace_node *node; /* Parent device */ - void *context; - acpi_adr_space_setup setup; - union acpi_operand_object *region_list; /* regions using this handler */ - union acpi_operand_object *next; -}; - -/* Flags for address handler (handler_flags) */ - -#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01 - -/****************************************************************************** - * - * Special internal objects - * - *****************************************************************************/ - -/* - * The Reference object type is used for these opcodes: - * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op - */ -struct acpi_object_reference { - ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ - u16 opcode; - void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ - struct acpi_namespace_node *node; - union acpi_operand_object **where; - u32 offset; /* Used for arg_op, local_op, and index_op */ -}; - -/* - * Extra object is used as additional storage for types that - * have AML code in their declarations (term_args) that must be - * evaluated at run time. - * - * Currently: Region and field_unit types - */ -struct acpi_object_extra { - ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ - void *region_context; /* Region-specific data */ - u8 *aml_start; - u32 aml_length; -}; - -/* Additional data that can be attached to namespace nodes */ - -struct acpi_object_data { - ACPI_OBJECT_COMMON_HEADER acpi_object_handler handler; - void *pointer; -}; - -/* Structure used when objects are cached for reuse */ - -struct acpi_object_cache_list { - ACPI_OBJECT_COMMON_HEADER union acpi_operand_object *next; /* Link for object cache and internal lists */ -}; - -/****************************************************************************** - * - * union acpi_operand_object Descriptor - a giant union of all of the above - * - *****************************************************************************/ - -union acpi_operand_object { - struct acpi_object_common common; - struct acpi_object_integer integer; - struct acpi_object_string string; - struct acpi_object_buffer buffer; - struct acpi_object_package package; - struct acpi_object_event event; - struct acpi_object_method method; - struct acpi_object_mutex mutex; - struct acpi_object_region region; - struct acpi_object_notify_common common_notify; - struct acpi_object_device device; - struct acpi_object_power_resource power_resource; - struct acpi_object_processor processor; - struct acpi_object_thermal_zone thermal_zone; - struct acpi_object_field_common common_field; - struct acpi_object_region_field field; - struct acpi_object_buffer_field buffer_field; - struct acpi_object_bank_field bank_field; - struct acpi_object_index_field index_field; - struct acpi_object_notify_handler notify; - struct acpi_object_addr_handler address_space; - struct acpi_object_reference reference; - struct acpi_object_extra extra; - struct acpi_object_data data; - struct acpi_object_cache_list cache; -}; - -/****************************************************************************** - * - * union acpi_descriptor - objects that share a common descriptor identifier - * - *****************************************************************************/ - -/* Object descriptor types */ - -#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ -#define ACPI_DESC_TYPE_STATE 0x02 -#define ACPI_DESC_TYPE_STATE_UPDATE 0x03 -#define ACPI_DESC_TYPE_STATE_PACKAGE 0x04 -#define ACPI_DESC_TYPE_STATE_CONTROL 0x05 -#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x06 -#define ACPI_DESC_TYPE_STATE_PSCOPE 0x07 -#define ACPI_DESC_TYPE_STATE_WSCOPE 0x08 -#define ACPI_DESC_TYPE_STATE_RESULT 0x09 -#define ACPI_DESC_TYPE_STATE_NOTIFY 0x0A -#define ACPI_DESC_TYPE_STATE_THREAD 0x0B -#define ACPI_DESC_TYPE_WALK 0x0C -#define ACPI_DESC_TYPE_PARSER 0x0D -#define ACPI_DESC_TYPE_OPERAND 0x0E -#define ACPI_DESC_TYPE_NAMED 0x0F -#define ACPI_DESC_TYPE_MAX 0x0F - -struct acpi_common_descriptor { - void *common_pointer; - u8 descriptor_type; /* To differentiate various internal objs */ -}; - -union acpi_descriptor { - struct acpi_common_descriptor common; - union acpi_operand_object object; - struct acpi_namespace_node node; - union acpi_parse_object op; -}; - -#pragma pack() - -#endif /* _ACOBJECT_H */ --- 2011-02-10.orig/xen/include/acpi/acpi.h +++ 2011-02-10/xen/include/acpi/acpi.h @@ -44,6 +44,8 @@ #ifndef __ACPI_H__ #define __ACPI_H__ +#define PREFIX "ACPI: " + /* * Common includes for all ACPI driver files * We put them here because we don't want to duplicate them @@ -60,8 +62,6 @@ #include "acoutput.h" /* Error output and Debug macros */ #include "acpiosxf.h" /* Interfaces to the ACPI-to-OS layer */ #include "acpixf.h" /* ACPI core subsystem external interfaces */ -#include "acobject.h" /* ACPI internal object */ -#include "acstruct.h" /* Common structures */ #include "acglobal.h" /* All global variables */ #include "achware.h" /* Hardware defines and interfaces */ #include "acutils.h" /* Utility interfaces */ --- 2011-02-10.orig/xen/include/acpi/acpi_bus.h +++ /dev/null @@ -1,389 +0,0 @@ -/* - * acpi_bus.h - ACPI Bus Driver ($Revision: 22 $) - * - * Copyright (C) 2001, 2002 Andy Grover - * Copyright (C) 2001, 2002 Paul Diefenbaugh - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - -#ifndef __ACPI_BUS_H__ -#define __ACPI_BUS_H__ - -#include - -#define PREFIX "ACPI: " - -/* TBD: Make dynamic */ -#define ACPI_MAX_HANDLES 10 -struct acpi_handle_list { - u32 count; - acpi_handle handles[ACPI_MAX_HANDLES]; -}; - -/* acpi_utils.h */ -acpi_status -acpi_extract_package(union acpi_object *package, - struct acpi_buffer *format, struct acpi_buffer *buffer); -acpi_status -acpi_evaluate_integer(acpi_handle handle, - acpi_string pathname, - struct acpi_object_list *arguments, unsigned long *data); -acpi_status -acpi_evaluate_reference(acpi_handle handle, - acpi_string pathname, - struct acpi_object_list *arguments, - struct acpi_handle_list *list); - -#if 0//def CONFIG_ACPI - -#include - -#define ACPI_BUS_FILE_ROOT "acpi" -extern struct proc_dir_entry *acpi_root_dir; - -enum acpi_bus_removal_type { - ACPI_BUS_REMOVAL_NORMAL = 0, - ACPI_BUS_REMOVAL_EJECT, - ACPI_BUS_REMOVAL_SUPRISE, - ACPI_BUS_REMOVAL_TYPE_COUNT -}; - -enum acpi_bus_device_type { - ACPI_BUS_TYPE_DEVICE = 0, - ACPI_BUS_TYPE_POWER, - ACPI_BUS_TYPE_PROCESSOR, - ACPI_BUS_TYPE_THERMAL, - ACPI_BUS_TYPE_SYSTEM, - ACPI_BUS_TYPE_POWER_BUTTON, - ACPI_BUS_TYPE_SLEEP_BUTTON, - ACPI_BUS_DEVICE_TYPE_COUNT -}; - -struct acpi_driver; -struct acpi_device; - -/* - * ACPI Driver - * ----------- - */ - -typedef int (*acpi_op_add) (struct acpi_device * device); -typedef int (*acpi_op_remove) (struct acpi_device * device, int type); -typedef int (*acpi_op_lock) (struct acpi_device * device, int type); -typedef int (*acpi_op_start) (struct acpi_device * device); -typedef int (*acpi_op_stop) (struct acpi_device * device, int type); -typedef int (*acpi_op_suspend) (struct acpi_device * device, - pm_message_t state); -typedef int (*acpi_op_resume) (struct acpi_device * device); -typedef int (*acpi_op_scan) (struct acpi_device * device); -typedef int (*acpi_op_bind) (struct acpi_device * device); -typedef int (*acpi_op_unbind) (struct acpi_device * device); -typedef int (*acpi_op_shutdown) (struct acpi_device * device); - -struct acpi_bus_ops { - u32 acpi_op_add:1; - u32 acpi_op_remove:1; - u32 acpi_op_lock:1; - u32 acpi_op_start:1; - u32 acpi_op_stop:1; - u32 acpi_op_suspend:1; - u32 acpi_op_resume:1; - u32 acpi_op_scan:1; - u32 acpi_op_bind:1; - u32 acpi_op_unbind:1; - u32 acpi_op_shutdown:1; - u32 reserved:21; -}; - -struct acpi_device_ops { - acpi_op_add add; - acpi_op_remove remove; - acpi_op_lock lock; - acpi_op_start start; - acpi_op_stop stop; - acpi_op_suspend suspend; - acpi_op_resume resume; - acpi_op_scan scan; - acpi_op_bind bind; - acpi_op_unbind unbind; - acpi_op_shutdown shutdown; -}; - -struct acpi_driver { - char name[80]; - char class[80]; - const struct acpi_device_id *ids; /* Supported Hardware IDs */ - struct acpi_device_ops ops; - struct device_driver drv; - struct module *owner; -}; - -/* - * ACPI Device - * ----------- - */ - -/* Status (_STA) */ - -struct acpi_device_status { - u32 present:1; - u32 enabled:1; - u32 show_in_ui:1; - u32 functional:1; - u32 battery_present:1; - u32 reserved:27; -}; - -/* Flags */ - -struct acpi_device_flags { - u32 dynamic_status:1; - u32 hardware_id:1; - u32 compatible_ids:1; - u32 bus_address:1; - u32 unique_id:1; - u32 removable:1; - u32 ejectable:1; - u32 lockable:1; - u32 suprise_removal_ok:1; - u32 power_manageable:1; - u32 performance_manageable:1; - u32 wake_capable:1; /* Wakeup(_PRW) supported? */ - u32 force_power_state:1; - u32 reserved:19; -}; - -/* File System */ - -struct acpi_device_dir { - struct proc_dir_entry *entry; -}; - -#define acpi_device_dir(d) ((d)->dir.entry) - -/* Plug and Play */ - -typedef char acpi_bus_id[5]; -typedef unsigned long acpi_bus_address; -typedef char acpi_hardware_id[15]; -typedef char acpi_unique_id[9]; -typedef char acpi_device_name[40]; -typedef char acpi_device_class[20]; - -struct acpi_device_pnp { - acpi_bus_id bus_id; /* Object name */ - acpi_bus_address bus_address; /* _ADR */ - acpi_hardware_id hardware_id; /* _HID */ - struct acpi_compatible_id_list *cid_list; /* _CIDs */ - acpi_unique_id unique_id; /* _UID */ - acpi_device_name device_name; /* Driver-determined */ - acpi_device_class device_class; /* " */ -}; - -#define acpi_device_bid(d) ((d)->pnp.bus_id) -#define acpi_device_adr(d) ((d)->pnp.bus_address) -#define acpi_device_hid(d) ((d)->pnp.hardware_id) -#define acpi_device_uid(d) ((d)->pnp.unique_id) -#define acpi_device_name(d) ((d)->pnp.device_name) -#define acpi_device_class(d) ((d)->pnp.device_class) - -/* Power Management */ - -struct acpi_device_power_flags { - u32 explicit_get:1; /* _PSC present? */ - u32 power_resources:1; /* Power resources */ - u32 inrush_current:1; /* Serialize Dx->D0 */ - u32 power_removed:1; /* Optimize Dx->D0 */ - u32 reserved:28; -}; - -struct acpi_device_power_state { - struct { - u8 valid:1; - u8 explicit_set:1; /* _PSx present? */ - u8 reserved:6; - } flags; - int power; /* % Power (compared to D0) */ - int latency; /* Dx->D0 time (microseconds) */ - struct acpi_handle_list resources; /* Power resources referenced */ -}; - -struct acpi_device_power { - int state; /* Current state */ - struct acpi_device_power_flags flags; - struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ -}; - -/* Performance Management */ - -struct acpi_device_perf_flags { - u8 reserved:8; -}; - -struct acpi_device_perf_state { - struct { - u8 valid:1; - u8 reserved:7; - } flags; - u8 power; /* % Power (compared to P0) */ - u8 performance; /* % Performance ( " ) */ - int latency; /* Px->P0 time (microseconds) */ -}; - -struct acpi_device_perf { - int state; - struct acpi_device_perf_flags flags; - int state_count; - struct acpi_device_perf_state *states; -}; - -/* Wakeup Management */ -struct acpi_device_wakeup_flags { - u8 valid:1; /* Can successfully enable wakeup? */ - u8 run_wake:1; /* Run-Wake GPE devices */ -}; - -struct acpi_device_wakeup_state { - u8 enabled:1; -}; - -struct acpi_device_wakeup { - acpi_handle gpe_device; - acpi_integer gpe_number; - acpi_integer sleep_state; - struct acpi_handle_list resources; - struct acpi_device_wakeup_state state; - struct acpi_device_wakeup_flags flags; -}; - -/* Device */ - -struct acpi_device { - acpi_handle handle; - struct acpi_device *parent; - struct list_head children; - struct list_head node; - struct list_head wakeup_list; - struct list_head g_list; - struct acpi_device_status status; - struct acpi_device_flags flags; - struct acpi_device_pnp pnp; - struct acpi_device_power power; - struct acpi_device_wakeup wakeup; - struct acpi_device_perf performance; - struct acpi_device_dir dir; - struct acpi_device_ops ops; - struct acpi_driver *driver; - void *driver_data; - struct device dev; - struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */ - enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ -}; - -#define acpi_driver_data(d) ((d)->driver_data) -#define to_acpi_device(d) container_of(d, struct acpi_device, dev) -#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) - -/* acpi_device.dev.bus == &acpi_bus_type */ -extern struct bus_type acpi_bus_type; - -/* - * Events - * ------ - */ - -struct acpi_bus_event { - struct list_head node; - acpi_device_class device_class; - acpi_bus_id bus_id; - u32 type; - u32 data; -}; - -extern struct kobject *acpi_kobj; -extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); -void acpi_bus_private_data_handler(acpi_handle, u32, void *); -int acpi_bus_get_private_data(acpi_handle, void **); -extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); -extern int register_acpi_notifier(struct notifier_block *); -extern int unregister_acpi_notifier(struct notifier_block *); -/* - * External Functions - */ - -int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); -void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context); -int acpi_bus_get_status(struct acpi_device *device); -int acpi_bus_get_power(acpi_handle handle, int *state); -int acpi_bus_set_power(acpi_handle handle, int state); -#ifdef CONFIG_ACPI_PROC_EVENT -int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); -int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data); -int acpi_bus_receive_event(struct acpi_bus_event *event); -#else -static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) - { return 0; } -#endif -int acpi_bus_register_driver(struct acpi_driver *driver); -void acpi_bus_unregister_driver(struct acpi_driver *driver); -int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, - acpi_handle handle, int type); -int acpi_bus_trim(struct acpi_device *start, int rmdevice); -int acpi_bus_start(struct acpi_device *device); -acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); -int acpi_match_device_ids(struct acpi_device *device, - const struct acpi_device_id *ids); -int acpi_create_dir(struct acpi_device *); -void acpi_remove_dir(struct acpi_device *); - -/* - * Bind physical devices with ACPI devices - */ -#include -struct acpi_bus_type { - struct list_head list; - struct bus_type *bus; - /* For general devices under the bus */ - int (*find_device) (struct device *, acpi_handle *); - /* For bridges, such as PCI root bridge, IDE controller */ - int (*find_bridge) (struct device *, acpi_handle *); -}; -int register_acpi_bus_type(struct acpi_bus_type *); -int unregister_acpi_bus_type(struct acpi_bus_type *); -struct device *acpi_get_physical_device(acpi_handle); -/* helper */ -acpi_handle acpi_get_child(acpi_handle, acpi_integer); -acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); -#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) - -#ifdef CONFIG_PM_SLEEP -int acpi_pm_device_sleep_state(struct device *, int, int *); -#else /* !CONFIG_PM_SLEEP */ -static inline int acpi_pm_device_sleep_state(struct device *d, int w, int *p) -{ - if (p) - *p = ACPI_STATE_D0; - return ACPI_STATE_D3; -} -#endif /* !CONFIG_PM_SLEEP */ - -#endif /* CONFIG_ACPI */ - -#endif /*__ACPI_BUS_H__*/ --- 2011-02-10.orig/xen/include/acpi/acpi_drivers.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * acpi_drivers.h ($Revision: 31 $) - * - * Copyright (C) 2001, 2002 Andy Grover - * Copyright (C) 2001, 2002 Paul Diefenbaugh - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - -#ifndef __ACPI_DRIVERS_H__ -#define __ACPI_DRIVERS_H__ - -#include -#include - - -#define ACPI_MAX_STRING 80 - -#define ACPI_BUS_COMPONENT 0x00010000 -#define ACPI_SYSTEM_COMPONENT 0x02000000 - -/* _HID definitions */ - -#define ACPI_POWER_HID "ACPI_PWR" -#define ACPI_PROCESSOR_HID "ACPI_CPU" -#define ACPI_SYSTEM_HID "ACPI_SYS" -#define ACPI_THERMAL_HID "ACPI_THM" -#define ACPI_BUTTON_HID_POWERF "ACPI_FPB" -#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB" - - -/* -------------------------------------------------------------------------- - PCI - -------------------------------------------------------------------------- */ - -#ifdef CONFIG_ACPI_PCI - -#define ACPI_PCI_COMPONENT 0x00400000 - -/* ACPI PCI Interrupt Link (pci_link.c) */ - -int acpi_irq_penalty_init (void); -int acpi_pci_link_get_irq (acpi_handle handle, int index, int* edge_level, int* active_high_low); - -/* ACPI PCI Interrupt Routing (pci_irq.c) */ - -int acpi_pci_irq_add_prt (acpi_handle handle, int segment, int bus); -void acpi_pci_irq_del_prt (int segment, int bus); - -/* ACPI PCI Device Binding (pci_bind.c) */ - -struct pci_bus; - -int acpi_pci_bind (struct acpi_device *device); -int acpi_pci_unbind (struct acpi_device *device); -int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus); - -/* Arch-defined function to add a bus to the system */ - -struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, int bus); - -#endif /*CONFIG_ACPI_PCI*/ - - -/* -------------------------------------------------------------------------- - Power Resource - -------------------------------------------------------------------------- */ - -#ifdef CONFIG_ACPI_POWER -int acpi_enable_wakeup_device_power (struct acpi_device *dev); -int acpi_disable_wakeup_device_power (struct acpi_device *dev); -int acpi_power_get_inferred_state (struct acpi_device *device); -int acpi_power_transition (struct acpi_device *device, int state); -#endif - - -/* -------------------------------------------------------------------------- - Embedded Controller - -------------------------------------------------------------------------- */ -#ifdef CONFIG_ACPI_EC -int acpi_ec_ecdt_probe (void); -#endif - -/* -------------------------------------------------------------------------- - Processor - -------------------------------------------------------------------------- */ - -#define ACPI_PROCESSOR_LIMIT_NONE 0x00 -#define ACPI_PROCESSOR_LIMIT_INCREMENT 0x01 -#define ACPI_PROCESSOR_LIMIT_DECREMENT 0x02 - -int acpi_processor_set_thermal_limit(acpi_handle handle, int type); - - -#endif /*__ACPI_DRIVERS_H__*/ --- 2011-02-10.orig/xen/include/acpi/acpiosxf.h +++ 2011-02-10/xen/include/acpi/acpiosxf.h @@ -50,155 +50,19 @@ #include "platform/acenv.h" #include "actypes.h" -/* Types for acpi_os_execute */ - -typedef enum { - OSL_GLOBAL_LOCK_HANDLER, - OSL_NOTIFY_HANDLER, - OSL_GPE_HANDLER, - OSL_DEBUGGER_THREAD, - OSL_EC_POLL_HANDLER, - OSL_EC_BURST_HANDLER -} acpi_execute_type; - -#define ACPI_NO_UNIT_LIMIT ((u32) -1) -#define ACPI_MUTEX_SEM 1 - -/* Functions for acpi_os_signal */ - -#define ACPI_SIGNAL_FATAL 0 -#define ACPI_SIGNAL_BREAKPOINT 1 - -struct acpi_signal_fatal_info { - u32 type; - u32 code; - u32 argument; -}; - -/* - * OSL Initialization and shutdown primitives - */ -acpi_status acpi_os_initialize(void); - -acpi_status acpi_os_terminate(void); - /* * ACPI Table interfaces */ acpi_physical_address acpi_os_get_root_pointer(void); -acpi_status -acpi_os_predefined_override(const struct acpi_predefined_names *init_val, - acpi_string * new_val); - -acpi_status -acpi_os_table_override(struct acpi_table_header *existing_table, - struct acpi_table_header **new_table); - -/* - * Spinlock primitives - */ -acpi_status acpi_os_create_lock(acpi_spinlock * out_handle); - -void acpi_os_delete_lock(acpi_spinlock handle); - -acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); - -void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags); - /* - * Semaphore primitives + * Memory mapping */ -acpi_status -acpi_os_create_semaphore(u32 max_units, - u32 initial_units, acpi_semaphore * out_handle); - -acpi_status acpi_os_delete_semaphore(acpi_semaphore handle); - -acpi_status -acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout); - -acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units); - -/* - * Mutex primitives - */ -acpi_status acpi_os_create_mutex(acpi_mutex * out_handle); - -void acpi_os_delete_mutex(acpi_mutex handle); - -acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout); - -void acpi_os_release_mutex(acpi_mutex handle); - -/* Temporary macros for Mutex* interfaces, map to existing semaphore xfaces */ - -#define acpi_os_create_mutex(out_handle) acpi_os_create_semaphore (1, 1, out_handle) -#define acpi_os_delete_mutex(handle) (void) acpi_os_delete_semaphore (handle) -#define acpi_os_acquire_mutex(handle,time) acpi_os_wait_semaphore (handle, 1, time) -#define acpi_os_release_mutex(handle) (void) acpi_os_signal_semaphore (handle, 1) - -/* - * Memory allocation and mapping - */ -void *acpi_os_allocate(acpi_size size); - void __iomem *acpi_os_map_memory(acpi_physical_address where, acpi_native_uint length); void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); -#ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_os_get_physical_address(void *logical_address, - acpi_physical_address * physical_address); -#endif - -/* - * Memory/Object Cache - */ -acpi_status -acpi_os_create_cache(char *cache_name, - u16 object_size, - u16 max_depth, acpi_cache_t ** return_cache); - -acpi_status acpi_os_delete_cache(acpi_cache_t * cache); - -acpi_status acpi_os_purge_cache(acpi_cache_t * cache); - -void *acpi_os_acquire_object(acpi_cache_t * cache); - -acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); - -/* - * Interrupt handlers - */ -acpi_status -acpi_os_install_interrupt_handler(u32 gsi, - acpi_osd_handler service_routine, - void *context); - -acpi_status -acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); - -void acpi_os_gpe_count(u32 gpe_number); -void acpi_os_fixed_event_count(u32 fixed_event_number); - -/* - * Threads and Scheduling - */ -acpi_thread_id acpi_os_get_thread_id(void); - -acpi_status -acpi_os_execute(acpi_execute_type type, - acpi_osd_exec_callback function, void *context); - -void acpi_os_wait_events_complete(void *context); - -void acpi_os_sleep(acpi_integer milliseconds); - -void acpi_os_stall(u32 microseconds); - /* * Platform and hardware-independent I/O interfaces */ @@ -216,68 +80,10 @@ acpi_status acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width); /* - * Platform and hardware-independent PCI configuration space access - * Note: Can't use "Register" as a parameter, changed to "Reg" -- - * certain compilers complain. - */ -acpi_status -acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, - u32 reg, u32 *value, u32 width); - -acpi_status -acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, - u32 reg, acpi_integer value, u32 width); - -/* - * Interim function needed for PCI IRQ routing - */ -void -acpi_os_derive_pci_id(acpi_handle rhandle, - acpi_handle chandle, struct acpi_pci_id **pci_id); - -/* - * Miscellaneous - */ -acpi_status acpi_os_validate_interface(char *interface); -acpi_status acpi_osi_invalidate(char* interface); - -acpi_status -acpi_os_validate_address(u8 space_id, acpi_physical_address address, - acpi_size length, char *name); - -u64 acpi_os_get_timer(void); - -acpi_status acpi_os_signal(u32 function, void *info); - -/* * Debug print routines */ void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...); void acpi_os_vprintf(const char *format, va_list args); -void acpi_os_redirect_output(void *destination); - -#ifdef ACPI_FUTURE_USAGE -/* - * Debug input - */ -u32 acpi_os_get_line(char *buffer); -#endif - -/* - * Directory manipulation - */ -void *acpi_os_open_directory(char *pathname, - char *wildcard_spec, char requested_file_type); - -/* requeste_file_type values */ - -#define REQUEST_FILE_ONLY 0 -#define REQUEST_DIR_ONLY 1 - -char *acpi_os_get_next_filename(void *dir_handle); - -void acpi_os_close_directory(void *dir_handle); - #endif /* __ACPIOSXF_H__ */ --- 2011-02-10.orig/xen/include/acpi/acpixf.h +++ 2011-02-10/xen/include/acpi/acpixf.h @@ -55,44 +55,8 @@ acpi_status acpi_initialize_tables(struct acpi_table_desc *initial_storage, u32 initial_table_count, u8 allow_resize); -acpi_status acpi_initialize_subsystem(void); - -acpi_status acpi_enable_subsystem(u32 flags); - -acpi_status acpi_initialize_objects(u32 flags); - -acpi_status acpi_terminate(void); - -#ifdef ACPI_FUTURE_USAGE -acpi_status acpi_subsystem_status(void); -#endif - -acpi_status acpi_enable(void); - -acpi_status acpi_disable(void); - -#ifdef ACPI_FUTURE_USAGE -acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); -#endif - const char *acpi_format_exception(acpi_status exception); -acpi_status acpi_purge_cached_objects(void); - -#ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_install_initialization_handler(acpi_init_handler handler, u32 function); -#endif - -/* - * ACPI Memory management - */ -void *acpi_allocate(u32 size); - -void *acpi_callocate(u32 size); - -void acpi_free(void *address); - /* * ACPI table manipulation interfaces */ @@ -104,8 +68,6 @@ acpi_status acpi_load_tables(void); acpi_status acpi_load_table(struct acpi_table_header *table_ptr); -acpi_status acpi_unload_table_id(acpi_owner_id id); - acpi_status acpi_get_table_header(acpi_string signature, acpi_native_uint instance, @@ -115,207 +77,28 @@ acpi_status acpi_get_table(acpi_string signature, acpi_native_uint instance, struct acpi_table_header **out_table); -acpi_status -acpi_get_table_by_index(acpi_native_uint table_index, - struct acpi_table_header **out_table); - /* * Namespace and name interfaces */ acpi_status -acpi_walk_namespace(acpi_object_type type, - acpi_handle start_object, - u32 max_depth, - acpi_walk_callback user_function, - void *context, void **return_value); - -acpi_status -acpi_get_devices(const char *HID, - acpi_walk_callback user_function, - void *context, void **return_value); - -acpi_status -acpi_get_name(acpi_handle handle, - u32 name_type, struct acpi_buffer *ret_path_ptr); - -acpi_status acpi_get_handle(acpi_handle parent, acpi_string pathname, acpi_handle * ret_handle); acpi_status -acpi_attach_data(acpi_handle obj_handle, - acpi_object_handler handler, void *data); - -acpi_status -acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler); - -acpi_status -acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); - -acpi_status acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags); -/* - * Object manipulation and enumeration - */ -acpi_status -acpi_evaluate_object(acpi_handle object, - acpi_string pathname, - struct acpi_object_list *parameter_objects, - struct acpi_buffer *return_object_buffer); - -#ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_evaluate_object_typed(acpi_handle object, - acpi_string pathname, - struct acpi_object_list *external_params, - struct acpi_buffer *return_buffer, - acpi_object_type return_type); -#endif - acpi_status acpi_get_object_info(acpi_handle handle, struct acpi_buffer *return_buffer); -acpi_status -acpi_get_next_object(acpi_object_type type, - acpi_handle parent, - acpi_handle child, acpi_handle * out_handle); - acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type); -acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type); - acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle); /* - * Event handler interfaces - */ -acpi_status -acpi_install_fixed_event_handler(u32 acpi_event, - acpi_event_handler handler, void *context); - -acpi_status -acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler); - -acpi_status -acpi_install_notify_handler(acpi_handle device, - u32 handler_type, - acpi_notify_handler handler, void *context); - -acpi_status -acpi_remove_notify_handler(acpi_handle device, - u32 handler_type, acpi_notify_handler handler); - -acpi_status -acpi_install_address_space_handler(acpi_handle device, - acpi_adr_space_type space_id, - acpi_adr_space_handler handler, - acpi_adr_space_setup setup, void *context); - -acpi_status -acpi_remove_address_space_handler(acpi_handle device, - acpi_adr_space_type space_id, - acpi_adr_space_handler handler); - -acpi_status -acpi_install_gpe_handler(acpi_handle gpe_device, - u32 gpe_number, - u32 type, acpi_event_handler address, void *context); - -#ifdef ACPI_FUTURE_USAGE -acpi_status acpi_install_exception_handler(acpi_exception_handler handler); -#endif - -/* - * Event interfaces - */ -acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); - -acpi_status acpi_release_global_lock(u32 handle); - -acpi_status -acpi_remove_gpe_handler(acpi_handle gpe_device, - u32 gpe_number, acpi_event_handler address); - -acpi_status acpi_enable_event(u32 event, u32 flags); - -acpi_status acpi_disable_event(u32 event, u32 flags); - -acpi_status acpi_clear_event(u32 event); - -#ifdef ACPI_FUTURE_USAGE -acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); -#endif /* ACPI_FUTURE_USAGE */ - -acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type); - -acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); - -acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); - -acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); - -#ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_get_gpe_status(acpi_handle gpe_device, - u32 gpe_number, - u32 flags, acpi_event_status * event_status); -#endif /* ACPI_FUTURE_USAGE */ - -acpi_status -acpi_install_gpe_block(acpi_handle gpe_device, - struct acpi_generic_address *gpe_block_address, - u32 register_count, u32 interrupt_number); - -acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); - -/* - * Resource interfaces - */ -typedef -acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, - void *context); - -acpi_status -acpi_get_vendor_resource(acpi_handle device_handle, - char *name, - struct acpi_vendor_uuid *uuid, - struct acpi_buffer *ret_buffer); - -acpi_status -acpi_get_current_resources(acpi_handle device_handle, - struct acpi_buffer *ret_buffer); - -#ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_get_possible_resources(acpi_handle device_handle, - struct acpi_buffer *ret_buffer); -#endif - -acpi_status -acpi_walk_resources(acpi_handle device_handle, - char *name, - acpi_walk_resource_callback user_function, void *context); - -acpi_status -acpi_set_current_resources(acpi_handle device_handle, - struct acpi_buffer *in_buffer); - -acpi_status -acpi_get_irq_routing_table(acpi_handle bus_device_handle, - struct acpi_buffer *ret_buffer); - -acpi_status -acpi_resource_to_address64(struct acpi_resource *resource, - struct acpi_resource_address64 *out); - -/* * Hardware (ACPI device) interfaces */ acpi_status acpi_get_register(u32 register_id, u32 * return_value); -acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value); - acpi_status acpi_set_register(u32 register_id, u32 value); acpi_status --- 2011-02-10.orig/xen/include/acpi/acstruct.h +++ /dev/null @@ -1,231 +0,0 @@ -/****************************************************************************** - * - * Name: acstruct.h - Internal structs - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2007, R. Byron Moore - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#ifndef __ACSTRUCT_H__ -#define __ACSTRUCT_H__ - -/* acpisrc:struct_defs -- for acpisrc conversion */ - -/***************************************************************************** - * - * Tree walking typedefs and structs - * - ****************************************************************************/ - -/* - * Walk state - current state of a parse tree walk. Used for both a leisurely - * stroll through the tree (for whatever reason), and for control method - * execution. - */ -#define ACPI_NEXT_OP_DOWNWARD 1 -#define ACPI_NEXT_OP_UPWARD 2 - -/* - * Groups of definitions for walk_type used for different implementations of - * walkers (never simultaneously) - flags for interpreter: - */ -#define ACPI_WALK_NON_METHOD 0 -#define ACPI_WALK_METHOD 0x01 -#define ACPI_WALK_METHOD_RESTART 0x02 - -/* Flags for i_aSL compiler only */ - -#define ACPI_WALK_CONST_REQUIRED 0x10 -#define ACPI_WALK_CONST_OPTIONAL 0x20 - -struct acpi_walk_state { - struct acpi_walk_state *next; /* Next walk_state in list */ - u8 descriptor_type; /* To differentiate various internal objs */ - u8 walk_type; - u16 opcode; /* Current AML opcode */ - u8 next_op_info; /* Info about next_op */ - u8 num_operands; /* Stack pointer for Operands[] array */ - acpi_owner_id owner_id; /* Owner of objects created during the walk */ - u8 last_predicate; /* Result of last predicate */ - u8 current_result; - u8 return_used; - u8 scope_depth; - u8 pass_number; /* Parse pass during table load */ - u32 aml_offset; - u32 arg_types; - u32 method_breakpoint; /* For single stepping */ - u32 user_breakpoint; /* User AML breakpoint */ - u32 parse_flags; - - struct acpi_parse_state parser_state; /* Current state of parser */ - u32 prev_arg_types; - u32 arg_count; /* push for fixed or var args */ - - struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ - struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ - union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ - union acpi_operand_object **params; - - u8 *aml_last_while; - union acpi_operand_object **caller_return_desc; - union acpi_generic_state *control_state; /* List of control states (nested IFs) */ - struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ - struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ - union acpi_operand_object *implicit_return_obj; - struct acpi_namespace_node *method_call_node; /* Called method Node */ - union acpi_parse_object *method_call_op; /* method_call Op if running a method */ - union acpi_operand_object *method_desc; /* Method descriptor if running a method */ - struct acpi_namespace_node *method_node; /* Method node if running a method. */ - union acpi_parse_object *op; /* Current parser op */ - const struct acpi_opcode_info *op_info; /* Info on current opcode */ - union acpi_parse_object *origin; /* Start of walk [Obsolete] */ - union acpi_operand_object *result_obj; - union acpi_generic_state *results; /* Stack of accumulated results */ - union acpi_operand_object *return_desc; /* Return object, if any */ - union acpi_generic_state *scope_info; /* Stack of nested scopes */ - union acpi_parse_object *prev_op; /* Last op that was processed */ - union acpi_parse_object *next_op; /* next op to be processed */ - struct acpi_thread_state *thread; - acpi_parse_downwards descending_callback; - acpi_parse_upwards ascending_callback; -}; - -/* Info used by acpi_ps_init_objects */ - -struct acpi_init_walk_info { - u16 method_count; - u16 device_count; - u16 op_region_count; - u16 field_count; - u16 buffer_count; - u16 package_count; - u16 op_region_init; - u16 field_init; - u16 buffer_init; - u16 package_init; - u16 object_count; - acpi_owner_id owner_id; - acpi_native_uint table_index; -}; - -struct acpi_get_devices_info { - acpi_walk_callback user_function; - void *context; - const char *hid; -}; - -union acpi_aml_operands { - union acpi_operand_object *operands[7]; - - struct { - struct acpi_object_integer *type; - struct acpi_object_integer *code; - struct acpi_object_integer *argument; - - } fatal; - - struct { - union acpi_operand_object *source; - struct acpi_object_integer *index; - union acpi_operand_object *target; - - } index; - - struct { - union acpi_operand_object *source; - struct acpi_object_integer *index; - struct acpi_object_integer *length; - union acpi_operand_object *target; - - } mid; -}; - -/* - * Structure used to pass object evaluation parameters. - * Purpose is to reduce CPU stack use. - */ -struct acpi_evaluate_info { - struct acpi_namespace_node *prefix_node; - char *pathname; - union acpi_operand_object *obj_desc; - union acpi_operand_object **parameters; - struct acpi_namespace_node *resolved_node; - union acpi_operand_object *return_object; - u8 pass_number; - u8 parameter_type; - u8 return_object_type; - u8 flags; -}; - -/* Types for parameter_type above */ - -#define ACPI_PARAM_ARGS 0 -#define ACPI_PARAM_GPE 1 - -/* Values for Flags above */ - -#define ACPI_IGNORE_RETURN_VALUE 1 - -/* Info used by acpi_ns_initialize_devices */ - -struct acpi_device_walk_info { - u16 device_count; - u16 num_STA; - u16 num_INI; - struct acpi_table_desc *table_desc; - struct acpi_evaluate_info *evaluate_info; -}; - -/* TBD: [Restructure] Merge with struct above */ - -struct acpi_walk_info { - u32 debug_level; - u32 count; - acpi_owner_id owner_id; - u8 display_type; -}; - -/* Display Types */ - -#define ACPI_DISPLAY_SUMMARY (u8) 0 -#define ACPI_DISPLAY_OBJECTS (u8) 1 -#define ACPI_DISPLAY_MASK (u8) 1 - -#define ACPI_DISPLAY_SHORT (u8) 2 - -#endif --- 2011-02-10.orig/xen/include/acpi/actables.h +++ 2011-02-10/xen/include/acpi/actables.h @@ -81,15 +81,6 @@ void acpi_tb_delete_table(struct acpi_ta void acpi_tb_terminate(void); -void acpi_tb_delete_namespace_by_owner(acpi_native_uint table_index); - -acpi_status acpi_tb_allocate_owner_id(acpi_native_uint table_index); - -acpi_status acpi_tb_release_owner_id(acpi_native_uint table_index); - -acpi_status -acpi_tb_get_owner_id(acpi_native_uint table_index, acpi_owner_id * owner_id); - u8 acpi_tb_is_table_loaded(acpi_native_uint table_index); void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded); @@ -97,8 +88,6 @@ void acpi_tb_set_table_loaded_flag(acpi_ /* * tbutils - table manager utilities */ -u8 acpi_tb_tables_loaded(void); - void acpi_tb_print_table_header(acpi_physical_address address, struct acpi_table_header *header); --- 2011-02-10.orig/xen/include/acpi/actypes.h +++ 2011-02-10/xen/include/acpi/actypes.h @@ -222,24 +222,6 @@ typedef acpi_native_uint acpi_size; #define acpi_thread_id acpi_native_uint #endif -/* Object returned from acpi_os_create_lock */ - -#ifndef acpi_spinlock -#define acpi_spinlock void * -#endif - -/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */ - -#ifndef acpi_cpu_flags -#define acpi_cpu_flags acpi_native_uint -#endif - -/* Object returned from acpi_os_create_cache */ - -#ifndef acpi_cache_t -#define acpi_cache_t struct acpi_memory_list -#endif - /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ #ifndef acpi_uintptr_t @@ -539,62 +521,6 @@ typedef u32 acpi_event_status; #define ACPI_EVENT_FLAG_WAKE_ENABLED (acpi_event_status) 0x02 #define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04 -/* - * General Purpose Events (GPE) - */ -#define ACPI_GPE_INVALID 0xFF -#define ACPI_GPE_MAX 0xFF -#define ACPI_NUM_GPE 256 - -#define ACPI_GPE_ENABLE 0 -#define ACPI_GPE_DISABLE 1 - -/* - * GPE info flags - Per GPE - * +-+-+-+---+---+-+ - * |7|6|5|4:3|2:1|0| - * +-+-+-+---+---+-+ - * | | | | | | - * | | | | | +--- Interrupt type: Edge or Level Triggered - * | | | | +--- Type: Wake-only, Runtime-only, or wake/runtime - * | | | +--- Type of dispatch -- to method, handler, or none - * | | +--- Enabled for runtime? - * | +--- Enabled for wake? - * +--- Unused - */ -#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01 -#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01 -#define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00 - -#define ACPI_GPE_TYPE_MASK (u8) 0x06 -#define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06 -#define ACPI_GPE_TYPE_WAKE (u8) 0x02 -#define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */ - -#define ACPI_GPE_DISPATCH_MASK (u8) 0x18 -#define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08 -#define ACPI_GPE_DISPATCH_METHOD (u8) 0x10 -#define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */ - -#define ACPI_GPE_RUN_ENABLE_MASK (u8) 0x20 -#define ACPI_GPE_RUN_ENABLED (u8) 0x20 -#define ACPI_GPE_RUN_DISABLED (u8) 0x00 /* Default */ - -#define ACPI_GPE_WAKE_ENABLE_MASK (u8) 0x40 -#define ACPI_GPE_WAKE_ENABLED (u8) 0x40 -#define ACPI_GPE_WAKE_DISABLED (u8) 0x00 /* Default */ - -#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */ - -/* - * Flags for GPE and Lock interfaces - */ -#define ACPI_EVENT_WAKE_ENABLE 0x2 /* acpi_gpe_enable */ -#define ACPI_EVENT_WAKE_DISABLE 0x2 /* acpi_gpe_disable */ - -#define ACPI_NOT_ISR 0x1 -#define ACPI_ISR 0x0 - /* Notify types */ #define ACPI_SYSTEM_NOTIFY 0x1 @@ -720,175 +646,6 @@ struct acpi_buffer { }; /* - * name_type for acpi_get_name - */ -#define ACPI_FULL_PATHNAME 0 -#define ACPI_SINGLE_NAME 1 -#define ACPI_NAME_TYPE_MAX 1 - -/* - * Structure and flags for acpi_get_system_info - */ -#define ACPI_SYS_MODE_UNKNOWN 0x0000 -#define ACPI_SYS_MODE_ACPI 0x0001 -#define ACPI_SYS_MODE_LEGACY 0x0002 -#define ACPI_SYS_MODES_MASK 0x0003 - -/* - * System info returned by acpi_get_system_info() - */ -struct acpi_system_info { - u32 acpi_ca_version; - u32 flags; - u32 timer_resolution; - u32 reserved1; - u32 reserved2; - u32 debug_level; - u32 debug_layer; -}; - -/* - * Types specific to the OS service interfaces - */ -typedef u32(ACPI_SYSTEM_XFACE * acpi_osd_handler) (void *context); - -typedef void - (ACPI_SYSTEM_XFACE * acpi_osd_exec_callback) (void *context); - -/* - * Various handlers and callback procedures - */ -typedef u32(*acpi_event_handler) (void *context); - -typedef -void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context); - -typedef -void (*acpi_object_handler) (acpi_handle object, u32 function, void *data); - -typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function); - -#define ACPI_INIT_DEVICE_INI 1 - -typedef -acpi_status(*acpi_exception_handler) (acpi_status aml_status, - acpi_name name, - u16 opcode, - u32 aml_offset, void *context); - -/* Address Spaces (For Operation Regions) */ - -typedef -acpi_status(*acpi_adr_space_handler) (u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer * value, - void *handler_context, - void *region_context); - -#define ACPI_DEFAULT_HANDLER NULL - -typedef -acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, - u32 function, - void *handler_context, - void **region_context); - -#define ACPI_REGION_ACTIVATE 0 -#define ACPI_REGION_DEACTIVATE 1 - -typedef -acpi_status(*acpi_walk_callback) (acpi_handle obj_handle, - u32 nesting_level, - void *context, void **return_value); - -/* Interrupt handler return values */ - -#define ACPI_INTERRUPT_NOT_HANDLED 0x00 -#define ACPI_INTERRUPT_HANDLED 0x01 - -/* Common string version of device HIDs and UIDs */ - -struct acpica_device_id { - char value[ACPI_DEVICE_ID_LENGTH]; -}; - -/* Common string version of device CIDs */ - -struct acpi_compatible_id { - char value[ACPI_MAX_CID_LENGTH]; -}; - -struct acpi_compatible_id_list { - u32 count; - u32 size; - struct acpi_compatible_id id[1]; -}; - -/* Structure and flags for acpi_get_object_info */ - -#define ACPI_VALID_STA 0x0001 -#define ACPI_VALID_ADR 0x0002 -#define ACPI_VALID_HID 0x0004 -#define ACPI_VALID_UID 0x0008 -#define ACPI_VALID_CID 0x0010 -#define ACPI_VALID_SXDS 0x0020 - -/* Flags for _STA method */ - -#define ACPI_STA_DEVICE_PRESENT 0x01 -#define ACPI_STA_DEVICE_ENABLED 0x02 -#define ACPI_STA_DEVICE_UI 0x04 -#define ACPI_STA_DEVICE_FUNCTIONING 0x08 -#define ACPI_STA_DEVICE_OK 0x08 /* Synonym */ -#define ACPI_STA_BATTERY_PRESENT 0x10 - -#define ACPI_COMMON_OBJ_INFO \ - acpi_object_type type; /* ACPI object type */ \ - acpi_name name /* ACPI object Name */ - -struct acpi_obj_info_header { - ACPI_COMMON_OBJ_INFO; -}; - -/* Structure returned from Get Object Info */ - -struct acpi_device_info { - ACPI_COMMON_OBJ_INFO; - - u32 valid; /* Indicates which fields below are valid */ - u32 current_status; /* _STA value */ - acpi_integer address; /* _ADR value if any */ - struct acpica_device_id hardware_id; /* _HID value if any */ - struct acpica_device_id unique_id; /* _UID value if any */ - u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ - struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ -}; - -/* Context structs for address space handlers */ - -struct acpi_pci_id { - u16 segment; - u16 bus; - u16 device; - u16 function; -}; - -struct acpi_mem_space_context { - u32 length; - acpi_physical_address address; - acpi_physical_address mapped_physical_address; - u8 *mapped_logical_address; - acpi_size mapped_length; -}; - -/* - * Definitions for Resource Attributes - */ -typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ -typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */ - -/* * Memory Attributes */ #define ACPI_READ_ONLY_MEMORY (u8) 0x00 @@ -968,270 +725,4 @@ typedef u32 acpi_rsdesc_size; /* Max Res #define ACPI_PRODUCER (u8) 0x00 #define ACPI_CONSUMER (u8) 0x01 -/* - * If possible, pack the following structures to byte alignment - */ -#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED -#pragma pack(1) -#endif - -/* UUID data structures for use in vendor-defined resource descriptors */ - -struct acpi_uuid { - u8 data[ACPI_UUID_LENGTH]; -}; - -struct acpi_vendor_uuid { - u8 subtype; - u8 data[ACPI_UUID_LENGTH]; -}; - -/* - * Structures used to describe device resources - */ -struct acpi_resource_irq { - u8 triggering; - u8 polarity; - u8 sharable; - u8 interrupt_count; - u8 interrupts[1]; -}; - -struct acpi_resource_dma { - u8 type; - u8 bus_master; - u8 transfer; - u8 channel_count; - u8 channels[1]; -}; - -struct acpi_resource_start_dependent { - u8 compatibility_priority; - u8 performance_robustness; -}; - -/* - * END_DEPENDENT_FUNCTIONS_RESOURCE struct is not - * needed because it has no fields - */ - -struct acpi_resource_io { - u8 io_decode; - u8 alignment; - u8 address_length; - u16 minimum; - u16 maximum; -}; - -struct acpi_resource_fixed_io { - u16 address; - u8 address_length; -}; - -struct acpi_resource_vendor { - u16 byte_length; - u8 byte_data[1]; -}; - -/* Vendor resource with UUID info (introduced in ACPI 3.0) */ - -struct acpi_resource_vendor_typed { - u16 byte_length; - u8 uuid_subtype; - u8 uuid[ACPI_UUID_LENGTH]; - u8 byte_data[1]; -}; - -struct acpi_resource_end_tag { - u8 checksum; -}; - -struct acpi_resource_memory24 { - u8 write_protect; - u16 minimum; - u16 maximum; - u16 alignment; - u16 address_length; -}; - -struct acpi_resource_memory32 { - u8 write_protect; - u32 minimum; - u32 maximum; - u32 alignment; - u32 address_length; -}; - -struct acpi_resource_fixed_memory32 { - u8 write_protect; - u32 address; - u32 address_length; -}; - -struct acpi_memory_attribute { - u8 write_protect; - u8 caching; - u8 range_type; - u8 translation; -}; - -struct acpi_io_attribute { - u8 range_type; - u8 translation; - u8 translation_type; - u8 reserved1; -}; - -union acpi_resource_attribute { - struct acpi_memory_attribute mem; - struct acpi_io_attribute io; - - /* Used for the *word_space macros */ - - u8 type_specific; -}; - -struct acpi_resource_source { - u8 index; - u16 string_length; - char *string_ptr; -}; - -/* Fields common to all address descriptors, 16/32/64 bit */ - -#define ACPI_RESOURCE_ADDRESS_COMMON \ - u8 resource_type; \ - u8 producer_consumer; \ - u8 decode; \ - u8 min_address_fixed; \ - u8 max_address_fixed; \ - union acpi_resource_attribute info; - -struct acpi_resource_address { -ACPI_RESOURCE_ADDRESS_COMMON}; - -struct acpi_resource_address16 { - ACPI_RESOURCE_ADDRESS_COMMON u16 granularity; - u16 minimum; - u16 maximum; - u16 translation_offset; - u16 address_length; - struct acpi_resource_source resource_source; -}; - -struct acpi_resource_address32 { - ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; - u32 minimum; - u32 maximum; - u32 translation_offset; - u32 address_length; - struct acpi_resource_source resource_source; -}; - -struct acpi_resource_address64 { - ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; - u64 minimum; - u64 maximum; - u64 translation_offset; - u64 address_length; - struct acpi_resource_source resource_source; -}; - -struct acpi_resource_extended_address64 { - ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD; - u64 granularity; - u64 minimum; - u64 maximum; - u64 translation_offset; - u64 address_length; - u64 type_specific; -}; - -struct acpi_resource_extended_irq { - u8 producer_consumer; - u8 triggering; - u8 polarity; - u8 sharable; - u8 interrupt_count; - struct acpi_resource_source resource_source; - u32 interrupts[1]; -}; - -struct acpi_resource_generic_register { - u8 space_id; - u8 bit_width; - u8 bit_offset; - u8 access_size; - u64 address; -}; - -/* ACPI_RESOURCE_TYPEs */ - -#define ACPI_RESOURCE_TYPE_IRQ 0 -#define ACPI_RESOURCE_TYPE_DMA 1 -#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2 -#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3 -#define ACPI_RESOURCE_TYPE_IO 4 -#define ACPI_RESOURCE_TYPE_FIXED_IO 5 -#define ACPI_RESOURCE_TYPE_VENDOR 6 -#define ACPI_RESOURCE_TYPE_END_TAG 7 -#define ACPI_RESOURCE_TYPE_MEMORY24 8 -#define ACPI_RESOURCE_TYPE_MEMORY32 9 -#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10 -#define ACPI_RESOURCE_TYPE_ADDRESS16 11 -#define ACPI_RESOURCE_TYPE_ADDRESS32 12 -#define ACPI_RESOURCE_TYPE_ADDRESS64 13 -#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ -#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 -#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 -#define ACPI_RESOURCE_TYPE_MAX 16 - -union acpi_resource_data { - struct acpi_resource_irq irq; - struct acpi_resource_dma dma; - struct acpi_resource_start_dependent start_dpf; - struct acpi_resource_io io; - struct acpi_resource_fixed_io fixed_io; - struct acpi_resource_vendor vendor; - struct acpi_resource_vendor_typed vendor_typed; - struct acpi_resource_end_tag end_tag; - struct acpi_resource_memory24 memory24; - struct acpi_resource_memory32 memory32; - struct acpi_resource_fixed_memory32 fixed_memory32; - struct acpi_resource_address16 address16; - struct acpi_resource_address32 address32; - struct acpi_resource_address64 address64; - struct acpi_resource_extended_address64 ext_address64; - struct acpi_resource_extended_irq extended_irq; - struct acpi_resource_generic_register generic_reg; - - /* Common fields */ - - struct acpi_resource_address address; /* Common 16/32/64 address fields */ -}; - -struct acpi_resource { - u32 type; - u32 length; - union acpi_resource_data data; -}; - -/* restore default alignment */ - -#pragma pack() - -#define ACPI_RS_SIZE_MIN 12 -#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */ -#define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) - -#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) - -struct acpi_pci_routing_table { - u32 length; - u32 pin; - acpi_integer address; /* here for 64-bit alignment */ - u32 source_index; - char source[4]; /* pad to 64 bits so sizeof() works in all cases */ -}; - #endif /* __ACTYPES_H__ */ --- 2011-02-10.orig/xen/include/acpi/acutils.h +++ 2011-02-10/xen/include/acpi/acutils.h @@ -44,32 +44,6 @@ #ifndef _ACUTILS_H #define _ACUTILS_H -extern const u8 acpi_gbl_resource_aml_sizes[]; - -/* Strings used by the disassembler and debugger resource dump routines */ - -#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) - -extern const char *acpi_gbl_bm_decode[]; -extern const char *acpi_gbl_config_decode[]; -extern const char *acpi_gbl_consume_decode[]; -extern const char *acpi_gbl_dec_decode[]; -extern const char *acpi_gbl_he_decode[]; -extern const char *acpi_gbl_io_decode[]; -extern const char *acpi_gbl_ll_decode[]; -extern const char *acpi_gbl_max_decode[]; -extern const char *acpi_gbl_mem_decode[]; -extern const char *acpi_gbl_min_decode[]; -extern const char *acpi_gbl_mtp_decode[]; -extern const char *acpi_gbl_rng_decode[]; -extern const char *acpi_gbl_rw_decode[]; -extern const char *acpi_gbl_shr_decode[]; -extern const char *acpi_gbl_siz_decode[]; -extern const char *acpi_gbl_trs_decode[]; -extern const char *acpi_gbl_ttp_decode[]; -extern const char *acpi_gbl_typ_decode[]; -#endif - /* Types for Resource descriptor entries */ #define ACPI_INVALID_RESOURCE 0 @@ -77,69 +51,10 @@ extern const char *acpi_gbl_typ_decode[] #define ACPI_VARIABLE_LENGTH 2 #define ACPI_SMALL_VARIABLE_LENGTH 3 -typedef -acpi_status(*acpi_walk_aml_callback) (u8 * aml, - u32 length, - u32 offset, - u8 resource_index, void **context); - -typedef -acpi_status(*acpi_pkg_callback) (u8 object_type, - union acpi_operand_object * source_object, - union acpi_generic_state * state, - void *context); - -struct acpi_pkg_info { - u8 *free_space; - acpi_size length; - u32 object_space; - u32 num_packages; -}; - -#define REF_INCREMENT (u16) 0 -#define REF_DECREMENT (u16) 1 -#define REF_FORCE_DELETE (u16) 2 - -/* acpi_ut_dump_buffer */ - -#define DB_BYTE_DISPLAY 1 -#define DB_WORD_DISPLAY 2 -#define DB_DWORD_DISPLAY 4 -#define DB_QWORD_DISPLAY 8 - /* * utglobal - Global data structures and procedures */ -void acpi_ut_init_globals(void); - -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) - -char *acpi_ut_get_mutex_name(u32 mutex_id); - -#endif - -char *acpi_ut_get_type_name(acpi_object_type type); - -char *acpi_ut_get_node_name(void *object); - -char *acpi_ut_get_descriptor_name(void *object); - -char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc); - -char *acpi_ut_get_region_name(u8 space_id); - -char *acpi_ut_get_event_name(u32 event_id); - -char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position); - -u8 acpi_ut_valid_object_type(acpi_object_type type); - -/* - * utinit - miscellaneous initialization and shutdown - */ -acpi_status acpi_ut_hardware_initialize(void); - -void acpi_ut_subsystem_shutdown(void); +const char *acpi_ut_get_region_name(u8 space_id); /* * utclib - Local implementations of C library functions @@ -200,45 +115,8 @@ extern const u8 _acpi_ctype[]; #endif /* ACPI_USE_SYSTEM_CLIBRARY */ /* - * utcopy - Object construction and conversion interfaces - */ -acpi_status -acpi_ut_build_simple_object(union acpi_operand_object *obj, - union acpi_object *user_obj, - u8 * data_space, u32 * buffer_space_used); - -acpi_status -acpi_ut_build_package_object(union acpi_operand_object *obj, - u8 * buffer, u32 * space_used); - -acpi_status -acpi_ut_copy_iobject_to_eobject(union acpi_operand_object *obj, - struct acpi_buffer *ret_buffer); - -acpi_status -acpi_ut_copy_eobject_to_iobject(union acpi_object *obj, - union acpi_operand_object **internal_obj); - -acpi_status -acpi_ut_copy_isimple_to_isimple(union acpi_operand_object *source_obj, - union acpi_operand_object *dest_obj); - -acpi_status -acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc, - union acpi_operand_object **dest_desc, - struct acpi_walk_state *walk_state); - -/* - * utcreate - Object creation - */ -acpi_status -acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action); - -/* * utdebug - Debug interfaces */ -void acpi_ut_init_stack_ptr_trace(void); - void acpi_ut_track_stack_ptr(void); void @@ -279,16 +157,6 @@ acpi_ut_ptr_exit(u32 line_number, const char *function_name, char *module_name, u32 component_id, u8 * ptr); -void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); - -void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display); - -void acpi_ut_report_error(char *module_name, u32 line_number); - -void acpi_ut_report_info(char *module_name, u32 line_number); - -void acpi_ut_report_warning(char *module_name, u32 line_number); - /* Error and message reporting interfaces */ void ACPI_INTERNAL_VAR_XFACE @@ -324,248 +192,8 @@ acpi_ut_info(char *module_name, u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); /* - * utdelete - Object deletion and reference counts - */ -void acpi_ut_add_reference(union acpi_operand_object *object); - -void acpi_ut_remove_reference(union acpi_operand_object *object); - -void acpi_ut_delete_internal_package_object(union acpi_operand_object *object); - -void acpi_ut_delete_internal_simple_object(union acpi_operand_object *object); - -void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list); - -/* - * uteval - object evaluation - */ -acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state); - -acpi_status -acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, - char *path, - u32 expected_return_btypes, - union acpi_operand_object **return_desc); - -acpi_status -acpi_ut_evaluate_numeric_object(char *object_name, - struct acpi_namespace_node *device_node, - acpi_integer * address); - -acpi_status -acpi_ut_execute_HID(struct acpi_namespace_node *device_node, - struct acpica_device_id *hid); - -acpi_status -acpi_ut_execute_CID(struct acpi_namespace_node *device_node, - struct acpi_compatible_id_list **return_cid_list); - -acpi_status -acpi_ut_execute_STA(struct acpi_namespace_node *device_node, - u32 * status_flags); - -acpi_status -acpi_ut_execute_UID(struct acpi_namespace_node *device_node, - struct acpica_device_id *uid); - -acpi_status -acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); - -/* - * utobject - internal object create/delete/cache routines - */ -union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name, - u32 line_number, - u32 component_id, - acpi_object_type - type); - -void *acpi_ut_allocate_object_desc_dbg(char *module_name, - u32 line_number, u32 component_id); - -#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t) -#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT) - -void acpi_ut_delete_object_desc(union acpi_operand_object *object); - -u8 acpi_ut_valid_internal_object(void *object); - -union acpi_operand_object *acpi_ut_create_package_object(u32 count); - -union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); - -union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); - -acpi_status -acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size * obj_length); - -/* - * utstate - Generic state creation/cache routines - */ -void -acpi_ut_push_generic_state(union acpi_generic_state **list_head, - union acpi_generic_state *state); - -union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state - **list_head); - -union acpi_generic_state *acpi_ut_create_generic_state(void); - -struct acpi_thread_state *acpi_ut_create_thread_state(void); - -union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object - *object, u16 action); - -union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, - void *external_object, - u16 index); - -acpi_status -acpi_ut_create_update_state_and_push(union acpi_operand_object *object, - u16 action, - union acpi_generic_state **state_list); - -#ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_ut_create_pkg_state_and_push(void *internal_object, - void *external_object, - u16 index, - union acpi_generic_state **state_list); -#endif /* ACPI_FUTURE_USAGE */ - -union acpi_generic_state *acpi_ut_create_control_state(void); - -void acpi_ut_delete_generic_state(union acpi_generic_state *state); - -/* - * utmath - */ -acpi_status -acpi_ut_divide(acpi_integer in_dividend, - acpi_integer in_divisor, - acpi_integer * out_quotient, acpi_integer * out_remainder); - -acpi_status -acpi_ut_short_divide(acpi_integer in_dividend, - u32 divisor, - acpi_integer * out_quotient, u32 * out_remainder); - -/* * utmisc */ const char *acpi_ut_validate_exception(acpi_status status); -u8 acpi_ut_is_aml_table(struct acpi_table_header *table); - -acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); - -void acpi_ut_release_owner_id(acpi_owner_id * owner_id); - -acpi_status -acpi_ut_walk_package_tree(union acpi_operand_object *source_object, - void *target_object, - acpi_pkg_callback walk_callback, void *context); - -void acpi_ut_strupr(char *src_string); - -void acpi_ut_print_string(char *string, u8 max_length); - -u8 acpi_ut_valid_acpi_name(u32 name); - -acpi_name acpi_ut_repair_name(char *name); - -u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position); - -acpi_status -acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); - -/* Values for Base above (16=Hex, 10=Decimal) */ - -#define ACPI_ANY_BASE 0 - -u32 acpi_ut_dword_byte_swap(u32 value); - -void acpi_ut_set_integer_width(u8 revision); - -#ifdef ACPI_DEBUG_OUTPUT -void -acpi_ut_display_init_pathname(u8 type, - struct acpi_namespace_node *obj_handle, - char *path); -#endif - -/* - * utresrc - */ -acpi_status -acpi_ut_walk_aml_resources(u8 * aml, - acpi_size aml_length, - acpi_walk_aml_callback user_function, - void **context); - -acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); - -u32 acpi_ut_get_descriptor_length(void *aml); - -u16 acpi_ut_get_resource_length(void *aml); - -u8 acpi_ut_get_resource_header_length(void *aml); - -u8 acpi_ut_get_resource_type(void *aml); - -acpi_status -acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, - u8 ** end_tag); - -/* - * utmutex - mutex support - */ -acpi_status acpi_ut_mutex_initialize(void); - -void acpi_ut_mutex_terminate(void); - -acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id); - -acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id); - -/* - * utalloc - memory allocation and object caching - */ -acpi_status acpi_ut_create_caches(void); - -acpi_status acpi_ut_delete_caches(void); - -acpi_status acpi_ut_validate_buffer(struct acpi_buffer *buffer); - -acpi_status -acpi_ut_initialize_buffer(struct acpi_buffer *buffer, - acpi_size required_length); - -void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); - -void *acpi_ut_allocate_zeroed(acpi_size size, - u32 component, char *module, u32 line); - -#ifdef ACPI_DBG_TRACK_ALLOCATIONS -void *acpi_ut_allocate_and_track(acpi_size size, - u32 component, char *module, u32 line); - -void *acpi_ut_allocate_zeroed_and_track(acpi_size size, - u32 component, char *module, u32 line); - -void -acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); - -#ifdef ACPI_FUTURE_USAGE -void acpi_ut_dump_allocation_info(void); -#endif /* ACPI_FUTURE_USAGE */ - -void acpi_ut_dump_allocations(u32 component, char *module); - -acpi_status -acpi_ut_create_list(char *list_name, - u16 object_size, struct acpi_memory_list **return_cache); - -#endif - #endif /* _ACUTILS_H */ --- 2011-02-10.orig/xen/include/asm-x86/acpi.h +++ 2011-02-10/xen/include/asm-x86/acpi.h @@ -84,8 +84,6 @@ extern bool_t acpi_disabled, acpi_pci_di extern bool_t acpi_skip_timer_override; extern u32 acpi_smi_cmd; extern u8 acpi_enable_value, acpi_disable_value; -extern u8 acpi_sci_flags; -extern int acpi_sci_override_gsi; void acpi_pic_sci_set_trigger(unsigned int, u16); static inline void disable_acpi(void) --- 2011-02-10.orig/xen/include/asm-x86/system.h +++ 2011-02-10/xen/include/asm-x86/system.h @@ -132,8 +132,6 @@ static always_inline unsigned long __cmp return old; } -#define __HAVE_ARCH_CMPXCHG - #define cmpxchgptr(ptr,o,n) ({ \ const __typeof__(**(ptr)) *__o = (o); \ __typeof__(**(ptr)) *__n = (n); \ --- 2011-02-10.orig/xen/include/xen/acpi.h +++ 2011-02-10/xen/include/xen/acpi.h @@ -32,21 +32,10 @@ #include #include -#include -#include #include #ifdef CONFIG_ACPI_BOOT -enum acpi_irq_model_id { - ACPI_IRQ_MODEL_PIC = 0, - ACPI_IRQ_MODEL_IOAPIC, - ACPI_IRQ_MODEL_IOSAPIC, - ACPI_IRQ_MODEL_COUNT -}; - -extern enum acpi_irq_model_id acpi_irq_model; - enum acpi_madt_entry_id { ACPI_MADT_LAPIC = 0, ACPI_MADT_IOAPIC, @@ -316,8 +305,6 @@ extern int acpi_mp_config; extern u32 pci_mmcfg_base_addr; -extern int sbf_port ; - #else /*!CONFIG_ACPI_BOOT*/ #define acpi_mp_config 0 @@ -346,67 +333,6 @@ int acpi_gsi_to_irq (u32 gsi, unsigned i void acpi_unregister_gsi (u32 gsi); #endif -#ifdef CONFIG_ACPI_PCI - -struct acpi_prt_entry { - struct list_head node; - struct acpi_pci_id id; - u8 pin; - struct { - acpi_handle handle; - u32 index; - } link; - u32 irq; -}; - -struct acpi_prt_list { - int count; - struct list_head entries; -}; - -extern struct acpi_prt_list acpi_prt; - -struct pci_dev; - -int acpi_pci_irq_enable (struct pci_dev *dev); -void acpi_penalize_isa_irq(int irq); - -#ifdef CONFIG_ACPI_DEALLOCATE_IRQ -void acpi_pci_irq_disable (struct pci_dev *dev); -#endif - -struct acpi_pci_driver { - struct acpi_pci_driver *next; - int (*add)(acpi_handle handle); - void (*remove)(acpi_handle handle); -}; - -int acpi_pci_register_driver(struct acpi_pci_driver *driver); -void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); - -#endif /*CONFIG_ACPI_PCI*/ - -#ifdef CONFIG_ACPI_EC - -extern int ec_read(u8 addr, u8 *val); -extern int ec_write(u8 addr, u8 val); - -#endif /*CONFIG_ACPI_EC*/ - -#ifdef CONFIG_ACPI_INTERPRETER - -extern int acpi_blacklisted(void); -extern void acpi_bios_year(char *s); - -#else /*!CONFIG_ACPI_INTERPRETER*/ - -static inline int acpi_blacklisted(void) -{ - return 0; -} - -#endif /*!CONFIG_ACPI_INTERPRETER*/ - #ifdef CONFIG_ACPI_CSTATE /* * Set highest legal C-state