]> git.neil.brown.name Git - history.git/commitdiff
ACPI: Interpreter update to 20030619
authorAndy Grover <agrover@groveronline.com>
Thu, 19 Jun 2003 10:41:38 +0000 (03:41 -0700)
committerAndy Grover <agrover@groveronline.com>
Thu, 19 Jun 2003 10:41:38 +0000 (03:41 -0700)
- Fix To/FromBCD, eliminating the need for an arch-specific #define
- Do not acquire a semaphore in the S5 shutdown path
- Fix ex_digits_needed for 0 (Takayoshi Kochi)
- Fix sleep/stall code reversal (Andi Kleen)
- Revert a change having to do with control method calling semantics

16 files changed:
drivers/acpi/dispatcher/dsmthdat.c
drivers/acpi/events/evgpe.c
drivers/acpi/events/evgpeblk.c
drivers/acpi/executer/exoparg1.c
drivers/acpi/executer/exstore.c
drivers/acpi/executer/exsystem.c
drivers/acpi/executer/exutils.c
drivers/acpi/hardware/hwregs.c
drivers/acpi/hardware/hwsleep.c
drivers/acpi/tables/tbconvrt.c
drivers/acpi/utilities/utmisc.c
include/acpi/acconfig.h
include/acpi/acglobal.h
include/acpi/achware.h
include/acpi/acpiosxf.h
include/acpi/actypes.h

index 55495cc50518e2161fdfc1fd65b0bdaacf4f9d5d..0c47ecea305df373133e20979228a9e34355b829 100644 (file)
@@ -306,7 +306,6 @@ acpi_ds_method_data_set_value (
 {
        acpi_status                     status;
        struct acpi_namespace_node      *node;
-       union acpi_operand_object       *new_desc = object;
 
 
        ACPI_FUNCTION_TRACE ("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,
-        * (the reference count is 1), then we can just store it directly into
-        * the arg/local.  Otherwise, we must copy it.
+        * Increment ref count so object can't be deleted while installed.
+        * NOTE: We do not copy the object in order to preserve the call by
+        * reference semantics of ACPI Control Method invocation.
+        * (See ACPI specification 2.0_c)
         */
-       if (object->common.reference_count > 1) {
-               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);
-       }
+       acpi_ut_add_reference (object);
 
        /* Install the object */
 
-       node->object = new_desc;
+       node->object = object;
        return_ACPI_STATUS (status);
 }
 
index 4cb089d54c67f3b278891570425ef3010b292ea7..0108b47fadffbf92e2b86ff83abae097ede8ae52 100644 (file)
@@ -186,11 +186,13 @@ acpi_ev_gpe_detect (
                        }
 
                        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_LODWORD (gpe_register_info->enable_address.address),
-                               gpe_register_info->enable,
-                               gpe_register_info->status));
+                               gpe_register_info->enable));
 
                        /* First check if there is anything active at all in this register */
 
