本网站可以出售:只需60000元直接拥有。QQ:939804642
您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ACPI_FORMAT_UINT64函数代码示例

51自学网 2021-06-01 19:32:36
  C++
这篇教程C++ ACPI_FORMAT_UINT64函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ACPI_FORMAT_UINT64函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_FORMAT_UINT64函数的具体用法?C++ ACPI_FORMAT_UINT64怎么用?C++ ACPI_FORMAT_UINT64使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ACPI_FORMAT_UINT64函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: acpi_ex_convert_to_integer

//.........这里部分代码省略.........	switch (obj_desc->common.type) {	case ACPI_TYPE_INTEGER:		/* No conversion necessary */		*result_desc = obj_desc;		return_ACPI_STATUS(AE_OK);	case ACPI_TYPE_BUFFER:	case ACPI_TYPE_STRING:		/* Note: Takes advantage of common buffer/string fields */		pointer = obj_desc->buffer.pointer;		count = obj_desc->buffer.length;		break;	default:		return_ACPI_STATUS(AE_TYPE);	}	/*	 * Convert the buffer/string to an integer. Note that both buffers and	 * strings are treated as raw data - we don't convert ascii to hex for	 * strings.	 *	 * There are two terminating conditions for the loop:	 * 1) The size of an integer has been reached, or	 * 2) The end of the buffer or string has been reached	 */	result = 0;	/* String conversion is different than Buffer conversion */	switch (obj_desc->common.type) {	case ACPI_TYPE_STRING:		/*		 * Convert string to an integer - for most cases, the string must be		 * hexadecimal as per the ACPI specification. The only exception (as		 * of ACPI 3.0) is that the to_integer() operator allows both decimal		 * and hexadecimal strings (hex prefixed with "0x").		 */		status = acpi_ut_strtoul64((char *)pointer, flags, &result);		if (ACPI_FAILURE(status)) {			return_ACPI_STATUS(status);		}		break;	case ACPI_TYPE_BUFFER:		/* Check for zero-length buffer */		if (!count) {			return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);		}		/* Transfer no more than an integer's worth of data */		if (count > acpi_gbl_integer_byte_width) {			count = acpi_gbl_integer_byte_width;		}		/*		 * Convert buffer to an integer - we simply grab enough raw data		 * from the buffer to fill an integer		 */		for (i = 0; i < count; i++) {			/*			 * Get next byte and shift it into the Result.			 * Little endian is used, meaning that the first byte of the buffer			 * is the LSB of the integer			 */			result |= (((u64) pointer[i]) << (i * 8));		}		break;	default:		/* No other types can get here */		break;	}	/* Create a new integer */	return_desc = acpi_ut_create_integer_object(result);	if (!return_desc) {		return_ACPI_STATUS(AE_NO_MEMORY);	}	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X/n",			  ACPI_FORMAT_UINT64(result)));	/* Save the Result */	acpi_ex_truncate_for32bit_table(return_desc);	*result_desc = return_desc;	return_ACPI_STATUS(AE_OK);}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:101,


示例2: AcpiExConvertToInteger

//.........这里部分代码省略.........    case ACPI_TYPE_BUFFER:    case ACPI_TYPE_STRING:        /* Note: Takes advantage of common buffer/string fields */        Pointer = ObjDesc->Buffer.Pointer;        Count   = ObjDesc->Buffer.Length;        break;    default:        return_ACPI_STATUS (AE_TYPE);    }    /*     * Convert the buffer/string to an integer. Note that both buffers and     * strings are treated as raw data - we don't convert ascii to hex for     * strings.     *     * There are two terminating conditions for the loop:     * 1) The size of an integer has been reached, or     * 2) The end of the buffer or string has been reached     */    Result = 0;    /* String conversion is different than Buffer conversion */    switch (ObjDesc->Common.Type)    {    case ACPI_TYPE_STRING:        /*         * Convert string to an integer - for most cases, the string must be         * hexadecimal as per the ACPI specification. The only exception (as         * of ACPI 3.0) is that the ToInteger() operator allows both decimal         * and hexadecimal strings (hex prefixed with "0x").         */        Status = AcpiUtStrtoul64 ((char *) Pointer, Flags, &Result);        if (ACPI_FAILURE (Status))        {            return_ACPI_STATUS (Status);        }        break;    case ACPI_TYPE_BUFFER:        /* Check for zero-length buffer */        if (!Count)        {            return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);        }        /* Transfer no more than an integer's worth of data */        if (Count > AcpiGbl_IntegerByteWidth)        {            Count = AcpiGbl_IntegerByteWidth;        }        /*         * Convert buffer to an integer - we simply grab enough raw data         * from the buffer to fill an integer         */        for (i = 0; i < Count; i++)        {            /*             * Get next byte and shift it into the Result.             * Little endian is used, meaning that the first byte of the buffer             * is the LSB of the integer             */            Result |= (((UINT64) Pointer[i]) << (i * 8));        }        break;    default:        /* No other types can get here */        break;    }    /* Create a new integer */    ReturnDesc = AcpiUtCreateIntegerObject (Result);    if (!ReturnDesc)    {        return_ACPI_STATUS (AE_NO_MEMORY);    }    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X/n",        ACPI_FORMAT_UINT64 (Result)));    /* Save the Result */    (void) AcpiExTruncateFor32bitTable (ReturnDesc);    *ResultDesc = ReturnDesc;    return_ACPI_STATUS (AE_OK);}
开发者ID:cloudius-systems,项目名称:acpica,代码行数:101,


示例3: AcpiDsInitObjectFromOp

//.........这里部分代码省略.........                /* Truncate value if we are executing from a 32-bit ACPI table */#ifndef ACPI_NO_METHOD_EXECUTION                (void) AcpiExTruncateFor32bitTable (ObjDesc);#endif                break;            case AML_REVISION_OP:                ObjDesc->Integer.Value = ACPI_CA_VERSION;                break;            default:                ACPI_ERROR ((AE_INFO,                    "Unknown constant opcode 0x%X", Opcode));                Status = AE_AML_OPERAND_TYPE;                break;            }            break;        case AML_TYPE_LITERAL:            ObjDesc->Integer.Value = Op->Common.Value.Integer;#ifndef ACPI_NO_METHOD_EXECUTION            if (AcpiExTruncateFor32bitTable (ObjDesc))            {                /* Warn if we found a 64-bit constant in a 32-bit table */                ACPI_WARNING ((AE_INFO,                    "Truncated 64-bit constant found in 32-bit table: %8.8X%8.8X => %8.8X",                    ACPI_FORMAT_UINT64 (Op->Common.Value.Integer),                    (UINT32) ObjDesc->Integer.Value));            }#endif            break;        default:            ACPI_ERROR ((AE_INFO, "Unknown Integer type 0x%X",                OpInfo->Type));            Status = AE_AML_OPERAND_TYPE;            break;        }        break;    case ACPI_TYPE_STRING:        ObjDesc->String.Pointer = Op->Common.Value.String;        ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Op->Common.Value.String);        /*         * The string is contained in the ACPI table, don't ever try         * to delete it         */        ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER;        break;    case ACPI_TYPE_METHOD:        break;    case ACPI_TYPE_LOCAL_REFERENCE:        switch (OpInfo->Type)
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:67,


示例4: AcpiExOpcode_6A_0T_1R

