Commit d7374b3f authored by Andy Grover's avatar Andy Grover

Merge groveronline.com:/root/bk/linux-2.5

into groveronline.com:/root/bk/linux-acpi
parents 189ea5d0 42af0cb8
obj-$(CONFIG_ACPI_HT_ONLY) := acpitable.o
obj-$(CONFIG_ACPI_BOOT) := boot.o obj-$(CONFIG_ACPI_BOOT) := boot.o
obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
This diff is collapsed.
/*
* acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1)
*
* Copyright (C) 1999 Andrew Henroid
* Copyright (C) 2001 Richard Schaal
* Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
* Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
* Copyright (C) 2001 Arjan van de Ven <arjanv@redhat.com>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* 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
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* $Id: acpitable.h,v 1.3 2001/11/03 22:41:34 fenrus Exp $
*/
/*
* The following codes are cut&pasted from drivers/acpi. Part of the code
* there can be not updated or delivered yet.
* To avoid conflicts when CONFIG_ACPI is defined, the following codes are
* modified so that they are self-contained in this file.
* -- jun
*/
#ifndef _HEADER_ACPITABLE_H_
#define _HEADER_ACPITABLE_H_
#define dprintk printk
typedef unsigned int ACPI_TBLPTR;
typedef struct { /* ACPI common table header */
char signature[4]; /* identifies type of table */
u32 length; /* length of table,
in bytes, * including header */
u8 revision; /* specification minor version # */
u8 checksum; /* to make sum of entire table == 0 */
char oem_id[6]; /* OEM identification */
char oem_table_id[8]; /* OEM table identification */
u32 oem_revision; /* OEM revision number */
char asl_compiler_id[4]; /* ASL compiler vendor ID */
u32 asl_compiler_revision; /* ASL compiler revision number */
} acpi_table_header __attribute__ ((packed));;
enum {
ACPI_APIC = 0,
ACPI_BOOT,
ACPI_DBGP,
ACPI_DSDT,
ACPI_ECDT,
ACPI_ETDT,
ACPI_FACP,
ACPI_FACS,
ACPI_OEMX,
ACPI_PSDT,
ACPI_SBST,
ACPI_SLIT,
ACPI_SPCR,
ACPI_SRAT,
ACPI_SSDT,
ACPI_SPMI,
ACPI_XSDT,
ACPI_TABLE_COUNT
};
static char *acpi_table_signatures[ACPI_TABLE_COUNT] = {
"APIC",
"BOOT",
"DBGP",
"DSDT",
"ECDT",
"ETDT",
"FACP",
"FACS",
"OEM",
"PSDT",
"SBST",
"SLIT",
"SPCR",
"SRAT",
"SSDT",
"SPMI",
"XSDT"
};
struct acpi_table_madt {
acpi_table_header header;
u32 lapic_address;
struct {
u32 pcat_compat:1;
u32 reserved:31;
} flags __attribute__ ((packed));
} __attribute__ ((packed));;
enum {
ACPI_MADT_LAPIC = 0,
ACPI_MADT_IOAPIC,
ACPI_MADT_INT_SRC_OVR,
ACPI_MADT_NMI_SRC,
ACPI_MADT_LAPIC_NMI,
ACPI_MADT_LAPIC_ADDR_OVR,
ACPI_MADT_IOSAPIC,
ACPI_MADT_LSAPIC,
ACPI_MADT_PLAT_INT_SRC,
ACPI_MADT_ENTRY_COUNT
};
#define RSDP_SIG "RSD PTR "
#define RSDT_SIG "RSDT"
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_MEMORY_MODE 0x01
#define ACPI_LOGICAL_ADDRESSING 0x00
#define ACPI_PHYSICAL_ADDRESSING 0x01
#define LO_RSDP_WINDOW_BASE 0 /* Physical Address */
#define HI_RSDP_WINDOW_BASE 0xE0000 /* Physical Address */
#define LO_RSDP_WINDOW_SIZE 0x400
#define HI_RSDP_WINDOW_SIZE 0x20000
#define RSDP_SCAN_STEP 16
#define RSDP_CHECKSUM_LENGTH 20
typedef int (*acpi_table_handler) (acpi_table_header * header, unsigned long);
struct acpi_table_rsdp {
char signature[8];
u8 checksum;
char oem_id[6];
u8 revision;
u32 rsdt_address;
} __attribute__ ((packed));
struct acpi_table_rsdt {
acpi_table_header header;
u32 entry[ACPI_TABLE_COUNT];
} __attribute__ ((packed));
typedef struct {
u8 type;
u8 length;
} acpi_madt_entry_header __attribute__ ((packed));
typedef struct {
u16 polarity:2;
u16 trigger:2;
u16 reserved:12;
} acpi_madt_int_flags __attribute__ ((packed));
struct acpi_table_lapic {
acpi_madt_entry_header header;
u8 acpi_id;
u8 id;
struct {
u32 enabled:1;
u32 reserved:31;
} flags __attribute__ ((packed));
} __attribute__ ((packed));
struct acpi_table_ioapic {
acpi_madt_entry_header header;
u8 id;
u8 reserved;
u32 address;
u32 global_irq_base;
} __attribute__ ((packed));
struct acpi_table_int_src_ovr {
acpi_madt_entry_header header;
u8 bus;
u8 bus_irq;
u32 global_irq;
acpi_madt_int_flags flags;
} __attribute__ ((packed));
struct acpi_table_nmi_src {
acpi_madt_entry_header header;
acpi_madt_int_flags flags;
u32 global_irq;
} __attribute__ ((packed));
struct acpi_table_lapic_nmi {
acpi_madt_entry_header header;
u8 acpi_id;
acpi_madt_int_flags flags;
u8 lint;
} __attribute__ ((packed));
struct acpi_table_lapic_addr_ovr {
acpi_madt_entry_header header;
u8 reserved[2];
u64 address;
} __attribute__ ((packed));
struct acpi_table_iosapic {
acpi_madt_entry_header header;
u8 id;
u8 reserved;
u32 global_irq_base;
u64 address;
} __attribute__ ((packed));
struct acpi_table_lsapic {
acpi_madt_entry_header header;
u8 acpi_id;
u8 id;
u8 eid;
u8 reserved[3];
struct {
u32 enabled:1;
u32 reserved:31;
} flags;
} __attribute__ ((packed));
struct acpi_table_plat_int_src {
acpi_madt_entry_header header;
acpi_madt_int_flags flags;
u8 type;
u8 id;
u8 eid;
u8 iosapic_vector;
u32 global_irq;
u32 reserved;
} __attribute__ ((packed));
/*
* ACPI Table Descriptor. One per ACPI table
*/
typedef struct acpi_table_desc {
struct acpi_table_desc *prev;
struct acpi_table_desc *next;
struct acpi_table_desc *installed_desc;
acpi_table_header *pointer;
void *base_pointer;
u8 *aml_pointer;
u64 physical_address;
u32 aml_length;
u32 length;
u32 count;
u16 table_id;
u8 type;
u8 allocation;
u8 loaded_into_namespace;
} acpi_table_desc __attribute__ ((packed));;
#endif
...@@ -61,7 +61,12 @@ struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; ...@@ -61,7 +61,12 @@ struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
unsigned long mmu_cr4_features; unsigned long mmu_cr4_features;
EXPORT_SYMBOL_GPL(mmu_cr4_features); EXPORT_SYMBOL_GPL(mmu_cr4_features);
int acpi_disabled __initdata = 0; #ifdef CONFIG_ACPI_HT_ONLY
int acpi_disabled = 1;
#else
int acpi_disabled = 0;
#endif
EXPORT_SYMBOL(acpi_disabled);
int MCA_bus; int MCA_bus;
/* for MCA, but anyone else can use it if they want */ /* for MCA, but anyone else can use it if they want */
...@@ -514,6 +519,10 @@ static void __init parse_cmdline_early (char ** cmdline_p) ...@@ -514,6 +519,10 @@ static void __init parse_cmdline_early (char ** cmdline_p)
if (c == ' ' && !memcmp(from, "acpi=off", 8)) if (c == ' ' && !memcmp(from, "acpi=off", 8))
acpi_disabled = 1; acpi_disabled = 1;
/* "acpismp=force" turns on ACPI again */
else if (!memcmp(from, "acpismp=force", 14))
acpi_disabled = 0;
/* /*
* highmem=size forces highmem to be exactly 'size' bytes. * highmem=size forces highmem to be exactly 'size' bytes.
* This works even on boxes that have no highmem otherwise. * This works even on boxes that have no highmem otherwise.
......
...@@ -49,12 +49,12 @@ config ACPI_HT_ONLY ...@@ -49,12 +49,12 @@ config ACPI_HT_ONLY
Full ACPI support (CONFIG_ACPI) is preferred. Use this option Full ACPI support (CONFIG_ACPI) is preferred. Use this option
only if you wish to limit ACPI's role to processor enumeration. only if you wish to limit ACPI's role to processor enumeration.
There is no command-line option to disable this, but the kernel In this configuration, ACPI defaults to off. It must be enabled
will fall back to the MPS table if the MADT is not present. on the command-line with the "acpismp=force" option.
config ACPI_BOOT config ACPI_BOOT
bool bool
depends on IA64 && (!IA64_HP_SIM || IA64_SGI_SN) || X86 && ACPI && !ACPI_HT_ONLY || X86 && ACPI depends on IA64 && (!IA64_HP_SIM || IA64_SGI_SN) || X86 && ACPI && !ACPI_HT_ONLY
default y default y
config ACPI_SLEEP config ACPI_SLEEP
...@@ -135,6 +135,31 @@ config ACPI_NUMA ...@@ -135,6 +135,31 @@ config ACPI_NUMA
bool "NUMA support" if NUMA && (IA64 && !IA64_HP_SIM || X86 && ACPI && !ACPI_HT_ONLY && !X86_64) bool "NUMA support" if NUMA && (IA64 && !IA64_HP_SIM || X86 && ACPI && !ACPI_HT_ONLY && !X86_64)
default y if IA64 && IA64_SGI_SN default y if IA64 && IA64_SGI_SN
config ACPI_ASUS
tristate "ASUS/Medion Laptop Extras"
depends on X86 && ACPI && !ACPI_HT_ONLY
---help---
This driver provides support for extra features of ACPI-compatible
ASUS laptops. As some of Medion laptops are made by ASUS, it may also
support some Medion laptops (such as 9675 for example). It makes all
the extra buttons generate standard ACPI events that go through
/proc/acpi/events, and (on some models) adds support for changing the
display brightness and output, switching the LCD backlight on and off,
and most importantly, allows you to blink those fancy LEDs intended
for reporting mail and wireless status.
All settings are changed via /proc/acpi/asus directory entries. Owner
and group for these entries can be set with asus_uid and asus_gid
parameters.
More information and a userspace daemon for handling the extra buttons
at <http://sourceforge.net/projects/acpi4asus/>.
If you have an ACPI-compatible ASUS laptop, say Y or M here. This
driver is still under development, so if your laptop is unsupported or
something works not quite as expected, please use the mailing list
available on the above page (acpi4asus-user@lists.sourceforge.net)
config ACPI_TOSHIBA config ACPI_TOSHIBA
tristate "Toshiba Laptop Extras" tristate "Toshiba Laptop Extras"
depends on X86 && ACPI && !ACPI_HT_ONLY depends on X86 && ACPI && !ACPI_HT_ONLY
......
...@@ -44,5 +44,6 @@ obj-$(CONFIG_ACPI_THERMAL) += thermal.o ...@@ -44,5 +44,6 @@ obj-$(CONFIG_ACPI_THERMAL) += thermal.o
obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o
obj-$(CONFIG_ACPI_DEBUG) += debug.o obj-$(CONFIG_ACPI_DEBUG) += debug.o
obj-$(CONFIG_ACPI_NUMA) += numa.o obj-$(CONFIG_ACPI_NUMA) += numa.o
obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o
obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
obj-$(CONFIG_ACPI_BUS) += scan.o obj-$(CONFIG_ACPI_BUS) += scan.o
This diff is collapsed.
...@@ -306,7 +306,6 @@ acpi_ds_method_data_set_value ( ...@@ -306,7 +306,6 @@ acpi_ds_method_data_set_value (
{ {
acpi_status status; acpi_status status;
struct acpi_namespace_node *node; struct acpi_namespace_node *node;
union acpi_operand_object *new_desc = object;
ACPI_FUNCTION_TRACE ("ds_method_data_set_value"); ACPI_FUNCTION_TRACE ("ds_method_data_set_value");
...@@ -325,28 +324,16 @@ acpi_ds_method_data_set_value ( ...@@ -325,28 +324,16 @@ acpi_ds_method_data_set_value (
} }
/* /*
* If the object has just been created and is not attached to anything, * Increment ref count so object can't be deleted while installed.
* (the reference count is 1), then we can just store it directly into * NOTE: We do not copy the object in order to preserve the call by
* the arg/local. Otherwise, we must copy it. * reference semantics of ACPI Control Method invocation.
* (See ACPI specification 2.0_c)
*/ */
if (object->common.reference_count > 1) { acpi_ut_add_reference (object);
status = acpi_ut_copy_iobject_to_iobject (object, &new_desc, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object Copied %p, new %p\n",
object, new_desc));
}
else {
/* Increment ref count so object can't be deleted while installed */
acpi_ut_add_reference (new_desc);
}
/* Install the object */ /* Install the object */
node->object = new_desc; node->object = object;
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
......
...@@ -186,11 +186,13 @@ acpi_ev_gpe_detect ( ...@@ -186,11 +186,13 @@ acpi_ev_gpe_detect (
} }
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"GPE block at %8.8X%8.8X - Values: Enable %02X Status %02X\n", "GPE pair: Status %8.8X%8.8X = %02X, Enable %8.8X%8.8X = %02X\n",
ACPI_HIDWORD (gpe_register_info->status_address.address),
ACPI_LODWORD (gpe_register_info->status_address.address),
gpe_register_info->status,
ACPI_HIDWORD (gpe_register_info->enable_address.address), ACPI_HIDWORD (gpe_register_info->enable_address.address),
ACPI_LODWORD (gpe_register_info->enable_address.address), ACPI_LODWORD (gpe_register_info->enable_address.address),
gpe_register_info->enable, gpe_register_info->enable));
gpe_register_info->status));
/* First check if there is anything active at all in this register */ /* First check if there is anything active at all in this register */
......
...@@ -76,9 +76,14 @@ acpi_ev_valid_gpe_event ( ...@@ -76,9 +76,14 @@ acpi_ev_valid_gpe_event (
/* No need for spin lock since we are not changing any list elements */ /* No need for spin lock since we are not changing any list elements */
/* Walk the GPE interrupt levels */
gpe_xrupt_block = acpi_gbl_gpe_xrupt_list_head; gpe_xrupt_block = acpi_gbl_gpe_xrupt_list_head;
while (gpe_xrupt_block) { while (gpe_xrupt_block) {
gpe_block = gpe_xrupt_block->gpe_block_list_head; gpe_block = gpe_xrupt_block->gpe_block_list_head;
/* Walk the GPE blocks on this interrupt level */
while (gpe_block) { while (gpe_block) {
if ((&gpe_block->event_info[0] <= gpe_event_info) && if ((&gpe_block->event_info[0] <= gpe_event_info) &&
(&gpe_block->event_info[((acpi_size) gpe_block->register_count) * 8] > gpe_event_info)) { (&gpe_block->event_info[((acpi_size) gpe_block->register_count) * 8] > gpe_event_info)) {
...@@ -155,7 +160,7 @@ acpi_ev_walk_gpe_list ( ...@@ -155,7 +160,7 @@ acpi_ev_walk_gpe_list (
* *
* PARAMETERS: Callback from walk_namespace * PARAMETERS: Callback from walk_namespace
* *
* RETURN: None * RETURN: Status
* *
* DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a * DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a
* control method under the _GPE portion of the namespace. * control method under the _GPE portion of the namespace.
...@@ -196,7 +201,8 @@ acpi_ev_save_method_info ( ...@@ -196,7 +201,8 @@ acpi_ev_save_method_info (
name[ACPI_NAME_SIZE] = 0; name[ACPI_NAME_SIZE] = 0;
/* /*
* Edge/Level determination is based on the 2nd character of the method name * Edge/Level determination is based on the 2nd character
* of the method name
*/ */
switch (name[1]) { switch (name[1]) {
case 'L': case 'L':
...@@ -249,15 +255,14 @@ acpi_ev_save_method_info ( ...@@ -249,15 +255,14 @@ acpi_ev_save_method_info (
gpe_event_info->flags = type; gpe_event_info->flags = type;
gpe_event_info->method_node = (struct acpi_namespace_node *) obj_handle; gpe_event_info->method_node = (struct acpi_namespace_node *) obj_handle;
/* /* Enable the GPE (SCIs should be disabled at this point) */
* Enable the GPE (SCIs should be disabled at this point)
*/
status = acpi_hw_enable_gpe (gpe_event_info); status = acpi_hw_enable_gpe (gpe_event_info);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_LOAD,
"Registered GPE method %s as GPE number 0x%.2X\n", "Registered GPE method %s as GPE number 0x%.2X\n",
name, gpe_number)); name, gpe_number));
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
...@@ -867,8 +872,8 @@ acpi_ev_gpe_initialize (void) ...@@ -867,8 +872,8 @@ acpi_ev_gpe_initialize (void)
} }
/* /*
* GPE0 and GPE1 do not have to be contiguous in the GPE number space, * GPE0 and GPE1 do not have to be contiguous in the GPE number
* But, GPE0 always starts at zero. * space. However, GPE0 always starts at GPE number zero.
*/ */
gpe_number_max = acpi_gbl_FADT->gpe1_base + gpe_number_max = acpi_gbl_FADT->gpe1_base +
((register_count1 * ACPI_GPE_REGISTER_WIDTH) - 1); ((register_count1 * ACPI_GPE_REGISTER_WIDTH) - 1);
......
...@@ -222,7 +222,7 @@ acpi_ex_opcode_1A_1T_1R ( ...@@ -222,7 +222,7 @@ acpi_ex_opcode_1A_1T_1R (
union acpi_operand_object *return_desc2 = NULL; union acpi_operand_object *return_desc2 = NULL;
u32 temp32; u32 temp32;
u32 i; u32 i;
u32 j; u32 power_of_ten;
acpi_integer digit; acpi_integer digit;
...@@ -291,61 +291,70 @@ acpi_ex_opcode_1A_1T_1R ( ...@@ -291,61 +291,70 @@ acpi_ex_opcode_1A_1T_1R (
case AML_FROM_BCD_OP: /* from_bcd (BCDValue, Result) */ case AML_FROM_BCD_OP: /* from_bcd (BCDValue, Result) */
/* /*
* The 64-bit ACPI integer can hold 16 4-bit BCD integers * The 64-bit ACPI integer can hold 16 4-bit BCD characters
* (if table is 32-bit, integer can hold 8 BCD characters)
* Convert each 4-bit BCD value
*/ */
power_of_ten = 1;
return_desc->integer.value = 0; return_desc->integer.value = 0;
for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) { digit = operand[0]->integer.value;
/* Get one BCD digit */
/* Convert each BCD digit (each is one nybble wide) */
digit = (acpi_integer) ((operand[0]->integer.value >> (i * 4)) & 0xF); for (i = 0; (i < acpi_gbl_integer_nybble_width) && (digit > 0); i++) {
/* Get the least significant 4-bit BCD digit */
temp32 = ((u32) digit) & 0xF;
/* Check the range of the digit */ /* Check the range of the digit */
if (digit > 9) { if (temp32 > 9) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD digit too large: %d\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
(u32) digit)); "BCD digit too large (not decimal): 0x%X\n",
temp32));
status = AE_AML_NUMERIC_OVERFLOW; status = AE_AML_NUMERIC_OVERFLOW;
goto cleanup; goto cleanup;
} }
if (digit > 0) { /* Sum the digit into the result with the current power of 10 */
/* Sum into the result with the appropriate power of 10 */
for (j = 0; j < i; j++) { return_desc->integer.value += (((acpi_integer) temp32) * power_of_ten);
digit *= 10;
}
return_desc->integer.value += digit; /* Shift to next BCD digit */
}
digit >>= 4;
/* Next power of 10 */
power_of_ten *= 10;
} }
break; break;
case AML_TO_BCD_OP: /* to_bcd (Operand, Result) */ case AML_TO_BCD_OP: /* to_bcd (Operand, Result) */
if (operand[0]->integer.value > ACPI_MAX_BCD_VALUE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD overflow: %8.8X%8.8X\n",
ACPI_HIDWORD(operand[0]->integer.value),
ACPI_LODWORD(operand[0]->integer.value)));
status = AE_AML_NUMERIC_OVERFLOW;
goto cleanup;
}
return_desc->integer.value = 0; return_desc->integer.value = 0;
for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
/* Divide by nth factor of 10 */
temp32 = 0;
digit = operand[0]->integer.value; digit = operand[0]->integer.value;
for (j = 0; j < i; j++) {
/* Each BCD digit is one nybble wide */
for (i = 0; (i < acpi_gbl_integer_nybble_width) && (digit > 0); i++) {
(void) acpi_ut_short_divide (&digit, 10, &digit, &temp32); (void) acpi_ut_short_divide (&digit, 10, &digit, &temp32);
/* Insert the BCD digit that resides in the remainder from above */
return_desc->integer.value |= (((acpi_integer) temp32) << (i * 4));
} }
/* Create the BCD digit from the remainder above */ /* Overflow if there is any data left in Digit */
if (digit > 0) { if (digit > 0) {
return_desc->integer.value += ((acpi_integer) temp32 << (i * 4)); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Integer too large to convert to BCD: %8.8X%8.8X\n",
} ACPI_HIDWORD(operand[0]->integer.value),
ACPI_LODWORD(operand[0]->integer.value)));
status = AE_AML_NUMERIC_OVERFLOW;
goto cleanup;
} }
break; break;
......
...@@ -190,8 +190,8 @@ acpi_ex_store ( ...@@ -190,8 +190,8 @@ acpi_ex_store (
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n", ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n",
ACPI_HIWORD (source_desc->integer.value), ACPI_HIDWORD (source_desc->integer.value),
ACPI_LOWORD (source_desc->integer.value))); ACPI_LODWORD (source_desc->integer.value)));
break; break;
......
...@@ -134,7 +134,7 @@ acpi_ex_system_do_stall ( ...@@ -134,7 +134,7 @@ acpi_ex_system_do_stall (
acpi_ex_exit_interpreter (); acpi_ex_exit_interpreter ();
acpi_os_stall (how_long); acpi_os_sleep (0, (how_long / 1000) + 1);
/* And now we must get the interpreter again */ /* And now we must get the interpreter again */
...@@ -142,7 +142,7 @@ acpi_ex_system_do_stall ( ...@@ -142,7 +142,7 @@ acpi_ex_system_do_stall (
} }
else { else {
acpi_os_sleep (0, (how_long / 1000) + 1); acpi_os_stall (how_long);
} }
return (status); return (status);
......
...@@ -289,7 +289,10 @@ acpi_ex_digits_needed ( ...@@ -289,7 +289,10 @@ acpi_ex_digits_needed (
/* /*
* acpi_integer is unsigned, so we don't worry about a '-' * acpi_integer is unsigned, so we don't worry about a '-'
*/ */
current_value = value; if ((current_value = value) == 0) {
return_VALUE (1);
}
num_digits = 0; num_digits = 0;
while (current_value) { while (current_value) {
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
* *
* FUNCTION: acpi_hw_clear_acpi_status * FUNCTION: acpi_hw_clear_acpi_status
* *
* PARAMETERS: none * PARAMETERS: Flags - Lock the hardware or not
* *
* RETURN: none * RETURN: none
* *
...@@ -65,7 +65,8 @@ ...@@ -65,7 +65,8 @@
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_hw_clear_acpi_status (void) acpi_hw_clear_acpi_status (
u32 flags)
{ {
acpi_status status; acpi_status status;
...@@ -77,11 +78,12 @@ acpi_hw_clear_acpi_status (void) ...@@ -77,11 +78,12 @@ acpi_hw_clear_acpi_status (void)
ACPI_BITMASK_ALL_FIXED_STATUS, ACPI_BITMASK_ALL_FIXED_STATUS,
(u16) acpi_gbl_FADT->xpm1a_evt_blk.address)); (u16) acpi_gbl_FADT->xpm1a_evt_blk.address));
if (flags & ACPI_MTX_LOCK) {
status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
}
status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS,
ACPI_BITMASK_ALL_FIXED_STATUS); ACPI_BITMASK_ALL_FIXED_STATUS);
...@@ -104,7 +106,9 @@ acpi_hw_clear_acpi_status (void) ...@@ -104,7 +106,9 @@ acpi_hw_clear_acpi_status (void)
status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block); status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block);
unlock_and_exit: unlock_and_exit:
if (flags & ACPI_MTX_LOCK) {
(void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE); (void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE);
}
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -237,8 +241,9 @@ acpi_hw_get_bit_register_info ( ...@@ -237,8 +241,9 @@ acpi_hw_get_bit_register_info (
* *
* FUNCTION: acpi_get_register * FUNCTION: acpi_get_register
* *
* PARAMETERS: register_id - Index of ACPI Register to access * PARAMETERS: register_id - ID of ACPI bit_register to access
* use_lock - Lock the hardware * return_value - Value that was read from the register
* Flags - Lock the hardware or not
* *
* RETURN: Value is read from specified Register. Value returned is * RETURN: Value is read from specified Register. Value returned is
* normalized to bit0 (is shifted all the way right) * normalized to bit0 (is shifted all the way right)
...@@ -290,7 +295,8 @@ acpi_get_register ( ...@@ -290,7 +295,8 @@ acpi_get_register (
*return_value = register_value; *return_value = register_value;
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read value %X\n", register_value)); ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read value %8.8X register %X\n",
register_value, bit_reg_info->parent_register));
} }
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
...@@ -443,7 +449,8 @@ acpi_set_register ( ...@@ -443,7 +449,8 @@ acpi_set_register (
ACPI_DEBUG_EXEC (register_value = ((register_value & bit_reg_info->access_bit_mask) >> bit_reg_info->bit_position)); ACPI_DEBUG_EXEC (register_value = ((register_value & bit_reg_info->access_bit_mask) >> bit_reg_info->bit_position));
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "ACPI Register Write actual %X\n", register_value)); ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Set bits: %8.8X actual %8.8X register %X\n",
value, register_value, bit_reg_info->parent_register));
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -751,10 +758,15 @@ acpi_hw_low_level_read ( ...@@ -751,10 +758,15 @@ acpi_hw_low_level_read (
default: default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Unsupported address space: %X\n", reg->address_space_id)); "Unsupported address space: %X\n", reg->address_space_id));
status = AE_BAD_PARAMETER; return (AE_BAD_PARAMETER);
break;
} }
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n",
*value, width,
ACPI_HIDWORD (reg->address),
ACPI_LODWORD (reg->address),
acpi_ut_get_region_name (reg->address_space_id)));
return (status); return (status);
} }
...@@ -832,9 +844,14 @@ acpi_hw_low_level_write ( ...@@ -832,9 +844,14 @@ acpi_hw_low_level_write (
default: default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Unsupported address space: %X\n", reg->address_space_id)); "Unsupported address space: %X\n", reg->address_space_id));
status = AE_BAD_PARAMETER; return (AE_BAD_PARAMETER);
break;
} }
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
value, width,
ACPI_HIDWORD (reg->address),
ACPI_LODWORD (reg->address),
acpi_ut_get_region_name (reg->address_space_id)));
return (status); return (status);
} }
...@@ -231,7 +231,7 @@ acpi_enter_sleep_state ( ...@@ -231,7 +231,7 @@ acpi_enter_sleep_state (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
status = acpi_hw_clear_acpi_status(); status = acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -355,7 +355,7 @@ acpi_enter_sleep_state_s4bios ( ...@@ -355,7 +355,7 @@ acpi_enter_sleep_state_s4bios (
ACPI_FUNCTION_TRACE ("acpi_enter_sleep_state_s4bios"); ACPI_FUNCTION_TRACE ("acpi_enter_sleep_state_s4bios");
acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK); acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
acpi_hw_clear_acpi_status(); acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
acpi_hw_disable_non_wakeup_gpes(); acpi_hw_disable_non_wakeup_gpes();
......
...@@ -287,10 +287,14 @@ acpi_tb_convert_fadt1 ( ...@@ -287,10 +287,14 @@ acpi_tb_convert_fadt1 (
(acpi_physical_address) (local_fadt->xpm1a_evt_blk.address + (acpi_physical_address) (local_fadt->xpm1a_evt_blk.address +
ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len))); ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
/* PM1B is optional; leave null if not present */
if (local_fadt->xpm1b_evt_blk.address) {
acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable, acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable,
(u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len), (u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
(acpi_physical_address) (local_fadt->xpm1b_evt_blk.address + (acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len))); ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
}
} }
...@@ -379,11 +383,15 @@ acpi_tb_convert_fadt2 ( ...@@ -379,11 +383,15 @@ acpi_tb_convert_fadt2 (
ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len))); ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
acpi_gbl_xpm1a_enable.address_space_id = local_fadt->xpm1a_evt_blk.address_space_id; acpi_gbl_xpm1a_enable.address_space_id = local_fadt->xpm1a_evt_blk.address_space_id;
/* PM1B is optional; leave null if not present */
if (local_fadt->xpm1b_evt_blk.address) {
acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable, acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable,
(u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len), (u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
(acpi_physical_address) (local_fadt->xpm1b_evt_blk.address + (acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len))); ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
acpi_gbl_xpm1b_enable.address_space_id = local_fadt->xpm1b_evt_blk.address_space_id; acpi_gbl_xpm1b_enable.address_space_id = local_fadt->xpm1b_evt_blk.address_space_id;
}
} }
......
...@@ -203,10 +203,12 @@ acpi_ut_set_integer_width ( ...@@ -203,10 +203,12 @@ acpi_ut_set_integer_width (
if (revision <= 1) { if (revision <= 1) {
acpi_gbl_integer_bit_width = 32; acpi_gbl_integer_bit_width = 32;
acpi_gbl_integer_nybble_width = 8;
acpi_gbl_integer_byte_width = 4; acpi_gbl_integer_byte_width = 4;
} }
else { else {
acpi_gbl_integer_bit_width = 64; acpi_gbl_integer_bit_width = 64;
acpi_gbl_integer_nybble_width = 16;
acpi_gbl_integer_byte_width = 8; acpi_gbl_integer_byte_width = 8;
} }
} }
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com) * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (c) 2001 IBM Corp. * Copyright (c) 2001 IBM Corp.
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com) * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com) * Copyright (c) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002 NEC Corporation * Copyright (c) 2002,2003 NEC Corporation
* *
* All rights reserved. * All rights reserved.
* *
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* Send feedback to <gregkh@us.ibm.com>, * Send feedback to <gregkh@us.ibm.com>,
* <h-aono@ap.jp.nec.com>, * <t-kochi@bq.jp.nec.com>
* <t-kouchi@cq.jp.nec.com>
* *
*/ */
...@@ -35,6 +34,7 @@ ...@@ -35,6 +34,7 @@
#define _ACPIPHP_H #define _ACPIPHP_H
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/kobject.h> /* for KOBJ_NAME_LEN */
#include "pci_hotplug.h" #include "pci_hotplug.h"
#define dbg(format, arg...) \ #define dbg(format, arg...) \
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#define SLOT_MAGIC 0x67267322 #define SLOT_MAGIC 0x67267322
/* name size which is used for entries in pcihpfs */ /* name size which is used for entries in pcihpfs */
#define SLOT_NAME_SIZE 32 /* ACPI{_SUN}-{BUS}:{DEV} */ #define SLOT_NAME_SIZE KOBJ_NAME_LEN /* {_SUN} */
struct acpiphp_bridge; struct acpiphp_bridge;
struct acpiphp_slot; struct acpiphp_slot;
...@@ -212,11 +212,7 @@ struct acpiphp_func { ...@@ -212,11 +212,7 @@ struct acpiphp_func {
#define FUNC_HAS_PS2 (0x00000040) #define FUNC_HAS_PS2 (0x00000040)
#define FUNC_HAS_PS3 (0x00000080) #define FUNC_HAS_PS3 (0x00000080)
/* not yet */ #define FUNC_EXISTS (0x10000000) /* to make sure we call _EJ0 only for existing funcs */
#define SLOT_SUPPORT_66MHZ (0x00010000)
#define SLOT_SUPPORT_100MHZ (0x00020000)
#define SLOT_SUPPORT_133MHZ (0x00040000)
#define SLOT_SUPPORT_PCIX (0x00080000)
/* function prototypes */ /* function prototypes */
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com) * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (c) 2001 IBM Corp. * Copyright (c) 2001 IBM Corp.
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com) * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com) * Copyright (c) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002 NEC Corporation * Copyright (c) 2002,2003 NEC Corporation
* *
* All rights reserved. * All rights reserved.
* *
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* Send feedback to <gregkh@us.ibm.com>, * Send feedback to <gregkh@us.ibm.com>,
* <h-aono@ap.jp.nec.com>, * <t-kochi@bq.jp.nec.com>
* <t-kouchi@cq.jp.nec.com>
* *
*/ */
...@@ -57,7 +56,7 @@ int acpiphp_debug; ...@@ -57,7 +56,7 @@ int acpiphp_debug;
static int num_slots; static int num_slots;
#define DRIVER_VERSION "0.4" #define DRIVER_VERSION "0.4"
#define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kouchi@cq.jp.nec.com>" #define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kochi@bq.jp.nec.com>"
#define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver" #define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver"
MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_AUTHOR(DRIVER_AUTHOR);
...@@ -376,10 +375,8 @@ static int init_acpi (void) ...@@ -376,10 +375,8 @@ static int init_acpi (void)
*/ */
static void make_slot_name (struct slot *slot) static void make_slot_name (struct slot *slot)
{ {
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "ACPI%d-%02x:%02x", snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%u",
slot->acpi_slot->sun, slot->acpi_slot->sun);
slot->acpi_slot->bridge->bus,
slot->acpi_slot->device);
} }
/** /**
......
/* /*
* ACPI PCI HotPlug glue functions to ACPI CA subsystem * ACPI PCI HotPlug glue functions to ACPI CA subsystem
* *
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com) * Copyright (c) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com) * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 NEC Corporation * Copyright (c) 2002,2003 NEC Corporation
* *
* All rights reserved. * All rights reserved.
* *
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* Send feedback to <t-kouchi@cq.jp.nec.com> * Send feedback to <t-kochi@bq.jp.nec.com>
* *
*/ */
...@@ -204,7 +204,6 @@ register_slot (acpi_handle handle, u32 lvl, void *context, void **rv) ...@@ -204,7 +204,6 @@ register_slot (acpi_handle handle, u32 lvl, void *context, void **rv)
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
err("failed to register interrupt notify handler\n"); err("failed to register interrupt notify handler\n");
kfree(newfunc);
return status; return status;
} }
...@@ -617,9 +616,8 @@ find_p2p_bridge (acpi_handle handle, u32 lvl, void *context, void **rv) ...@@ -617,9 +616,8 @@ find_p2p_bridge (acpi_handle handle, u32 lvl, void *context, void **rv)
/* find hot-pluggable slots, and then find P2P bridge */ /* find hot-pluggable slots, and then find P2P bridge */
static int add_bridges(struct acpi_device *device) static int add_bridge(acpi_handle handle)
{ {
acpi_handle *handle = device->handle;
acpi_status status; acpi_status status;
unsigned long tmp; unsigned long tmp;
int seg, bus; int seg, bus;
...@@ -673,6 +671,12 @@ static int add_bridges(struct acpi_device *device) ...@@ -673,6 +671,12 @@ static int add_bridges(struct acpi_device *device)
} }
static void remove_bridge (acpi_handle handle)
{
/* No-op for now .. */
}
static int power_on_slot (struct acpiphp_slot *slot) static int power_on_slot (struct acpiphp_slot *slot)
{ {
acpi_status status; acpi_status status;
...@@ -725,9 +729,7 @@ static int power_off_slot (struct acpiphp_slot *slot) ...@@ -725,9 +729,7 @@ static int power_off_slot (struct acpiphp_slot *slot)
list_for_each (l, &slot->funcs) { list_for_each (l, &slot->funcs) {
func = list_entry(l, struct acpiphp_func, sibling); func = list_entry(l, struct acpiphp_func, sibling);
if (func->flags & FUNC_HAS_PS3) { if (func->flags & (FUNC_HAS_PS3 | FUNC_EXISTS)) {
dbg("%s: executing _PS3 on %s\n", __FUNCTION__,
func->pci_dev->slot_name);
status = acpi_evaluate_object(func->handle, "_PS3", NULL, NULL); status = acpi_evaluate_object(func->handle, "_PS3", NULL, NULL);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
warn("%s: _PS3 failed\n", __FUNCTION__); warn("%s: _PS3 failed\n", __FUNCTION__);
...@@ -740,10 +742,8 @@ static int power_off_slot (struct acpiphp_slot *slot) ...@@ -740,10 +742,8 @@ static int power_off_slot (struct acpiphp_slot *slot)
list_for_each (l, &slot->funcs) { list_for_each (l, &slot->funcs) {
func = list_entry(l, struct acpiphp_func, sibling); func = list_entry(l, struct acpiphp_func, sibling);
if (func->flags & FUNC_HAS_EJ0) { /* We don't want to call _EJ0 on non-existing functions. */
dbg("%s: executing _EJ0 on %s\n", __FUNCTION__, if (func->flags & (FUNC_HAS_EJ0 | FUNC_EXISTS)) {
func->pci_dev->slot_name);
/* _EJ0 method take one argument */ /* _EJ0 method take one argument */
arg_list.count = 1; arg_list.count = 1;
arg_list.pointer = &arg; arg_list.pointer = &arg;
...@@ -756,6 +756,7 @@ static int power_off_slot (struct acpiphp_slot *slot) ...@@ -756,6 +756,7 @@ static int power_off_slot (struct acpiphp_slot *slot)
retval = -1; retval = -1;
goto err_exit; goto err_exit;
} }
func->flags &= (~FUNC_EXISTS);
} }
} }
...@@ -835,6 +836,8 @@ static int enable_device (struct acpiphp_slot *slot) ...@@ -835,6 +836,8 @@ static int enable_device (struct acpiphp_slot *slot)
retval = acpiphp_configure_function(func); retval = acpiphp_configure_function(func);
if (retval) if (retval)
goto err_exit; goto err_exit;
func->flags |= FUNC_EXISTS;
} }
slot->flags |= SLOT_ENABLED; slot->flags |= SLOT_ENABLED;
...@@ -1029,13 +1032,10 @@ static void handle_hotplug_event_func (acpi_handle handle, u32 type, void *conte ...@@ -1029,13 +1032,10 @@ static void handle_hotplug_event_func (acpi_handle handle, u32 type, void *conte
} }
} }
static struct acpi_driver acpi_pci_hp_driver = {
.name = "pci_hp", static struct acpi_pci_driver acpi_pci_hp_driver = {
.class = "", .add = add_bridge,
.ids = ACPI_PCI_HOST_HID, .remove = remove_bridge,
.ops = {
.add = add_bridges,
}
}; };
/** /**
...@@ -1044,17 +1044,15 @@ static struct acpi_driver acpi_pci_hp_driver = { ...@@ -1044,17 +1044,15 @@ static struct acpi_driver acpi_pci_hp_driver = {
*/ */
int acpiphp_glue_init (void) int acpiphp_glue_init (void)
{ {
acpi_status status; int num;
if (list_empty(&pci_root_buses)) if (list_empty(&pci_root_buses))
return -1; return -1;
status = acpi_bus_register_driver(&acpi_pci_hp_driver); num = acpi_pci_register_driver(&acpi_pci_hp_driver);
if (ACPI_FAILURE(status)) { if (num <= 0)
err("%s: acpi_walk_namespace() failed\n", __FUNCTION__);
return -1; return -1;
}
return 0; return 0;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Copyright (c) 1995,2001 Compaq Computer Corporation * Copyright (c) 1995,2001 Compaq Computer Corporation
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com) * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (c) 2001,2002 IBM Corp. * Copyright (c) 2001,2002 IBM Corp.
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com) * Copyright (c) 2002 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com) * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 NEC Corporation * Copyright (c) 2002 NEC Corporation
* *
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* Send feedback to <t-kouchi@cq.jp.nec.com> * Send feedback to <t-kochi@bq.jp.nec.com>
* *
*/ */
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com) * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (c) 2001 IBM Corp. * Copyright (c) 2001 IBM Corp.
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com) * Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com) * Copyright (c) 2002 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002 NEC Corporation * Copyright (c) 2002 NEC Corporation
* *
* All rights reserved. * All rights reserved.
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* Send feedback to <gregkh@us.ibm.com>,<h-aono@ap.jp.nec.com> * Send feedback to <gregkh@us.ibm.com>, <t-kochi@bq.jp.nec.com>
* *
*/ */
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
/* Version string */ /* Version string */
#define ACPI_CA_VERSION 0x20030522 #define ACPI_CA_VERSION 0x20030619
/* Maximum objects in the various object caches */ /* Maximum objects in the various object caches */
......
...@@ -105,6 +105,7 @@ ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; ...@@ -105,6 +105,7 @@ ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
*/ */
ACPI_EXTERN u8 acpi_gbl_integer_bit_width; ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
ACPI_EXTERN u8 acpi_gbl_integer_byte_width; ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable; ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
......
...@@ -108,7 +108,7 @@ acpi_hw_low_level_write ( ...@@ -108,7 +108,7 @@ acpi_hw_low_level_write (
acpi_status acpi_status
acpi_hw_clear_acpi_status ( acpi_hw_clear_acpi_status (
void); u32 flags);
/* GPE support */ /* GPE support */
......
...@@ -287,15 +287,15 @@ acpi_os_derive_pci_id( ...@@ -287,15 +287,15 @@ acpi_os_derive_pci_id(
* Miscellaneous * Miscellaneous
*/ */
BOOLEAN u8
acpi_os_readable ( acpi_os_readable (
void *pointer, void *pointer,
u32 length); acpi_size length);
BOOLEAN u8
acpi_os_writable ( acpi_os_writable (
void *pointer, void *pointer,
u32 length); acpi_size length);
u32 u32
acpi_os_get_timer ( acpi_os_get_timer (
......
...@@ -50,11 +50,14 @@ ...@@ -50,11 +50,14 @@
/* /*
* Data type ranges * Data type ranges
* Note: These macros are designed to be compiler independent as well as
* working around problems that some 32-bit compilers have with 64-bit
* constants.
*/ */
#define ACPI_UINT8_MAX (~((UINT8) 0)) #define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */
#define ACPI_UINT16_MAX (~((UINT16) 0)) #define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */
#define ACPI_UINT32_MAX (~((UINT32) 0)) #define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */
#define ACPI_UINT64_MAX (~((UINT64) 0)) #define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
#define ACPI_ASCII_MAX 0x7F #define ACPI_ASCII_MAX 0x7F
...@@ -299,8 +302,6 @@ struct uint32_struct ...@@ -299,8 +302,6 @@ struct uint32_struct
typedef u32 acpi_integer; typedef u32 acpi_integer;
#define ACPI_INTEGER_MAX ACPI_UINT32_MAX #define ACPI_INTEGER_MAX ACPI_UINT32_MAX
#define ACPI_INTEGER_BIT_SIZE 32 #define ACPI_INTEGER_BIT_SIZE 32
#define ACPI_MAX_BCD_VALUE 99999999
#define ACPI_MAX_BCD_DIGITS 8
#define ACPI_MAX_DECIMAL_DIGITS 10 #define ACPI_MAX_DECIMAL_DIGITS 10
#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */ #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */
...@@ -313,12 +314,6 @@ typedef u32 acpi_integer; ...@@ -313,12 +314,6 @@ typedef u32 acpi_integer;
typedef u64 acpi_integer; typedef u64 acpi_integer;
#define ACPI_INTEGER_MAX ACPI_UINT64_MAX #define ACPI_INTEGER_MAX ACPI_UINT64_MAX
#define ACPI_INTEGER_BIT_SIZE 64 #define ACPI_INTEGER_BIT_SIZE 64
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_MAX_BCD_VALUE 9999999999999999UL
#else
#define ACPI_MAX_BCD_VALUE 9999999999999999ULL
#endif
#define ACPI_MAX_BCD_DIGITS 16
#define ACPI_MAX_DECIMAL_DIGITS 19 #define ACPI_MAX_DECIMAL_DIGITS 19
#if ACPI_MACHINE_WIDTH == 64 #if ACPI_MACHINE_WIDTH == 64
......
...@@ -106,6 +106,10 @@ ...@@ -106,6 +106,10 @@
:"0"(n_hi), "1"(n_lo)) :"0"(n_hi), "1"(n_lo))
#ifdef CONFIG_ACPI_HT_ONLY
extern int acpi_lapic;
#define acpi_ioapic 0
#else
#ifndef CONFIG_ACPI_BOOT #ifndef CONFIG_ACPI_BOOT
#define acpi_lapic 0 #define acpi_lapic 0
#define acpi_ioapic 0 #define acpi_ioapic 0
...@@ -120,6 +124,7 @@ extern int acpi_ioapic; ...@@ -120,6 +124,7 @@ extern int acpi_ioapic;
#else #else
#define acpi_ioapic 0 #define acpi_ioapic 0
#endif #endif
#endif
/* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */ /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
#define FIX_ACPI_PAGES 4 #define FIX_ACPI_PAGES 4
......
...@@ -403,8 +403,8 @@ int acpi_pci_irq_init (void); ...@@ -403,8 +403,8 @@ int acpi_pci_irq_init (void);
struct acpi_pci_driver { struct acpi_pci_driver {
struct acpi_pci_driver *next; struct acpi_pci_driver *next;
int (*add)(acpi_handle *handle); int (*add)(acpi_handle handle);
void (*remove)(acpi_handle *handle); void (*remove)(acpi_handle handle);
}; };
int acpi_pci_register_driver(struct acpi_pci_driver *driver); int acpi_pci_register_driver(struct acpi_pci_driver *driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment