ACPI: ACPICA 20060310

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>
This commit is contained in:
Bob Moore
2006-10-03 00:00:00 -04:00
committed by Len Brown
parent ea936b78f4
commit 8313524a0d
65 changed files with 368 additions and 364 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ acpi_ds_method_data_get_type(u16 opcode,
* special data types. * special data types.
* *
* NOTES: walk_state fields are initialized to zero by the * 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 * A pseudo-Namespace Node is assigned to each argument and local
* so that ref_of() can return a pointer to the Node. * so that ref_of() can return a pointer to the Node.
+5 -4
View File
@@ -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")); "Buffer defined with zero length in AML, creating\n"));
} else { } else {
obj_desc->buffer.pointer = obj_desc->buffer.pointer =
ACPI_MEM_CALLOCATE(obj_desc->buffer.length); ACPI_ALLOCATE_ZEROED(obj_desc->buffer.length);
if (!obj_desc->buffer.pointer) { if (!obj_desc->buffer.pointer) {
acpi_ut_delete_object_desc(obj_desc); acpi_ut_delete_object_desc(obj_desc);
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
@@ -341,9 +341,10 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
* individual objects). Add an extra pointer slot so * individual objects). Add an extra pointer slot so
* that the list is always null terminated. * that the list is always null terminated.
*/ */
obj_desc->package.elements = ACPI_MEM_CALLOCATE(((acpi_size) obj_desc-> obj_desc->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size)
package.count + obj_desc->package.
1) * sizeof(void *)); count +
1) * sizeof(void *));
if (!obj_desc->package.elements) { if (!obj_desc->package.elements) {
acpi_ut_delete_object_desc(obj_desc); acpi_ut_delete_object_desc(obj_desc);
+1 -1
View File
@@ -577,7 +577,7 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
/* Free the namestring created above */ /* Free the namestring created above */
ACPI_MEM_FREE(name_string); ACPI_FREE(name_string);
/* Check status from the lookup */ /* Check status from the lookup */
-1
View File
@@ -1113,7 +1113,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
ACPI_NS_DONT_OPEN_SCOPE, walk_state, ACPI_NS_DONT_OPEN_SCOPE, walk_state,
&(new_node)); &(new_node));
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
/* /*
* Make sure that what we found is indeed a method * Make sure that what we found is indeed a method
* We didn't search for a method on purpose, to see if the name * We didn't search for a method on purpose, to see if the name
+3 -5
View File
@@ -66,7 +66,6 @@ void *acpi_ds_obj_stack_get_value(u32 index,
#endif #endif
#ifdef ACPI_FUTURE_USAGE #ifdef ACPI_FUTURE_USAGE
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ds_result_remove * FUNCTION: acpi_ds_result_remove
@@ -128,7 +127,6 @@ acpi_ds_result_remove(union acpi_operand_object **object,
return (AE_OK); return (AE_OK);
} }
#endif /* ACPI_FUTURE_USAGE */ #endif /* ACPI_FUTURE_USAGE */
/******************************************************************************* /*******************************************************************************
@@ -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"); 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) { if (!walk_state) {
return_PTR(NULL); return_PTR(NULL);
} }
@@ -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); status = acpi_ds_result_stack_push(walk_state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_MEM_FREE(walk_state); ACPI_FREE(walk_state);
return_PTR(NULL); return_PTR(NULL);
} }
@@ -859,7 +857,7 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
acpi_ut_delete_generic_state(state); acpi_ut_delete_generic_state(state);
} }
ACPI_MEM_FREE(walk_state); ACPI_FREE(walk_state);
return_VOID; return_VOID;
} }
+20 -19
View File
@@ -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) == if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_HANDLER) { 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->dispatch.handler = NULL;
gpe_event_info->flags &= gpe_event_info->flags &=
~ACPI_GPE_DISPATCH_MASK; ~ACPI_GPE_DISPATCH_MASK;
@@ -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 */ /* 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) { if (!gpe_xrupt) {
return_PTR(NULL); return_PTR(NULL);
} }
@@ -595,7 +595,7 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
/* Free the block */ /* Free the block */
ACPI_MEM_FREE(gpe_xrupt); ACPI_FREE(gpe_xrupt);
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
@@ -712,9 +712,9 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
/* Free the gpe_block */ /* Free the gpe_block */
ACPI_MEM_FREE(gpe_block->register_info); ACPI_FREE(gpe_block->register_info);
ACPI_MEM_FREE(gpe_block->event_info); ACPI_FREE(gpe_block->event_info);
ACPI_MEM_FREE(gpe_block); ACPI_FREE(gpe_block);
unlock_and_exit: unlock_and_exit:
status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
@@ -748,10 +748,10 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
/* Allocate the GPE register information block */ /* Allocate the GPE register information block */
gpe_register_info = ACPI_MEM_CALLOCATE((acpi_size) gpe_block-> gpe_register_info = ACPI_ALLOCATE_ZEROED((acpi_size) gpe_block->
register_count * register_count *
sizeof(struct sizeof(struct
acpi_gpe_register_info)); acpi_gpe_register_info));
if (!gpe_register_info) { if (!gpe_register_info) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Could not allocate the gpe_register_info table")); "Could not allocate the gpe_register_info table"));
@@ -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 * Allocate the GPE event_info block. There are eight distinct GPEs
* per register. Initialization to zeros is sufficient. * per register. Initialization to zeros is sufficient.
*/ */
gpe_event_info = ACPI_MEM_CALLOCATE(((acpi_size) gpe_block-> gpe_event_info = ACPI_ALLOCATE_ZEROED(((acpi_size) gpe_block->
register_count * register_count *
ACPI_GPE_REGISTER_WIDTH) * ACPI_GPE_REGISTER_WIDTH) *
sizeof(struct acpi_gpe_event_info)); sizeof(struct
acpi_gpe_event_info));
if (!gpe_event_info) { if (!gpe_event_info) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Could not allocate the gpe_event_info table")); "Could not allocate the gpe_event_info table"));
@@ -848,10 +849,10 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
error_exit: error_exit:
if (gpe_register_info) { if (gpe_register_info) {
ACPI_MEM_FREE(gpe_register_info); ACPI_FREE(gpe_register_info);
} }
if (gpe_event_info) { if (gpe_event_info) {
ACPI_MEM_FREE(gpe_event_info); ACPI_FREE(gpe_event_info);
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
@@ -895,7 +896,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
/* Allocate a new GPE block */ /* 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) { if (!gpe_block) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
@@ -915,7 +916,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
*/ */
status = acpi_ev_create_gpe_info_blocks(gpe_block); status = acpi_ev_create_gpe_info_blocks(gpe_block);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_MEM_FREE(gpe_block); ACPI_FREE(gpe_block);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
@@ -923,7 +924,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
status = acpi_ev_install_gpe_block(gpe_block, interrupt_number); status = acpi_ev_install_gpe_block(gpe_block, interrupt_number);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_MEM_FREE(gpe_block); ACPI_FREE(gpe_block);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
+1 -1
View File
@@ -366,7 +366,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
/* The handler for this region was already installed */ /* The handler for this region was already installed */
ACPI_MEM_FREE(region_context); ACPI_FREE(region_context);
} else { } else {
/* /*
* Save the returned context for use in all accesses to * Save the returned context for use in all accesses to
+4 -4
View File
@@ -75,7 +75,7 @@ acpi_ev_system_memory_region_setup(acpi_handle handle,
if (function == ACPI_REGION_DEACTIVATE) { if (function == ACPI_REGION_DEACTIVATE) {
if (*region_context) { if (*region_context) {
ACPI_MEM_FREE(*region_context); ACPI_FREE(*region_context);
*region_context = NULL; *region_context = NULL;
} }
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
@@ -84,7 +84,7 @@ acpi_ev_system_memory_region_setup(acpi_handle handle,
/* Create a new context */ /* Create a new context */
local_region_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)) { if (!(local_region_context)) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
@@ -178,7 +178,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
*region_context = NULL; *region_context = NULL;
if (function == ACPI_REGION_DEACTIVATE) { if (function == ACPI_REGION_DEACTIVATE) {
if (pci_id) { if (pci_id) {
ACPI_MEM_FREE(pci_id); ACPI_FREE(pci_id);
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
@@ -264,7 +264,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
/* Region is still not initialized. Create a new context */ /* 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) { if (!pci_id) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
+12 -20
View File
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
*/ */
#include <linux/module.h>
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/acevents.h> #include <acpi/acevents.h>
@@ -90,6 +88,8 @@ acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
#endif /* ACPI_FUTURE_USAGE */ #endif /* ACPI_FUTURE_USAGE */
/******************************************************************************* /*******************************************************************************
@@ -107,7 +107,6 @@ acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
* event. * event.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_install_fixed_event_handler(u32 event, acpi_install_fixed_event_handler(u32 event,
acpi_event_handler handler, void *context) acpi_event_handler handler, void *context)
@@ -161,7 +160,7 @@ acpi_install_fixed_event_handler(u32 event,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_install_fixed_event_handler); ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler)
/******************************************************************************* /*******************************************************************************
* *
@@ -175,7 +174,6 @@ EXPORT_SYMBOL(acpi_install_fixed_event_handler);
* DESCRIPTION: Disables the event and unregisters the event handler. * DESCRIPTION: Disables the event and unregisters the event handler.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler) acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
{ {
@@ -216,7 +214,7 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_remove_fixed_event_handler); ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler)
/******************************************************************************* /*******************************************************************************
* *
@@ -235,7 +233,6 @@ EXPORT_SYMBOL(acpi_remove_fixed_event_handler);
* DESCRIPTION: Install a handler for notifies on an ACPI device * DESCRIPTION: Install a handler for notifies on an ACPI device
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_install_notify_handler(acpi_handle device, acpi_install_notify_handler(acpi_handle device,
u32 handler_type, u32 handler_type,
@@ -384,7 +381,7 @@ acpi_install_notify_handler(acpi_handle device,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_install_notify_handler); ACPI_EXPORT_SYMBOL(acpi_install_notify_handler)
/******************************************************************************* /*******************************************************************************
* *
@@ -402,7 +399,6 @@ EXPORT_SYMBOL(acpi_install_notify_handler);
* DESCRIPTION: Remove a handler for notifies on an ACPI device * DESCRIPTION: Remove a handler for notifies on an ACPI device
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_remove_notify_handler(acpi_handle device, acpi_remove_notify_handler(acpi_handle device,
u32 handler_type, acpi_notify_handler handler) u32 handler_type, acpi_notify_handler handler)
@@ -538,7 +534,7 @@ acpi_remove_notify_handler(acpi_handle device,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_remove_notify_handler); ACPI_EXPORT_SYMBOL(acpi_remove_notify_handler)
/******************************************************************************* /*******************************************************************************
* *
@@ -557,7 +553,6 @@ EXPORT_SYMBOL(acpi_remove_notify_handler);
* DESCRIPTION: Install a handler for a General Purpose Event. * DESCRIPTION: Install a handler for a General Purpose Event.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_install_gpe_handler(acpi_handle gpe_device, acpi_install_gpe_handler(acpi_handle gpe_device,
u32 gpe_number, u32 gpe_number,
@@ -599,7 +594,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
/* Allocate and init handler object */ /* Allocate and init handler object */
handler = ACPI_MEM_CALLOCATE(sizeof(struct acpi_handler_info)); handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_handler_info));
if (!handler) { if (!handler) {
status = AE_NO_MEMORY; status = AE_NO_MEMORY;
goto unlock_and_exit; goto unlock_and_exit;
@@ -633,7 +628,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_install_gpe_handler); ACPI_EXPORT_SYMBOL(acpi_install_gpe_handler)
/******************************************************************************* /*******************************************************************************
* *
@@ -649,7 +644,6 @@ EXPORT_SYMBOL(acpi_install_gpe_handler);
* DESCRIPTION: Remove a handler for a General Purpose acpi_event. * DESCRIPTION: Remove a handler for a General Purpose acpi_event.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_remove_gpe_handler(acpi_handle gpe_device, acpi_remove_gpe_handler(acpi_handle gpe_device,
u32 gpe_number, acpi_event_handler address) u32 gpe_number, acpi_event_handler address)
@@ -727,14 +721,14 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
/* Now we can free the handler object */ /* Now we can free the handler object */
ACPI_MEM_FREE(handler); ACPI_FREE(handler);
unlock_and_exit: unlock_and_exit:
(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_remove_gpe_handler); ACPI_EXPORT_SYMBOL(acpi_remove_gpe_handler)
/******************************************************************************* /*******************************************************************************
* *
@@ -749,7 +743,6 @@ EXPORT_SYMBOL(acpi_remove_gpe_handler);
* DESCRIPTION: Acquire the ACPI Global Lock * DESCRIPTION: Acquire the ACPI Global Lock
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle) acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
{ {
acpi_status status; acpi_status status;
@@ -774,7 +767,7 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
return (status); return (status);
} }
EXPORT_SYMBOL(acpi_acquire_global_lock); ACPI_EXPORT_SYMBOL(acpi_acquire_global_lock)
/******************************************************************************* /*******************************************************************************
* *
@@ -787,7 +780,6 @@ EXPORT_SYMBOL(acpi_acquire_global_lock);
* DESCRIPTION: Release the ACPI Global Lock. The handle must be valid. * DESCRIPTION: Release the ACPI Global Lock. The handle must be valid.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_release_global_lock(u32 handle) acpi_status acpi_release_global_lock(u32 handle)
{ {
acpi_status status; acpi_status status;
@@ -800,4 +792,4 @@ acpi_status acpi_release_global_lock(u32 handle)
return (status); return (status);
} }
EXPORT_SYMBOL(acpi_release_global_lock); ACPI_EXPORT_SYMBOL(acpi_release_global_lock)
+19 -21
View File
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
*/ */
#include <linux/module.h>
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acevents.h> #include <acpi/acevents.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
@@ -94,6 +92,8 @@ acpi_status acpi_enable(void)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
ACPI_EXPORT_SYMBOL(acpi_enable)
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_disable * FUNCTION: acpi_disable
@@ -105,7 +105,6 @@ acpi_status acpi_enable(void)
* DESCRIPTION: Transfers the system into LEGACY (non-ACPI) mode. * DESCRIPTION: Transfers the system into LEGACY (non-ACPI) mode.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_disable(void) acpi_status acpi_disable(void)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
@@ -137,6 +136,8 @@ acpi_status acpi_disable(void)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
ACPI_EXPORT_SYMBOL(acpi_disable)
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_enable_event * FUNCTION: acpi_enable_event
@@ -149,7 +150,6 @@ acpi_status acpi_disable(void)
* DESCRIPTION: Enable an ACPI event (fixed) * DESCRIPTION: Enable an ACPI event (fixed)
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_enable_event(u32 event, u32 flags) acpi_status acpi_enable_event(u32 event, u32 flags)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
@@ -193,7 +193,7 @@ acpi_status acpi_enable_event(u32 event, u32 flags)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_enable_event); ACPI_EXPORT_SYMBOL(acpi_enable_event)
/******************************************************************************* /*******************************************************************************
* *
@@ -208,7 +208,6 @@ EXPORT_SYMBOL(acpi_enable_event);
* DESCRIPTION: Set the type of an individual GPE * DESCRIPTION: Set the type of an individual GPE
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type) acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
@@ -236,7 +235,7 @@ acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_set_gpe_type); ACPI_EXPORT_SYMBOL(acpi_set_gpe_type)
/******************************************************************************* /*******************************************************************************
* *
@@ -252,7 +251,6 @@ EXPORT_SYMBOL(acpi_set_gpe_type);
* DESCRIPTION: Enable an ACPI event (general purpose) * DESCRIPTION: Enable an ACPI event (general purpose)
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags) acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
@@ -288,7 +286,7 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_enable_gpe); ACPI_EXPORT_SYMBOL(acpi_enable_gpe)
/******************************************************************************* /*******************************************************************************
* *
@@ -304,7 +302,6 @@ EXPORT_SYMBOL(acpi_enable_gpe);
* DESCRIPTION: Disable an ACPI event (general purpose) * DESCRIPTION: Disable an ACPI event (general purpose)
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags) acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
@@ -338,6 +335,8 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
ACPI_EXPORT_SYMBOL(acpi_disable_gpe)
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_disable_event * FUNCTION: acpi_disable_event
@@ -350,7 +349,6 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
* DESCRIPTION: Disable an ACPI event (fixed) * DESCRIPTION: Disable an ACPI event (fixed)
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_disable_event(u32 event, u32 flags) acpi_status acpi_disable_event(u32 event, u32 flags)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
@@ -392,7 +390,7 @@ acpi_status acpi_disable_event(u32 event, u32 flags)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_disable_event); ACPI_EXPORT_SYMBOL(acpi_disable_event)
/******************************************************************************* /*******************************************************************************
* *
@@ -405,7 +403,6 @@ EXPORT_SYMBOL(acpi_disable_event);
* DESCRIPTION: Clear an ACPI event (fixed) * DESCRIPTION: Clear an ACPI event (fixed)
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_clear_event(u32 event) acpi_status acpi_clear_event(u32 event)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
@@ -429,7 +426,7 @@ acpi_status acpi_clear_event(u32 event)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_clear_event); ACPI_EXPORT_SYMBOL(acpi_clear_event)
/******************************************************************************* /*******************************************************************************
* *
@@ -444,7 +441,6 @@ EXPORT_SYMBOL(acpi_clear_event);
* DESCRIPTION: Clear an ACPI event (general purpose) * DESCRIPTION: Clear an ACPI event (general purpose)
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags) acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
@@ -478,6 +474,8 @@ acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
ACPI_EXPORT_SYMBOL(acpi_clear_gpe)
#ifdef ACPI_FUTURE_USAGE #ifdef ACPI_FUTURE_USAGE
/******************************************************************************* /*******************************************************************************
* *
@@ -492,7 +490,6 @@ acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
* DESCRIPTION: Obtains and returns the current status of the event * DESCRIPTION: Obtains and returns the current status of the event
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status) acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
@@ -518,6 +515,8 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
ACPI_EXPORT_SYMBOL(acpi_get_event_status)
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_get_gpe_status * FUNCTION: acpi_get_gpe_status
@@ -533,7 +532,6 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
* DESCRIPTION: Get status of an event (general purpose) * DESCRIPTION: Get status of an event (general purpose)
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_get_gpe_status(acpi_handle gpe_device, acpi_get_gpe_status(acpi_handle gpe_device,
u32 gpe_number, u32 flags, acpi_event_status * event_status) u32 gpe_number, u32 flags, acpi_event_status * event_status)
@@ -570,6 +568,8 @@ acpi_get_gpe_status(acpi_handle gpe_device,
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
ACPI_EXPORT_SYMBOL(acpi_get_gpe_status)
#endif /* ACPI_FUTURE_USAGE */ #endif /* ACPI_FUTURE_USAGE */
/******************************************************************************* /*******************************************************************************
@@ -586,7 +586,6 @@ acpi_get_gpe_status(acpi_handle gpe_device,
* DESCRIPTION: Create and Install a block of GPE registers * DESCRIPTION: Create and Install a block of GPE registers
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_install_gpe_block(acpi_handle gpe_device, acpi_install_gpe_block(acpi_handle gpe_device,
struct acpi_generic_address *gpe_block_address, struct acpi_generic_address *gpe_block_address,
@@ -666,7 +665,7 @@ acpi_install_gpe_block(acpi_handle gpe_device,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_install_gpe_block); ACPI_EXPORT_SYMBOL(acpi_install_gpe_block)
/******************************************************************************* /*******************************************************************************
* *
@@ -679,7 +678,6 @@ EXPORT_SYMBOL(acpi_install_gpe_block);
* DESCRIPTION: Remove a previously installed block of GPE registers * DESCRIPTION: Remove a previously installed block of GPE registers
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_remove_gpe_block(acpi_handle gpe_device) acpi_status acpi_remove_gpe_block(acpi_handle gpe_device)
{ {
union acpi_operand_object *obj_desc; union acpi_operand_object *obj_desc;
@@ -722,4 +720,4 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_remove_gpe_block); ACPI_EXPORT_SYMBOL(acpi_remove_gpe_block)
+2 -5
View File
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
*/ */
#include <linux/module.h>
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/acevents.h> #include <acpi/acevents.h>
@@ -114,7 +112,7 @@ acpi_install_address_space_handler(acpi_handle device,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_install_address_space_handler); ACPI_EXPORT_SYMBOL(acpi_install_address_space_handler)
/******************************************************************************* /*******************************************************************************
* *
@@ -129,7 +127,6 @@ EXPORT_SYMBOL(acpi_install_address_space_handler);
* DESCRIPTION: Remove a previously installed handler. * DESCRIPTION: Remove a previously installed handler.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_remove_address_space_handler(acpi_handle device, acpi_remove_address_space_handler(acpi_handle device,
acpi_adr_space_type space_id, acpi_adr_space_type space_id,
@@ -242,4 +239,4 @@ acpi_remove_address_space_handler(acpi_handle device,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
EXPORT_SYMBOL(acpi_remove_address_space_handler); ACPI_EXPORT_SYMBOL(acpi_remove_address_space_handler)
+2 -2
View File
@@ -349,7 +349,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
/* Allocate a buffer for the entire table */ /* Allocate a buffer for the entire table */
table_ptr = ACPI_MEM_ALLOCATE(table_header.length); table_ptr = ACPI_ALLOCATE(table_header.length);
if (!table_ptr) { if (!table_ptr) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
@@ -447,7 +447,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
cleanup: cleanup:
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_MEM_FREE(table_ptr); ACPI_FREE(table_ptr);
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
+1 -1
View File
@@ -903,7 +903,7 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
acpi_os_printf("Could not convert name to pathname\n"); acpi_os_printf("Could not convert name to pathname\n");
} else { } else {
acpi_os_printf("%s\n", (char *)ret_buf.pointer); acpi_os_printf("%s\n", (char *)ret_buf.pointer);
ACPI_MEM_FREE(ret_buf.pointer); ACPI_FREE(ret_buf.pointer);
} }
} else if (obj_desc->reference.object) { } else if (obj_desc->reference.object) {
acpi_os_printf("\nReferenced Object: %p\n", acpi_os_printf("\nReferenced Object: %p\n",
+2 -2
View File
@@ -333,7 +333,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
/* We need to create a new buffer */ /* We need to create a new buffer */
new_buffer = ACPI_MEM_CALLOCATE(required_length); new_buffer = ACPI_ALLOCATE_ZEROED(required_length);
if (!new_buffer) { if (!new_buffer) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
@@ -377,7 +377,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
/* Free temporary buffer if we used one */ /* Free temporary buffer if we used one */
if (new_buffer) { if (new_buffer) {
ACPI_MEM_FREE(new_buffer); ACPI_FREE(new_buffer);
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
+2 -2
View File
@@ -98,7 +98,7 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs)
* Allocate a buffer for the name. * Allocate a buffer for the name.
* This buffer must be deleted by the caller! * This buffer must be deleted by the caller!
*/ */
name_string = ACPI_MEM_ALLOCATE(size_needed); name_string = ACPI_ALLOCATE(size_needed);
if (!name_string) { if (!name_string) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Could not allocate size %d", size_needed)); "Could not allocate size %d", size_needed));
@@ -424,7 +424,7 @@ acpi_ex_get_name_string(acpi_object_type data_type,
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (name_string) { if (name_string) {
ACPI_MEM_FREE(name_string); ACPI_FREE(name_string);
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
+12 -5
View File
@@ -554,16 +554,18 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
cleanup: cleanup:
if (!walk_state->result_obj) {
walk_state->result_obj = return_desc;
}
/* Delete return object on error */ /* Delete return object on error */
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_ut_remove_reference(return_desc); acpi_ut_remove_reference(return_desc);
} }
/* Save return object on success */
else if (!walk_state->result_obj) {
walk_state->result_obj = return_desc;
}
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
@@ -1028,6 +1030,11 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
acpi_ut_remove_reference(return_desc); acpi_ut_remove_reference(return_desc);
} }
walk_state->result_obj = return_desc; /* Save return object on success */
else {
walk_state->result_obj = return_desc;
}
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
+2 -2
View File
@@ -391,7 +391,6 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
index = operand[1]->integer.value; index = operand[1]->integer.value;
return_desc->reference.offset = (u32) index; return_desc->reference.offset = (u32) index;
return_desc->reference.opcode = AML_INDEX_OP; return_desc->reference.opcode = AML_INDEX_OP;
return_desc->reference.object = operand[0];
/* /*
* At this point, the Source operand is a String, Buffer, or Package. * At this point, the Source operand is a String, Buffer, or Package.
@@ -445,9 +444,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
} }
/* /*
* Add a reference to the target package/buffer/string for the life * Save the target object and add a reference to it for the life
* of the index * of the index
*/ */
return_desc->reference.object = operand[0];
acpi_ut_add_reference(operand[0]); acpi_ut_add_reference(operand[0]);
/* Store the reference to the Target */ /* Store the reference to the Target */
+4 -5
View File
@@ -100,8 +100,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
(u32) operand[1]->integer.value, (u32) operand[1]->integer.value,
(u32) operand[2]->integer.value)); (u32) operand[2]->integer.value));
fatal = fatal = ACPI_ALLOCATE(sizeof(struct acpi_signal_fatal_info));
ACPI_MEM_ALLOCATE(sizeof(struct acpi_signal_fatal_info));
if (fatal) { if (fatal) {
fatal->type = (u32) operand[0]->integer.value; fatal->type = (u32) operand[0]->integer.value;
fatal->code = (u32) operand[1]->integer.value; fatal->code = (u32) operand[1]->integer.value;
@@ -114,7 +113,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
/* Might return while OS is shutting down, just continue */ /* Might return while OS is shutting down, just continue */
ACPI_MEM_FREE(fatal); ACPI_FREE(fatal);
break; break;
default: default:
@@ -196,7 +195,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
/* Always allocate a new buffer for the String */ /* Always allocate a new buffer for the String */
buffer = ACPI_MEM_CALLOCATE((acpi_size) length + 1); buffer = ACPI_ALLOCATE_ZEROED((acpi_size) length + 1);
if (!buffer) { if (!buffer) {
status = AE_NO_MEMORY; status = AE_NO_MEMORY;
goto cleanup; goto cleanup;
@@ -211,7 +210,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
/* Allocate a new buffer for the Buffer */ /* Allocate a new buffer for the Buffer */
buffer = ACPI_MEM_CALLOCATE(length); buffer = ACPI_ALLOCATE_ZEROED(length);
if (!buffer) { if (!buffer) {
status = AE_NO_MEMORY; status = AE_NO_MEMORY;
goto cleanup; goto cleanup;
+5 -5
View File
@@ -182,8 +182,8 @@ acpi_ex_system_memory_space_handler(u32 function,
(acpi_integer) mem_info->mapped_physical_address); (acpi_integer) mem_info->mapped_physical_address);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"system_memory %d (%d width) Address=%8.8X%8.8X\n", "System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n",
function, bit_width, ACPI_FORMAT_UINT64(address))); bit_width, function, ACPI_FORMAT_UINT64(address)));
/* /*
* Perform the memory read or write * Perform the memory read or write
@@ -287,8 +287,8 @@ acpi_ex_system_io_space_handler(u32 function,
ACPI_FUNCTION_TRACE("ex_system_io_space_handler"); ACPI_FUNCTION_TRACE("ex_system_io_space_handler");
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"system_iO %d (%d width) Address=%8.8X%8.8X\n", "System-IO (width %d) R/W %d Address=%8.8X%8.8X\n",
function, bit_width, ACPI_FORMAT_UINT64(address))); bit_width, function, ACPI_FORMAT_UINT64(address)));
/* Decode the function parameter */ /* Decode the function parameter */
@@ -361,7 +361,7 @@ acpi_ex_pci_config_space_handler(u32 function,
pci_register = (u16) (u32) address; pci_register = (u16) (u32) address;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", "Pci-Config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
function, bit_width, pci_id->segment, pci_id->bus, function, bit_width, pci_id->segment, pci_id->bus,
pci_id->device, pci_id->function, pci_register)); pci_id->device, pci_id->function, pci_register));
+4 -4
View File
@@ -80,7 +80,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc,
*/ */
if ((target_desc->buffer.length == 0) || if ((target_desc->buffer.length == 0) ||
(target_desc->common.flags & AOPOBJ_STATIC_POINTER)) { (target_desc->common.flags & AOPOBJ_STATIC_POINTER)) {
target_desc->buffer.pointer = ACPI_MEM_ALLOCATE(length); target_desc->buffer.pointer = ACPI_ALLOCATE(length);
if (!target_desc->buffer.pointer) { if (!target_desc->buffer.pointer) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
@@ -188,11 +188,11 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
/* Only free if not a pointer into the DSDT */ /* Only free if not a pointer into the DSDT */
ACPI_MEM_FREE(target_desc->string.pointer); ACPI_FREE(target_desc->string.pointer);
} }
target_desc->string.pointer = ACPI_MEM_CALLOCATE((acpi_size) target_desc->string.pointer = ACPI_ALLOCATE_ZEROED((acpi_size)
length + 1); length + 1);
if (!target_desc->string.pointer) { if (!target_desc->string.pointer) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }

Some files were not shown because too many files have changed in this diff Show More