ACPI_STATUSAcpiExOpcode_6A_0T_1R (    ACPI_WALK_STATE         *WalkState){    ACPI_OPERAND_OBJECT     **Operand = &WalkState->Operands[0];    ACPI_OPERAND_OBJECT     *ReturnDesc = NULL;    ACPI_STATUS             Status = AE_OK;    UINT64                  Index;    ACPI_OPERAND_OBJECT     *ThisElement;    ACPI_FUNCTION_TRACE_STR (ExOpcode_6A_0T_1R,        AcpiPsGetOpcodeName (WalkState->Opcode));    switch (WalkState->Opcode)    {    case AML_MATCH_OP:        /*         * Match (SearchPkg[0], MatchOp1[1], MatchObj1[2],         *                      MatchOp2[3], MatchObj2[4], StartIndex[5])         */        /* Validate both Match Term Operators (MTR, MEQ, etc.) */        if ((Operand[1]->Integer.Value > MAX_MATCH_OPERATOR) ||            (Operand[3]->Integer.Value > MAX_MATCH_OPERATOR))        {            ACPI_ERROR ((AE_INFO, "Match operator out of range"));            Status = AE_AML_OPERAND_VALUE;            goto Cleanup;        }        /* Get the package StartIndex, validate against the package length */        Index = Operand[5]->Integer.Value;        if (Index >= Operand[0]->Package.Count)        {            ACPI_ERROR ((AE_INFO,                "Index (0x%8.8X%8.8X) beyond package end (0x%X)",                ACPI_FORMAT_UINT64 (Index), Operand[0]->Package.Count));            Status = AE_AML_PACKAGE_LIMIT;            goto Cleanup;        }        /* Create an integer for the return value */        /* Default return value is ACPI_UINT64_MAX if no match found */        ReturnDesc = AcpiUtCreateIntegerObject (ACPI_UINT64_MAX);        if (!ReturnDesc)        {            Status = AE_NO_MEMORY;            goto Cleanup;        }        /*         * Examine each element until a match is found. Both match conditions         * must be satisfied for a match to occur. Within the loop,         * "continue" signifies that the current element does not match         * and the next should be examined.         *         * Upon finding a match, the loop will terminate via "break" at         * the bottom. If it terminates "normally", MatchValue will be         * ACPI_UINT64_MAX (Ones) (its initial value) indicating that no         * match was found.         */        for ( ; Index < Operand[0]->Package.Count; Index++)        {            /* Get the current package element */            ThisElement = Operand[0]->Package.Elements[Index];            /* Treat any uninitialized (NULL) elements as non-matching */            if (!ThisElement)            {                continue;            }            /*             * Both match conditions must be satisfied. Execution of a continue             * (proceed to next iteration of enclosing for loop) signifies a             * non-match.             */            if (!AcpiExDoMatch ((UINT32) Operand[1]->Integer.Value,                    ThisElement, Operand[2]))            {                continue;            }            if (!AcpiExDoMatch ((UINT32) Operand[3]->Integer.Value,                    ThisElement, Operand[4]))            {                continue;            }            /* Match found: Index is the return value */            ReturnDesc->Integer.Value = Index;//.........这里部分代码省略.........
开发者ID:ChaiSoft,项目名称:ChaiOS,代码行数:101,


示例5: AcpiExSystemMemorySpaceHandler

//.........这里部分代码省略.........        MapLength = (ACPI_SIZE)            ((MemInfo->Address + MemInfo->Length) - Address);        /*         * If mapping the entire remaining portion of the region will cross         * a page boundary, just map up to the page boundary, do not cross.         * On some systems, crossing a page boundary while mapping regions         * can cause warnings if the pages have different attributes         * due to resource management.         *         * This has the added benefit of constraining a single mapping to         * one page, which is similar to the original code that used a 4k         * maximum window.         */        PageBoundaryMapLength = (ACPI_SIZE)            (ACPI_ROUND_UP (Address, ACPI_DEFAULT_PAGE_SIZE) - Address);        if (PageBoundaryMapLength == 0)        {            PageBoundaryMapLength = ACPI_DEFAULT_PAGE_SIZE;        }        if (MapLength > PageBoundaryMapLength)        {            MapLength = PageBoundaryMapLength;        }        /* Create a new mapping starting at the address given */        MemInfo->MappedLogicalAddress = AcpiOsMapMemory (Address, MapLength);        if (!MemInfo->MappedLogicalAddress)        {            ACPI_ERROR ((AE_INFO,                "Could not map memory at 0x%8.8X%8.8X, size %u",                ACPI_FORMAT_UINT64 (Address), (UINT32) MapLength));            MemInfo->MappedLength = 0;            return_ACPI_STATUS (AE_NO_MEMORY);        }        /* Save the physical address and mapping size */        MemInfo->MappedPhysicalAddress = Address;        MemInfo->MappedLength = MapLength;    }    /*     * Generate a logical pointer corresponding to the address we want to     * access     */    LogicalAddrPtr = MemInfo->MappedLogicalAddress +        ((UINT64) Address - (UINT64) MemInfo->MappedPhysicalAddress);    ACPI_DEBUG_PRINT ((ACPI_DB_INFO,        "System-Memory (width %u) R/W %u Address=%8.8X%8.8X/n",        BitWidth, Function, ACPI_FORMAT_UINT64 (Address)));    /*     * Perform the memory read or write     *     * Note: For machines that do not support non-aligned transfers, the target     * address was checked for alignment above. We do not attempt to break the     * transfer up into smaller (byte-size) chunks because the AML specifically     * asked for a transfer width that the hardware may require.     */    switch (Function)    {    case ACPI_READ:
开发者ID:CSRedRat,项目名称:reactos,代码行数:67,


示例6: acpi_tb_validate_fadt

static void acpi_tb_validate_fadt(void){	char *name;	struct acpi_generic_address *address64;	u8 length;	u32 i;	/*	 * Check for FACS and DSDT address mismatches. An address mismatch between	 * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and	 * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables.	 */	if (acpi_gbl_FADT.facs &&	    (acpi_gbl_FADT.Xfacs != (u64)acpi_gbl_FADT.facs)) {		ACPI_BIOS_WARNING((AE_INFO,				   "32/64X FACS address mismatch in FADT - "				   "0x%8.8X/0x%8.8X%8.8X, using 32",				   acpi_gbl_FADT.facs,				   ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs)));		acpi_gbl_FADT.Xfacs = (u64)acpi_gbl_FADT.facs;	}	if (acpi_gbl_FADT.dsdt &&	    (acpi_gbl_FADT.Xdsdt != (u64)acpi_gbl_FADT.dsdt)) {		ACPI_BIOS_WARNING((AE_INFO,				   "32/64X DSDT address mismatch in FADT - "				   "0x%8.8X/0x%8.8X%8.8X, using 32",				   acpi_gbl_FADT.dsdt,				   ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt)));		acpi_gbl_FADT.Xdsdt = (u64)acpi_gbl_FADT.dsdt;	}	/* If Hardware Reduced flag is set, we are all done */	if (acpi_gbl_reduced_hardware) {		return;	}	/* Examine all of the 64-bit extended address fields (X fields) */	for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {		/*		 * Generate pointer to the 64-bit address, get the register		 * length (width) and the register name		 */		address64 = ACPI_ADD_PTR(struct acpi_generic_address,					 &acpi_gbl_FADT,					 fadt_info_table[i].address64);		length =		    *ACPI_ADD_PTR(u8, &acpi_gbl_FADT,				  fadt_info_table[i].length);		name = fadt_info_table[i].name;		/*		 * For each extended field, check for length mismatch between the		 * legacy length field and the corresponding 64-bit X length field.		 */		if (address64->address &&		    (address64->bit_width != ACPI_MUL_8(length))) {			ACPI_BIOS_WARNING((AE_INFO,					   "32/64X length mismatch in FADT/%s: %u/%u",					   name, ACPI_MUL_8(length),					   address64->bit_width));		}		if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) {			/*			 * Field is required (Pm1a_event, Pm1a_control, pm_timer).			 * Both the address and length must be non-zero.			 */			if (!address64->address || !length) {				ACPI_BIOS_ERROR((AE_INFO,						 "Required FADT field %s has zero address and/or length: "						 "0x%8.8X%8.8X/0x%X",						 name,						 ACPI_FORMAT_UINT64(address64->								    address),						 length));			}		} else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) {			/*			 * Field is optional (Pm2_control, GPE0, GPE1) AND has its own			 * length field. If present, both the address and length must			 * be valid.			 */			if ((address64->address && !length) ||			    (!address64->address && length)) {				ACPI_BIOS_WARNING((AE_INFO,						   "Optional FADT field %s has zero address or length: "						   "0x%8.8X%8.8X/0x%X",						   name,						   ACPI_FORMAT_UINT64						   (address64->address),						   length));			}		}	}}
开发者ID:AiWinters,项目名称:linux,代码行数:100,


示例7: AcpiDsEvalTableRegionOperands

ACPI_STATUSAcpiDsEvalTableRegionOperands (    ACPI_WALK_STATE         *WalkState,    ACPI_PARSE_OBJECT       *Op){    ACPI_STATUS             Status;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     **Operand;    ACPI_NAMESPACE_NODE     *Node;    ACPI_PARSE_OBJECT       *NextOp;    ACPI_TABLE_HEADER       *Table;    UINT32                  TableIndex;    ACPI_FUNCTION_TRACE_PTR (DsEvalTableRegionOperands, Op);    /*     * This is where we evaluate the Signature string, OemId string,     * and OemTableId string of the Data Table Region declaration     */    Node =  Op->Common.Node;    /* NextOp points to Signature string op */    NextOp = Op->Common.Value.Arg;    /*     * Evaluate/create the Signature string, OemId string,     * and OemTableId string operands     */    Status = AcpiDsCreateOperands (WalkState, NextOp);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    Operand = &WalkState->Operands[0];    /*     * Resolve the Signature string, OemId string,     * and OemTableId string operands     */    Status = AcpiExResolveOperands (        Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);    if (ACPI_FAILURE (Status))    {        goto Cleanup;    }    /* Find the ACPI table */    Status = AcpiTbFindTable (        Operand[0]->String.Pointer,        Operand[1]->String.Pointer,        Operand[2]->String.Pointer, &TableIndex);    if (ACPI_FAILURE (Status))    {        if (Status == AE_NOT_FOUND)        {            ACPI_ERROR ((AE_INFO,                "ACPI Table [%4.4s] OEM:(%s, %s) not found in RSDT/XSDT",                Operand[0]->String.Pointer,                Operand[1]->String.Pointer,                Operand[2]->String.Pointer));        }        goto Cleanup;    }    Status = AcpiGetTableByIndex (TableIndex, &Table);    if (ACPI_FAILURE (Status))    {        goto Cleanup;    }    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        Status = AE_NOT_EXIST;        goto Cleanup;    }    ObjDesc->Region.Address = ACPI_PTR_TO_PHYSADDR (Table);    ObjDesc->Region.Length = Table->Length;    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X/n",        ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),        ObjDesc->Region.Length));    /* Now the address and length are valid for this opregion */    ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;Cleanup:    AcpiUtRemoveReference (Operand[0]);    AcpiUtRemoveReference (Operand[1]);    AcpiUtRemoveReference (Operand[2]);    return_ACPI_STATUS (Status);}
开发者ID:Lekensteyn,项目名称:acpica,代码行数:100,


