Skip to content

Commit

Permalink
ACPICA 20050408 from Bob Moore
Browse files Browse the repository at this point in the history
Fixed three cases in the interpreter where an "index"
argument to an ASL function was still (internally) 32
bits instead of the required 64 bits.  This was the Index
argument to the Index, Mid, and Match operators.

The "strupr" function is now permanently local
(acpi_ut_strupr), since this is not a POSIX-defined
function and not present in most kernel-level C
libraries. References to the C library strupr function
have been removed from the headers.

Completed the deployment of static
functions/prototypes. All prototypes with the static
attribute have been moved from the headers to the owning
C file.

ACPICA 20050329 from Bob Moore

An error is now generated if an attempt is made to create
a Buffer Field of length zero (A CreateField with a length
operand of zero.)

The interpreter now issues a warning whenever executable
code at the module level is detected during ACPI table
load. This will give some idea of the prevalence of this
type of code.

Implemented support for references to named objects (other
than control methods) within package objects.

Enhanced package object output for the debug
object. Package objects are now completely dumped, showing
all elements.

Enhanced miscellaneous object output for the debug
object. Any object can now be written to the debug object
(for example, a device object can be written, and the type
of the object will be displayed.)

The "static" qualifier has been added to all local
functions across the core subsystem.

The number of "long" lines (> 80 chars) within the source
has been significantly reduced, by about 1/3.

Cleaned up all header files to ensure that all CA/iASL
functions are prototyped (even static functions) and the
formatting is consistent.

Two new header files have been added, acopcode.h and
acnames.h.

Removed several obsolete functions that were no longer
used.

Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Robert Moore authored and Len Brown committed Jul 12, 2005
1 parent ebb6e1a commit 44f6c01
Show file tree
Hide file tree
Showing 128 changed files with 5,220 additions and 4,811 deletions.
58 changes: 37 additions & 21 deletions drivers/acpi/dispatcher/dsfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,20 @@
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsfield")

/* Local prototypes */

static acpi_status
acpi_ds_get_field_names (
struct acpi_create_field_info *info,
struct acpi_walk_state *walk_state,
union acpi_parse_object *arg);


/*******************************************************************************
*
* FUNCTION: acpi_ds_create_buffer_field
*
* PARAMETERS: Opcode - The opcode to be executed
* Operands - List of operands for the opcode
* PARAMETERS: Op - Current parse op (create_xXField)
* walk_state - Current state
*
* RETURN: Status
Expand All @@ -70,7 +77,7 @@
* create_word_field_op,
* create_dword_field_op,
* create_qword_field_op,
* create_field_op (all of which define fields in buffers)
* create_field_op (all of which define a field in a buffer)
*
******************************************************************************/

Expand Down Expand Up @@ -119,7 +126,8 @@ acpi_ds_create_buffer_field (
flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE;
}
else {
flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND;
flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
ACPI_NS_ERROR_IF_FOUND;
}

/*
Expand All @@ -134,16 +142,16 @@ acpi_ds_create_buffer_field (
}
}

/* We could put the returned object (Node) on the object stack for later, but
* for now, we will put it in the "op" object that the parser uses, so we
* can get it again at the end of this scope
/* We could put the returned object (Node) on the object stack for later,
* but for now, we will put it in the "op" object that the parser uses,
* so we can get it again at the end of this scope
*/
op->common.node = node;

