aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/hardware/hwsleep.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-11-12 02:34:52 -0500
committerLen Brown <len.brown@intel.com>2008-12-29 22:38:37 -0500
commit009c4cbe99bea2da53f29ad685975a36f38c001c (patch)
tree170887ee9986ae84792200abd3f3022df01630ce /drivers/acpi/hardware/hwsleep.c
parentc87609f31a8641009641fc1d19dac75e6de06fd4 (diff)
ACPICA: Add global pointer for FACS table to simplify FACS access
Use a global pointer instead of using AcpiGetTableByIndex for each FACS access. This simplifies the code for the Global Lock and the Firmware Waking Vector(s). 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.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index 6a30c8095ff1..5ec727ffcbe3 100644
--- a/drivers/acpi/hardware/hwsleep.c
+++ b/drivers/acpi/hardware/hwsleep.c
@@ -63,20 +63,8 @@ ACPI_MODULE_NAME("hwsleep")
63acpi_status 63acpi_status
64acpi_set_firmware_waking_vector(u32 physical_address) 64acpi_set_firmware_waking_vector(u32 physical_address)
65{ 65{
66 struct acpi_table_facs *facs;
67 acpi_status status;
68
69 ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector); 66 ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector);
70 67
71 /* Get the FACS */
72
73 status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
74 ACPI_CAST_INDIRECT_PTR(struct
75 acpi_table_header,
76 &facs));
77 if (ACPI_FAILURE(status)) {
78 return_ACPI_STATUS(status);
79 }
80 68
81 /* 69 /*
82 * According to the ACPI specification 2.0c and later, the 64-bit 70 * According to the ACPI specification 2.0c and later, the 64-bit
@@ -88,12 +76,12 @@ acpi_set_firmware_waking_vector(u32 physical_address)
88 76
89 /* Set the 32-bit vector */ 77 /* Set the 32-bit vector */
90 78
91 facs->firmware_waking_vector = physical_address; 79 acpi_gbl_FACS->firmware_waking_vector = physical_address;
92 80
93 /* Clear the 64-bit vector if it exists */ 81 /* Clear the 64-bit vector if it exists */
94 82
95 if ((facs->length > 32) && (facs->version >= 1)) { 83 if ((acpi_gbl_FACS->length > 32) && (acpi_gbl_FACS->version >= 1)) {
96 facs->xfirmware_waking_vector = 0; 84 acpi_gbl_FACS->xfirmware_waking_vector = 0;
97 } 85 }
98 86
99 return_ACPI_STATUS(AE_OK); 87 return_ACPI_STATUS(AE_OK);
@@ -117,32 +105,19 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector)
117acpi_status 105acpi_status
118acpi_set_firmware_waking_vector64(u64 physical_address) 106acpi_set_firmware_waking_vector64(u64 physical_address)
119{ 107{
120 struct acpi_table_facs *facs;
121 acpi_status status;
122
123 ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector64); 108 ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector64);
124 109
125 110
126 /* Get the FACS */
127
128 status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
129 ACPI_CAST_INDIRECT_PTR(struct
130 acpi_table_header,
131 &facs));
132 if (ACPI_FAILURE(status)) {
133 return_ACPI_STATUS(status);
134 }
135
136 /* Determine if the 64-bit vector actually exists */ 111 /* Determine if the 64-bit vector actually exists */
137 112
138 if ((facs->length <= 32) || (facs->version < 1)) { 113 if ((acpi_gbl_FACS->length <= 32) || (acpi_gbl_FACS->version < 1)) {
139 return_ACPI_STATUS(AE_NOT_EXIST); 114 return_ACPI_STATUS(AE_NOT_EXIST);
140 } 115 }
141 116
142 /* Clear 32-bit vector, set the 64-bit X_ vector */ 117 /* Clear 32-bit vector, set the 64-bit X_ vector */
143 118
144 facs->firmware_waking_vector = 0; 119 acpi_gbl_FACS->firmware_waking_vector = 0;
145 facs->xfirmware_waking_vector = physical_address; 120 acpi_gbl_FACS->xfirmware_waking_vector = physical_address;
146 121
147 return_ACPI_STATUS(AE_OK); 122 return_ACPI_STATUS(AE_OK);
148} 123}