示例8: DtDoOperator

//.........这里部分代码省略.........    case EXPOP_DIVIDE:        if (!RightValue)        {            DtError (ASL_ERROR, ASL_MSG_DIVIDE_BY_ZERO,                Gbl_CurrentField, Gbl_CurrentField->Value);            return (0);        }        Result = LeftValue / RightValue;        break;    case EXPOP_MODULO:        if (!RightValue)        {            DtError (ASL_ERROR, ASL_MSG_DIVIDE_BY_ZERO,                Gbl_CurrentField, Gbl_CurrentField->Value);            return (0);        }        Result = LeftValue % RightValue;        break;    case EXPOP_ADD:        Result = LeftValue + RightValue;        break;    case EXPOP_SUBTRACT:        Result = LeftValue - RightValue;        break;    case EXPOP_SHIFT_RIGHT:        Result = LeftValue >> RightValue;        break;    case EXPOP_SHIFT_LEFT:        Result = LeftValue << RightValue;        break;    case EXPOP_LESS:        Result = LeftValue < RightValue;        break;    case EXPOP_GREATER:        Result = LeftValue > RightValue;        break;    case EXPOP_LESS_EQUAL:        Result = LeftValue <= RightValue;        break;    case EXPOP_GREATER_EQUAL:        Result = LeftValue >= RightValue;        break;    case EXPOP_EQUAL:        Result = LeftValue = RightValue;        break;    case EXPOP_NOT_EQUAL:        Result = LeftValue != RightValue;        break;    case EXPOP_AND:        Result = LeftValue & RightValue;        break;    case EXPOP_XOR:        Result = LeftValue ^ RightValue;        break;    case EXPOP_OR:        Result = LeftValue | RightValue;        break;    case EXPOP_LOGICAL_AND:        Result = LeftValue && RightValue;        break;    case EXPOP_LOGICAL_OR:        Result = LeftValue || RightValue;        break;   default:        /* Unknown operator */        DtFatal (ASL_MSG_INVALID_EXPRESSION,            Gbl_CurrentField, Gbl_CurrentField->Value);        return (0);    }    DbgPrint (ASL_DEBUG_OUTPUT,        "IntegerEval: %s (%8.8X%8.8X %s %8.8X%8.8X) = %8.8X%8.8X/n",        Gbl_CurrentField->Value,        ACPI_FORMAT_UINT64 (LeftValue),        DtGetOpName (Operator),        ACPI_FORMAT_UINT64 (RightValue),        ACPI_FORMAT_UINT64 (Result));    return (Result);}
开发者ID:dmarion,项目名称:freebsd-armv6-sys,代码行数:101,


示例9: AcpiDbDisplayObjectType

voidAcpiDbDisplayObjectType (    char                    *Name){    ACPI_NAMESPACE_NODE     *Node;    ACPI_DEVICE_INFO        *Info;    ACPI_STATUS             Status;    UINT32                  i;    Node = AcpiDbConvertToNode (Name);    if (!Node)    {        return;    }    Status = AcpiGetObjectInfo (ACPI_CAST_PTR (ACPI_HANDLE, Node), &Info);    if (ACPI_FAILURE (Status))    {        AcpiOsPrintf ("Could not get object info, %s/n",            AcpiFormatException (Status));        return;    }    if (Info->Valid & ACPI_VALID_ADR)    {        AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X/n",            ACPI_FORMAT_UINT64 (Info->Address),            Info->CurrentStatus, Info->Flags);    }    if (Info->Valid & ACPI_VALID_SXDS)    {        AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X/n",            Info->HighestDstates[0], Info->HighestDstates[1],            Info->HighestDstates[2], Info->HighestDstates[3]);    }    if (Info->Valid & ACPI_VALID_SXWS)    {        AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X/n",            Info->LowestDstates[0], Info->LowestDstates[1],            Info->LowestDstates[2], Info->LowestDstates[3],            Info->LowestDstates[4]);    }    if (Info->Valid & ACPI_VALID_HID)    {        AcpiOsPrintf ("HID: %s/n", Info->HardwareId.String);    }    if (Info->Valid & ACPI_VALID_UID)    {        AcpiOsPrintf ("UID: %s/n", Info->UniqueId.String);    }    if (Info->Valid & ACPI_VALID_SUB)    {        AcpiOsPrintf ("SUB: %s/n", Info->SubsystemId.String);    }    if (Info->Valid & ACPI_VALID_CID)    {        for (i = 0; i < Info->CompatibleIdList.Count; i++)        {            AcpiOsPrintf ("CID %u: %s/n", i,                Info->CompatibleIdList.Ids[i].String);        }    }    ACPI_FREE (Info);}
开发者ID:wan721,项目名称:DragonFlyBSD,代码行数:67,


示例10: acpi_ds_eval_region_operands

acpi_statusacpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,			     union acpi_parse_object *op){	acpi_status status;	union acpi_operand_object *obj_desc;	union acpi_operand_object *operand_desc;	struct acpi_namespace_node *node;	union acpi_parse_object *next_op;	ACPI_FUNCTION_TRACE_PTR(ds_eval_region_operands, op);	/*	 * This is where we evaluate the address and length fields of the	 * op_region declaration	 */	node = op->common.node;	/* next_op points to the op that holds the space_ID */	next_op = op->common.value.arg;	/* next_op points to address op */	next_op = next_op->common.next;	/* Evaluate/create the address and length operands */	status = acpi_ds_create_operands(walk_state, next_op);	if (ACPI_FAILURE(status)) {		return_ACPI_STATUS(status);	}	/* Resolve the length and address operands to numbers */	status = acpi_ex_resolve_operands(op->common.aml_opcode,					  ACPI_WALK_OPERANDS, walk_state);	if (ACPI_FAILURE(status)) {		return_ACPI_STATUS(status);	}	obj_desc = acpi_ns_get_attached_object(node);	if (!obj_desc) {		return_ACPI_STATUS(AE_NOT_EXIST);	}	/*	 * Get the length operand and save it	 * (at Top of stack)	 */	operand_desc = walk_state->operands[walk_state->num_operands - 1];	obj_desc->region.length = (u32) operand_desc->integer.value;	acpi_ut_remove_reference(operand_desc);	/*	 * Get the address and save it	 * (at top of stack - 1)	 */	operand_desc = walk_state->operands[walk_state->num_operands - 2];	obj_desc->region.address = (acpi_physical_address)	    operand_desc->integer.value;	acpi_ut_remove_reference(operand_desc);	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X/n",			  obj_desc,			  ACPI_FORMAT_UINT64(obj_desc->region.address),			  obj_desc->region.length));	/* Now the address and length are valid for this opregion */	obj_desc->region.flags |= AOPOBJ_DATA_VALID;	return_ACPI_STATUS(status);}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:76,


示例11: acpi_ds_eval_table_region_operands

acpi_statusacpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,				   union acpi_parse_object *op){	acpi_status status;	union acpi_operand_object *obj_desc;	union acpi_operand_object **operand;	struct acpi_namespace_node *node;	union acpi_parse_object *next_op;	u32 table_index;	struct acpi_table_header *table;	ACPI_FUNCTION_TRACE_PTR(ds_eval_table_region_operands, op);	/*	 * This is where we evaluate the Signature string, oem_id string,	 * and oem_table_id string of the Data Table Region declaration	 */	node = op->common.node;	/* next_op points to Signature string op */	next_op = op->common.value.arg;	/*	 * Evaluate/create the Signature string, oem_id string,	 * and oem_table_id string operands	 */	status = acpi_ds_create_operands(walk_state, next_op);	if (ACPI_FAILURE(status)) {		return_ACPI_STATUS(status);	}	/*	 * Resolve the Signature string, oem_id string,	 * and oem_table_id string operands	 */	status = acpi_ex_resolve_operands(op->common.aml_opcode,					  ACPI_WALK_OPERANDS, walk_state);	if (ACPI_FAILURE(status)) {		return_ACPI_STATUS(status);	}	operand = &walk_state->operands[0];	/* Find the ACPI table */	status = acpi_tb_find_table(operand[0]->string.pointer,				    operand[1]->string.pointer,				    operand[2]->string.pointer, &table_index);	if (ACPI_FAILURE(status)) {		return_ACPI_STATUS(status);	}	acpi_ut_remove_reference(operand[0]);	acpi_ut_remove_reference(operand[1]);	acpi_ut_remove_reference(operand[2]);	status = acpi_get_table_by_index(table_index, &table);	if (ACPI_FAILURE(status)) {		return_ACPI_STATUS(status);	}	obj_desc = acpi_ns_get_attached_object(node);	if (!obj_desc) {		return_ACPI_STATUS(AE_NOT_EXIST);	}	obj_desc->region.address = ACPI_PTR_TO_PHYSADDR(table);	obj_desc->region.length = table->length;	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X/n",			  obj_desc,			  ACPI_FORMAT_UINT64(obj_desc->region.address),			  obj_desc->region.length));	/* Now the address and length are valid for this opregion */	obj_desc->region.flags |= AOPOBJ_DATA_VALID;	return_ACPI_STATUS(status);}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:82,


示例12: acpi_ex_write_with_update_rule

acpi_statusacpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,			       u64 mask,			       u64 field_value, u32 field_datum_byte_offset){	acpi_status status = AE_OK;	u64 merged_value;	u64 current_value;	ACPI_FUNCTION_TRACE_U32(ex_write_with_update_rule, mask);	/* Start with the new bits  */	merged_value = field_value;	/* If the mask is all ones, we don't need to worry about the update rule */	if (mask != ACPI_UINT64_MAX) {		/* Decode the update rule */		switch (obj_desc->common_field.			field_flags & AML_FIELD_UPDATE_RULE_MASK) {		case AML_FIELD_UPDATE_PRESERVE:			/*			 * Check if update rule needs to be applied (not if mask is all			 * ones)  The left shift drops the bits we want to ignore.			 */			if ((~mask << (ACPI_MUL_8(sizeof(mask)) -				       ACPI_MUL_8(obj_desc->common_field.						  access_byte_width))) != 0) {				/*				 * Read the current contents of the byte/word/dword containing				 * the field, and merge with the new field value.				 */				status =				    acpi_ex_field_datum_io(obj_desc,							   field_datum_byte_offset,							   &current_value,							   ACPI_READ);				if (ACPI_FAILURE(status)) {					return_ACPI_STATUS(status);				}				merged_value |= (current_value & ~mask);			}			break;		case AML_FIELD_UPDATE_WRITE_AS_ONES:			/* Set positions outside the field to all ones */			merged_value |= ~mask;			break;		case AML_FIELD_UPDATE_WRITE_AS_ZEROS:			/* Set positions outside the field to all zeros */			merged_value &= mask;			break;		default:			ACPI_ERROR((AE_INFO,				    "Unknown UpdateRule value: 0x%X",				    (obj_desc->common_field.				     field_flags &				     AML_FIELD_UPDATE_RULE_MASK)));			return_ACPI_STATUS(AE_AML_OPERAND_VALUE);		}	}	ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,			  "Mask %8.8X%8.8X, DatumOffset %X, Width %X, Value %8.8X%8.8X, MergedValue %8.8X%8.8X/n",			  ACPI_FORMAT_UINT64(mask),			  field_datum_byte_offset,			  obj_desc->common_field.access_byte_width,			  ACPI_FORMAT_UINT64(field_value),			  ACPI_FORMAT_UINT64(merged_value)));	/* Write the merged value */	status = acpi_ex_field_datum_io(obj_desc, field_datum_byte_offset,					&merged_value, ACPI_WRITE);	return_ACPI_STATUS(status);}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:88,


