本文整理匯總了C++中ACPI_MEM_FREE函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACPI_MEM_FREE函數的具體用法?C++ ACPI_MEM_FREE怎麽用?C++ ACPI_MEM_FREE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ACPI_MEM_FREE函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: acpi_ut_terminate
void
acpi_ut_terminate (void)
{
struct acpi_gpe_block_info *gpe_block;
struct acpi_gpe_block_info *next_gpe_block;
struct acpi_gpe_xrupt_info *gpe_xrupt_info;
struct acpi_gpe_xrupt_info *next_gpe_xrupt_info;
ACPI_FUNCTION_TRACE ("ut_terminate");
/* Free global tables, etc. */
/* Free global GPE blocks and related info structures */
gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
while (gpe_xrupt_info) {
gpe_block = gpe_xrupt_info->gpe_block_list_head;
while (gpe_block) {
next_gpe_block = gpe_block->next;
ACPI_MEM_FREE (gpe_block->event_info);
ACPI_MEM_FREE (gpe_block->register_info);
ACPI_MEM_FREE (gpe_block);
gpe_block = next_gpe_block;
}
next_gpe_xrupt_info = gpe_xrupt_info->next;
ACPI_MEM_FREE (gpe_xrupt_info);
gpe_xrupt_info = next_gpe_xrupt_info;
}
return_VOID;
}
示例2: acpi_ev_delete_gpe_block
acpi_status
acpi_ev_delete_gpe_block (
struct acpi_gpe_block_info *gpe_block)
{
acpi_status status;
ACPI_FUNCTION_TRACE ("ev_install_gpe_block");
status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Disable all GPEs in this block */
status = acpi_hw_disable_gpe_block (gpe_block->xrupt_block, gpe_block);
if (!gpe_block->previous && !gpe_block->next) {
/* This is the last gpe_block on this interrupt */
status = acpi_ev_delete_gpe_xrupt (gpe_block->xrupt_block);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
}
else {
/* Remove the block on this interrupt with lock */
acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);
if (gpe_block->previous) {
gpe_block->previous->next = gpe_block->next;
}
else {
gpe_block->xrupt_block->gpe_block_list_head = gpe_block->next;
}
if (gpe_block->next) {
gpe_block->next->previous = gpe_block->previous;
}
acpi_os_release_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);
}
/* Free the gpe_block */
ACPI_MEM_FREE (gpe_block->register_info);
ACPI_MEM_FREE (gpe_block->event_info);
ACPI_MEM_FREE (gpe_block);
unlock_and_exit:
status = acpi_ut_release_mutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (status);
}
示例3: acpi_ut_release_to_cache
void
acpi_ut_release_to_cache (
u32 list_id,
void *object)
{
struct acpi_memory_list *cache_info;
ACPI_FUNCTION_ENTRY ();
cache_info = &acpi_gbl_memory_lists[list_id];
#ifdef ACPI_ENABLE_OBJECT_CACHE
/* If walk cache is full, just free this wallkstate object */
if (cache_info->cache_depth >= cache_info->max_cache_depth) {
ACPI_MEM_FREE (object);
ACPI_MEM_TRACKING (cache_info->total_freed++);
}
/* Otherwise put this object back into the cache */
else {
if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES))) {
return;
}
/* Mark the object as cached */
ACPI_MEMSET (object, 0xCA, cache_info->object_size);
ACPI_SET_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_CACHED);
/* Put the object at the head of the cache list */
* (ACPI_CAST_INDIRECT_PTR (char, &(((char *) object)[cache_info->link_offset]))) = cache_info->list_head;
cache_info->list_head = object;
cache_info->cache_depth++;
(void) acpi_ut_release_mutex (ACPI_MTX_CACHES);
}
#else
/* Object cache is disabled; just free the object */
ACPI_MEM_FREE (object);
ACPI_MEM_TRACKING (cache_info->total_freed++);
#endif
}
示例4: acpi_ns_print_node_pathname
void
acpi_ns_print_node_pathname (
struct acpi_namespace_node *node,
char *msg)
{
struct acpi_buffer buffer;
acpi_status status;
if (!node) {
acpi_os_printf ("[NULL NAME]");
return;
}
/* Convert handle to full pathname and print it (with supplied message) */
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
status = acpi_ns_handle_to_pathname (node, &buffer);
if (ACPI_SUCCESS (status)) {
if (msg) {
acpi_os_printf ("%s ", msg);
}
acpi_os_printf ("[%s] (Node %p)", (char *) buffer.pointer, node);
ACPI_MEM_FREE (buffer.pointer);
}
}
示例5: AcpiNsDumpPathname
ACPI_STATUS
AcpiNsDumpPathname (
ACPI_HANDLE Handle,
NATIVE_CHAR *Msg,
UINT32 Level,
UINT32 Component)
{
ACPI_BUFFER Buffer;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE ("NsDumpPathname");
/* Do this only if the requested debug level and component are enabled */
if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
{
return_ACPI_STATUS (AE_OK);
}
/* Convert handle to a full pathname and print it (with supplied message) */
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (Handle, &Buffer);
if (ACPI_SUCCESS (Status))
{
AcpiOsPrintf ("%s %s (Node %p)\n", Msg, (char *) Buffer.Pointer, Handle);
ACPI_MEM_FREE (Buffer.Pointer);
}
return_ACPI_STATUS (Status);
}
示例6: acpi_tb_delete_single_table
void
acpi_tb_delete_single_table (
struct acpi_table_desc *table_desc)
{
/* Must have a valid table descriptor and pointer */
if ((!table_desc) ||
(!table_desc->pointer)) {
return;
}
/* Valid table, determine type of memory allocation */
switch (table_desc->allocation) {
case ACPI_MEM_NOT_ALLOCATED:
break;
case ACPI_MEM_ALLOCATED:
ACPI_MEM_FREE (table_desc->pointer);
break;
case ACPI_MEM_MAPPED:
acpi_os_unmap_memory (table_desc->pointer, table_desc->length);
break;
default:
break;
}
}
示例7: acpi_ns_dump_one_device
acpi_status
acpi_ns_dump_one_device (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value)
{
struct acpi_buffer buffer;
struct acpi_device_info *info;
acpi_status status;
u32 i;
ACPI_FUNCTION_NAME ("ns_dump_one_device");
status = acpi_ns_dump_one_object (obj_handle, level, context, return_value);
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
status = acpi_get_object_info (obj_handle, &buffer);
if (ACPI_SUCCESS (status)) {
info = buffer.pointer;
for (i = 0; i < level; i++) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES,
" HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
info->hardware_id.value, ACPI_FORMAT_UINT64 (info->address),
info->current_status));
ACPI_MEM_FREE (info);
}
return (status);
}
示例8: acpi_ev_delete_gpe_handlers
acpi_status
acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block)
{
struct acpi_gpe_event_info *gpe_event_info;
acpi_native_uint i;
acpi_native_uint j;
ACPI_FUNCTION_TRACE("ev_delete_gpe_handlers");
/* Examine each GPE Register within the block */
for (i = 0; i < gpe_block->register_count; i++) {
/* Now look at the individual GPEs in this byte register */
for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
gpe_event_info =
&gpe_block->
event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j];
if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_HANDLER) {
ACPI_MEM_FREE(gpe_event_info->dispatch.handler);
gpe_event_info->dispatch.handler = NULL;
gpe_event_info->flags &=
~ACPI_GPE_DISPATCH_MASK;
}
}
}
return_ACPI_STATUS(AE_OK);
}
示例9: acpi_tb_delete_single_table
void
acpi_tb_delete_single_table (
acpi_table_desc *table_desc)
{
if (!table_desc) {
return;
}
if (table_desc->pointer) {
/* Valid table, determine type of memory allocation */
switch (table_desc->allocation) {
case ACPI_MEM_NOT_ALLOCATED:
break;
case ACPI_MEM_ALLOCATED:
ACPI_MEM_FREE (table_desc->base_pointer);
break;
case ACPI_MEM_MAPPED:
acpi_os_unmap_memory (table_desc->base_pointer, table_desc->length);
break;
}
}
}
示例10: acpi_ns_search_node
acpi_status
acpi_ns_search_node(u32 target_name,
struct acpi_namespace_node *node,
acpi_object_type type,
struct acpi_namespace_node **return_node)
{
struct acpi_namespace_node *next_node;
ACPI_FUNCTION_TRACE("ns_search_node");
#ifdef ACPI_DEBUG_OUTPUT
if (ACPI_LV_NAMES & acpi_dbg_level) {
char *scope_name;
scope_name = acpi_ns_get_external_pathname(node);
if (scope_name) {
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"Searching %s (%p) For [%4.4s] (%s)\n",
scope_name, node, ACPI_CAST_PTR(char,
&target_name),
acpi_ut_get_type_name(type)));
ACPI_MEM_FREE(scope_name);
}
}
示例11: acpi_ns_evaluate_by_name
acpi_status
acpi_ns_evaluate_by_name (
NATIVE_CHAR *pathname,
acpi_operand_object **params,
acpi_operand_object **return_object)
{
acpi_status status;
acpi_namespace_node *node = NULL;
NATIVE_CHAR *internal_path = NULL;
FUNCTION_TRACE ("Ns_evaluate_by_name");
/* Build an internal name string for the method */
status = acpi_ns_internalize_name (pathname, &internal_path);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
/* Lookup the name in the namespace */
status = acpi_ns_lookup (NULL, internal_path, ACPI_TYPE_ANY,
IMODE_EXECUTE, NS_NO_UPSEARCH, NULL,
&node);
acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object at [%s] was not found, status=%.4X\n",
pathname, status));
goto cleanup;
}
/*
* Now that we have a handle to the object, we can attempt
* to evaluate it.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s [%p] Value %p\n",
pathname, node, node->object));
status = acpi_ns_evaluate_by_handle (node, params, return_object);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*** Completed eval of object %s ***\n",
pathname));
cleanup:
/* Cleanup */
if (internal_path) {
ACPI_MEM_FREE (internal_path);
}
return_ACPI_STATUS (status);
}
示例12: acpi_ns_get_node
acpi_status
acpi_ns_get_node (
NATIVE_CHAR *pathname,
acpi_namespace_node *start_node,
acpi_namespace_node **return_node)
{
acpi_generic_state scope_info;
acpi_status status;
NATIVE_CHAR *internal_path = NULL;
FUNCTION_TRACE_PTR ("Ns_get_node", pathname);
/* Ensure that the namespace has been initialized */
if (!acpi_gbl_root_node) {
return_ACPI_STATUS (AE_NO_NAMESPACE);
}
if (!pathname) {
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Convert path to internal representation */
status = acpi_ns_internalize_name (pathname, &internal_path);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
/* Setup lookup scope (search starting point) */
scope_info.scope.node = start_node;
/* Lookup the name in the namespace */
status = acpi_ns_lookup (&scope_info, internal_path,
ACPI_TYPE_ANY, IMODE_EXECUTE,
NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
NULL, return_node);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s, %s\n",
internal_path, acpi_format_exception (status)));
}
acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
/* Cleanup */
ACPI_MEM_FREE (internal_path);
return_ACPI_STATUS (status);
}
示例13: acpi_ex_store_string_to_string
acpi_status
acpi_ex_store_string_to_string (
union acpi_operand_object *source_desc,
union acpi_operand_object *target_desc)
{
u32 length;
u8 *buffer;
ACPI_FUNCTION_TRACE_PTR ("ex_store_string_to_string", source_desc);
/*
* We know that source_desc is a string by now.
*/
buffer = (u8 *) source_desc->string.pointer;
length = source_desc->string.length;
/*
* Replace existing string value if it will fit and the string
* pointer is not a static pointer (part of an ACPI table)
*/
if ((length < target_desc->string.length) &&
(!(target_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
/*
* String will fit in existing non-static buffer.
* Clear old string and copy in the new one
*/
ACPI_MEMSET (target_desc->string.pointer, 0, (acpi_size) target_desc->string.length + 1);
ACPI_MEMCPY (target_desc->string.pointer, buffer, length);
}
else {
/*
* Free the current buffer, then allocate a new buffer
* large enough to hold the value
*/
if (target_desc->string.pointer &&
(!(target_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
/*
* Only free if not a pointer into the DSDT
*/
ACPI_MEM_FREE (target_desc->string.pointer);
}
target_desc->string.pointer = ACPI_MEM_CALLOCATE ((acpi_size) length + 1);
if (!target_desc->string.pointer) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
target_desc->common.flags &= ~AOPOBJ_STATIC_POINTER;
ACPI_MEMCPY (target_desc->string.pointer, buffer, length);
}
/* Set the new target length */
target_desc->string.length = length;
return_ACPI_STATUS (AE_OK);
}
示例14: acpi_ns_evaluate_by_name
acpi_status
acpi_ns_evaluate_by_name(char *pathname, struct acpi_parameter_info *info)
{
acpi_status status;
char *internal_path = NULL;
ACPI_FUNCTION_TRACE("ns_evaluate_by_name");
/* Build an internal name string for the method */
status = acpi_ns_internalize_name(pathname, &internal_path);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
/* Lookup the name in the namespace */
status = acpi_ns_lookup(NULL, internal_path, ACPI_TYPE_ANY,
ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, NULL,
&info->node);
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"Object at [%s] was not found, status=%.4X\n",
pathname, status));
goto cleanup;
}
/*
* Now that we have a handle to the object, we can attempt to evaluate it.
*/
ACPI_DEBUG_PRINT((ACPI_DB_NAMES, "%s [%p] Value %p\n",
pathname, info->node,
acpi_ns_get_attached_object(info->node)));
status = acpi_ns_evaluate_by_handle(info);
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"*** Completed eval of object %s ***\n", pathname));
cleanup:
/* Cleanup */
if (internal_path) {
ACPI_MEM_FREE(internal_path);
}
return_ACPI_STATUS(status);
}
示例15: acpi_ns_delete_node
void
acpi_ns_delete_node (
struct acpi_namespace_node *node)
{
struct acpi_namespace_node *parent_node;
struct acpi_namespace_node *prev_node;
struct acpi_namespace_node *next_node;
ACPI_FUNCTION_TRACE_PTR ("ns_delete_node", node);
parent_node = acpi_ns_get_parent_node (node);
prev_node = NULL;
next_node = parent_node->child;
/* Find the node that is the previous peer in the parent's child list */
while (next_node != node) {
prev_node = next_node;
next_node = prev_node->peer;
}
if (prev_node) {
/* Node is not first child, unlink it */
prev_node->peer = next_node->peer;
if (next_node->flags & ANOBJ_END_OF_PEER_LIST) {
prev_node->flags |= ANOBJ_END_OF_PEER_LIST;
}
}
else {
/* Node is first child (has no previous peer) */
if (next_node->flags & ANOBJ_END_OF_PEER_LIST) {
/* No peers at all */
parent_node->child = NULL;
}
else { /* Link peer list to parent */
parent_node->child = next_node->peer;
}
}
ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].total_freed++);
/*
* Detach an object if there is one then delete the node
*/
acpi_ns_detach_object (node);
ACPI_MEM_FREE (node);
return_VOID;
}