Commit 5fdd86ae authored by Andy Grover's avatar Andy Grover

ACPI: Fixes from FreeBSD and NetBSD. (Frank van der Linden, Thomas Klausner,

Nate Lawson)
parent 861976f2
......@@ -357,9 +357,9 @@ acpi_set_register (
/*
* Decode the Register ID
* Register id = Register block id | bit id
* Register ID = [Register block ID] | [bit ID]
*
* Check bit id to fine locate Register offset.
* Check bit ID to fine locate Register offset.
* Check Mask to determine Register offset, and then read-write.
*/
switch (bit_reg_info->parent_register) {
......@@ -367,9 +367,9 @@ acpi_set_register (
/*
* Status Registers are different from the rest. Clear by
* writing 1, writing 0 has no effect. So, the only relevant
* writing 1, and writing 0 has no effect. So, the only relevant
* information is the single bit we're interested in, all others should
* be written as 0 so they will be left unchanged
* be written as 0 so they will be left unchanged.
*/
value = ACPI_REGISTER_PREPARE_BITS (value,
bit_reg_info->bit_position, bit_reg_info->access_bit_mask);
......@@ -394,17 +394,17 @@ acpi_set_register (
case ACPI_REGISTER_PM1_CONTROL:
/*
* Read the PM1 Control register.
* Write the PM1 Control register.
* Note that at this level, the fact that there are actually TWO
* registers (A and B - and that B may not exist) is abstracted.
* registers (A and B - and B may not exist) is abstracted.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM1 control: Read %X\n", register_value));
ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position,
bit_reg_info->access_bit_mask, value);
status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, register_id,
(u16) register_value);
status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1_CONTROL, (u16) register_value);
break;
......@@ -724,7 +724,7 @@ acpi_hw_low_level_read (
/*
* Three address spaces supported:
* Memory, Io, or PCI config.
* Memory, IO, or PCI_Config.
*/
switch (reg->address_space_id) {
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
......@@ -808,9 +808,10 @@ acpi_hw_low_level_write (
(!reg->address)) {
return (AE_OK);
}
/*
* Three address spaces supported:
* Memory, Io, or PCI config.
* Memory, IO, or PCI_Config.
*/
switch (reg->address_space_id) {
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
......
......@@ -75,14 +75,10 @@ acpi_tb_get_table_count (
ACPI_FUNCTION_ENTRY ();
#if ACPI_MACHINE_WIDTH != 64
if (RSDP->revision < 2) {
pointer_size = sizeof (u32);
}
else
#endif
{
else {
pointer_size = sizeof (u64);
}
......
......@@ -145,7 +145,7 @@ acpi_tb_get_table_header (
/* Create a logical address for the physical pointer*/
status = acpi_os_map_memory (address->pointer.physical, sizeof (struct acpi_table_header),
(void **) &header);
(void *) &header);
if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Could not map memory at %8.8X%8.8X for length %X\n",
ACPI_HIDWORD (address->pointer.physical),
......@@ -361,7 +361,7 @@ acpi_tb_get_this_table (
* into our address space.
*/
status = acpi_os_map_memory (address->pointer.physical, (acpi_size) header->length,
(void **) &full_table);
(void *) &full_table);
if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n",
header->signature,
......
......@@ -85,7 +85,7 @@ acpi_tb_verify_rsdp (
* Obtain access to the RSDP structure
*/
status = acpi_os_map_memory (address->pointer.physical, sizeof (struct rsdp_descriptor),
(void **) &rsdp);
(void *) &rsdp);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
......
......@@ -179,7 +179,7 @@ acpi_get_firmware_table (
if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) {
status = acpi_os_map_memory (rsdp_address.pointer.physical, sizeof (struct rsdp_descriptor),
(void **) &acpi_gbl_RSDP);
(void *) &acpi_gbl_RSDP);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
......@@ -423,7 +423,7 @@ acpi_tb_find_rsdp (
* 1) Search EBDA (low memory) paragraphs
*/
status = acpi_os_map_memory ((u64) ACPI_LO_RSDP_WINDOW_BASE, ACPI_LO_RSDP_WINDOW_SIZE,
(void **) &table_ptr);
(void *) &table_ptr);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %X for length %X\n",
ACPI_LO_RSDP_WINDOW_BASE, ACPI_LO_RSDP_WINDOW_SIZE));
......@@ -447,7 +447,7 @@ acpi_tb_find_rsdp (
* 2) Search upper memory: 16-byte boundaries in E0000h-F0000h
*/
status = acpi_os_map_memory ((u64) ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE,
(void **) &table_ptr);
(void *) &table_ptr);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %X for length %X\n",
ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE));
......
......@@ -307,9 +307,9 @@ struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES] =
/*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */
/* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof (RSDP_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE},
/* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void **) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE | ACPI_TABLE_EXECUTABLE},
/* FADT 2 */ {FADT_SIG, FADT_SIG, (void **) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE},
/* FACS 3 */ {FACS_SIG, FACS_SIG, (void **) &acpi_gbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE},
/* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void *) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE | ACPI_TABLE_EXECUTABLE},
/* FADT 2 */ {FADT_SIG, FADT_SIG, (void *) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE},
/* FACS 3 */ {FACS_SIG, FACS_SIG, (void *) &acpi_gbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE},
/* PSDT 4 */ {PSDT_SIG, PSDT_SIG, NULL, sizeof (PSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE},
/* SSDT 5 */ {SSDT_SIG, SSDT_SIG, NULL, sizeof (SSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE},
/* XSDT 6 */ {XSDT_SIG, XSDT_SIG, NULL, sizeof (RSDT_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE},
......
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