示例13: acpi_ex_field_datum_io

//.........这里部分代码省略.........						     value));		if (ACPI_FAILURE(status)) {			return_ACPI_STATUS(status);		}		/*		 * Now that the Bank has been selected, fall through to the		 * region_field case and write the datum to the Operation Region		 */		/*lint -fallthrough */	case ACPI_TYPE_LOCAL_REGION_FIELD:		/*		 * For simple region_fields, we just directly access the owning		 * Operation Region.		 */		status =		    acpi_ex_access_region(obj_desc, field_datum_byte_offset,					  value, read_write);		break;	case ACPI_TYPE_LOCAL_INDEX_FIELD:		/*		 * Ensure that the index_value is not beyond the capacity of		 * the register		 */		if (acpi_ex_register_overflow(obj_desc->index_field.index_obj,					      (u64) obj_desc->index_field.					      value)) {			return_ACPI_STATUS(AE_AML_REGISTER_LIMIT);		}		/* Write the index value to the index_register (itself a region_field) */		field_datum_byte_offset += obj_desc->index_field.value;		ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,				  "Write to Index Register: Value %8.8X/n",				  field_datum_byte_offset));		status =		    acpi_ex_insert_into_field(obj_desc->index_field.index_obj,					      &field_datum_byte_offset,					      sizeof(field_datum_byte_offset));		if (ACPI_FAILURE(status)) {			return_ACPI_STATUS(status);		}		if (read_write == ACPI_READ) {			/* Read the datum from the data_register */			ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,					  "Read from Data Register/n"));			status =			    acpi_ex_extract_from_field(obj_desc->index_field.						       data_obj, value,						       sizeof(u64));		} else {			/* Write the datum to the data_register */			ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,					  "Write to Data Register: Value %8.8X%8.8X/n",					  ACPI_FORMAT_UINT64(*value)));			status =			    acpi_ex_insert_into_field(obj_desc->index_field.						      data_obj, value,						      sizeof(u64));		}		break;	default:		ACPI_ERROR((AE_INFO, "Wrong object type in field I/O %u",			    obj_desc->common.type));		status = AE_AML_INTERNAL;		break;	}	if (ACPI_SUCCESS(status)) {		if (read_write == ACPI_READ) {			ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,					  "Value Read %8.8X%8.8X, Width %u/n",					  ACPI_FORMAT_UINT64(*value),					  obj_desc->common_field.					  access_byte_width));		} else {			ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,					  "Value Written %8.8X%8.8X, Width %u/n",					  ACPI_FORMAT_UINT64(*value),					  obj_desc->common_field.					  access_byte_width));		}	}	return_ACPI_STATUS(status);}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:101,


示例14: acpi_ex_access_region

acpi_statusacpi_ex_access_region(union acpi_operand_object *obj_desc,		      u32 field_datum_byte_offset, u64 *value, u32 function){	acpi_status status;	union acpi_operand_object *rgn_desc;	u32 region_offset;	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;	region_offset =	    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, ByteBase %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_FORMAT_UINT64(rgn_desc->region.address +						 region_offset)));	/* Invoke the appropriate address_space/op_region handler */	status = acpi_ev_address_space_dispatch(rgn_desc, obj_desc,						function, region_offset,						ACPI_MUL_8(obj_desc->							   common_field.							   access_byte_width),						value);	if (ACPI_FAILURE(status)) {		if (status == AE_NOT_IMPLEMENTED) {			ACPI_ERROR((AE_INFO,				    "Region %s (ID=%u) not implemented",				    acpi_ut_get_region_name(rgn_desc->region.							    space_id),				    rgn_desc->region.space_id));		} else if (status == AE_NOT_EXIST) {			ACPI_ERROR((AE_INFO,				    "Region %s (ID=%u) has no handler",				    acpi_ut_get_region_name(rgn_desc->region.							    space_id),				    rgn_desc->region.space_id));		}	}	return_ACPI_STATUS(status);}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:74,


示例15: AcpiExOpcode_1A_1T_1R

//.........这里部分代码省略.........                Digit >>= 4;                /* Next power of 10 */                PowerOfTen *= 10;            }            break;        case AML_TO_BCD_OP:             /* ToBcd (Operand, Result)  */            ReturnDesc->Integer.Value = 0;            Digit = Operand[0]->Integer.Value;            /* Each BCD digit is one nybble wide */            for (i = 0; (i < AcpiGbl_IntegerNybbleWidth) && (Digit > 0); i++)            {                (void) AcpiUtShortDivide (Digit, 10, &Digit, &Temp32);                /*                 * Insert the BCD digit that resides in the                 * remainder from above                 */                ReturnDesc->Integer.Value |=                    (((UINT64) Temp32) << ACPI_MUL_4 (i));            }            /* Overflow if there is any data left in Digit */            if (Digit > 0)            {                ACPI_ERROR ((AE_INFO,                    "Integer too large to convert to BCD: 0x%8.8X%8.8X",                    ACPI_FORMAT_UINT64 (Operand[0]->Integer.Value)));                Status = AE_AML_NUMERIC_OVERFLOW;                goto Cleanup;            }            break;        case AML_COND_REF_OF_OP:        /* CondRefOf (SourceObject, Result)  */            /*             * This op is a little strange because the internal return value is             * different than the return value stored in the result descriptor             * (There are really two return values)             */            if ((ACPI_NAMESPACE_NODE *) Operand[0] == AcpiGbl_RootNode)            {                /*                 * This means that the object does not exist in the namespace,                 * return FALSE                 */                ReturnDesc->Integer.Value = 0;                goto Cleanup;            }            /* Get the object reference, store it, and remove our reference */            Status = AcpiExGetObjectReference (Operand[0],                        &ReturnDesc2, WalkState);            if (ACPI_FAILURE (Status))            {                goto Cleanup;            }            Status = AcpiExStore (ReturnDesc2, Operand[1], WalkState);            AcpiUtRemoveReference (ReturnDesc2);
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:67,


