Skip to content

Commit

Permalink
ACPI: ACPICA 20060310
Browse files Browse the repository at this point in the history
Tagged all external interfaces to the subsystem with the
new ACPI_EXPORT_SYMBOL macro. This macro can be defined
as necessary to assist kernel integration. For Linux,
the macro resolves to the EXPORT_SYMBOL macro. The default
definition is NULL.

Added the ACPI_THREAD_ID type for the return value from
acpi_os_get_thread_id(). This allows the host to define this
as necessary to simplify kernel integration. The default
definition is ACPI_NATIVE_UINT.

Valery Podrezov fixed two interpreter problems related
to error processing, the deletion of objects, and placing
invalid pointers onto the internal operator result stack.
http://bugzilla.kernel.org/show_bug.cgi?id=6028
http://bugzilla.kernel.org/show_bug.cgi?id=6151

Increased the reference count threshold where a warning is
emitted for large reference counts in order to eliminate
unnecessary warnings on systems with large namespaces
(especially 64-bit.) Increased the value from 0x400
to 0x800.

Due to universal disagreement as to the meaning of the
'c' in the calloc() function, the ACPI_MEM_CALLOCATE
macro has been renamed to ACPI_ALLOCATE_ZEROED so that the
purpose of the interface is 'clear'. ACPI_MEM_ALLOCATE and
ACPI_MEM_FREE are renamed to ACPI_ALLOCATE and ACPI_FREE.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bob Moore authored and Len Brown committed Apr 1, 2006
1 parent ea936b7 commit 8313524
Show file tree
Hide file tree
Showing 65 changed files with 367 additions and 363 deletions.
2 changes: 1 addition & 1 deletion drivers/acpi/dispatcher/dsmthdat.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ acpi_ds_method_data_get_type(u16 opcode,
* special data types.
*
* NOTES: walk_state fields are initialized to zero by the
* ACPI_MEM_CALLOCATE().
* ACPI_ALLOCATE_ZEROED().
*
* A pseudo-Namespace Node is assigned to each argument and local
* so that ref_of() can return a pointer to the Node.
Expand Down
9 changes: 5 additions & 4 deletions drivers/acpi/dispatcher/dsobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
"Buffer defined with zero length in AML, creating\n"));
} else {
obj_desc->buffer.pointer =
ACPI_MEM_CALLOCATE(obj_desc->buffer.length);
ACPI_ALLOCATE_ZEROED(obj_desc->buffer.length);
if (!obj_desc->buffer.pointer) {
acpi_ut_delete_object_desc(obj_desc);
return_ACPI_STATUS(AE_NO_MEMORY);
Expand Down Expand Up @@ -341,9 +341,10 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
* individual objects). Add an extra pointer slot so
* that the list is always null terminated.
*/
obj_desc->package.elements = ACPI_MEM_CALLOCATE(((acpi_size) obj_desc->
package.count +
1) * sizeof(void *));
obj_desc->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size)
obj_desc->package.
count +
1) * sizeof(void *));

if (!obj_desc->package.elements) {
acpi_ut_delete_object_desc(obj_desc);
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/dispatcher/dsutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,

/* Free the namestring created above */

ACPI_MEM_FREE(name_string);
ACPI_FREE(name_string);

/* Check status from the lookup */

Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/dispatcher/dswload.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
ACPI_NS_DONT_OPEN_SCOPE, walk_state,
&(new_node));
if (ACPI_SUCCESS(status)) {

/*
* Make sure that what we found is indeed a method
* We didn't search for a method on purpose, to see if the name
Expand Down
8 changes: 3 additions & 5 deletions drivers/acpi/dispatcher/dswstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ void *acpi_ds_obj_stack_get_value(u32 index,
#endif

#ifdef ACPI_FUTURE_USAGE

/*******************************************************************************
*
* FUNCTION: acpi_ds_result_remove
Expand Down Expand Up @@ -128,7 +127,6 @@ acpi_ds_result_remove(union acpi_operand_object **object,

return (AE_OK);
}

#endif /* ACPI_FUTURE_USAGE */

/*******************************************************************************
Expand Down Expand Up @@ -645,7 +643,7 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,

ACPI_FUNCTION_TRACE("ds_create_walk_state");

walk_state = ACPI_MEM_CALLOCATE(sizeof(struct acpi_walk_state));
walk_state = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_walk_state));
if (!walk_state) {
return_PTR(NULL);
}
Expand All @@ -668,7 +666,7 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,

status = acpi_ds_result_stack_push(walk_state);
if (ACPI_FAILURE(status)) {
ACPI_MEM_FREE(walk_state);
ACPI_FREE(walk_state);
return_PTR(NULL);
}

Expand Down Expand Up @@ -859,7 +857,7 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
acpi_ut_delete_generic_state(state);
}

ACPI_MEM_FREE(walk_state);
ACPI_FREE(walk_state);
return_VOID;
}

Expand Down
39 changes: 20 additions & 19 deletions drivers/acpi/events/evgpeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,

if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_HANDLER) {
ACPI_MEM_FREE(gpe_event_info->dispatch.handler);
ACPI_FREE(gpe_event_info->dispatch.handler);
gpe_event_info->dispatch.handler = NULL;
gpe_event_info->flags &=
~ACPI_GPE_DISPATCH_MASK;
Expand Down Expand Up @@ -504,7 +504,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32

/* Not found, must allocate a new xrupt descriptor */

gpe_xrupt = ACPI_MEM_CALLOCATE(sizeof(struct acpi_gpe_xrupt_info));
gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info));
if (!gpe_xrupt) {
return_PTR(NULL);
}
Expand Down Expand Up @@ -595,7 +595,7 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)