index c24a11d9aaec50664570e773900593f3a0de3124..0849a14560c861a5946e447d7e0f24af66ac8e72 100644 (file)
@@ -76,9 +76,14 @@ acpi_ev_valid_gpe_event (
 
        /* 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;
        while (gpe_xrupt_block) {
                gpe_block = gpe_xrupt_block->gpe_block_list_head;
+
+               /* Walk the GPE blocks on this interrupt level */
+
                while (gpe_block) {
                        if ((&gpe_block->event_info[0] <= gpe_event_info) &&
                                (&gpe_block->event_info[((acpi_size) gpe_block->register_count) * 8] > gpe_event_info)) {
@@ -155,7 +160,7 @@ unlock_and_exit:
  *
  * PARAMETERS:  Callback from walk_namespace
  *
- * RETURN:      None
+ * RETURN:      Status
  *
  * DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a
  *              control method under the _GPE portion of the namespace.
@@ -164,10 +169,10 @@ unlock_and_exit:
  *
  *              The name of each GPE control method is of the form:
  *                  "_Lnn" or "_Enn"
- *              Where:
- *                  L      - means that the GPE is level triggered
- *                  E      - means that the GPE is edge triggered
- *                  nn     - is the GPE number [in HEX]
+ *                  Where:
+ *                      L      - means that the GPE is level triggered
+ *                      E      - means that the GPE is edge triggered
+ *                      nn     - is the GPE number [in HEX]
  *
  ******************************************************************************/
 
@@ -196,7 +201,8 @@ acpi_ev_save_method_info (
        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]) {
        case 'L':
@@ -249,15 +255,14 @@ acpi_ev_save_method_info (
        gpe_event_info->flags    = type;
        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);
        if (ACPI_FAILURE (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",
                name, gpe_number));
        return_ACPI_STATUS (AE_OK);
@@ -867,8 +872,8 @@ acpi_ev_gpe_initialize (void)
                        }
 
                        /*
-                        * GPE0 and GPE1 do not have to be contiguous in the GPE number space,
-                        * But, GPE0 always starts at zero.
+                        * GPE0 and GPE1 do not have to be contiguous in the GPE number
+                        * space. However, GPE0 always starts at GPE number zero.
                         */
                        gpe_number_max = acpi_gbl_FADT->gpe1_base +
                                           ((register_count1 * ACPI_GPE_REGISTER_WIDTH) - 1);
index 757ef213ede5a54eae823bd0498b01695eb8d260..85e2acdf3c1252a2a586e64b0795dfa4d28ad6a2 100644 (file)
@@ -222,7 +222,7 @@ acpi_ex_opcode_1A_1T_1R (
        union acpi_operand_object       *return_desc2 = NULL;
        u32                             temp32;
        u32                             i;
-       u32                             j;
+       u32                             power_of_ten;
        acpi_integer                    digit;
 
 
@@ -291,61 +291,70 @@ acpi_ex_opcode_1A_1T_1R (
                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;
-                       for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
-                               /* Get one BCD digit */
+                       digit = operand[0]->integer.value;
 
-                               digit = (acpi_integer) ((operand[0]->integer.value >> (i * 4)) & 0xF);
+                       /* Convert each BCD digit (each is one nybble wide) */
+
+                       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 */
 
-                               if (digit > 9) {
-                                       ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD digit too large: %d\n",
-                                               (u32) digit));
+                               if (temp32 > 9) {
+                                       ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+                                               "BCD digit too large (not decimal): 0x%X\n",
+                                               temp32));
+
                                        status = AE_AML_NUMERIC_OVERFLOW;
                                        goto cleanup;
                                }
 
-                               if (digit > 0) {
-                                       /* Sum into the result with the appropriate power of 10 */
+                               /* Sum the digit into the result with the current power of 10 */
 
-                                       for (j = 0; j < i; j++) {
-                                               digit *= 10;
-                                       }
+                               return_desc->integer.value += (((acpi_integer) temp32) * power_of_ten);
 
-                                       return_desc->integer.value += digit;
-                               }
+                               /* Shift to next BCD digit */
+
+                               digit >>= 4;
+
+                               /* Next power of 10 */
+
+                               power_of_ten *= 10;
                        }
                        break;
 
 
                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;
-                       for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
-                               /* Divide by nth factor of 10 */
+                       digit = operand[0]->integer.value;
 
-                               temp32 = 0;
-                               digit = operand[0]->integer.value;
-                               for (j = 0; j < i; j++) {
-                                       (void) acpi_ut_short_divide (&digit, 10, &digit, &temp32);
-                               }
+                       /* Each BCD digit is one nybble wide */
 
-                               /* Create the BCD digit from the remainder above */
+                       for (i = 0; (i < acpi_gbl_integer_nybble_width) && (digit > 0); i++) {
+                               (void) acpi_ut_short_divide (&digit, 10, &digit, &temp32);
 
-                               if (digit > 0) {
-                                       return_desc->integer.value += ((acpi_integer) temp32 << (i * 4));
-                               }
+                               /* Insert the BCD digit that resides in the remainder from above */
+
+                               return_desc->integer.value |= (((acpi_integer) temp32) << (i * 4));
+                       }
+
+                       /* Overflow if there is any data left in Digit */
+
+                       if (digit > 0) {
+                               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;
 
index acd9da27a3ac6b083d128fc523d481fabbf81866..517dbaec6227e00519c50a435adf2b3a6e873471 100644 (file)
@@ -190,8 +190,8 @@ acpi_ex_store (
                case ACPI_TYPE_INTEGER:
 
                        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n",
-                                       ACPI_HIWORD (source_desc->integer.value),
-                                       ACPI_LOWORD (source_desc->integer.value)));
+                                       ACPI_HIDWORD (source_desc->integer.value),
+                                       ACPI_LODWORD (source_desc->integer.value)));
                        break;
 
 