示例16: AcpiDbDisplayGpes

voidAcpiDbDisplayGpes (    void){    ACPI_GPE_BLOCK_INFO     *GpeBlock;    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo;    ACPI_GPE_EVENT_INFO     *GpeEventInfo;    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;    char                    *GpeType;    ACPI_GPE_NOTIFY_INFO    *Notify;    UINT32                  GpeIndex;    UINT32                  Block = 0;    UINT32                  i;    UINT32                  j;    UINT32                  Count;    char                    Buffer[80];    ACPI_BUFFER             RetBuf;    ACPI_STATUS             Status;    RetBuf.Length = sizeof (Buffer);    RetBuf.Pointer = Buffer;    Block = 0;    /* Walk the GPE lists */    GpeXruptInfo = AcpiGbl_GpeXruptListHead;    while (GpeXruptInfo)    {        GpeBlock = GpeXruptInfo->GpeBlockListHead;        while (GpeBlock)        {            Status = AcpiGetName (GpeBlock->Node, ACPI_FULL_PATHNAME, &RetBuf);            if (ACPI_FAILURE (Status))            {                AcpiOsPrintf ("Could not convert name to pathname/n");            }            if (GpeBlock->Node == AcpiGbl_FadtGpeDevice)            {                GpeType = "FADT-defined GPE block";            }            else            {                GpeType = "GPE Block Device";            }            AcpiOsPrintf ("/nBlock %u - Info %p  DeviceNode %p [%s] - %s/n",                Block, GpeBlock, GpeBlock->Node, Buffer, GpeType);            AcpiOsPrintf ("    Registers:    %u (%u GPEs)/n",                GpeBlock->RegisterCount, GpeBlock->GpeCount);            AcpiOsPrintf ("    GPE range:    0x%X to 0x%X on interrupt %u/n",                GpeBlock->BlockBaseNumber,                GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1),                GpeXruptInfo->InterruptNumber);            AcpiOsPrintf (                "    RegisterInfo: %p  Status %8.8X%8.8X Enable %8.8X%8.8X/n",                GpeBlock->RegisterInfo,                ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->StatusAddress.Address),                ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->EnableAddress.Address));            AcpiOsPrintf ("    EventInfo:    %p/n", GpeBlock->EventInfo);            /* Examine each GPE Register within the block */            for (i = 0; i < GpeBlock->RegisterCount; i++)            {                GpeRegisterInfo = &GpeBlock->RegisterInfo[i];                AcpiOsPrintf (                    "    Reg %u: (GPE %.2X-%.2X)  RunEnable %2.2X WakeEnable %2.2X"                    " Status %8.8X%8.8X Enable %8.8X%8.8X/n",                    i, GpeRegisterInfo->BaseGpeNumber,                    GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),                    GpeRegisterInfo->EnableForRun,                    GpeRegisterInfo->EnableForWake,                    ACPI_FORMAT_UINT64 (GpeRegisterInfo->StatusAddress.Address),                    ACPI_FORMAT_UINT64 (GpeRegisterInfo->EnableAddress.Address));                /* Now look at the individual GPEs in this byte register */                for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)                {                    GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;                    GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];                    if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==                        ACPI_GPE_DISPATCH_NONE)                    {                        /* This GPE is not used (no method or handler), ignore it */                        continue;                    }                    AcpiOsPrintf (                        "        GPE %.2X: %p  RunRefs %2.2X Flags %2.2X (",//.........这里部分代码省略.........
开发者ID:wan721,项目名称:DragonFlyBSD,代码行数:101,


示例17: acpi_tb_convert_fadt

static void acpi_tb_convert_fadt(void){	struct acpi_generic_address *address64;	u32 address32;	u32 i;	/*	 * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.	 * Later code will always use the X 64-bit field. Also, check for an	 * address mismatch between the 32-bit and 64-bit address fields	 * (FIRMWARE_CTRL/X_FIRMWARE_CTRL, DSDT/X_DSDT) which would indicate	 * the presence of two FACS or two DSDT tables.	 */	if (!acpi_gbl_FADT.Xfacs) {		acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;	} else if (acpi_gbl_FADT.facs &&		   (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) {		ACPI_WARNING((AE_INFO,		    "32/64 FACS address mismatch in FADT - two FACS tables!"));	}	if (!acpi_gbl_FADT.Xdsdt) {		acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;	} else if (acpi_gbl_FADT.dsdt &&		   (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) {		ACPI_WARNING((AE_INFO,		    "32/64 DSDT address mismatch in FADT - two DSDT tables!"));	}	/*	 * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which	 * should be zero are indeed zero. This will workaround BIOSs that	 * inadvertently place values in these fields.	 *	 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located	 * at offset 45, 55, 95, and the word located at offset 109, 110.	 *	 * Note: The FADT revision value is unreliable. Only the length can be	 * trusted.	 */	if (acpi_gbl_FADT.header.length <= ACPI_FADT_V2_SIZE) {		acpi_gbl_FADT.preferred_profile = 0;		acpi_gbl_FADT.pstate_control = 0;		acpi_gbl_FADT.cst_control = 0;		acpi_gbl_FADT.boot_flags = 0;	}	/* Update the local FADT table header length */	acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);	/*	 * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"	 * generic address structures as necessary. Later code will always use	 * the 64-bit address structures.	 *	 * March 2009:	 * We now always use the 32-bit address if it is valid (non-null). This	 * is not in accordance with the ACPI specification which states that	 * the 64-bit address supersedes the 32-bit version, but we do this for	 * compatibility with other ACPI implementations. Most notably, in the	 * case where both the 32 and 64 versions are non-null, we use the 32-bit	 * version. This is the only address that is guaranteed to have been	 * tested by the BIOS manufacturer.	 */	for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {		address32 = *ACPI_ADD_PTR(u32,					  &acpi_gbl_FADT,					  fadt_info_table[i].address32);		address64 = ACPI_ADD_PTR(struct acpi_generic_address,					 &acpi_gbl_FADT,					 fadt_info_table[i].address64);		/*		 * If both 32- and 64-bit addresses are valid (non-zero),		 * they must match.		 */		if (address64->address && address32 &&		    (address64->address != (u64)address32)) {			ACPI_BIOS_ERROR((AE_INFO,					 "32/64X address mismatch in FADT/%s: "					 "0x%8.8X/0x%8.8X%8.8X, using 32",					 fadt_info_table[i].name, address32,					 ACPI_FORMAT_UINT64(address64->							    address)));		}		/* Always use 32-bit address if it is valid (non-null) */		if (address32) {			/*			 * Copy the 32-bit address to the 64-bit GAS structure. The			 * Space ID is always I/O for 32-bit legacy address fields			*/			acpi_tb_init_generic_address(address64,						     ACPI_ADR_SPACE_SYSTEM_IO,						     *ACPI_ADD_PTR(u8,								   &acpi_gbl_FADT,								   fadt_info_table//.........这里部分代码省略.........
开发者ID:AiWinters,项目名称:linux,代码行数:101,


示例18: AcpiNsDumpOneObject

//.........这里部分代码省略.........    {    case ACPI_DISPLAY_SUMMARY:        if (!ObjDesc)        {            /* No attached object. Some types should always have an object */            switch (Type)            {            case ACPI_TYPE_INTEGER:            case ACPI_TYPE_PACKAGE:            case ACPI_TYPE_BUFFER:            case ACPI_TYPE_STRING:            case ACPI_TYPE_METHOD:                AcpiOsPrintf ("<No attached object>");                break;            default:                break;            }            AcpiOsPrintf ("/n");            return (AE_OK);        }        switch (Type)        {        case ACPI_TYPE_PROCESSOR:            AcpiOsPrintf ("ID %02X Len %02X Addr %8.8X%8.8X/n",                ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,                ACPI_FORMAT_UINT64 (ObjDesc->Processor.Address));            break;        case ACPI_TYPE_DEVICE:            AcpiOsPrintf ("Notify Object: %p/n", ObjDesc);            break;        case ACPI_TYPE_METHOD:            AcpiOsPrintf ("Args %X Len %.4X Aml %p/n",                (UINT32) ObjDesc->Method.ParamCount,                ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart);            break;        case ACPI_TYPE_INTEGER:            AcpiOsPrintf ("= %8.8X%8.8X/n",                ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));            break;        case ACPI_TYPE_PACKAGE:            if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)            {                AcpiOsPrintf ("Elements %.2X/n",                    ObjDesc->Package.Count);            }            else            {                AcpiOsPrintf ("[Length not yet evaluated]/n");            }            break;
开发者ID:bahamas10,项目名称:openzfs,代码行数:67,


示例19: AcpiDsEvalRegionOperands

ACPI_STATUSAcpiDsEvalRegionOperands (    ACPI_WALK_STATE         *WalkState,    ACPI_PARSE_OBJECT       *Op){    ACPI_STATUS             Status;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     *OperandDesc;    ACPI_NAMESPACE_NODE     *Node;    ACPI_PARSE_OBJECT       *NextOp;    ACPI_FUNCTION_TRACE_PTR (DsEvalRegionOperands, Op);    /*     * This is where we evaluate the address and length fields of the     * OpRegion declaration     */    Node =  Op->Common.Node;    /* NextOp points to the op that holds the SpaceID */    NextOp = Op->Common.Value.Arg;    /* NextOp points to address op */    NextOp = NextOp->Common.Next;    /* Evaluate/create the address and length operands */    Status = AcpiDsCreateOperands (WalkState, NextOp);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Resolve the length and address operands to numbers */    Status = AcpiExResolveOperands (        Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        return_ACPI_STATUS (AE_NOT_EXIST);    }    /*     * Get the length operand and save it     * (at Top of stack)     */    OperandDesc = WalkState->Operands[WalkState->NumOperands - 1];    ObjDesc->Region.Length = (UINT32) OperandDesc->Integer.Value;    AcpiUtRemoveReference (OperandDesc);    /*     * Get the address and save it     * (at top of stack - 1)     */    OperandDesc = WalkState->Operands[WalkState->NumOperands - 2];    ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS)        OperandDesc->Integer.Value;    AcpiUtRemoveReference (OperandDesc);    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X/n",        ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),        ObjDesc->Region.Length));    /* Now the address and length are valid for this opregion */    ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;    return_ACPI_STATUS (Status);}
开发者ID:Lekensteyn,项目名称:acpica,代码行数:80,


示例20: PrDoDirective

//.........这里部分代码省略.........                Gbl_CurrentLineNumber, Token, Token2);            PrAddDefine (Token, Token2, FALSE);        }        break;    case PR_DIRECTIVE_ERROR:        /* TBD compiler should abort */        /* Note: No macro expansion */        PrError (ASL_ERROR, ASL_MSG_ERROR_DIRECTIVE,            THIS_TOKEN_OFFSET (Token));        break;    case PR_DIRECTIVE_IF:        TokenOffset = Token - Gbl_MainTokenBuffer;        /* Need to expand #define macros in the expression string first */        Status = PrResolveIntegerExpression (            &Gbl_CurrentLineBuffer[TokenOffset-1], &Value);        if (ACPI_FAILURE (Status))        {            return;        }        if (!Value)        {            *IgnoringThisCodeBlock = TRUE;        }        DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID            "Resolved #if: %8.8X%8.8X %s/n",            Gbl_CurrentLineNumber, ACPI_FORMAT_UINT64 (Value),            *IgnoringThisCodeBlock ? "<Skipping Block>" : "<Executing Block>");        Gbl_IfDepth++;        break;    case PR_DIRECTIVE_IFDEF:        if (!PrMatchDefine (Token))        {            *IgnoringThisCodeBlock = TRUE;        }        Gbl_IfDepth++;        DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID            "Start #ifdef %s/n", Gbl_CurrentLineNumber,            *IgnoringThisCodeBlock ? "<Skipping Block>" : "<Executing Block>");        break;    case PR_DIRECTIVE_IFNDEF:        if (PrMatchDefine (Token))        {            *IgnoringThisCodeBlock = TRUE;        }        Gbl_IfDepth++;        DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID            "Start #ifndef %2.2X/n", Gbl_CurrentLineNumber,            *IgnoringThisCodeBlock, Gbl_CurrentLineNumber);        break;    case PR_DIRECTIVE_INCLUDE:        Token = PrGetNextToken (NULL, " /"<>", Next);        if (!Token)
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:67,


示例21: acpi_ex_system_memory_space_handler

//.........这里部分代码省略.........		 * end of the region. However, we will never map more than one		 * page, nor will we cross a page boundary.		 */		map_length = (acpi_size)		    ((mem_info->address + mem_info->length) - address);		/*		 * If mapping the entire remaining portion of the region will cross		 * a page boundary, just map up to the page boundary, do not cross.		 * On some systems, crossing a page boundary while mapping regions		 * can cause warnings if the pages have different attributes		 * due to resource management.		 *		 * This has the added benefit of constraining a single mapping to		 * one page, which is similar to the original code that used a 4k		 * maximum window.		 */		page_boundary_map_length =		    ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address;		if (page_boundary_map_length == 0) {			page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;		}		if (map_length > page_boundary_map_length) {			map_length = page_boundary_map_length;		}		/* Create a new mapping starting at the address given */		mem_info->mapped_logical_address = acpi_os_map_memory((acpi_physical_address) address, map_length);		if (!mem_info->mapped_logical_address) {			ACPI_ERROR((AE_INFO,				    "Could not map memory at 0x%8.8X%8.8X, size %u",				    ACPI_FORMAT_UINT64(address),				    (u32) map_length));			mem_info->mapped_length = 0;			return_ACPI_STATUS(AE_NO_MEMORY);		}		/* Save the physical address and mapping size */		mem_info->mapped_physical_address = address;		mem_info->mapped_length = map_length;	}	/*	 * Generate a logical pointer corresponding to the address we want to	 * access	 */	logical_addr_ptr = mem_info->mapped_logical_address +	    ((u64) address - (u64) mem_info->mapped_physical_address);	ACPI_DEBUG_PRINT((ACPI_DB_INFO,			  "System-Memory (width %u) R/W %u Address=%8.8X%8.8X/n",			  bit_width, function, ACPI_FORMAT_UINT64(address)));	/*	 * Perform the memory read or write	 *	 * Note: For machines that do not support non-aligned transfers, the target	 * address was checked for alignment above. We do not attempt to break the	 * transfer up into smaller (byte-size) chunks because the AML specifically	 * asked for a transfer width that the hardware may require.	 */	switch (function) {	case ACPI_READ:
开发者ID:adityaatluri,项目名称:L3.12-amd,代码行数:67,


示例22: acpi_rs_out_integer64

static void acpi_rs_out_integer64(const char *title, u64 value){    acpi_os_printf("%27s : %8.8X%8.8X/n", title, ACPI_FORMAT_UINT64(value));}
开发者ID:ChineseDr,项目名称:linux,代码行数:5,


示例23: acpi_ex_system_memory_space_handler

//.........这里部分代码省略.........						  mem_info->						  mapped_physical_address +						  mem_info->mapped_length))) {		/*		 * The request cannot be resolved by the current memory mapping;		 * Delete the existing mapping and create a new one.		 */		if (mem_info->mapped_length) {			/* Valid mapping, delete it */			acpi_os_unmap_memory(mem_info->mapped_logical_address,					     mem_info->mapped_length);		}		/*		 * Don't attempt to map memory beyond the end of the region, and		 * constrain the maximum mapping size to something reasonable.		 */		window_size = (acpi_size)		    ((mem_info->address + mem_info->length) - address);		if (window_size > ACPI_SYSMEM_REGION_WINDOW_SIZE) {			window_size = ACPI_SYSMEM_REGION_WINDOW_SIZE;		}		/* Create a new mapping starting at the address given */		mem_info->mapped_logical_address =		    acpi_os_map_memory((acpi_native_uint) address, window_size);		if (!mem_info->mapped_logical_address) {			ACPI_ERROR((AE_INFO,				    "Could not map memory at %8.8X%8.8X, size %X",				    ACPI_FORMAT_UINT64(address),				    (u32) window_size));			mem_info->mapped_length = 0;			return_ACPI_STATUS(AE_NO_MEMORY);		}		/* Save the physical address and mapping size */		mem_info->mapped_physical_address = address;		mem_info->mapped_length = window_size;	}	/*	 * Generate a logical pointer corresponding to the address we want to	 * access	 */	logical_addr_ptr = mem_info->mapped_logical_address +	    ((acpi_integer) address -	     (acpi_integer) mem_info->mapped_physical_address);	ACPI_DEBUG_PRINT((ACPI_DB_INFO,			  "System-Memory (width %d) R/W %d Address=%8.8X%8.8X/n",			  bit_width, function, ACPI_FORMAT_UINT64(address)));	/*	 * Perform the memory read or write	 *	 * Note: For machines that do not support non-aligned transfers, the target	 * address was checked for alignment above.  We do not attempt to break the	 * transfer up into smaller (byte-size) chunks because the AML specifically	 * asked for a transfer width that the hardware may require.	 */	switch (function) {
开发者ID:Tigrouzen,项目名称:k1099,代码行数:67,


示例24: acpi_ev_address_space_dispatch

//.........这里部分代码省略.........								region.								space_id)));			return_ACPI_STATUS(status);		}		/* Region initialization may have been completed by region_setup */		if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) {			region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE;			/*			 * Save the returned context for use in all accesses to			 * the handler for this particular region			 */			if (!(region_obj2->extra.region_context)) {				region_obj2->extra.region_context =				    region_context;			}		}	}	/* We have everything we need, we can invoke the address space handler */	handler = handler_desc->address_space.handler;	address = (region_obj->region.address + region_offset);	/*	 * Special handling for generic_serial_bus and general_purpose_io:	 * There are three extra parameters that must be passed to the	 * handler via the context:	 *   1) Connection buffer, a resource template from Connection() op	 *   2) Length of the above buffer	 *   3) Actual access length from the access_as() op	 *	 * In addition, for general_purpose_io, the Address and bit_width fields	 * are defined as follows:	 *   1) Address is the pin number index of the field (bit offset from	 *      the previous Connection)	 *   2) bit_width is the actual bit length of the field (number of pins)	 */	if ((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) &&	    context && field_obj) {		/* Get the Connection (resource_template) buffer */		context->connection = field_obj->field.resource_buffer;		context->length = field_obj->field.resource_length;		context->access_length = field_obj->field.access_length;	}	if ((region_obj->region.space_id == ACPI_ADR_SPACE_GPIO) &&	    context && field_obj) {		/* Get the Connection (resource_template) buffer */		context->connection = field_obj->field.resource_buffer;		context->length = field_obj->field.resource_length;		context->access_length = field_obj->field.access_length;		address = field_obj->field.pin_number_index;		bit_width = field_obj->field.bit_length;	}	ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,			  "Handler %p (@%p) Address %8.8X%8.8X [%s]/n",			  &region_obj->region.handler->address_space, handler,			  ACPI_FORMAT_UINT64(address),			  acpi_ut_get_region_name(region_obj->region.						  space_id)));	if (!(handler_desc->address_space.handler_flags &	      ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {		/*		 * For handlers other than the default (supplied) handlers, we must		 * exit the interpreter because the handler *might* block -- we don't		 * know what it will do, so we can't hold the lock on the intepreter.		 */		acpi_ex_exit_interpreter();	}	/* Call the handler */	status = handler(function, address, bit_width, value, context,			 region_obj2->extra.region_context);	if (ACPI_FAILURE(status)) {		ACPI_EXCEPTION((AE_INFO, status, "Returned by Handler for [%s]",				acpi_ut_get_region_name(region_obj->region.							space_id)));	}	if (!(handler_desc->address_space.handler_flags &	      ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {		/*		 * We just returned from a non-default handler, we must re-enter the		 * interpreter		 */		acpi_ex_enter_interpreter();	}	return_ACPI_STATUS(status);}
开发者ID:020gzh,项目名称:linux,代码行数:101,


示例25: DtCompileInteger

voidDtCompileInteger (    UINT8                   *Buffer,    DT_FIELD                *Field,    UINT32                  ByteLength,    UINT8                   Flags){    UINT64                  Value;    UINT64                  MaxValue;    ACPI_STATUS             Status;    /* Output buffer byte length must be in range 1-8 */    if ((ByteLength > 8) || (ByteLength == 0))    {        DtFatal (ASL_MSG_COMPILER_INTERNAL, Field,            "Invalid internal Byte length");        return;    }    /* Resolve integer expression to a single integer value */    Status = DtResolveIntegerExpression (Field, &Value);    if (ACPI_FAILURE (Status))    {        return;    }    /*     * Ensure that reserved fields are set properly. Note: uses     * the DT_NON_ZERO flag to indicate that the reserved value     * must be exactly one. Otherwise, the value must be zero.     * This is sufficient for now.     */    /* TBD: Should use a flag rather than compare "Reserved" */    if (!ACPI_STRCMP (Field->Name, "Reserved"))    {        if (Flags & DT_NON_ZERO)        {            if (Value != 1)            {                DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,                    "Must be one, setting to one");                Value = 1;            }        }        else if (Value != 0)        {            DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,                "Must be zero, setting to zero");            Value = 0;        }    }    /* Check if the value must be non-zero */    else if ((Flags & DT_NON_ZERO) && (Value == 0))    {        DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL);    }    /*     * Generate the maximum value for the data type (ByteLength)     * Note: construct chosen for maximum portability     */    MaxValue = ((UINT64) (-1)) >> (64 - (ByteLength * 8));    /* Validate that the input value is within range of the target */    if (Value > MaxValue)    {        sprintf (MsgBuffer, "%8.8X%8.8X - max %u bytes",            ACPI_FORMAT_UINT64 (Value), ByteLength);        DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);    }    ACPI_MEMCPY (Buffer, &Value, ByteLength);    return;}
开发者ID:Lxg1582,项目名称:freebsd,代码行数:82,


示例26: TrCreateConstantLeafNode

ACPI_PARSE_OBJECT *TrCreateConstantLeafNode (    UINT32                  ParseOpcode){    ACPI_PARSE_OBJECT       *Op = NULL;    time_t                  CurrentTime;    char                    *StaticTimeString;    char                    *TimeString;    char                    *Filename;    switch (ParseOpcode)    {    case PARSEOP___LINE__:        Op = TrAllocateNode (PARSEOP_INTEGER);        Op->Asl.Value.Integer = Op->Asl.LineNumber;        break;    case PARSEOP___PATH__:        Op = TrAllocateNode (PARSEOP_STRING_LITERAL);        /* Op.Asl.Filename contains the full pathname to the file */        Op->Asl.Value.String = Op->Asl.Filename;        break;    case PARSEOP___FILE__:        Op = TrAllocateNode (PARSEOP_STRING_LITERAL);        /* Get the simple filename from the full path */        FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);        Op->Asl.Value.String = Filename;        break;    case PARSEOP___DATE__:        Op = TrAllocateNode (PARSEOP_STRING_LITERAL);        /* Get a copy of the current time */        CurrentTime = time (NULL);        StaticTimeString = ctime (&CurrentTime);        TimeString = UtLocalCalloc (strlen (StaticTimeString) + 1);        strcpy (TimeString, StaticTimeString);        TimeString[strlen(TimeString) -1] = 0;  /* Remove trailing newline */        Op->Asl.Value.String = TimeString;        break;    default: /* This would be an internal error */        return (NULL);    }    DbgPrint (ASL_PARSE_OUTPUT,        "/nCreateConstantLeafNode  Ln/Col %u/%u NewNode %p  Op %s  Value %8.8X%8.8X  /n",        Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),        ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));    return (Op);}
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:64,


