Skip to content

Commit

Permalink
ACPICA: Predefine names: Add allowed argument types to master info table
Browse files Browse the repository at this point in the history
This change adds the infrastructure to enable typechecking
on incoming arguments for the predefined methods/objects. It
does not actually contain the code that will fully utilize this
information. Also condenses some duplicate code for the predefined
names into a new module, utilities/utpredef.c

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Bob Moore authored and Rafael J. Wysocki committed Apr 12, 2013
1 parent f084dbb commit c34c82b
Show file tree
Hide file tree
Showing 8 changed files with 1,361 additions and 513 deletions.
1 change: 1 addition & 0 deletions drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ acpi-y += \
utobject.o \
utosi.o \
utownerid.o \
utpredef.o \
utresrc.o \
utstate.o \
utstring.o \
Expand Down
13 changes: 10 additions & 3 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ acpi_status(*acpi_internal_method) (struct acpi_walk_state * walk_state);
#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF

#pragma pack(1)

/*
* Information structure for ACPI predefined names.
* Each entry in the table contains the following items:
Expand All @@ -304,7 +306,7 @@ acpi_status(*acpi_internal_method) (struct acpi_walk_state * walk_state);
*/
struct acpi_name_info {
char name[ACPI_NAME_SIZE];
u8 param_count;
u16 argument_list;
u8 expected_btypes;
};

Expand All @@ -327,7 +329,7 @@ struct acpi_package_info {
u8 count1;
u8 object_type2;
u8 count2;
u8 reserved;
u16 reserved;
};

/* Used for ACPI_PTYPE2_FIXED */
Expand All @@ -336,6 +338,7 @@ struct acpi_package_info2 {
u8 type;
u8 count;
u8 object_type[4];
u8 reserved;
};

/* Used for ACPI_PTYPE1_OPTION */
Expand All @@ -345,7 +348,7 @@ struct acpi_package_info3 {
u8 count;
u8 object_type[2];
u8 tail_object_type;
u8 reserved;
u16 reserved;
};

union acpi_predefined_info {
Expand All @@ -355,6 +358,10 @@ union acpi_predefined_info {
struct acpi_package_info3 ret_info3;
};

/* Reset to default packing */

#pragma pack()

/* Data block used during object validation */

struct acpi_predefined_data {
Expand Down
4 changes: 0 additions & 4 deletions drivers/acpi/acpica/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
acpi_status return_status,
union acpi_operand_object **return_object);

const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct
acpi_namespace_node
*node);

void
acpi_ns_check_parameter_count(char *pathname,
struct acpi_namespace_node *node,
Expand Down
Loading

0 comments on commit c34c82b

Please sign in to comment.