Explorar el Código

acpi: widen acpi_evaluate_dsm() revision and function-index arguments

The ACPI specification states that arguments "Revision ID" and "Function
Index" to a _DSM are type "Integer."  Type Integers are 64 bit
quantities.

The function evaluate_dsm specifies these types as simple "int" which
are 32 bits.  Widen type passed to acpi_evaluate_dsm and its callers and
derived callers to pass correct type.

acpi_check_dsm and acpi_evaluate_dsm_typed had similar issue and were
corrected as well.

This is in preparation for libnvdimm implementing a generic _DSM
passthrough facility to have the capacity to pass 64-bit values as the
ACPI specification allows.

[djbw: clarify the changelog, add rationale]
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Jerry Hoemann hace 9 años
padre
commit
c7e16e5257
Se han modificado 2 ficheros con 5 adiciones y 5 borrados
  1. 2 2
      drivers/acpi/utils.c
  2. 3 3
      include/acpi/acpi_bus.h

+ 2 - 2
drivers/acpi/utils.c

@@ -625,7 +625,7 @@ acpi_status acpi_evaluate_lck(acpi_handle handle, int lock)
  * some old BIOSes do expect a buffer or an integer etc.
  * some old BIOSes do expect a buffer or an integer etc.
  */
  */
 union acpi_object *
 union acpi_object *
-acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, int rev, int func,
+acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 func,
 		  union acpi_object *argv4)
 		  union acpi_object *argv4)
 {
 {
 	acpi_status ret;
 	acpi_status ret;
@@ -674,7 +674,7 @@ EXPORT_SYMBOL(acpi_evaluate_dsm);
  * functions. Currently only support 64 functions at maximum, should be
  * functions. Currently only support 64 functions at maximum, should be
  * enough for now.
  * enough for now.
  */
  */
-bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs)
+bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs)
 {
 {
 	int i;
 	int i;
 	u64 mask = 0;
 	u64 mask = 0;

+ 3 - 3
include/acpi/acpi_bus.h

@@ -61,12 +61,12 @@ bool acpi_ata_match(acpi_handle handle);
 bool acpi_bay_match(acpi_handle handle);
 bool acpi_bay_match(acpi_handle handle);
 bool acpi_dock_match(acpi_handle handle);
 bool acpi_dock_match(acpi_handle handle);
 
 
-bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs);
+bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs);
 union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid,
 union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid,
-			int rev, int func, union acpi_object *argv4);
+			u64 rev, u64 func, union acpi_object *argv4);
 
 
 static inline union acpi_object *
 static inline union acpi_object *
-acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, int rev, int func,
+acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, u64 rev, u64 func,
 			union acpi_object *argv4, acpi_object_type type)
 			union acpi_object *argv4, acpi_object_type type)
 {
 {
 	union acpi_object *obj;
 	union acpi_object *obj;