示例27: AcpiEvAddressSpaceDispatch

//.........这里部分代码省略.........        /* Region initialization may have been completed by RegionSetup */        if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE))        {            RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE;            /*             * Save the returned context for use in all accesses to             * the handler for this particular region             */            if (!(RegionObj2->Extra.RegionContext))            {                RegionObj2->Extra.RegionContext = RegionContext;            }        }    }    /* We have everything we need, we can invoke the address space handler */    Handler = HandlerDesc->AddressSpace.Handler;    Address = (RegionObj->Region.Address + RegionOffset);    /*     * Special handling for GenericSerialBus and GeneralPurposeIo:     * There are three extra parameters that must be passed to the     * handler via the context:     *   1) Connection buffer, a resource template from Connection() op     *   2) Length of the above buffer     *   3) Actual access length from the AccessAs() op     *     * In addition, for GeneralPurposeIo, the Address and BitWidth fields     * are defined as follows:     *   1) Address is the pin number index of the field (bit offset from     *      the previous Connection)     *   2) BitWidth is the actual bit length of the field (number of pins)     */    if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) &&        Context &&        FieldObj)    {        /* Get the Connection (ResourceTemplate) buffer */        Context->Connection = FieldObj->Field.ResourceBuffer;        Context->Length = FieldObj->Field.ResourceLength;        Context->AccessLength = FieldObj->Field.AccessLength;    }    if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO) &&        Context &&        FieldObj)    {        /* Get the Connection (ResourceTemplate) buffer */        Context->Connection = FieldObj->Field.ResourceBuffer;        Context->Length = FieldObj->Field.ResourceLength;        Context->AccessLength = FieldObj->Field.AccessLength;        Address = FieldObj->Field.PinNumberIndex;        BitWidth = FieldObj->Field.BitLength;    }    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,        "Handler %p (@%p) Address %8.8X%8.8X [%s]/n",        &RegionObj->Region.Handler->AddressSpace, Handler,        ACPI_FORMAT_UINT64 (Address),        AcpiUtGetRegionName (RegionObj->Region.SpaceId)));    if (!(HandlerDesc->AddressSpace.HandlerFlags &        ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))    {        /*         * For handlers other than the default (supplied) handlers, we must         * exit the interpreter because the handler *might* block -- we don't         * know what it will do, so we can't hold the lock on the intepreter.         */        AcpiExExitInterpreter();    }    /* Call the handler */    Status = Handler (Function, Address, BitWidth, Value, Context,        RegionObj2->Extra.RegionContext);    if (ACPI_FAILURE (Status))    {        ACPI_EXCEPTION ((AE_INFO, Status, "Returned by Handler for [%s]",            AcpiUtGetRegionName (RegionObj->Region.SpaceId)));    }    if (!(HandlerDesc->AddressSpace.HandlerFlags &        ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))    {        /*         * We just returned from a non-default handler, we must re-enter the         * interpreter         */        AcpiExEnterInterpreter ();    }    return_ACPI_STATUS (Status);}
开发者ID:BarrelfishOS,项目名称:barrelfish,代码行数:101,