index ea3dbe74ef5874124626bbdc2e4b3f47ea0c3f54..8d4c003ac195f51a48e98e6d39b527b9449a9c9e 100644 (file)
@@ -134,7 +134,7 @@ acpi_ex_system_do_stall (
 
                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 */
 
@@ -142,7 +142,7 @@ acpi_ex_system_do_stall (
        }
 
        else {
-               acpi_os_sleep (0, (how_long / 1000) + 1);
+               acpi_os_stall (how_long);
        }
 
        return (status);
index 090684c6ea161302bfae37a2dc254f475c06962f..d58e97e3e724eba8a79b22f52033e7a2eb94a584 100644 (file)
@@ -289,7 +289,10 @@ acpi_ex_digits_needed (
        /*
         * 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;
 
        while (current_value) {
index 25e05b1384431a2480540707c866514cc57efb01..b18cbfa6bef47219f2841fe19d02d23e522a0282 100644 (file)
@@ -56,7 +56,7 @@
  *
  * FUNCTION:    acpi_hw_clear_acpi_status
  *
- * PARAMETERS:  none
+ * PARAMETERS:  Flags           - Lock the hardware or not
  *
  * RETURN:      none
  *
@@ -65,7 +65,8 @@
  ******************************************************************************/
 
 acpi_status
-acpi_hw_clear_acpi_status (void)
+acpi_hw_clear_acpi_status (
+       u32                             flags)
 {
        acpi_status                     status;
 
@@ -77,10 +78,11 @@ acpi_hw_clear_acpi_status (void)
                ACPI_BITMASK_ALL_FIXED_STATUS,
                (u16) acpi_gbl_FADT->xpm1a_evt_blk.address));
 
-
-       status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE);
-       if (ACPI_FAILURE (status)) {
-               return_ACPI_STATUS (status);
+       if (flags & ACPI_MTX_LOCK) {
+               status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE);
+               if (ACPI_FAILURE (status)) {
+                       return_ACPI_STATUS (status);
+               }
        }
 
        status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS,
@@ -104,7 +106,9 @@ acpi_hw_clear_acpi_status (void)
        status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block);
 
 unlock_and_exit:
-       (void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE);
+       if (flags & ACPI_MTX_LOCK) {
+               (void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE);
+       }
        return_ACPI_STATUS (status);
 }
 
@@ -237,8 +241,9 @@ acpi_hw_get_bit_register_info (
  *
  * FUNCTION:    acpi_get_register
  *
- * PARAMETERS:  register_id         - Index of ACPI Register to access
- *              use_lock            - Lock the hardware
+ * PARAMETERS:  register_id     - ID of ACPI bit_register to access
+ *              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
  *              normalized to bit0 (is shifted all the way right)
@@ -290,7 +295,8 @@ acpi_get_register (
 
                *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);
@@ -443,7 +449,8 @@ unlock_and_exit:
 
        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);
 }
 
@@ -751,10 +758,15 @@ acpi_hw_low_level_read (
        default:
                ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
                        "Unsupported address space: %X\n", reg->address_space_id));
-               status = AE_BAD_PARAMETER;
-               break;
+               return (AE_BAD_PARAMETER);
        }
 
+       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);
 }
 
@@ -832,9 +844,14 @@ acpi_hw_low_level_write (
        default:
                ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
                        "Unsupported address space: %X\n", reg->address_space_id));
-               status = AE_BAD_PARAMETER;
-               break;
+               return (AE_BAD_PARAMETER);
        }
 
+       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);
 }
index 37dc30a49bde1aa735a7173ac6dcedfaa2036307..87642c7568651c19a0f7da46726dbf7ed4b6e407 100644 (file)
@@ -231,7 +231,7 @@ acpi_enter_sleep_state (
                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)) {
                return_ACPI_STATUS (status);
        }
@@ -355,7 +355,7 @@ 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_hw_clear_acpi_status();
+       acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
 
        acpi_hw_disable_non_wakeup_gpes();
 
