本文整理汇总了C++中ACPI_WARNING函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_WARNING函数的具体用法?C++ ACPI_WARNING怎么用?C++ ACPI_WARNING使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ACPI_WARNING函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: acpi_ut_repair_name
void acpi_ut_repair_name(char *name)
{
u32 i;
u8 found_bad_char = FALSE;
u32 original_name;
ACPI_FUNCTION_NAME(ut_repair_name);
ACPI_MOVE_NAME(&original_name, name);
/* Check each character in the name */
for (i = 0; i < ACPI_NAME_SIZE; i++) {
if (acpi_ut_valid_acpi_char(name[i], i)) {
continue;
}
/*
* Replace a bad character with something printable, yet technically
* still invalid. This prevents any collisions with existing "good"
* names in the namespace.
*/
name[i] = '*';
found_bad_char = TRUE;
}
if (found_bad_char) {
/* Report warning only if in strict mode or debug mode */
if (!acpi_gbl_enable_interpreter_slack) {
ACPI_WARNING((AE_INFO,
"Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
original_name, name));
} else {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
original_name, name));
}
}
}
示例2: acpi_ev_release_global_lock
acpi_status acpi_ev_release_global_lock(void)
{
u8 pending = FALSE;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(ev_release_global_lock);
if (!acpi_gbl_global_lock_thread_count) {
ACPI_WARNING((AE_INFO,
"Cannot release HW Global Lock, it has not been acquired"));
return_ACPI_STATUS(AE_NOT_ACQUIRED);
}
/* One fewer thread has the global lock */
acpi_gbl_global_lock_thread_count--;
if (acpi_gbl_global_lock_thread_count) {
/* There are still some threads holding the lock, cannot release */
return_ACPI_STATUS(AE_OK);
}
/*
* No more threads holding lock, we can do the actual hardware
* release
*/
ACPI_RELEASE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, pending);
acpi_gbl_global_lock_acquired = FALSE;
/*
* If the pending bit was set, we must write GBL_RLS to the control
* register
*/
if (pending) {
status = acpi_set_register(ACPI_BITREG_GLOBAL_LOCK_RELEASE,
1, ACPI_MTX_LOCK);
}
return_ACPI_STATUS(status);
}
示例3: ACPI_FUNCTION_TRACE_PTR
union acpi_operand_object *acpi_ns_get_attached_object(struct
acpi_namespace_node
*node)
{
ACPI_FUNCTION_TRACE_PTR(ns_get_attached_object, node);
if (!node) {
ACPI_WARNING((AE_INFO, "Null Node ptr"));
return_PTR(NULL);
}
if (!node->object ||
((ACPI_GET_DESCRIPTOR_TYPE(node->object) != ACPI_DESC_TYPE_OPERAND)
&& (ACPI_GET_DESCRIPTOR_TYPE(node->object) !=
ACPI_DESC_TYPE_NAMED))
|| ((node->object)->common.type == ACPI_TYPE_LOCAL_DATA)) {
return_PTR(NULL);
}
return_PTR(node->object);
}
示例4: AcpiTbCreateLocalFadt
void
AcpiTbCreateLocalFadt (
ACPI_TABLE_HEADER *Table,
UINT32 Length)
{
/*
* Check if the FADT is larger than the largest table that we expect
* (the ACPI 2.0/3.0 version). If so, truncate the table, and issue
* a warning.
*/
if (Length > sizeof (ACPI_TABLE_FADT))
{
ACPI_WARNING ((AE_INFO,
"FADT (revision %u) is longer than ACPI 2.0 version, "
"truncating length %u to %u",
Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT)));
}
/* Clear the entire local FADT */
ACPI_MEMSET (&AcpiGbl_FADT, 0, sizeof (ACPI_TABLE_FADT));
/* Copy the original FADT, up to sizeof (ACPI_TABLE_FADT) */
ACPI_MEMCPY (&AcpiGbl_FADT, Table,
ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT)));
/* Convert the local copy of the FADT to the common internal format */
AcpiTbConvertFadt ();
/* Validate FADT values now, before we make any changes */
AcpiTbValidateFadt ();
/* Initialize the global ACPI register structures */
AcpiTbSetupFadtRegisters ();
}
示例5: AcpiTbGetTable
ACPI_STATUS
AcpiTbGetTable (
ACPI_TABLE_DESC *TableDesc,
ACPI_TABLE_HEADER **OutTable)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiTbGetTable);
if (TableDesc->ValidationCount == 0)
{
/* Table need to be "VALIDATED" */
Status = AcpiTbValidateTable (TableDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
}
if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS)
{
TableDesc->ValidationCount++;
/*
* Detect ValidationCount overflows to ensure that the warning
* message will only be printed once.
*/
if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS)
{
ACPI_WARNING((AE_INFO,
"Table %p, Validation count overflows\n", TableDesc));
}
}
*OutTable = TableDesc->Pointer;
return_ACPI_STATUS (AE_OK);
}
示例6: acpi_remove_fixed_event_handler
/*******************************************************************************
*
* FUNCTION: acpi_remove_fixed_event_handler
*
* PARAMETERS: event - Event type to disable.
* handler - Address of the handler
*
* RETURN: Status
*
* DESCRIPTION: Disables the event and unregisters the event handler.
*
******************************************************************************/
acpi_status
acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
{
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(acpi_remove_fixed_event_handler);
/* Parameter validation */
if (event > ACPI_EVENT_MAX) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Disable the event before removing the handler */
status = acpi_disable_event(event, 0);
/* Always Remove the handler */
acpi_gbl_fixed_event_handlers[event].handler = NULL;
acpi_gbl_fixed_event_handlers[event].context = NULL;
if (ACPI_FAILURE(status)) {
ACPI_WARNING((AE_INFO,
"Could not disable fixed event - %s (%u)",
acpi_ut_get_event_name(event), event));
} else {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Disabled fixed event - %s (%X)\n",
acpi_ut_get_event_name(event), event));
}
(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
return_ACPI_STATUS(status);
}
示例7: acpi_ev_release_global_lock
acpi_status acpi_ev_release_global_lock(void)
{
u8 pending = FALSE;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(ev_release_global_lock);
if (!acpi_gbl_global_lock_acquired) {
ACPI_WARNING((AE_INFO,
"Cannot release the ACPI Global Lock, it has not been acquired"));
return_ACPI_STATUS(AE_NOT_ACQUIRED);
}
if (acpi_gbl_global_lock_present) {
ACPI_RELEASE_GLOBAL_LOCK(acpi_gbl_FACS, pending);
if (pending) {
status =
acpi_write_bit_register
(ACPI_BITREG_GLOBAL_LOCK_RELEASE,
ACPI_ENABLE_EVENT);
}
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Released hardware Global Lock\n"));
}
acpi_gbl_global_lock_acquired = FALSE;
acpi_os_release_mutex(acpi_gbl_global_lock_mutex->mutex.os_mutex);
return_ACPI_STATUS(status);
}
示例8: acpi_tb_create_local_fadt
void __init acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
{
/*
* Check if the FADT is larger than the largest table that we expect
* (the ACPI 5.0 version). If so, truncate the table, and issue
* a warning.
*/
if (length > sizeof(struct acpi_table_fadt)) {
ACPI_WARNING((AE_INFO,
"FADT (revision %u) is longer than ACPI 5.0 version,"
" truncating length %u to %zu",
table->revision, (unsigned)length,
sizeof(struct acpi_table_fadt)));
}
/* Clear the entire local FADT */
ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));
/* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */
ACPI_MEMCPY(&acpi_gbl_FADT, table,
ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
/* Take a copy of the Hardware Reduced flag */
acpi_gbl_reduced_hardware = FALSE;
if (acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) {
acpi_gbl_reduced_hardware = TRUE;
}
/*
* 1) Convert the local copy of the FADT to the common internal format
* 2) Validate some of the important values within the FADT
*/
acpi_tb_convert_fadt();
acpi_tb_validate_fadt();
}
示例9: AcpiNsGetAttachedObject
ACPI_OPERAND_OBJECT *
AcpiNsGetAttachedObject (
ACPI_NAMESPACE_NODE *Node)
{
ACPI_FUNCTION_TRACE_PTR (NsGetAttachedObject, Node);
if (!Node)
{
ACPI_WARNING ((AE_INFO, "Null Node ptr"));
return_PTR (NULL);
}
if (!Node->Object ||
((ACPI_GET_DESCRIPTOR_TYPE (Node->Object) != ACPI_DESC_TYPE_OPERAND) &&
(ACPI_GET_DESCRIPTOR_TYPE (Node->Object) != ACPI_DESC_TYPE_NAMED)) ||
((Node->Object)->Common.Type == ACPI_TYPE_LOCAL_DATA))
{
return_PTR (NULL);
}
return_PTR (Node->Object);
}
示例10: acpi_tb_create_local_fadt
void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
{
/*
* Check if the FADT is larger than the largest table that we expect
* (the ACPI 2.0/3.0 version). If so, truncate the table, and issue
* a warning.
*/
if (length > sizeof(struct acpi_table_fadt)) {
ACPI_WARNING((AE_INFO,
"FADT (revision %u) is longer than ACPI 2.0 version, "
"truncating length %u to %u",
table->revision, length,
(u32)sizeof(struct acpi_table_fadt)));
}
/* Clear the entire local FADT */
ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));
/* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */
ACPI_MEMCPY(&acpi_gbl_FADT, table,
ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
/* Convert the local copy of the FADT to the common internal format */
acpi_tb_convert_fadt();
/* Validate FADT values now, before we make any changes */
acpi_tb_validate_fadt();
/* Initialize the global ACPI register structures */
acpi_tb_setup_fadt_registers();
}
示例11: AcpiUtUpdateRefCount
static void
AcpiUtUpdateRefCount (
ACPI_OPERAND_OBJECT *Object,
UINT32 Action)
{
UINT16 OriginalCount;
UINT16 NewCount = 0;
ACPI_CPU_FLAGS LockFlags;
ACPI_FUNCTION_NAME (UtUpdateRefCount);
if (!Object)
{
return;
}
/*
* Always get the reference count lock. Note: Interpreter and/or
* Namespace is not always locked when this function is called.
*/
LockFlags = AcpiOsAcquireLock (AcpiGbl_ReferenceCountLock);
OriginalCount = Object->Common.ReferenceCount;
/* Perform the reference count action (increment, decrement) */
switch (Action)
{
case REF_INCREMENT:
NewCount = OriginalCount + 1;
Object->Common.ReferenceCount = NewCount;
AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags);
/* The current reference count should never be zero here */
if (!OriginalCount)
{
ACPI_WARNING ((AE_INFO,
"Obj %p, Reference Count was zero before increment\n",
Object));
}
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
"Obj %p Type %.2X Refs %.2X [Incremented]\n",
Object, Object->Common.Type, NewCount));
break;
case REF_DECREMENT:
/* The current reference count must be non-zero */
if (OriginalCount)
{
NewCount = OriginalCount - 1;
Object->Common.ReferenceCount = NewCount;
}
AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags);
if (!OriginalCount)
{
ACPI_WARNING ((AE_INFO,
"Obj %p, Reference Count is already zero, cannot decrement\n",
Object));
}
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
"Obj %p Type %.2X Refs %.2X [Decremented]\n",
Object, Object->Common.Type, NewCount));
/* Actually delete the object on a reference count of zero */
if (NewCount == 0)
{
AcpiUtDeleteInternalObj (Object);
}
break;
default:
AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags);
ACPI_ERROR ((AE_INFO, "Unknown Reference Count action (0x%X)",
Action));
return;
}
/*
* Sanity check the reference count, for debug purposes only.
* (A deleted object will have a huge reference count)
*/
if (NewCount > ACPI_MAX_REFERENCE_COUNT)
{
ACPI_WARNING ((AE_INFO,
"Large Reference Count (0x%X) in object %p, Type=0x%.2X",
NewCount, Object, Object->Common.Type));
}
}
示例12: AcpiDsScopeStackPush
ACPI_STATUS
AcpiDsScopeStackPush (
ACPI_NAMESPACE_NODE *Node,
ACPI_OBJECT_TYPE Type,
ACPI_WALK_STATE *WalkState)
{
ACPI_GENERIC_STATE *ScopeInfo;
ACPI_GENERIC_STATE *OldScopeInfo;
ACPI_FUNCTION_TRACE (DsScopeStackPush);
if (!Node)
{
/* Invalid scope */
ACPI_ERROR ((AE_INFO, "Null scope parameter"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Make sure object type is valid */
if (!AcpiUtValidObjectType (Type))
{
ACPI_WARNING ((AE_INFO,
"Invalid object type: 0x%X", Type));
}
/* Allocate a new scope object */
ScopeInfo = AcpiUtCreateGenericState ();
if (!ScopeInfo)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Init new scope object */
ScopeInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_WSCOPE;
ScopeInfo->Scope.Node = Node;
ScopeInfo->Common.Value = (UINT16) Type;
WalkState->ScopeDepth++;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"[%.2d] Pushed scope ", (UINT32) WalkState->ScopeDepth));
OldScopeInfo = WalkState->ScopeInfo;
if (OldScopeInfo)
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[%4.4s] (%s)",
AcpiUtGetNodeName (OldScopeInfo->Scope.Node),
AcpiUtGetTypeName (OldScopeInfo->Common.Value)));
}
else
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, ACPI_NAMESPACE_ROOT));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
", New scope -> [%4.4s] (%s)\n",
AcpiUtGetNodeName (ScopeInfo->Scope.Node),
AcpiUtGetTypeName (ScopeInfo->Common.Value)));
/* Push new scope object onto stack */
AcpiUtPushGenericState (&WalkState->ScopeInfo, ScopeInfo);
return_ACPI_STATUS (AE_OK);
}
示例13: AcpiExStoreObjectToObject
ACPI_STATUS
AcpiExStoreObjectToObject (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *DestDesc,
ACPI_OPERAND_OBJECT **NewDesc,
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT *ActualSrcDesc;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE_PTR (ExStoreObjectToObject, SourceDesc);
ActualSrcDesc = SourceDesc;
if (!DestDesc)
{
/*
* There is no destination object (An uninitialized node or
* package element), so we can simply copy the source object
* creating a new destination object
*/
Status = AcpiUtCopyIobjectToIobject (ActualSrcDesc, NewDesc, WalkState);
return_ACPI_STATUS (Status);
}
if (SourceDesc->Common.Type != DestDesc->Common.Type)
{
/*
* The source type does not match the type of the destination.
* Perform the "implicit conversion" of the source to the current type
* of the target as per the ACPI specification.
*
* If no conversion performed, ActualSrcDesc = SourceDesc.
* Otherwise, ActualSrcDesc is a temporary object to hold the
* converted object.
*/
Status = AcpiExConvertToTargetType (DestDesc->Common.Type,
SourceDesc, &ActualSrcDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
if (SourceDesc == ActualSrcDesc)
{
/*
* No conversion was performed. Return the SourceDesc as the
* new object.
*/
*NewDesc = SourceDesc;
return_ACPI_STATUS (AE_OK);
}
}
/*
* We now have two objects of identical types, and we can perform a
* copy of the *value* of the source object.
*/
switch (DestDesc->Common.Type)
{
case ACPI_TYPE_INTEGER:
DestDesc->Integer.Value = ActualSrcDesc->Integer.Value;
/* Truncate value if we are executing from a 32-bit ACPI table */
AcpiExTruncateFor32bitTable (DestDesc);
break;
case ACPI_TYPE_STRING:
Status = AcpiExStoreStringToString (ActualSrcDesc, DestDesc);
break;
case ACPI_TYPE_BUFFER:
Status = AcpiExStoreBufferToBuffer (ActualSrcDesc, DestDesc);
break;
case ACPI_TYPE_PACKAGE:
Status = AcpiUtCopyIobjectToIobject (ActualSrcDesc, &DestDesc,
WalkState);
break;
default:
/*
* All other types come here.
*/
ACPI_WARNING ((AE_INFO, "Store into type %s not implemented",
AcpiUtGetObjectTypeName (DestDesc)));
Status = AE_NOT_IMPLEMENTED;
break;
}
if (ActualSrcDesc != SourceDesc)
{
/* Delete the intermediate (temporary) source object */
//.........这里部分代码省略.........
示例14: MtMethodAnalysisWalkBegin
//.........这里部分代码省略.........
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
MethodInfo->ArgInitialized[RegisterNumber] = TRUE;
}
/*
* Otherwise, this is a reference, check if the Arg
* has been previously initialized.
*
* The only operator that accepts an uninitialized value is ObjectType()
*/
else if ((!MethodInfo->ArgInitialized[RegisterNumber]) &&
(Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE))
{
AslError (ASL_ERROR, ASL_MSG_ARG_INIT, Op, ArgName);
}
/* Flag this arg if it is not a "real" argument to the method */
if (RegisterNumber >= MethodInfo->NumArguments)
{
AslError (ASL_REMARK, ASL_MSG_NOT_PARAMETER, Op, ArgName);
}
break;
case PARSEOP_RETURN:
if (!MethodInfo)
{
/*
* Probably was an error in the method declaration,
* no additional error here
*/
ACPI_WARNING ((AE_INFO, "%p, No parent method", Op));
return (AE_ERROR);
}
/*
* A child indicates a possible return value. A simple Return or
* Return() is marked with NODE_IS_NULL_RETURN by the parser so
* that it is not counted as a "real" return-with-value, although
* the AML code that is actually emitted is Return(0). The AML
* definition of Return has a required parameter, so we are
* forced to convert a null return to Return(0).
*/
if ((Op->Asl.Child) &&
(Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
(!(Op->Asl.Child->Asl.CompileFlags & NODE_IS_NULL_RETURN)))
{
MethodInfo->NumReturnWithValue++;
}
else
{
MethodInfo->NumReturnNoValue++;
}
break;
case PARSEOP_BREAK:
case PARSEOP_CONTINUE:
Next = Op->Asl.Parent;
while (Next)
{
if (Next->Asl.ParseOpcode == PARSEOP_WHILE)
{
break;
示例15: AcpiEvTerminate
void
AcpiEvTerminate (
void)
{
UINT32 i;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (EvTerminate);
if (AcpiGbl_EventsInitialized)
{
/*
* Disable all event-related functionality. In all cases, on error,
* print a message but obviously we don't abort.
*/
/* Disable all fixed events */
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
{
Status = AcpiDisableEvent (i, 0);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO,
"Could not disable fixed event %u", (UINT32) i));
}
}
/* Disable all GPEs in all GPE blocks */
Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);
Status = AcpiEvRemoveGlobalLockHandler ();
if (ACPI_FAILURE(Status))
{
ACPI_ERROR ((AE_INFO,
"Could not remove Global Lock handler"));
}
AcpiGbl_EventsInitialized = FALSE;
}
/* Remove SCI handlers */
Status = AcpiEvRemoveAllSciHandlers ();
if (ACPI_FAILURE(Status))
{
ACPI_ERROR ((AE_INFO,
"Could not remove SCI handler"));
}
/* Deallocate all handler objects installed within GPE info structs */
Status = AcpiEvWalkGpeList (AcpiEvDeleteGpeHandlers, NULL);
/* Return to original mode if necessary */
if (AcpiGbl_OriginalMode == ACPI_SYS_MODE_LEGACY)
{
Status = AcpiDisable ();
if (ACPI_FAILURE (Status))
{
ACPI_WARNING ((AE_INFO, "AcpiDisable failed"));
}
}
return_VOID;
}