/* Free the block */

ACPI_MEM_FREE(gpe_xrupt);
ACPI_FREE(gpe_xrupt);
return_ACPI_STATUS(AE_OK);
}

Expand Down Expand Up @@ -712,9 +712,9 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)

/* Free the gpe_block */

ACPI_MEM_FREE(gpe_block->register_info);
ACPI_MEM_FREE(gpe_block->event_info);
ACPI_MEM_FREE(gpe_block);
ACPI_FREE(gpe_block->register_info);
ACPI_FREE(gpe_block->event_info);
ACPI_FREE(gpe_block);

unlock_and_exit:
status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
Expand Down Expand Up @@ -748,10 +748,10 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)

/* Allocate the GPE register information block */

gpe_register_info = ACPI_MEM_CALLOCATE((acpi_size) gpe_block->
register_count *
sizeof(struct
acpi_gpe_register_info));
gpe_register_info = ACPI_ALLOCATE_ZEROED((acpi_size) gpe_block->
register_count *
sizeof(struct
acpi_gpe_register_info));
if (!gpe_register_info) {
ACPI_ERROR((AE_INFO,
"Could not allocate the gpe_register_info table"));
Expand All @@ -762,10 +762,11 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
* Allocate the GPE event_info block. There are eight distinct GPEs
* per register. Initialization to zeros is sufficient.
*/
gpe_event_info = ACPI_MEM_CALLOCATE(((acpi_size) gpe_block->
register_count *
ACPI_GPE_REGISTER_WIDTH) *
sizeof(struct acpi_gpe_event_info));
gpe_event_info = ACPI_ALLOCATE_ZEROED(((acpi_size) gpe_block->
register_count *
ACPI_GPE_REGISTER_WIDTH) *
sizeof(struct
acpi_gpe_event_info));
if (!gpe_event_info) {
ACPI_ERROR((AE_INFO,
"Could not allocate the gpe_event_info table"));
Expand Down Expand Up @@ -848,10 +849,10 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)

error_exit:
if (gpe_register_info) {
ACPI_MEM_FREE(gpe_register_info);
ACPI_FREE(gpe_register_info);
}
if (gpe_event_info) {
ACPI_MEM_FREE(gpe_event_info);
ACPI_FREE(gpe_event_info);
}

return_ACPI_STATUS(status);
Expand Down Expand Up @@ -895,7 +896,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,

/* Allocate a new GPE block */

gpe_block = ACPI_MEM_CALLOCATE(sizeof(struct acpi_gpe_block_info));
gpe_block = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_block_info));
if (!gpe_block) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
Expand All @@ -915,15 +916,15 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
*/
status = acpi_ev_create_gpe_info_blocks(gpe_block);
if (ACPI_FAILURE(status)) {
ACPI_MEM_FREE(gpe_block);
ACPI_FREE(gpe_block);
return_ACPI_STATUS(status);
}

/* Install the new block in the global lists */

status = acpi_ev_install_gpe_block(gpe_block, interrupt_number);
if (ACPI_FAILURE(status)) {
ACPI_MEM_FREE(gpe_block);
ACPI_FREE(gpe_block);
return_ACPI_STATUS(status);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/events/evregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,

/* The handler for this region was already installed */

ACPI_MEM_FREE(region_context);
ACPI_FREE(region_context);
} else {
/*
* Save the returned context for use in all accesses to
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/events/evrgnini.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ acpi_ev_system_memory_region_setup(acpi_handle handle,

if (function == ACPI_REGION_DEACTIVATE) {
if (*region_context) {
ACPI_MEM_FREE(*region_context);
ACPI_FREE(*region_context);
*region_context = NULL;
}
return_ACPI_STATUS(AE_OK);
Expand All @@ -84,7 +84,7 @@ acpi_ev_system_memory_region_setup(acpi_handle handle,
/* Create a new context */

local_region_context =
ACPI_MEM_CALLOCATE(sizeof(struct acpi_mem_space_context));
ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_mem_space_context));
if (!(local_region_context)) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
Expand Down Expand Up @@ -178,7 +178,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
*region_context = NULL;
if (function == ACPI_REGION_DEACTIVATE) {
if (pci_id) {
ACPI_MEM_FREE(pci_id);
ACPI_FREE(pci_id);
}
return_ACPI_STATUS(status);
}
Expand Down Expand Up @@ -264,7 +264,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,

/* Region is still not initialized. Create a new context */

pci_id = ACPI_MEM_CALLOCATE(sizeof(struct acpi_pci_id));
pci_id = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pci_id));
if (!pci_id) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
Expand Down
Loading

0 comments on commit 8313524

Please sign in to comment.