/*
* If there is no object attached to the node, this node was just created and
* we need to create the field object. Otherwise, this was a lookup of an
* existing node and we don't want to create the field object again.
* If there is no object attached to the node, this node was just created
* and we need to create the field object. Otherwise, this was a lookup
* of an existing node and we don't want to create the field object again.
*/
obj_desc = acpi_ns_get_attached_object (node);
if (obj_desc) {
Expand Down Expand Up @@ -205,7 +213,7 @@ acpi_ds_create_buffer_field (
*
******************************************************************************/

acpi_status
static acpi_status
acpi_ds_get_field_names (
struct acpi_create_field_info *info,
struct acpi_walk_state *walk_state,
Expand Down Expand Up @@ -238,7 +246,8 @@ acpi_ds_get_field_names (
+ (acpi_integer) arg->common.value.size;

if (position > ACPI_UINT32_MAX) {
ACPI_REPORT_ERROR (("Bit offset within field too large (> 0xFFFFFFFF)\n"));
ACPI_REPORT_ERROR ((
"Bit offset within field too large (> 0xFFFFFFFF)\n"));
return_ACPI_STATUS (AE_SUPPORT);
}

Expand All @@ -250,12 +259,15 @@ acpi_ds_get_field_names (

/*
* Get a new access_type and access_attribute -- to be used for all
* field units that follow, until field end or another access_as keyword.
* field units that follow, until field end or another access_as
* keyword.
*
* In field_flags, preserve the flag bits other than the ACCESS_TYPE bits
* In field_flags, preserve the flag bits other than the
* ACCESS_TYPE bits
*/
info->field_flags = (u8) ((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
((u8) ((u32) arg->common.value.integer >> 8)));
info->field_flags = (u8)
((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
((u8) ((u32) arg->common.value.integer >> 8)));

info->attribute = (u8) (arg->common.value.integer);
break;
Expand All @@ -267,7 +279,8 @@ acpi_ds_get_field_names (

status = acpi_ns_lookup (walk_state->scope_info,
(char *) &arg->named.name,
info->field_type, ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
info->field_type, ACPI_IMODE_EXECUTE,
ACPI_NS_DONT_OPEN_SCOPE,
walk_state, &info->field_node);
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR ((char *) &arg->named.name, status);
Expand Down Expand Up @@ -295,8 +308,9 @@ acpi_ds_get_field_names (
+ (acpi_integer) arg->common.value.size;

if (position > ACPI_UINT32_MAX) {
ACPI_REPORT_ERROR (("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n",
(char *) &info->field_node->name));
ACPI_REPORT_ERROR ((
"Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n",
(char *) &info->field_node->name));
return_ACPI_STATUS (AE_SUPPORT);
}

Expand All @@ -306,7 +320,8 @@ acpi_ds_get_field_names (

default:

ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n",
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Invalid opcode in field list: %X\n",
arg->common.aml_opcode));
return_ACPI_STATUS (AE_AML_BAD_OPCODE);
}
Expand Down Expand Up @@ -435,7 +450,8 @@ acpi_ds_init_field_objects (
status = acpi_ns_lookup (walk_state->scope_info,
(char *) &arg->named.name,
type, ACPI_IMODE_LOAD_PASS1,
ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND,
ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
ACPI_NS_ERROR_IF_FOUND,
walk_state, &node);
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR ((char *) &arg->named.name, status);
Expand Down
28 changes: 21 additions & 7 deletions drivers/acpi/dispatcher/dsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,21 @@
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsinit")

/* Local prototypes */

static acpi_status
acpi_ds_init_one_object (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value);


/*******************************************************************************
*
* FUNCTION: acpi_ds_init_one_object
*
* PARAMETERS: obj_handle - Node
* PARAMETERS: obj_handle - Node for the object
* Level - Current nesting level
* Context - Points to a init info struct
* return_value - Not used
Expand All @@ -70,7 +79,7 @@
*
******************************************************************************/

acpi_status
static acpi_status
acpi_ds_init_one_object (
acpi_handle obj_handle,
u32 level,
Expand Down Expand Up @@ -105,7 +114,8 @@ acpi_ds_init_one_object (

status = acpi_ds_initialize_region (obj_handle);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %p [%4.4s] - Init failure, %s\n",
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Region %p [%4.4s] - Init failure, %s\n",
obj_handle, acpi_ut_get_node_name (obj_handle),
acpi_format_exception (status)));
}
Expand All @@ -118,8 +128,10 @@ acpi_ds_init_one_object (

info->method_count++;

/* Print a dot for each method unless we are going to print the entire pathname */

/*
* Print a dot for each method unless we are going to print
* the entire pathname
*/
if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
}
Expand All @@ -140,7 +152,8 @@ acpi_ds_init_one_object (
*/
status = acpi_ds_parse_method (obj_handle);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n",
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Method %p [%4.4s] - parse failure, %s\n",
obj_handle, acpi_ut_get_node_name (obj_handle),
acpi_format_exception (status)));

Expand All @@ -154,7 +167,8 @@ acpi_ds_init_one_object (
* for every execution since there isn't much overhead
*/
acpi_ns_delete_namespace_subtree (obj_handle);
acpi_ns_delete_namespace_by_owner (((struct acpi_namespace_node *) obj_handle)->object->method.owning_id);
acpi_ns_delete_namespace_by_owner (
((struct acpi_namespace_node *) obj_handle)->object->method.owning_id);
break;


Expand Down
11 changes: 5 additions & 6 deletions drivers/acpi/dispatcher/dsmethod.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,11 @@ acpi_ds_parse_method (
/*
* Parse the method, first pass
*
* The first pass load is where newly declared named objects are
* added into the namespace. Actual evaluation of
* the named objects (what would be called a "second
* pass") happens during the actual execution of the
* method so that operands to the named objects can
* take on dynamic run-time values.
* The first pass load is where newly declared named objects are added into
* the namespace. Actual evaluation of the named objects (what would be
* called a "second pass") happens during the actual execution of the
* method so that operands to the named objects can take on dynamic
* run-time values.
*/
status = acpi_ps_parse_aml (walk_state);
if (ACPI_FAILURE (status)) {
Expand Down
Loading

0 comments on commit 44f6c01

Please sign in to comment.