aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/hardware/hwsleep.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-11-12 01:54:05 -0500
committerLen Brown <len.brown@intel.com>2008-12-29 22:38:36 -0500
commitd85988fa0205b18459071e4bd709e48e695b952d (patch)
treec8b81db8e5c697195813bd322c926ded595e9741 /drivers/acpi/hardware/hwsleep.c
parent6de4048a416d46eb2ac6597d03d2b58806a6b800 (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>
Diffstat (limited to 'drivers/acpi/hardware/hwsleep.c')
-rw-r--r--drivers/acpi/hardware/hwsleep.c54
1 files changed, 32 insertions, 22 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 ******************************************************************************/
63acpi_status 63acpi_status
64acpi_set_firmware_waking_vector(acpi_physical_address physical_address) 64acpi_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
112acpi_status 117acpi_status
113acpi_get_firmware_waking_vector(acpi_physical_address * physical_address) 118acpi_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
140ACPI_EXPORT_SYMBOL(acpi_get_firmware_waking_vector) 150ACPI_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