示例28: acpi_tb_get_this_table

static acpi_statusacpi_tb_get_this_table(struct acpi_pointer *address,		       struct acpi_table_header *header,		       struct acpi_table_desc *table_info){	struct acpi_table_header *full_table = NULL;	u8 allocation;	acpi_status status = AE_OK;	ACPI_FUNCTION_TRACE("tb_get_this_table");	/*	 * Flags contains the current processor mode (Virtual or Physical	 * addressing) The pointer_type is either Logical or Physical	 */	switch (address->pointer_type) {	case ACPI_PHYSMODE_PHYSPTR:	case ACPI_LOGMODE_LOGPTR:		/* Pointer matches processor mode, copy the table to a new buffer */		full_table = ACPI_MEM_ALLOCATE(header->length);		if (!full_table) {			ACPI_REPORT_ERROR(("Could not allocate table memory for [%4.4s] length %X/n", header->signature, header->length));			return_ACPI_STATUS(AE_NO_MEMORY);		}		/* Copy the entire table (including header) to the local buffer */		ACPI_MEMCPY(full_table, address->pointer.logical,			    header->length);		/* Save allocation type */		allocation = ACPI_MEM_ALLOCATED;		break;	case ACPI_LOGMODE_PHYSPTR:		/*		 * Just map the table's physical memory		 * into our address space.		 */		status = acpi_os_map_memory(address->pointer.physical,					    (acpi_size) header->length,					    (void *)&full_table);		if (ACPI_FAILURE(status)) {			ACPI_REPORT_ERROR(("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X/n", header->signature, ACPI_FORMAT_UINT64(address->pointer.physical), header->length));			return (status);		}		/* Save allocation type */		allocation = ACPI_MEM_MAPPED;		break;	default:		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid address flags %X/n",				  address->pointer_type));		return_ACPI_STATUS(AE_BAD_PARAMETER);	}	/*	 * Validate checksum for _most_ tables,	 * even the ones whose signature we don't recognize	 */	if (table_info->type != ACPI_TABLE_FACS) {		status = acpi_tb_verify_table_checksum(full_table);#if (!ACPI_CHECKSUM_ABORT)		if (ACPI_FAILURE(status)) {			/* Ignore the error if configuration says so */			status = AE_OK;		}#endif	}	/* Return values */	table_info->pointer = full_table;	table_info->length = (acpi_size) header->length;	table_info->allocation = allocation;	ACPI_DEBUG_PRINT((ACPI_DB_INFO,			  "Found table [%4.4s] at %8.8X%8.8X, mapped/copied to %p/n",			  full_table->signature,			  ACPI_FORMAT_UINT64(address->pointer.physical),			  full_table));	return_ACPI_STATUS(status);}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:93,


示例29: acpi_ns_dump_one_object

//.........这里部分代码省略.........			}			acpi_os_printf("/n");			return (AE_OK);		}		switch (type) {		case ACPI_TYPE_PROCESSOR:			acpi_os_printf("ID %X Len %.4X Addr %p/n",				       obj_desc->processor.proc_id,				       obj_desc->processor.length,				       ACPI_CAST_PTR(void,						     obj_desc->processor.						     address));			break;		case ACPI_TYPE_DEVICE:			acpi_os_printf("Notify Object: %p/n", obj_desc);			break;		case ACPI_TYPE_METHOD:			acpi_os_printf("Args %X Len %.4X Aml %p/n",				       (u32) obj_desc->method.param_count,				       obj_desc->method.aml_length,				       obj_desc->method.aml_start);			break;		case ACPI_TYPE_INTEGER:			acpi_os_printf("= %8.8X%8.8X/n",				       ACPI_FORMAT_UINT64(obj_desc->integer.							  value));			break;		case ACPI_TYPE_PACKAGE:			if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {				acpi_os_printf("Elements %.2X/n",					       obj_desc->package.count);			} else {				acpi_os_printf("[Length not yet evaluated]/n");			}			break;		case ACPI_TYPE_BUFFER:			if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {				acpi_os_printf("Len %.2X",					       obj_desc->buffer.length);								if (obj_desc->buffer.length > 0) {					acpi_os_printf(" =");					for (i = 0;					     (i < obj_desc->buffer.length					      && i < 12); i++) {						acpi_os_printf(" %.2hX",							       obj_desc->buffer.							       pointer[i]);					}				}				acpi_os_printf("/n");
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:67,


示例30: AcpiTbConvertFadt

//.........这里部分代码省略.........         * overridden by the AcpiGbl_Use32BitFadtAddresses flag.         *         * During 64-bit address construction and verification,         * these cases are handled:         *         * Address32 zero, Address64 [don't care]   - Use Address64         *         * Address32 non-zero, Address64 zero       - Copy/use Address32         * Address32 non-zero == Address64 non-zero - Use Address64         * Address32 non-zero != Address64 non-zero - Warning, use Address64         *         * Override: if AcpiGbl_Use32BitFadtAddresses is TRUE, and:         * Address32 non-zero != Address64 non-zero - Warning, copy/use Address32         *         * Note: SpaceId is always I/O for 32-bit legacy address fields         */        if (Address32)        {            if (!Address64->Address)            {                /* 64-bit address is zero, use 32-bit address */                AcpiTbInitGenericAddress (Address64,                    ACPI_ADR_SPACE_SYSTEM_IO,                    *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,                        FadtInfoTable[i].Length),                    (UINT64) Address32, Name, Flags);            }            else if (Address64->Address != (UINT64) Address32)            {                /* Address mismatch */                ACPI_BIOS_WARNING ((AE_INFO,                    "32/64X address mismatch in FADT/%s: "                    "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",                    Name, Address32,                    ACPI_FORMAT_UINT64 (Address64->Address),                    AcpiGbl_Use32BitFadtAddresses ? 32 : 64));                if (AcpiGbl_Use32BitFadtAddresses)                {                    /* 32-bit address override */                    AcpiTbInitGenericAddress (Address64,                        ACPI_ADR_SPACE_SYSTEM_IO,                        *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,                            FadtInfoTable[i].Length),                        (UINT64) Address32, Name, Flags);                }            }        }        /*         * For each extended field, check for length mismatch between the         * legacy length field and the corresponding 64-bit X length field.         * Note: If the legacy length field is > 0xFF bits, ignore this         * check. (GPE registers can be larger than the 64-bit GAS structure         * can accomodate, 0xFF bits).         */        if (Address64->Address &&           (ACPI_MUL_8 (Length) <= ACPI_UINT8_MAX) &&           (Address64->BitWidth != ACPI_MUL_8 (Length)))        {            ACPI_BIOS_WARNING ((AE_INFO,                "32/64X length mismatch in FADT/%s: %u/%u",                Name, ACPI_MUL_8 (Length), Address64->BitWidth));        }        if (FadtInfoTable[i].Flags & ACPI_FADT_REQUIRED)        {            /*             * Field is required (PM1aEvent, PM1aControl).             * Both the address and length must be non-zero.             */            if (!Address64->Address || !Length)            {                ACPI_BIOS_ERROR ((AE_INFO,                    "Required FADT field %s has zero address and/or length: "                    "0x%8.8X%8.8X/0x%X",                    Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));            }        }        else if (FadtInfoTable[i].Flags & ACPI_FADT_SEPARATE_LENGTH)        {            /*             * Field is optional (PM2Control, GPE0, GPE1) AND has its own             * length field. If present, both the address and length must             * be valid.             */            if ((Address64->Address && !Length) ||                (!Address64->Address && Length))            {                ACPI_BIOS_WARNING ((AE_INFO,                    "Optional FADT field %s has zero address or length: "                    "0x%8.8X%8.8X/0x%X",                    Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));            }        }    }}
开发者ID:Lianguocheng,项目名称:acpica,代码行数:101,



注:本文中的ACPI_FORMAT_UINT64函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ACPI_FREE函数代码示例
C++ ACPI_FORMAT_NATIVE_UINT函数代码示例
51自学网自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1