本文整理汇总了C++中ACPI_DEBUG_PRINT_RAW函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_DEBUG_PRINT_RAW函数的具体用法?C++ ACPI_DEBUG_PRINT_RAW怎么用?C++ ACPI_DEBUG_PRINT_RAW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ACPI_DEBUG_PRINT_RAW函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: acpi_ns_init_one_object
acpi_status
acpi_ns_init_one_object (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value)
{
acpi_object_type8 type;
acpi_status status;
acpi_init_walk_info *info = (acpi_init_walk_info *) context;
acpi_namespace_node *node = (acpi_namespace_node *) obj_handle;
acpi_operand_object *obj_desc;
PROC_NAME ("Ns_init_one_object");
info->object_count++;
/* And even then, we are only interested in a few object types */
type = acpi_ns_get_type (obj_handle);
obj_desc = node->object;
if (!obj_desc) {
return (AE_OK);
}
if ((type != ACPI_TYPE_REGION) &&
(type != ACPI_TYPE_BUFFER_FIELD)) {
return (AE_OK);
}
/*
* Must lock the interpreter before executing AML code
*/
status = acpi_ex_enter_interpreter ();
if (ACPI_FAILURE (status)) {
return (status);
}
switch (type) {
case ACPI_TYPE_REGION:
info->op_region_count++;
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
break;
}
info->op_region_init++;
status = acpi_ds_get_region_arguments (obj_desc);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"%s while getting region arguments [%4.4s]\n",
acpi_format_exception (status), (char*)&node->name));
}
if (!(acpi_dbg_level & ACPI_LV_INIT)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
break;
case ACPI_TYPE_BUFFER_FIELD:
info->field_count++;
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
break;
}
info->field_init++;
status = acpi_ds_get_buffer_field_arguments (obj_desc);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"%s while getting buffer field arguments [%4.4s]\n",
acpi_format_exception (status), (char*)&node->name));
}
if (!(acpi_dbg_level & ACPI_LV_INIT)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
break;
default:
break;
}
/*
* We ignore errors from above, and always return OK, since
* we don't want to abort the walk on a single error.
*/
acpi_ex_exit_interpreter ();
return (AE_OK);
//.........这里部分代码省略.........
开发者ID:TitaniumBoy,项目名称:lin,代码行数:101,代码来源:nsinit.c
示例2: OptSearchToRoot
static ACPI_STATUS
OptSearchToRoot (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE *CurrentNode,
ACPI_NAMESPACE_NODE *TargetNode,
ACPI_BUFFER *TargetPath,
char **NewPath)
{
ACPI_NAMESPACE_NODE *Node;
ACPI_GENERIC_STATE ScopeInfo;
ACPI_STATUS Status;
char *Path;
ACPI_FUNCTION_NAME (OptSearchToRoot);
/*
* Check if search-to-root can be utilized. Use the last NameSeg of
* the NamePath and 1) See if can be found and 2) If found, make
* sure that it is the same node that we want. If there is another
* name in the search path before the one we want, the nodes will
* not match, and we cannot use this optimization.
*/
Path = &(((char *) TargetPath->Pointer)[
TargetPath->Length - ACPI_NAME_SIZE]),
ScopeInfo.Scope.Node = CurrentNode;
/* Lookup the NameSeg using SEARCH_PARENT (search-to-root) */
Status = AcpiNsLookup (&ScopeInfo, Path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
WalkState, &(Node));
if (ACPI_FAILURE (Status))
{
return (Status);
}
/*
* We found the name, but we must check to make sure that the node
* matches. Otherwise, there is another identical name in the search
* path that precludes the use of this optimization.
*/
if (Node != TargetNode)
{
/*
* This means that another object with the same name was found first,
* and we cannot use this optimization.
*/
return (AE_NOT_FOUND);
}
/* Found the node, we can use this optimization */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
"NAMESEG: %-24s", Path));
/* We must allocate a new string for the name (TargetPath gets deleted) */
*NewPath = UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
strcpy (*NewPath, Path);
if (strncmp (*NewPath, "_T_", 3))
{
AslError (ASL_OPTIMIZATION, ASL_MSG_SINGLE_NAME_OPTIMIZATION,
Op, *NewPath);
}
return (AE_OK);
}
开发者ID:cailianchun,项目名称:acpica,代码行数:71,代码来源:aslopt.c
示例3: OptOptimizeNameDeclaration
static ACPI_STATUS
OptOptimizeNameDeclaration (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE *CurrentNode,
ACPI_NAMESPACE_NODE *TargetNode,
char *AmlNameString,
char **NewPath)
{
ACPI_STATUS Status;
char *NewPathExternal;
ACPI_NAMESPACE_NODE *Node;
ACPI_FUNCTION_TRACE (OptOptimizeNameDeclaration);
if (((CurrentNode == AcpiGbl_RootNode) ||
(Op->Common.Parent->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)) &&
(ACPI_IS_ROOT_PREFIX (AmlNameString[0])))
{
/*
* The current scope is the root, and the namepath has a root prefix
* that is therefore extraneous. Remove it.
*/
*NewPath = &AmlNameString[1];
/* Debug output */
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, *NewPath,
NULL, &NewPathExternal);
if (ACPI_FAILURE (Status))
{
AslCoreSubsystemError (Op, Status, "Externalizing NamePath",
ASL_NO_ABORT);
return (Status);
}
/*
* Check to make sure that the optimization finds the node we are
* looking for. This is simply a sanity check on the new
* path that has been created.
*
* We know that we are at the root, so NULL is used for the scope.
*/
Status = AcpiNsLookup (NULL, *NewPath,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node));
if (ACPI_SUCCESS (Status))
{
/* Found the namepath, but make sure the node is correct */
if (Node == TargetNode)
{
/* The lookup matched the node, accept this optimization */
AslError (ASL_OPTIMIZATION, ASL_MSG_NAME_OPTIMIZATION,
Op, NewPathExternal);
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
"AT ROOT: %-24s", NewPathExternal));
}
else
{
/* Node is not correct, do not use this optimization */
Status = AE_NOT_FOUND;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
" ***** WRONG NODE"));
AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op,
"Not using optimized name - found wrong node");
}
}
else
{
/* The lookup failed, we obviously cannot use this optimization */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
" ***** NOT FOUND"));
AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op,
"Not using optimized name - did not find node");
}
ACPI_FREE (NewPathExternal);
return (Status);
}
/* Could not optimize */
return (AE_NOT_FOUND);
}
开发者ID:cailianchun,项目名称:acpica,代码行数:91,代码来源:aslopt.c
示例4: AcpiUtOsiImplementation
ACPI_STATUS
AcpiUtOsiImplementation (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT *StringDesc;
ACPI_OPERAND_OBJECT *ReturnDesc;
ACPI_INTERFACE_INFO *InterfaceInfo;
ACPI_INTERFACE_HANDLER InterfaceHandler;
ACPI_STATUS Status;
UINT32 ReturnValue;
ACPI_FUNCTION_TRACE (UtOsiImplementation);
/* Validate the string input argument (from the AML caller) */
StringDesc = WalkState->Arguments[0].Object;
if (!StringDesc ||
(StringDesc->Common.Type != ACPI_TYPE_STRING))
{
return_ACPI_STATUS (AE_TYPE);
}
/* Create a return object */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
if (!ReturnDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Default return value is 0, NOT SUPPORTED */
ReturnValue = 0;
Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
if (ACPI_FAILURE (Status))
{
AcpiUtRemoveReference (ReturnDesc);
return_ACPI_STATUS (Status);
}
/* Lookup the interface in the global _OSI list */
InterfaceInfo = AcpiUtGetInterface (StringDesc->String.Pointer);
if (InterfaceInfo &&
!(InterfaceInfo->Flags & ACPI_OSI_INVALID))
{
/*
* The interface is supported.
* Update the OsiData if necessary. We keep track of the latest
* version of Windows that has been requested by the BIOS.
*/
if (InterfaceInfo->Value > AcpiGbl_OsiData)
{
AcpiGbl_OsiData = InterfaceInfo->Value;
}
ReturnValue = ACPI_UINT32_MAX;
}
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
/*
* Invoke an optional _OSI interface handler. The host OS may wish
* to do some interface-specific handling. For example, warn about
* certain interfaces or override the true/false support value.
*/
InterfaceHandler = AcpiGbl_InterfaceHandler;
if (InterfaceHandler)
{
ReturnValue = InterfaceHandler (
StringDesc->String.Pointer, ReturnValue);
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
"ACPI: BIOS _OSI(\"%s\") is %ssupported\n",
StringDesc->String.Pointer, ReturnValue == 0 ? "not " : ""));
/* Complete the return object */
ReturnDesc->Integer.Value = ReturnValue;
WalkState->ReturnDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK);
}
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:85,代码来源:utosi.c
示例5: AcpiEvCreateGpeBlock
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
ACPI_GENERIC_ADDRESS *GpeBlockAddress,
UINT32 RegisterCount,
UINT8 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
{
ACPI_STATUS Status;
ACPI_GPE_BLOCK_INFO *GpeBlock;
ACPI_GPE_WALK_INFO WalkInfo;
ACPI_FUNCTION_TRACE (EvCreateGpeBlock);
if (!RegisterCount)
{
return_ACPI_STATUS (AE_OK);
}
/* Allocate a new GPE block */
GpeBlock = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_BLOCK_INFO));
if (!GpeBlock)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Initialize the new GPE block */
GpeBlock->Node = GpeDevice;
GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
GpeBlock->Initialized = FALSE;
GpeBlock->RegisterCount = RegisterCount;
GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
ACPI_MEMCPY (&GpeBlock->BlockAddress, GpeBlockAddress,
sizeof (ACPI_GENERIC_ADDRESS));
/*
* Create the RegisterInfo and EventInfo sub-structures
* Note: disables and clears all GPEs in the block
*/
Status = AcpiEvCreateGpeInfoBlocks (GpeBlock);
if (ACPI_FAILURE (Status))
{
ACPI_FREE (GpeBlock);
return_ACPI_STATUS (Status);
}
/* Install the new block in the global lists */
Status = AcpiEvInstallGpeBlock (GpeBlock, InterruptNumber);
if (ACPI_FAILURE (Status))
{
ACPI_FREE (GpeBlock->RegisterInfo);
ACPI_FREE (GpeBlock->EventInfo);
ACPI_FREE (GpeBlock);
return_ACPI_STATUS (Status);
}
AcpiGbl_AllGpesInitialized = FALSE;
/* Find all GPE methods (_Lxx or_Exx) for this block */
WalkInfo.GpeBlock = GpeBlock;
WalkInfo.GpeDevice = GpeDevice;
WalkInfo.ExecuteByOwnerId = FALSE;
Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL);
/* Return the new block */
if (ReturnGpeBlock)
{
(*ReturnGpeBlock) = GpeBlock;
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
" Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n",
(UINT32) GpeBlock->BlockBaseNumber,
(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
GpeDevice->Name.Ascii, GpeBlock->RegisterCount,
InterruptNumber));
/* Update global count of currently available GPEs */
AcpiCurrentGpeCount += GpeBlock->GpeCount;
return_ACPI_STATUS (AE_OK);
}
开发者ID:CSharpLover,项目名称:MosquitOS,代码行数:94,代码来源:evgpeblk.c
示例6: acpi_ev_gpe_initialize
/*******************************************************************************
*
* FUNCTION: acpi_ev_gpe_initialize
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Initialize the GPE data structures and the FADT GPE 0/1 blocks
*
******************************************************************************/
acpi_status acpi_ev_gpe_initialize(void)
{
u32 register_count0 = 0;
u32 register_count1 = 0;
u32 gpe_number_max = 0;
acpi_status status;
ACPI_FUNCTION_TRACE(ev_gpe_initialize);
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Initializing General Purpose Events (GPEs):\n"));
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/*
* Initialize the GPE Block(s) defined in the FADT
*
* Why the GPE register block lengths are divided by 2: From the ACPI
* Spec, section "General-Purpose Event Registers", we have:
*
* "Each register block contains two registers of equal length
* GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the
* GPE0_STS and GPE0_EN registers is equal to half the GPE0_LEN
* The length of the GPE1_STS and GPE1_EN registers is equal to
* half the GPE1_LEN. If a generic register block is not supported
* then its respective block pointer and block length values in the
* FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need
* to be the same size."
*/
/*
* Determine the maximum GPE number for this machine.
*
* Note: both GPE0 and GPE1 are optional, and either can exist without
* the other.
*
* If EITHER the register length OR the block address are zero, then that
* particular block is not supported.
*/
if (acpi_gbl_FADT.gpe0_block_length &&
acpi_gbl_FADT.xgpe0_block.address) {
/* GPE block 0 exists (has both length and address > 0) */
register_count0 = (u16)(acpi_gbl_FADT.gpe0_block_length / 2);
gpe_number_max =
(register_count0 * ACPI_GPE_REGISTER_WIDTH) - 1;
/* Install GPE Block 0 */
status = acpi_ev_create_gpe_block(acpi_gbl_fadt_gpe_device,
acpi_gbl_FADT.xgpe0_block.
address,
acpi_gbl_FADT.xgpe0_block.
space_id, register_count0, 0,
acpi_gbl_FADT.sci_interrupt,
&acpi_gbl_gpe_fadt_blocks[0]);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"Could not create GPE Block 0"));
}
}
if (acpi_gbl_FADT.gpe1_block_length &&
acpi_gbl_FADT.xgpe1_block.address) {
/* GPE block 1 exists (has both length and address > 0) */
register_count1 = (u16)(acpi_gbl_FADT.gpe1_block_length / 2);
/* Check for GPE0/GPE1 overlap (if both banks exist) */
if ((register_count0) &&
(gpe_number_max >= acpi_gbl_FADT.gpe1_base)) {
ACPI_ERROR((AE_INFO,
"GPE0 block (GPE 0 to %u) overlaps the GPE1 block "
"(GPE %u to %u) - Ignoring GPE1",
gpe_number_max, acpi_gbl_FADT.gpe1_base,
acpi_gbl_FADT.gpe1_base +
((register_count1 *
ACPI_GPE_REGISTER_WIDTH) - 1)));
/* Ignore GPE1 block by setting the register count to zero */
register_count1 = 0;
//.........这里部分代码省略.........
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:101,代码来源:evgpeinit.c
示例7: 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,
"[\\___] (%s)", "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);
}
开发者ID:andreiw,项目名称:polaris,代码行数:72,代码来源:dswscope.c
示例8: acpi_ns_initialize_devices
acpi_status acpi_ns_initialize_devices(void)
{
acpi_status status;
struct acpi_device_walk_info info;
ACPI_FUNCTION_TRACE(ns_initialize_devices);
/* Init counters */
info.device_count = 0;
info.num_STA = 0;
info.num_INI = 0;
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Initializing Device/Processor/Thermal objects "
"and executing _INI/_STA methods:\n"));
/* Tree analysis: find all subtrees that contain _INI methods */
status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE,
acpi_ns_find_ini_methods, NULL, &info,
NULL);
if (ACPI_FAILURE(status)) {
goto error_exit;
}
/* Allocate the evaluation information block */
info.evaluate_info =
ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
if (!info.evaluate_info) {
status = AE_NO_MEMORY;
goto error_exit;
}
/*
* Execute the "global" _INI method that may appear at the root. This
* support is provided for Windows compatibility (Vista+) and is not
* part of the ACPI specification.
*/
info.evaluate_info->prefix_node = acpi_gbl_root_node;
info.evaluate_info->relative_pathname = METHOD_NAME__INI;
info.evaluate_info->parameters = NULL;
info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;
status = acpi_ns_evaluate(info.evaluate_info);
if (ACPI_SUCCESS(status)) {
info.num_INI++;
}
/* Walk namespace to execute all _INIs on present devices */
status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE,
acpi_ns_init_one_device, NULL, &info,
NULL);
/*
* Any _OSI requests should be completed by now. If the BIOS has
* requested any Windows OSI strings, we will always truncate
* I/O addresses to 16 bits -- for Windows compatibility.
*/
if (acpi_gbl_osi_data >= ACPI_OSI_WIN_2000) {
acpi_gbl_truncate_io_addresses = TRUE;
}
ACPI_FREE(info.evaluate_info);
if (ACPI_FAILURE(status)) {
goto error_exit;
}
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
" Executed %u _INI methods requiring %u _STA executions "
"(examined %u objects)\n",
info.num_INI, info.num_STA, info.device_count));
return_ACPI_STATUS(status);
error_exit:
ACPI_EXCEPTION((AE_INFO, status, "During device initialization"));
return_ACPI_STATUS(status);
}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:83,代码来源:nsinit.c
示例9: acpi_ex_access_region
acpi_status
acpi_ex_access_region (
union acpi_operand_object *obj_desc,
u32 field_datum_byte_offset,
acpi_integer *value,
u32 function)
{
acpi_status status;
union acpi_operand_object *rgn_desc;
acpi_physical_address address;
ACPI_FUNCTION_TRACE ("ex_access_region");
/*
* Ensure that the region operands are fully evaluated and verify
* the validity of the request
*/
status = acpi_ex_setup_region (obj_desc, field_datum_byte_offset);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/*
* The physical address of this field datum is:
*
* 1) The base of the region, plus
* 2) The base offset of the field, plus
* 3) The current offset into the field
*/
rgn_desc = obj_desc->common_field.region_obj;
address = rgn_desc->region.address
+ obj_desc->common_field.base_byte_offset
+ field_datum_byte_offset;
if ((function & ACPI_IO_MASK) == ACPI_READ) {
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "[READ]"));
}
else {
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "[WRITE]"));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_BFIELD,
" Region [%s:%X], Width %X, byte_base %X, Offset %X at %8.8X%8.8X\n",
acpi_ut_get_region_name (rgn_desc->region.space_id),
rgn_desc->region.space_id,
obj_desc->common_field.access_byte_width,
obj_desc->common_field.base_byte_offset,
field_datum_byte_offset,
ACPI_HIDWORD (address), ACPI_LODWORD (address)));
/* Invoke the appropriate address_space/op_region handler */
status = acpi_ev_address_space_dispatch (rgn_desc, function,
address, ACPI_MUL_8 (obj_desc->common_field.access_byte_width), value);
if (ACPI_FAILURE (status)) {
if (status == AE_NOT_IMPLEMENTED) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Region %s(%X) not implemented\n",
acpi_ut_get_region_name (rgn_desc->region.space_id),
rgn_desc->region.space_id));
}
else if (status == AE_NOT_EXIST) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Region %s(%X) has no handler\n",
acpi_ut_get_region_name (rgn_desc->region.space_id),
rgn_desc->region.space_id));
}
}
return_ACPI_STATUS (status);
}
开发者ID:iPodLinux,项目名称:linux-2.4.24-ipod,代码行数:74,代码来源:exfldio.c
示例10: acpi_ds_call_control_method
//.........这里部分代码省略.........
status =
acpi_ds_begin_method_execution(method_node, obj_desc,
this_walk_state);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Begin method parse/execution. Create a new walk state */
next_walk_state =
acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, obj_desc,
thread);
if (!next_walk_state) {
status = AE_NO_MEMORY;
goto cleanup;
}
/*
* The resolved arguments were put on the previous walk state's operand
* stack. Operands on the previous walk state stack always
* start at index 0. Also, null terminate the list of arguments
*/
this_walk_state->operands[this_walk_state->num_operands] = NULL;
/*
* Allocate and initialize the evaluation information block
* TBD: this is somewhat inefficient, should change interface to
* ds_init_aml_walk. For now, keeps this struct off the CPU stack
*/
info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
if (!info) {
status = AE_NO_MEMORY;
goto cleanup;
}
info->parameters = &this_walk_state->operands[0];
status = acpi_ds_init_aml_walk(next_walk_state, NULL, method_node,
obj_desc->method.aml_start,
obj_desc->method.aml_length, info,
ACPI_IMODE_EXECUTE);
ACPI_FREE(info);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
next_walk_state->method_nesting_depth =
this_walk_state->method_nesting_depth + 1;
/*
* Delete the operands on the previous walkstate operand stack
* (they were copied to new objects)
*/
for (i = 0; i < obj_desc->method.param_count; i++) {
acpi_ut_remove_reference(this_walk_state->operands[i]);
this_walk_state->operands[i] = NULL;
}
/* Clear the operand stack */
this_walk_state->num_operands = 0;
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Begin nested execution of [%4.4s] **** WalkState=%p\n",
method_node->name.ascii, next_walk_state));
this_walk_state->method_pathname =
acpi_ns_get_normalized_pathname(method_node, TRUE);
this_walk_state->method_is_nested = TRUE;
/* Optional object evaluation log */
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION,
"%-26s: %*s%s\n", " Nested method call",
next_walk_state->method_nesting_depth * 3, " ",
&this_walk_state->method_pathname[1]));
/* Invoke an internal method if necessary */
if (obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) {
status =
obj_desc->method.dispatch.implementation(next_walk_state);
if (status == AE_OK) {
status = AE_CTRL_TERMINATE;
}
}
return_ACPI_STATUS(status);
cleanup:
/* On error, we must terminate the method properly */
acpi_ds_terminate_control_method(obj_desc, next_walk_state);
acpi_ds_delete_walk_state(next_walk_state);
return_ACPI_STATUS(status);
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:101,代码来源:dsmethod.c
示例11: AcpiExDoDebugObject
//.........这里部分代码省略.........
AcpiOsPrintf ("Table Index 0x%X\n", SourceDesc->Reference.Value);
return_VOID;
default:
break;
}
AcpiOsPrintf (" ");
/* Check for valid node first, then valid object */
if (SourceDesc->Reference.Node)
{
if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) !=
ACPI_DESC_TYPE_NAMED)
{
AcpiOsPrintf (" %p - Not a valid namespace node\n",
SourceDesc->Reference.Node);
}
else
{
AcpiOsPrintf ("Node %p [%4.4s] ", SourceDesc->Reference.Node,
(SourceDesc->Reference.Node)->Name.Ascii);
switch ((SourceDesc->Reference.Node)->Type)
{
/* These types have no attached object */
case ACPI_TYPE_DEVICE:
AcpiOsPrintf ("Device\n");
break;
case ACPI_TYPE_THERMAL:
AcpiOsPrintf ("Thermal Zone\n");
break;
default:
AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object,
Level+4, 0);
break;
}
}
}
else if (SourceDesc->Reference.Object)
{
if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) ==
ACPI_DESC_TYPE_NAMED)
{
AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *)
SourceDesc->Reference.Object)->Object,
Level+4, 0);
}
else
{
ObjectDesc = SourceDesc->Reference.Object;
Value = SourceDesc->Reference.Value;
switch (ObjectDesc->Common.Type)
{
case ACPI_TYPE_BUFFER:
AcpiOsPrintf ("Buffer[%u] = 0x%2.2X\n",
Value, *SourceDesc->Reference.IndexPointer);
break;
case ACPI_TYPE_STRING:
AcpiOsPrintf ("String[%u] = \"%c\" (0x%2.2X)\n",
Value, *SourceDesc->Reference.IndexPointer,
*SourceDesc->Reference.IndexPointer);
break;
case ACPI_TYPE_PACKAGE:
AcpiOsPrintf ("Package[%u] = ", Value);
AcpiExDoDebugObject (*SourceDesc->Reference.Where,
Level+4, 0);
break;
default:
AcpiOsPrintf ("Unknown Reference object type %X\n",
ObjectDesc->Common.Type);
break;
}
}
}
break;
default:
AcpiOsPrintf ("%p\n", SourceDesc);
break;
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "\n"));
return_VOID;
}
开发者ID:imgits,项目名称:ChaiOS,代码行数:101,代码来源:exdebug.c
示例12: acpi_ds_initialize_objects
acpi_status
acpi_ds_initialize_objects(u32 table_index,
struct acpi_namespace_node *start_node)
{
acpi_status status;
struct acpi_init_walk_info info;
struct acpi_table_header *table;
acpi_owner_id owner_id;
ACPI_FUNCTION_TRACE(ds_initialize_objects);
status = acpi_tb_get_owner_id(table_index, &owner_id);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
/* Set all init info to zero */
memset(&info, 0, sizeof(struct acpi_init_walk_info));
info.owner_id = owner_id;
info.table_index = table_index;
/* Walk entire namespace from the supplied root */
/*
* We don't use acpi_walk_namespace since we do not want to acquire
* the namespace reader lock.
*/
status =
acpi_ns_walk_namespace(ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
ACPI_NS_WALK_NO_UNLOCK,
acpi_ds_init_one_object, NULL, &info, NULL);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace"));
}
status = acpi_get_table_by_index(table_index, &table);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* DSDT is always the first AML table */
if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT)) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"\nInitializing Namespace objects:\n"));
}
/* Summary of objects initialized */
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Table [%4.4s: %-8.8s] (id %.2X) - %4u Objects with %3u Devices, "
"%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
table->signature, table->oem_table_id, owner_id,
info.object_count, info.device_count,
info.op_region_count, info.method_count,
info.serial_method_count,
info.non_serial_method_count,
info.serialized_method_count));
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
info.method_count, info.op_region_count));
return_ACPI_STATUS(AE_OK);
}
开发者ID:forgivemyheart,项目名称:linux,代码行数:69,代码来源:dsinit.c
示例13: acpi_ns_init_one_device
acpi_status
acpi_ns_init_one_device (
acpi_handle obj_handle,
u32 nesting_level,
void *context,
void **return_value)
{
acpi_status status;
acpi_namespace_node *node;
u32 flags;
acpi_device_walk_info *info = (acpi_device_walk_info *) context;
FUNCTION_TRACE ("Ns_init_one_device");
if (!(acpi_dbg_level & ACPI_LV_INIT)) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
}
info->device_count++;
acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
node = acpi_ns_map_handle_to_node (obj_handle);
if (!node) {
acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return (AE_BAD_PARAMETER);
}
acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
/*
* Run _STA to determine if we can run _INI on the device.
*/
DEBUG_EXEC (acpi_ut_display_init_pathname (node, "_STA [Method]"));
status = acpi_ut_execute_STA (node, &flags);
if (ACPI_FAILURE (status)) {
/* Ignore error and move on to next device */
return_ACPI_STATUS (AE_OK);
}
info->num_STA++;
if (!(flags & 0x01)) {
/* don't look at children of a not present device */
return_ACPI_STATUS(AE_CTRL_DEPTH);
}
/*
* The device is present. Run _INI.
*/
DEBUG_EXEC (acpi_ut_display_init_pathname (obj_handle, "_INI [Method]"));
status = acpi_ns_evaluate_relative (obj_handle, "_INI", NULL, NULL);
if (AE_NOT_FOUND == status) {
/* No _INI means device requires no initialization */
status = AE_OK;
}
else if (ACPI_FAILURE (status)) {
/* Ignore error and move on to next device */
#ifdef ACPI_DEBUG
NATIVE_CHAR *scope_name = acpi_ns_get_table_pathname (obj_handle);
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n",
scope_name, acpi_format_exception (status)));
ACPI_MEM_FREE (scope_name);
#endif
}
else {
/* Count of successful INIs */
info->num_INI++;
}
return_ACPI_STATUS (AE_OK);
}
开发者ID:TitaniumBoy,项目名称:lin,代码行数:84,代码来源:nsinit.c
示例14: acpi_ex_do_debug_object
static void
acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
u32 level, u32 index)
{
u32 i;
ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc);
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s",
level, " "));
/* Display index for package output only */
if (index > 0) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
"(%.2u) ", index - 1));
}
if (!source_desc) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "<Null Object>\n"));
return_VOID;
}
if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s: ",
acpi_ut_get_object_type_name
(source_desc)));
if (!acpi_ut_valid_internal_object(source_desc)) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
"%p, Invalid Internal Object!\n",
source_desc));
return_VOID;
}
} else if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) ==
ACPI_DESC_TYPE_NAMED) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s: %p\n",
acpi_ut_get_type_name(((struct
acpi_namespace_node
*)source_desc)->
type),
source_desc));
return_VOID;
} else {
return_VOID;
}
switch (ACPI_GET_OBJECT_TYPE(source_desc)) {
case ACPI_TYPE_INTEGER:
/* Output correct integer width */
if (acpi_gbl_integer_byte_width == 4) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "0x%8.8X\n",
(u32) source_desc->integer.
value));
} else {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
"0x%8.8X%8.8X\n",
ACPI_FORMAT_UINT64(source_desc->
integer.
value)));
}
break;
case ACPI_TYPE_BUFFER:
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[0x%.2X]\n",
(u32) source_desc->buffer.length));
ACPI_DUMP_BUFFER(source_desc->buffer.pointer,
(source_desc->buffer.length <
32) ? source_desc->buffer.length : 32);
break;
case ACPI_TYPE_STRING:
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] \"%s\"\n",
source_desc->string.length,
source_desc->string.pointer));
break;
case ACPI_TYPE_PACKAGE:
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
"[0x%.2X Elements]\n",
source_desc->package.count));
/* Output the entire contents of the package */
for (i = 0; i < source_desc->package.count; i++) {
acpi_ex_do_debug_object(source_desc->package.
elements[i], level + 4, i + 1);
}
break;
case ACPI_TYPE_LOCAL_REFERENCE:
if (source_desc->reference.opcode == AML_INDEX_OP) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
"[%s, 0x%X]\n",
//.........这里部分代码省略.........
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:101,代码来源:exstore.c
示例15: AcpiTbLoadNamespace
//.........这里部分代码省略.........
*/
AcpiGbl_DSDT = Table->Pointer;
/*
* Optionally copy the entire DSDT to local memory (instead of simply
* mapping it.) There are some BIOSs that corrupt or replace the original
* DSDT, creating the need for this option. Default is FALSE, do not copy
* the DSDT.
*/
if (AcpiGbl_CopyDsdtLocally)
{
NewDsdt = AcpiTbCopyDsdt (AcpiGbl_DsdtIndex);
if (NewDsdt)
{
AcpiGbl_DSDT = NewDsdt;
}
}
/*
* Save the original DSDT header for detection of table corruption
* and/or replacement of the DSDT from outside the OS.
*/
memcpy (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT,
sizeof (ACPI_TABLE_HEADER));
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
/* Load and parse tables */
Status = AcpiNsLoadTable (AcpiGbl_DsdtIndex, AcpiGbl_RootNode);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "[DSDT] table load failed"));
TablesFailed++;
}
else
{
TablesLoaded++;
}
/* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
{
Table = &AcpiGbl_RootTableList.Tables[i];
if (!AcpiGbl_RootTableList.Tables[i].Address ||
(!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_SSDT) &&
!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_PSDT) &&
!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_OSDT)) ||
ACPI_FAILURE (AcpiTbValidateTable (Table)))
{
continue;
}
/* Ignore errors while loading tables, get as many as possible */
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
Status = AcpiNsLoadTable (i, AcpiGbl_RootNode);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "(%4.4s:%8.8s) while loading table",
Table->Signature.Ascii, Table->Pointer->OemTableId));
TablesFailed++;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
"Table [%4.4s:%8.8s] (id FF) - Table namespace load failed\n\n",
Table->Signature.Ascii, Table->Pointer->OemTableId));
}
else
{
TablesLoaded++;
}
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
}
if (!TablesFailed)
{
ACPI_INFO ((
"%u ACPI AML tables successfully acquired and loaded\n",
TablesLoaded));
}
else
{
ACPI_ERROR ((AE_INFO,
"%u table load failures, %u successful",
TablesFailed, TablesLoaded));
/* Indicate at least one failure */
Status = AE_CTRL_TERMINATE;
}
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
return_ACPI_STATUS (Status);
}
开发者ID:alex1818,项目名称:fwts,代码行数:101,代码来源:tbxfload.c
示例16: AcpiDsInitOneObject
ACPI_STATUS
AcpiDsInitOneObject (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue)
{
ACPI_OBJECT_TYPE Type;
ACPI_STATUS Status;
ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
ACPI_FUNCTION_NAME ("DsInitOneObject");
/*
* We are only interested in objects owned by the table that
* was just loaded
*/
if (((ACPI_NAMESPACE_NODE *) ObjHandle)->OwnerId !=
Info->TableDesc->TableId)
{
return (AE_OK);
}
Info->ObjectCount++;
/* And even then, we are only interested in a few object types */
Type = AcpiNsGetType (ObjHandle);
switch (Type)
{
case ACPI_TYPE_REGION:
Status = AcpiDsInitializeRegion (ObjHandle);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %p [%4.4s] - Init failure, %s\n",
ObjHandle, ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii,
AcpiFormatException (Status)));
}
Info->OpRegionCount++;
break;
case ACPI_TYPE_METHOD:
Info->MethodCount++;
/* Print a dot for each method unless we are going to print the entire pathname */
if (!(AcpiDbgLevel & ACPI_LV_INIT_NAMES))
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
}
/*
* Set the execution data width (32 or 64) based upon the
* revision number of the parent ACPI table.
* TBD: This is really for possible future support of integer width
* on a per-table basis. Currently, we just use a global for the width.
*/
if (Info->TableDesc->Pointer->Revision == 1)
{
((ACPI_NAMESPACE_NODE *) ObjHandle)->Flags |= ANOBJ_DATA_WIDTH_32;
}
/*
* Always parse methods to detect errors, we may delete
* the parse tree below
*/
Status = AcpiDsParseMethod (ObjHandle);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n",
ObjHandle, ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii,
AcpiFormatException (Status)));
/* This parse failed, but we will continue parsing more methods */
break;
}
/*
* Delete the parse tree. We simple re-parse the method
* for every execution since there isn't much overhead
*/
AcpiNsDeleteNamespaceSubtree (ObjHandle);
AcpiNsDeleteNamespaceByOwner (((ACPI_NAMESPACE_NODE *) ObjHandle)->Object->Method.OwningId);
break;
case ACPI_TYPE_DEVICE:
Info->DeviceCount++;
break;
//.........这里部分代码省略.........
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:101,代码来源:dsinit.c
示例17: AcpiNsInitializeDevi |
请发表评论