diff options
author | Bob Moore <robert.moore@intel.com> | 2008-11-12 01:54:05 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-12-29 22:38:36 -0500 |
commit | d85988fa0205b18459071e4bd709e48e695b952d (patch) | |
tree | c8b81db8e5c697195813bd322c926ded595e9741 | |
parent | 6de4048a416d46eb2ac6597d03d2b58806a6b800 (diff) |
ACPICA: Update FACS waking vector interfaces
Split AcpiSetFirmwareWakingVector into two: one for the 32-bit
vector, another for the 64-bit vector. This is required because the
host OS must setup the wake much differently for each vector (real
vs. protected mode, etc.) and the interface should not be deciding
which vector to use. Also eliminate the GetFirmwareWakingVector
interface, as it served no purpose (only the firmware reads the
vector, OS only writes the vector.) ACPICA BZ 731.
http://www.acpica.org/bugzilla/show_bug.cgi?id=731
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/hardware/hwsleep.c | 54 | ||||
-rw-r--r-- | include/acpi/acpixf.h | 6 |
2 files changed, 34 insertions, 26 deletions
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index 25dccdf179b9..6a30c8095ff1 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c | |||
@@ -52,16 +52,16 @@ ACPI_MODULE_NAME("hwsleep") | |||
52 | * | 52 | * |
53 | * FUNCTION: acpi_set_firmware_waking_vector | 53 | * FUNCTION: acpi_set_firmware_waking_vector |
54 | * | 54 | * |
55 | * PARAMETERS: physical_address - Physical address of ACPI real mode | 55 | * PARAMETERS: physical_address - 32-bit physical address of ACPI real mode |
56 | * entry point. | 56 | * entry point. |
57 | * | 57 | * |
58 | * RETURN: Status | 58 | * RETURN: Status |
59 | * | 59 | * |
60 | * DESCRIPTION: Access function for the firmware_waking_vector field in FACS | 60 | * DESCRIPTION: Sets the 32-bit firmware_waking_vector field of the FACS |
61 | * | 61 | * |
62 | ******************************************************************************/ | 62 | ******************************************************************************/ |
63 | acpi_status | 63 | acpi_status |
64 | acpi_set_firmware_waking_vector(acpi_physical_address physical_address) | 64 | acpi_set_firmware_waking_vector(u32 physical_address) |
65 | { | 65 | { |
66 | struct acpi_table_facs *facs; | 66 | struct acpi_table_facs *facs; |
67 | acpi_status status; | 67 | acpi_status status; |
@@ -85,10 +85,16 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address) | |||
85 | * Protected Mode. Some systems (for example HP dv5-1004nr) are known | 85 | * Protected Mode. Some systems (for example HP dv5-1004nr) are known |
86 | * to fail to resume if the 64-bit vector is used. | 86 | * to fail to resume if the 64-bit vector is used. |
87 | */ | 87 | */ |
88 | if (facs->version >= 1) | ||
89 | facs->xfirmware_waking_vector = 0; | ||
90 | 88 | ||
91 | facs->firmware_waking_vector = (u32)physical_address; | 89 | /* Set the 32-bit vector */ |
90 | |||
91 | facs->firmware_waking_vector = physical_address; | ||
92 | |||
93 | /* Clear the 64-bit vector if it exists */ | ||
94 | |||
95 | if ((facs->length > 32) && (facs->version >= 1)) { | ||
96 | facs->xfirmware_waking_vector = 0; | ||
97 | } | ||
92 | 98 | ||
93 | return_ACPI_STATUS(AE_OK); | 99 | return_ACPI_STATUS(AE_OK); |
94 | } | 100 | } |
@@ -97,29 +103,25 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector) | |||
97 | 103 | ||
98 | /******************************************************************************* | 104 | /******************************************************************************* |
99 | * | 105 | * |
100 | * FUNCTION: acpi_get_firmware_waking_vector | 106 | * FUNCTION: acpi_set_firmware_waking_vector64 |
101 | * | 107 | * |
102 | * PARAMETERS: *physical_address - Where the contents of | 108 | * PARAMETERS: physical_address - 64-bit physical address of ACPI protected |
103 | * the firmware_waking_vector field of | 109 | * mode entry point. |
104 | * the FACS will be returned. | ||
105 | * | 110 | * |
106 | * RETURN: Status, vector | 111 | * RETURN: Status |
107 | * | 112 | * |
108 | * DESCRIPTION: Access function for the firmware_waking_vector field in FACS | 113 | * DESCRIPTION: Sets the 64-bit X_firmware_waking_vector field of the FACS, if |
114 | * it exists in the table. | ||
109 | * | 115 | * |
110 | ******************************************************************************/ | 116 | ******************************************************************************/ |
111 | #ifdef ACPI_FUTURE_USAGE | ||
112 | acpi_status | 117 | acpi_status |
113 | acpi_get_firmware_waking_vector(acpi_physical_address * physical_address) | 118 | acpi_set_firmware_waking_vector64(u64 physical_address) |
114 | { | 119 | { |
115 | struct acpi_table_facs *facs; | 120 | struct acpi_table_facs *facs; |
116 | acpi_status status; | 121 | acpi_status status; |
117 | 122 | ||
118 | ACPI_FUNCTION_TRACE(acpi_get_firmware_waking_vector); | 123 | ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector64); |
119 | 124 | ||
120 | if (!physical_address) { | ||
121 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
122 | } | ||
123 | 125 | ||
124 | /* Get the FACS */ | 126 | /* Get the FACS */ |
125 | 127 | ||
@@ -131,14 +133,22 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address) | |||
131 | return_ACPI_STATUS(status); | 133 | return_ACPI_STATUS(status); |
132 | } | 134 | } |
133 | 135 | ||
134 | /* Get the vector */ | 136 | /* Determine if the 64-bit vector actually exists */ |
135 | *physical_address = (acpi_physical_address)facs->firmware_waking_vector; | 137 | |
138 | if ((facs->length <= 32) || (facs->version < 1)) { | ||
139 | return_ACPI_STATUS(AE_NOT_EXIST); | ||
140 | } | ||
141 | |||
142 | /* Clear 32-bit vector, set the 64-bit X_ vector */ | ||
143 | |||
144 | facs->firmware_waking_vector = 0; | ||
145 | facs->xfirmware_waking_vector = physical_address; | ||
136 | 146 | ||
137 | return_ACPI_STATUS(AE_OK); | 147 | return_ACPI_STATUS(AE_OK); |
138 | } | 148 | } |
139 | 149 | ||
140 | ACPI_EXPORT_SYMBOL(acpi_get_firmware_waking_vector) | 150 | ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector64) |
141 | #endif | 151 | |
142 | /******************************************************************************* | 152 | /******************************************************************************* |
143 | * | 153 | * |
144 | * FUNCTION: acpi_enter_sleep_state_prep | 154 | * FUNCTION: acpi_enter_sleep_state_prep |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 33bc0e3b1954..c9b903f3625a 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -320,12 +320,10 @@ acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value); | |||
320 | acpi_status acpi_set_register(u32 register_id, u32 value); | 320 | acpi_status acpi_set_register(u32 register_id, u32 value); |
321 | 321 | ||
322 | acpi_status | 322 | acpi_status |
323 | acpi_set_firmware_waking_vector(acpi_physical_address physical_address); | 323 | acpi_set_firmware_waking_vector(u32 physical_address); |
324 | 324 | ||
325 | #ifdef ACPI_FUTURE_USAGE | ||
326 | acpi_status | 325 | acpi_status |
327 | acpi_get_firmware_waking_vector(acpi_physical_address * physical_address); | 326 | acpi_set_firmware_waking_vector64(u64 physical_address); |
328 | #endif | ||
329 | 327 | ||
330 | acpi_status | 328 | acpi_status |
331 | acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); | 329 | acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); |