index 4b412360e417a03c3f861d65c9cc4e9d59f80225..099eb723b64e1a01b30ad37f30c9a7f928c28a8b 100644 (file)
@@ -287,10 +287,14 @@ acpi_tb_convert_fadt1 (
                 (acpi_physical_address) (local_fadt->xpm1a_evt_blk.address +
                        ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
 
-       acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable,
-                (u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
-                (acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
-                       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,
+                        (u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
+                        (acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
+                               ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
+       }
 }
 
 
@@ -379,11 +383,15 @@ acpi_tb_convert_fadt2 (
                        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_tb_init_generic_address (&acpi_gbl_xpm1b_enable,
-               (u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
-               (acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
-                       ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
-       acpi_gbl_xpm1b_enable.address_space_id = local_fadt->xpm1b_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,
+                       (u8) ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len),
+                       (acpi_physical_address) (local_fadt->xpm1b_evt_blk.address +
+                               ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len)));
+               acpi_gbl_xpm1b_enable.address_space_id = local_fadt->xpm1b_evt_blk.address_space_id;
+       }
 }
 
 
index b16c01e8355993f815f9d07ab926989a58ba59f5..5012037926cb98c335962f12b58904677be70642 100644 (file)
@@ -203,10 +203,12 @@ acpi_ut_set_integer_width (
 
        if (revision <= 1) {
                acpi_gbl_integer_bit_width = 32;
+               acpi_gbl_integer_nybble_width = 8;
                acpi_gbl_integer_byte_width = 4;
        }
        else {
                acpi_gbl_integer_bit_width = 64;
+               acpi_gbl_integer_nybble_width = 16;
                acpi_gbl_integer_byte_width = 8;
        }
 }
index 3fda218d6de3af8c731cb681e7f940e0ab7b71ef..329cdaafe22cfbe80a006adf99d6502187c3c4cd 100644 (file)
@@ -64,7 +64,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20030522
+#define ACPI_CA_VERSION                 0x20030619
 
 /* Maximum objects in the various object caches */
 
index 254d11a7ac5e95502411e041988474136e1cd156..8520f1372cca441c1d305dd7d7cf3e57d62b1d60 100644 (file)
@@ -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_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_xpm1b_enable;
 
index 4be6958950e6616cc1b2c80073c368796cf9d64f..9fbb1b0e9c84179174908ca925ac4a3e2be843eb 100644 (file)
@@ -108,7 +108,7 @@ acpi_hw_low_level_write (
 
 acpi_status
 acpi_hw_clear_acpi_status (
-   void);
+       u32                             flags);
 
 
 /* GPE support */
index 0d495da9ab1c691290eb62368427eb23aec3a9f8..bb6df66442bc15bf04e68a1fa59c912be217df34 100644 (file)
@@ -287,15 +287,15 @@ acpi_os_derive_pci_id(
  * Miscellaneous
  */
 
-BOOLEAN
+u8
 acpi_os_readable (
        void                            *pointer,
-       u32                             length);
+       acpi_size                       length);
 
-BOOLEAN
+u8
 acpi_os_writable (
        void                            *pointer,
-       u32                             length);
+       acpi_size                       length);
 
 u32
 acpi_os_get_timer (
index d077d741968280af84d3726fbf5cfd0d910bccbd..beec737952a32dc3e7a21f79a0ceb63d443d5808 100644 (file)
 
 /*
  * 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_UINT16_MAX                 (~((UINT16) 0))
-#define ACPI_UINT32_MAX                 (~((UINT32) 0))
-#define ACPI_UINT64_MAX                 (~((UINT64) 0))
+#define ACPI_UINT8_MAX                  (UINT8) (~((UINT8)  0)) /* 0xFF               */
+#define ACPI_UINT16_MAX                 (UINT16)(~((UINT16) 0)) /* 0xFFFF             */
+#define ACPI_UINT32_MAX                 (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF         */
+#define ACPI_UINT64_MAX                 (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
 #define ACPI_ASCII_MAX                  0x7F
 
 
@@ -299,8 +302,6 @@ struct uint32_struct
 typedef u32                                     acpi_integer;
 #define ACPI_INTEGER_MAX                ACPI_UINT32_MAX
 #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_USE_NATIVE_DIVIDE          /* Use compiler native 32-bit divide */
@@ -313,12 +314,6 @@ typedef u32                                     acpi_integer;
 typedef u64                                     acpi_integer;
 #define ACPI_INTEGER_MAX                ACPI_UINT64_MAX
 #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
 
 #if ACPI_MACHINE_WIDTH == 64