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

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

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

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

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

示例1: AcpiTbUninstallTable

voidAcpiTbUninstallTable (    ACPI_TABLE_DESC         *TableDesc){    ACPI_FUNCTION_TRACE (TbUninstallTable);    /* Table must be installed */    if (!TableDesc->Address)    {        return_VOID;    }    AcpiTbInvalidateTable (TableDesc);    if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==        ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL)    {        ACPI_FREE (ACPI_PHYSADDR_TO_PTR (TableDesc->Address));    }    TableDesc->Address = ACPI_PTR_TO_PHYSADDR (NULL);    return_VOID;}
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:26,


示例2: AcpiOsGetRootPointer

ACPI_PHYSICAL_ADDRESSAcpiOsGetRootPointer (    void){    return (ACPI_PTR_TO_PHYSADDR (&LocalRSDP));}
开发者ID:BarrelfishOS,项目名称:barrelfish,代码行数:7,


示例3: AcpiOsGetRootPointer

ACPI_PHYSICAL_ADDRESSAcpiOsGetRootPointer (    void){    return (ACPI_PTR_TO_PHYSADDR (RsdpCode));}
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:7,


示例4: AcpiLoadTable

ACPI_STATUSAcpiLoadTable (    ACPI_TABLE_HEADER       *Table){    ACPI_STATUS             Status;    UINT32                  TableIndex;    ACPI_FUNCTION_TRACE (AcpiLoadTable);    /* Parameter validation */    if (!Table)    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    /* Install the table and load it into the namespace */    ACPI_INFO (("Host-directed Dynamic ACPI Table Load:"));    Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table),        ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, &TableIndex);    return_ACPI_STATUS (Status);}
开发者ID:9elements,项目名称:fwts,代码行数:25,


示例5: AcpiTbCopyDsdt

ACPI_TABLE_HEADER *AcpiTbCopyDsdt (    UINT32                  TableIndex){    ACPI_TABLE_HEADER       *NewTable;    ACPI_TABLE_DESC         *TableDesc;    TableDesc = &AcpiGbl_RootTableList.Tables[TableIndex];    NewTable = ACPI_ALLOCATE (TableDesc->Length);    if (!NewTable)    {        ACPI_ERROR ((AE_INFO, "Could not copy DSDT of length 0x%X",            TableDesc->Length));        return (NULL);    }    memcpy (NewTable, TableDesc->Pointer, TableDesc->Length);    AcpiTbUninstallTable (TableDesc);    AcpiTbInitTableDescriptor (        &AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex],        ACPI_PTR_TO_PHYSADDR (NewTable),        ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, NewTable);    ACPI_INFO ((        "Forced DSDT copy: length 0x%05X copied locally, original unmapped",        NewTable->Length));    return (NewTable);}
开发者ID:benevo,项目名称:acpica,代码行数:32,


示例6: acpi_load_table

/******************************************************************************* * * FUNCTION:    acpi_load_table * * PARAMETERS:  table               - Pointer to a buffer containing the ACPI *                                    table to be loaded. * * RETURN:      Status * * DESCRIPTION: Dynamically load an ACPI table from the caller's buffer. Must *              be a valid ACPI table with a valid ACPI table header. *              Note1: Mainly intended to support hotplug addition of SSDTs. *              Note2: Does not copy the incoming table. User is responsible *              to ensure that the table is not deleted or unmapped. * ******************************************************************************/acpi_status acpi_load_table(struct acpi_table_header *table){	acpi_status status;	u32 table_index;	ACPI_FUNCTION_TRACE(acpi_load_table);	/* Parameter validation */	if (!table) {		return_ACPI_STATUS(AE_BAD_PARAMETER);	}	/* Must acquire the interpreter lock during this operation */	status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);	if (ACPI_FAILURE(status)) {		return_ACPI_STATUS(status);	}	/* Install the table and load it into the namespace */	ACPI_INFO((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);	status = acpi_tb_install_standard_table(ACPI_PTR_TO_PHYSADDR(table),						ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL,						TRUE, FALSE, &table_index);	(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);	if (ACPI_FAILURE(status)) {		goto unlock_and_exit;	}	/*	 * Note: Now table is "INSTALLED", it must be validated before	 * using.	 */	status =	    acpi_tb_validate_table(&acpi_gbl_root_table_list.				   tables[table_index]);	if (ACPI_FAILURE(status)) {		goto unlock_and_exit;	}	status = acpi_ns_load_table(table_index, acpi_gbl_root_node);	/* Invoke table handler if present */	if (acpi_gbl_table_handler) {		(void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table,					     acpi_gbl_table_handler_context);	}unlock_and_exit:	(void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);	return_ACPI_STATUS(status);}
开发者ID:vmayoral,项目名称:ubuntu-vivid,代码行数:74,


示例7: AcpiLoadTable

ACPI_STATUSAcpiLoadTable (    ACPI_TABLE_HEADER       *Table){    ACPI_STATUS             Status;    ACPI_TABLE_DESC         TableDesc;    UINT32                  TableIndex;    ACPI_FUNCTION_TRACE (AcpiLoadTable);    /* Parameter validation */    if (!Table)    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    /* Init local table descriptor */    ACPI_MEMSET (&TableDesc, 0, sizeof (ACPI_TABLE_DESC));    TableDesc.Address = ACPI_PTR_TO_PHYSADDR (Table);    TableDesc.Pointer = Table;    TableDesc.Length = Table->Length;    TableDesc.Flags = ACPI_TABLE_ORIGIN_UNKNOWN;    /* Must acquire the interpreter lock during this operation */    Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Install the table and load it into the namespace */    ACPI_INFO ((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));    Status = AcpiTbAddTable (&TableDesc, &TableIndex);    if (ACPI_FAILURE (Status))    {        goto UnlockAndExit;    }    Status = AcpiNsLoadTable (TableIndex, AcpiGbl_RootNode);    /* Invoke table handler if present */    if (AcpiGbl_TableHandler)    {        (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,                    AcpiGbl_TableHandlerContext);    }UnlockAndExit:    (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);    return_ACPI_STATUS (Status);}
开发者ID:vkhromov,项目名称:freebsd,代码行数:58,


示例8: AcpiOsGetPhysicalAddress

ACPI_STATUS AcpiOsGetPhysicalAddress(		void *LogicalAddress,		ACPI_PHYSICAL_ADDRESS *PhysicalAddress) {	PRINTD("AcpiOsGetPhysicalAddress() called");	if (!LogicalAddress || !PhysicalAddress) {		return AE_BAD_PARAMETER;	}	*PhysicalAddress = ACPI_PTR_TO_PHYSADDR(LogicalAddress);	return AE_OK;}
开发者ID:AleksandraButrova,项目名称:embox,代码行数:13,


示例9: acpi_load_table

acpi_status acpi_load_table(struct acpi_table_header *table){	acpi_status status;	struct acpi_table_desc table_desc;	u32 table_index;	ACPI_FUNCTION_TRACE(acpi_load_table);	/* Parameter validation */	if (!table) {		return_ACPI_STATUS(AE_BAD_PARAMETER);	}	/* Init local table descriptor */	ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc));	table_desc.address = ACPI_PTR_TO_PHYSADDR(table);	table_desc.pointer = table;	table_desc.length = table->length;	table_desc.flags = ACPI_TABLE_ORIGIN_UNKNOWN;	/* Must acquire the interpreter lock during this operation */	status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);	if (ACPI_FAILURE(status)) {		return_ACPI_STATUS(status);	}	/* Install the table and load it into the namespace */	ACPI_INFO((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));	status = acpi_tb_add_table(&table_desc, &table_index);	if (ACPI_FAILURE(status)) {		goto unlock_and_exit;	}	status = acpi_ns_load_table(table_index, acpi_gbl_root_node);	/* Invoke table handler if present */	if (acpi_gbl_table_handler) {		(void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table,					     acpi_gbl_table_handler_context);	}      unlock_and_exit:	(void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);	return_ACPI_STATUS(status);}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:50,


示例10: AcpiTbTableOverride

ACPI_TABLE_HEADER *AcpiTbTableOverride (    ACPI_TABLE_HEADER       *TableHeader,    ACPI_TABLE_DESC         *TableDesc){    ACPI_STATUS             Status;    ACPI_TABLE_HEADER       *NewTable = NULL;    ACPI_PHYSICAL_ADDRESS   NewAddress = 0;    UINT32                  NewTableLength = 0;    UINT8                   NewFlags;    char                    *OverrideType;    /* (1) Attempt logical override (returns a logical address) */    Status = AcpiOsTableOverride (TableHeader, &NewTable);    if (ACPI_SUCCESS (Status) && NewTable)    {        NewAddress = ACPI_PTR_TO_PHYSADDR (NewTable);        NewTableLength = NewTable->Length;        NewFlags = ACPI_TABLE_ORIGIN_OVERRIDE;        OverrideType = "Logical";        goto FinishOverride;    }    /* (2) Attempt physical override (returns a physical address) */    Status = AcpiOsPhysicalTableOverride (TableHeader,        &NewAddress, &NewTableLength);    if (ACPI_SUCCESS (Status) && NewAddress && NewTableLength)    {        /* Map the entire new table */        NewTable = AcpiOsMapMemory (NewAddress, NewTableLength);        if (!NewTable)        {            ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,                "%4.4s %p Attempted physical table override failed",                TableHeader->Signature,                ACPI_CAST_PTR (void, TableDesc->Address)));            return (NULL);        }
开发者ID:rodero95,项目名称:sys,代码行数:42,


示例11: AcpiEfiGetRsdpViaGuid

static ACPI_PHYSICAL_ADDRESSAcpiEfiGetRsdpViaGuid (    EFI_GUID                *Guid){    ACPI_PHYSICAL_ADDRESS   Address = 0;    int                     i;    for (i = 0; i < ST->NumberOfTableEntries; i++)    {        if (AcpiEfiCompareGuid (&ST->ConfigurationTable[i].VendorGuid, Guid))        {            Address = ACPI_PTR_TO_PHYSADDR (                    ST->ConfigurationTable[i].VendorTable);            break;        }    }    return (Address);}
开发者ID:Raphine,项目名称:Raph_Kernel,代码行数:20,


示例12: acpi_os_table_override

struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header						 *table_header,						 struct acpi_table_desc						 *table_desc){	acpi_status status;	struct acpi_table_header *new_table = NULL;	acpi_physical_address new_address = 0;	u32 new_table_length = 0;	u8 new_flags;	char *override_type;	/* (1) Attempt logical override (returns a logical address) */	status = acpi_os_table_override(table_header, &new_table);	if (ACPI_SUCCESS(status) && new_table) {		new_address = ACPI_PTR_TO_PHYSADDR(new_table);		new_table_length = new_table->length;		new_flags = ACPI_TABLE_ORIGIN_OVERRIDE;		override_type = "Logical";		goto finish_override;	}	/* (2) Attempt physical override (returns a physical address) */	status = acpi_os_physical_table_override(table_header,						 &new_address,						 &new_table_length);	if (ACPI_SUCCESS(status) && new_address && new_table_length) {		/* Map the entire new table */		new_table = acpi_os_map_memory(new_address, new_table_length);		if (!new_table) {			ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY,					"%4.4s %p Attempted physical table override failed",					table_header->signature,					ACPI_CAST_PTR(void,						      table_desc->address)));			return (NULL);		}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:41,


示例13: acpi_load_table

/******************************************************************************* * * FUNCTION:    acpi_load_table * * PARAMETERS:  table               - Pointer to a buffer containing the ACPI *                                    table to be loaded. * * RETURN:      Status * * DESCRIPTION: Dynamically load an ACPI table from the caller's buffer. Must *              be a valid ACPI table with a valid ACPI table header. *              Note1: Mainly intended to support hotplug addition of SSDTs. *              Note2: Does not copy the incoming table. User is responsible *              to ensure that the table is not deleted or unmapped. * ******************************************************************************/acpi_status acpi_load_table(struct acpi_table_header *table){	acpi_status status;	u32 table_index;	ACPI_FUNCTION_TRACE(acpi_load_table);	/* Parameter validation */	if (!table) {		return_ACPI_STATUS(AE_BAD_PARAMETER);	}	/* Install the table and load it into the namespace */	ACPI_INFO(("Host-directed Dynamic ACPI Table Load:"));	status = acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table),						ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL,						FALSE, &table_index);	return_ACPI_STATUS(status);}
开发者ID:avagin,项目名称:linux,代码行数:37,


示例14: AdStoreTable

static ACPI_STATUSAdStoreTable (    ACPI_TABLE_HEADER       *Table,    UINT32                  *TableIndex){    ACPI_STATUS             Status;    ACPI_TABLE_DESC         *TableDesc;    Status = AcpiTbGetNextTableDescriptor (TableIndex, &TableDesc);    if (ACPI_FAILURE (Status))    {        return (Status);    }    /* Initialize added table */    AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table),        ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table);    Status = AcpiTbValidateTable (TableDesc);    return (Status);}
开发者ID:JamesLinus,项目名称:acpica,代码行数:22,


示例15: AcpiExLoadOp

//.........这里部分代码省略.........        /* Table cannot extend beyond the buffer */        if (Length > ObjDesc->Buffer.Length)        {            return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);        }        if (Length < sizeof (ACPI_TABLE_HEADER))        {            return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH);        }        /*         * Copy the table from the buffer because the buffer could be modified         * or even deleted in the future         */        Table = ACPI_ALLOCATE (Length);        if (!Table)        {            return_ACPI_STATUS (AE_NO_MEMORY);        }        ACPI_MEMCPY (Table, TableHeader, Length);        break;    default:        return_ACPI_STATUS (AE_AML_OPERAND_TYPE);    }    /* Install the new table into the local data structures */    ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),                ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,                &TableIndex);    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);    if (ACPI_FAILURE (Status))    {        /* Delete allocated table buffer */        ACPI_FREE (Table);        return_ACPI_STATUS (Status);    }    /*     * Note: Now table is "INSTALLED", it must be validated before     * loading.     */    Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /*     * Add the table to the namespace.     *     * Note: Load the table objects relative to the root of the namespace.     * This appears to go against the ACPI specification, but we do it for     * compatibility with other ACPI implementations.     */    Status = AcpiExAddTable (TableIndex, AcpiGbl_RootNode, &DdbHandle);    if (ACPI_FAILURE (Status))    {        /* On error, TablePtr was deallocated above */        return_ACPI_STATUS (Status);    }    /* Store the DdbHandle into the Target operand */    Status = AcpiExStore (DdbHandle, Target, WalkState);    if (ACPI_FAILURE (Status))    {        (void) AcpiExUnloadTable (DdbHandle);        /* TablePtr was deallocated above */        AcpiUtRemoveReference (DdbHandle);        return_ACPI_STATUS (Status);    }    /* Remove the reference by added by AcpiExStore above */    AcpiUtRemoveReference (DdbHandle);    /* Invoke table handler if present */    if (AcpiGbl_TableHandler)    {        (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,                    AcpiGbl_TableHandlerContext);    }    return_ACPI_STATUS (Status);}
开发者ID:Stichting-MINIX-Research-Foundation,项目名称:minix,代码行数:101,


示例16: acpi_tb_add_table

//.........这里部分代码省略.........	 * Originally, we checked the table signature for "SSDT" or "PSDT" here.	 * Next, we added support for OEMx tables, signature "OEM".	 * Valid tables were encountered with a null signature, so we've just	 * given up on validating the signature, since it seems to be a waste	 * of code. The original code was removed (05/2008).	 */	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);	/* Check if table is already registered */	for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) {		if (!acpi_gbl_root_table_list.tables[i].pointer) {			status =			    acpi_tb_verify_table(&acpi_gbl_root_table_list.						 tables[i]);			if (ACPI_FAILURE(status)			    || !acpi_gbl_root_table_list.tables[i].pointer) {				continue;			}		}		/*		 * Check for a table match on the entire table length,		 * not just the header.		 */		if (table_desc->length !=		    acpi_gbl_root_table_list.tables[i].length) {			continue;		}		if (ACPI_MEMCMP(table_desc->pointer,				acpi_gbl_root_table_list.tables[i].pointer,				acpi_gbl_root_table_list.tables[i].length)) {			continue;		}		/*		 * Note: the current mechanism does not unregister a table if it is		 * dynamically unloaded. The related namespace entries are deleted,		 * but the table remains in the root table list.		 *		 * The assumption here is that the number of different tables that		 * will be loaded is actually small, and there is minimal overhead		 * in just keeping the table in case it is needed again.		 *		 * If this assumption changes in the future (perhaps on large		 * machines with many table load/unload operations), tables will		 * need to be unregistered when they are unloaded, and slots in the		 * root table list should be reused when empty.		 */		/*		 * Table is already registered.		 * We can delete the table that was passed as a parameter.		 */		acpi_tb_delete_table(table_desc);		*table_index = i;		if (acpi_gbl_root_table_list.tables[i].		    flags & ACPI_TABLE_IS_LOADED) {			/* Table is still loaded, this is an error */			status = AE_ALREADY_EXISTS;			goto release;		} else {			/* Table was unloaded, allow it to be reloaded */			table_desc->pointer =			    acpi_gbl_root_table_list.tables[i].pointer;			table_desc->address =			    acpi_gbl_root_table_list.tables[i].address;			status = AE_OK;			goto print_header;		}	}	/*	 * ACPI Table Override:	 * Allow the host to override dynamically loaded tables.	 */	status = acpi_os_table_override(table_desc->pointer, &override_table);	if (ACPI_SUCCESS(status) && override_table) {		ACPI_INFO((AE_INFO,			   "%4.4s @ 0x%p Table override, replaced with:",			   table_desc->pointer->signature,			   ACPI_CAST_PTR(void, table_desc->address)));		/* We can delete the table that was passed as a parameter */		acpi_tb_delete_table(table_desc);		/* Setup descriptor for the new table */		table_desc->address = ACPI_PTR_TO_PHYSADDR(override_table);		table_desc->pointer = override_table;		table_desc->length = override_table->length;		table_desc->flags = ACPI_TABLE_ORIGIN_OVERRIDE;	}
开发者ID:1111saeid,项目名称:jb_kernel_3.0.16_htc_golfu,代码行数:101,


示例17: 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:ModeenF,项目名称:haiku,代码行数:100,


示例18: AnBuildLocalTables

ACPI_STATUSAnBuildLocalTables (    ACPI_NEW_TABLE_DESC     *TableList){    UINT32                  TableCount = 0;    ACPI_PHYSICAL_ADDRESS   DsdtAddress = 0;    UINT32                  XsdtSize;    ACPI_NEW_TABLE_DESC     *NextTable;    UINT32                  NextIndex;    ACPI_TABLE_FADT         *ExternalFadt = NULL;    /*     * Update the table count. For the DSDT, it is not put into the XSDT.     * For the FADT, this table is already accounted for since we usually     * install a local FADT.     */    NextTable = TableList;    while (NextTable)    {        if (!ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_DSDT) &&            !ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_FADT))        {            TableCount++;        }        NextTable = NextTable->Next;    }    XsdtSize = BASE_XSDT_SIZE + (TableCount * sizeof (UINT64));    /* Build an XSDT */    LocalXSDT = AcpiOsAllocate (XsdtSize);    if (!LocalXSDT)    {        return (AE_NO_MEMORY);    }    memset (LocalXSDT, 0, XsdtSize);    LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalFADT);    /*     * Install the user tables. The DSDT must be installed in the FADT.     * All other tables are installed directly into the XSDT.     *     * Note: The tables are loaded in reverse order from the incoming     * input, which makes it match the command line order.     */    NextIndex = BASE_XSDT_TABLES;    NextTable = TableList;    while (NextTable)    {        /*         * Incoming DSDT or FADT are special cases. All other tables are         * just immediately installed into the XSDT.         */        if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_DSDT))        {            if (DsdtAddress)            {                printf ("Already found a DSDT, only one allowed/n");                return (AE_ALREADY_EXISTS);            }            /* The incoming user table is a DSDT */            DsdtAddress = ACPI_PTR_TO_PHYSADDR (NextTable->Table);        }        else if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_FADT))        {            ExternalFadt =                ACPI_CAST_PTR (ACPI_TABLE_FADT, NextTable->Table);            LocalXSDT->TableOffsetEntry[0] =                ACPI_PTR_TO_PHYSADDR (NextTable->Table);        }        else        {            /* Install the table in the XSDT */            LocalXSDT->TableOffsetEntry[TableCount - NextIndex + 1] =                ACPI_PTR_TO_PHYSADDR (NextTable->Table);            NextIndex++;        }        NextTable = NextTable->Next;    }    /* Build an RSDP. Contains a valid XSDT only, no RSDT */    memset (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP));    ACPI_MAKE_RSDP_SIG (LocalRSDP.Signature);    memcpy (LocalRSDP.OemId, "Intel", 6);    LocalRSDP.Revision = 2;    LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT);    LocalRSDP.Length = sizeof (ACPI_TABLE_XSDT);    /* Set checksums for both XSDT and RSDP *///.........这里部分代码省略.........
开发者ID:SchmErik,项目名称:acpica,代码行数:101,


示例19: AcpiTbOverrideTable

voidAcpiTbOverrideTable (    ACPI_TABLE_DESC         *OldTableDesc){    ACPI_STATUS             Status;    char                    *OverrideType;    ACPI_TABLE_DESC         NewTableDesc;    ACPI_TABLE_HEADER       *Table;    ACPI_PHYSICAL_ADDRESS   Address;    UINT32                  Length;    /* (1) Attempt logical override (returns a logical address) */    Status = AcpiOsTableOverride (OldTableDesc->Pointer, &Table);    if (ACPI_SUCCESS (Status) && Table)    {        AcpiTbAcquireTempTable (&NewTableDesc, ACPI_PTR_TO_PHYSADDR (Table),            ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL);        OverrideType = "Logical";        goto FinishOverride;    }    /* (2) Attempt physical override (returns a physical address) */    Status = AcpiOsPhysicalTableOverride (OldTableDesc->Pointer,        &Address, &Length);    if (ACPI_SUCCESS (Status) && Address && Length)    {        AcpiTbAcquireTempTable (&NewTableDesc, Address,            ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);        OverrideType = "Physical";        goto FinishOverride;    }    return; /* There was no override */FinishOverride:    /* Validate and verify a table before overriding */    Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);    if (ACPI_FAILURE (Status))    {        return;    }    ACPI_INFO ((AE_INFO, "%4.4s 0x%8.8X%8.8X"        " %s table override, new table: 0x%8.8X%8.8X",        OldTableDesc->Signature.Ascii,        ACPI_FORMAT_UINT64 (OldTableDesc->Address),        OverrideType, ACPI_FORMAT_UINT64 (NewTableDesc.Address)));    /* We can now uninstall the original table */    AcpiTbUninstallTable (OldTableDesc);    /*     * Replace the original table descriptor and keep its state as     * "VALIDATED".     */    AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address,        NewTableDesc.Flags, NewTableDesc.Pointer);    AcpiTbValidateTempTable (OldTableDesc);    /* Release the temporary table descriptor */    AcpiTbReleaseTempTable (&NewTableDesc);}
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:70,


示例20: acpi_os_table_override

struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header        *table_header,        struct acpi_table_desc        *table_desc){    acpi_status status;    struct acpi_table_header *new_table = NULL;    acpi_physical_address new_address = 0;    u32 new_table_length = 0;    u8 new_flags;    char *override_type;    /* (1) Attempt logical override (returns a logical address) */    status = acpi_os_table_override(table_header, &new_table);    if (ACPI_SUCCESS(status) && new_table) {        new_address = ACPI_PTR_TO_PHYSADDR(new_table);        new_table_length = new_table->length;        new_flags = ACPI_TABLE_ORIGIN_OVERRIDE;        override_type = "Logical";        goto finish_override;    }    /* (2) Attempt physical override (returns a physical address) */    status = acpi_os_physical_table_override(table_header,             &new_address,             &new_table_length);    if (ACPI_SUCCESS(status) && new_address && new_table_length) {        /* Map the entire new table */        new_table = acpi_os_map_memory(new_address, new_table_length);        if (!new_table) {            ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY,                            "%4.4s %p Attempted physical table override failed",                            table_header->signature,                            ACPI_PHYSADDR_TO_PTR(table_desc->address)));            return (NULL);        }        override_type = "Physical";        new_flags = ACPI_TABLE_ORIGIN_MAPPED;        goto finish_override;    }    return (NULL);		/* There was no override */finish_override:    ACPI_INFO((AE_INFO,               "%4.4s %p %s table override, new table: %p",               table_header->signature,               ACPI_PHYSADDR_TO_PTR(table_desc->address),               override_type, new_table));    /* We can now unmap/delete the original table (if fully mapped) */    acpi_tb_delete_table(table_desc);    /* Setup descriptor for the new table */    table_desc->address = new_address;    table_desc->pointer = new_table;    table_desc->length = new_table_length;    table_desc->flags = new_flags;    return (new_table);}
开发者ID:friedrich420,项目名称:Ael-Zen-Kernel-Asus-Zenfone2-,代码行数:69,


示例21: AeBuildLocalTables

ACPI_STATUSAeBuildLocalTables (    ACPI_NEW_TABLE_DESC     *ListHead){    UINT32                  TableCount = 1;    ACPI_PHYSICAL_ADDRESS   DsdtAddress = 0;    UINT32                  XsdtSize;    ACPI_NEW_TABLE_DESC     *NextTable;    UINT32                  NextIndex;    ACPI_TABLE_FADT         *ExternalFadt = NULL;    /*     * Update the table count. For the DSDT, it is not put into the XSDT.     * For the FADT, this table is already accounted for since we usually     * install a local FADT.     */    NextTable = ListHead;    while (NextTable)    {        if (!ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_DSDT) &&            !ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_FADT))        {            TableCount++;        }        NextTable = NextTable->Next;    }    XsdtSize = (((TableCount + 1) * sizeof (UINT64)) +        sizeof (ACPI_TABLE_HEADER));    if (AcpiGbl_LoadTestTables)    {        XsdtSize += BASE_XSDT_SIZE;    }    /* Build an XSDT */    LocalXSDT = AcpiOsAllocate (XsdtSize);    if (!LocalXSDT)    {        return (AE_NO_MEMORY);    }    memset (LocalXSDT, 0, XsdtSize);    LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalFADT);    NextIndex = 1;    /*     * Install the user tables. The DSDT must be installed in the FADT.     * All other tables are installed directly into the XSDT.     */    NextTable = ListHead;    while (NextTable)    {        /*         * Incoming DSDT or FADT are special cases. All other tables are         * just immediately installed into the XSDT.         */        if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_DSDT))        {            if (DsdtAddress)            {                printf ("Already found a DSDT, only one allowed/n");                return (AE_ALREADY_EXISTS);            }            /* The incoming user table is a DSDT */            DsdtAddress = ACPI_PTR_TO_PHYSADDR (NextTable->Table);            DsdtToInstallOverride = NextTable->Table;        }        else if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_FADT))        {            ExternalFadt = ACPI_CAST_PTR (ACPI_TABLE_FADT, NextTable->Table);            LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (NextTable->Table);        }        else        {            /* Install the table in the XSDT */            LocalXSDT->TableOffsetEntry[NextIndex] =                ACPI_PTR_TO_PHYSADDR (NextTable->Table);            NextIndex++;        }        NextTable = NextTable->Next;    }    /* Install the optional extra local tables */    if (AcpiGbl_LoadTestTables)    {        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&LocalTEST);        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&LocalBADTABLE);        /* Install two SSDTs to test multiple table support */        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&Ssdt1Code);        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&Ssdt2Code);//.........这里部分代码省略.........
开发者ID:BarrelfishOS,项目名称:barrelfish,代码行数:101,


示例22: 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:AndroPlus-org,项目名称:android_kernel_sony_msm8996,代码行数:82,


示例23: AcpiTbAddTable

//.........这里部分代码省略.........     * Valid tables were encountered with a null signature, so we've just     * given up on validating the signature, since it seems to be a waste     * of code. The original code was removed (05/2008).     */    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    /* Check if table is already registered */    for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)    {        if (!AcpiGbl_RootTableList.Tables[i].Pointer)        {            Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);            if (ACPI_FAILURE (Status) ||                !AcpiGbl_RootTableList.Tables[i].Pointer)            {                continue;            }        }        /*         * Check for a table match on the entire table length,         * not just the header.         */        if (TableDesc->Length != AcpiGbl_RootTableList.Tables[i].Length)        {            continue;        }        if (ACPI_MEMCMP (TableDesc->Pointer,                AcpiGbl_RootTableList.Tables[i].Pointer,                AcpiGbl_RootTableList.Tables[i].Length))        {            continue;        }        /*         * Note: the current mechanism does not unregister a table if it is         * dynamically unloaded. The related namespace entries are deleted,         * but the table remains in the root table list.         *         * The assumption here is that the number of different tables that         * will be loaded is actually small, and there is minimal overhead         * in just keeping the table in case it is needed again.         *         * If this assumption changes in the future (perhaps on large         * machines with many table load/unload operations), tables will         * need to be unregistered when they are unloaded, and slots in the         * root table list should be reused when empty.         */        /*         * Table is already registered.         * We can delete the table that was passed as a parameter.         */        AcpiTbDeleteTable (TableDesc);        *TableIndex = i;        if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED)        {            /* Table is still loaded, this is an error */            Status = AE_ALREADY_EXISTS;            goto Release;        }        else        {            /* Table was unloaded, allow it to be reloaded */            TableDesc->Pointer = AcpiGbl_RootTableList.Tables[i].Pointer;            TableDesc->Address = AcpiGbl_RootTableList.Tables[i].Address;            Status = AE_OK;            goto PrintHeader;        }    }    /*     * ACPI Table Override:     * Allow the host to override dynamically loaded tables.     */    Status = AcpiOsTableOverride (TableDesc->Pointer, &OverrideTable);    if (ACPI_SUCCESS (Status) && OverrideTable)    {        ACPI_INFO ((AE_INFO,            "%4.4s @ 0x%p Table override, replaced with:",            TableDesc->Pointer->Signature,            ACPI_CAST_PTR (void, TableDesc->Address)));        /* We can delete the table that was passed as a parameter */        AcpiTbDeleteTable (TableDesc);        /* Setup descriptor for the new table */        TableDesc->Address = ACPI_PTR_TO_PHYSADDR (OverrideTable);        TableDesc->Pointer = OverrideTable;        TableDesc->Length = OverrideTable->Length;        TableDesc->Flags = ACPI_TABLE_ORIGIN_OVERRIDE;    }
开发者ID:AgamAgarwal,项目名称:minix,代码行数:101,


示例24: AeBuildLocalTables

ACPI_STATUSAeBuildLocalTables (    UINT32                  TableCount,    AE_TABLE_DESC           *TableList){    ACPI_PHYSICAL_ADDRESS   DsdtAddress = 0;    UINT32                  XsdtSize;    AE_TABLE_DESC           *NextTable;    UINT32                  NextIndex;    ACPI_TABLE_FADT         *ExternalFadt = NULL;    /*     * Update the table count. For DSDT, it is not put into the XSDT. For     * FADT, this is already accounted for since we usually install a     * local FADT.     */    NextTable = TableList;    while (NextTable)    {        if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_DSDT) ||            ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_FADT))        {            TableCount--;        }        NextTable = NextTable->Next;    }    XsdtSize = BASE_XSDT_SIZE + (TableCount * sizeof (UINT64));    /* Build an XSDT */    LocalXSDT = AcpiOsAllocate (XsdtSize);    if (!LocalXSDT)    {        return (AE_NO_MEMORY);    }    ACPI_MEMSET (LocalXSDT, 0, XsdtSize);    ACPI_MOVE_NAME (LocalXSDT->Header.Signature, ACPI_SIG_XSDT);    LocalXSDT->Header.Length = XsdtSize;    LocalXSDT->Header.Revision = 1;    LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalFADT);    /*     * Install the user tables. The DSDT must be installed in the FADT.     * All other tables are installed directly into the XSDT.     */    NextIndex = BASE_XSDT_TABLES;    NextTable = TableList;    while (NextTable)    {        /*         * Incoming DSDT or FADT are special cases. All other tables are         * just immediately installed into the XSDT.         */        if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_DSDT))        {            if (DsdtAddress)            {                printf ("Already found a DSDT, only one allowed/n");                return (AE_ALREADY_EXISTS);            }            /* The incoming user table is a DSDT */            DsdtAddress = ACPI_PTR_TO_PHYSADDR (NextTable->Table);        }        else if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_FADT))        {            ExternalFadt = ACPI_CAST_PTR (ACPI_TABLE_FADT, NextTable->Table);            LocalXSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (NextTable->Table);        }        else        {            /* Install the table in the XSDT */            LocalXSDT->TableOffsetEntry[NextIndex] = ACPI_PTR_TO_PHYSADDR (NextTable->Table);            NextIndex++;        }        NextTable = NextTable->Next;    }    /* Build an RSDP */    ACPI_MEMSET (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP));    ACPI_MAKE_RSDP_SIG (LocalRSDP.Signature);    ACPI_MEMCPY (LocalRSDP.OemId, "I_TEST", 6);    LocalRSDP.Revision = 2;    LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT);    LocalRSDP.Length = sizeof (ACPI_TABLE_XSDT);    /* Set checksums for both XSDT and RSDP */    LocalXSDT->Header.Checksum = (UINT8) -AcpiTbChecksum (        (void *) LocalXSDT, LocalXSDT->Header.Length);    LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum (        (void *) &LocalRSDP, ACPI_RSDP_CHECKSUM_LENGTH);//.........这里部分代码省略.........
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:101,


示例25: AcpiLoadTable

ACPI_STATUSAcpiLoadTable (    ACPI_TABLE_HEADER       *Table){    ACPI_STATUS             Status;    UINT32                  TableIndex;    ACPI_FUNCTION_TRACE (AcpiLoadTable);    /* Parameter validation */    if (!Table)    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    /* Must acquire the interpreter lock during this operation */    Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Install the table and load it into the namespace */    ACPI_INFO (("Host-directed Dynamic ACPI Table Load:"));    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),        ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, TRUE, FALSE,        &TableIndex);    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);    if (ACPI_FAILURE (Status))    {        goto UnlockAndExit;    }    /*     * Note: Now table is "INSTALLED", it must be validated before     * using.     */    Status = AcpiTbValidateTable (        &AcpiGbl_RootTableList.Tables[TableIndex]);    if (ACPI_FAILURE (Status))    {        goto UnlockAndExit;    }    Status = AcpiNsLoadTable (TableIndex, AcpiGbl_RootNode);    /* Invoke table handler if present */    if (AcpiGbl_TableHandler)    {        (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,            AcpiGbl_TableHandlerContext);    }UnlockAndExit:    (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);    return_ACPI_STATUS (Status);}
开发者ID:alex1818,项目名称:fwts,代码行数:66,


示例26: AcpiTbAddTable

//.........这里部分代码省略.........            *(UINT32 *) TableDesc->Pointer->Signature));        return_ACPI_STATUS (AE_BAD_SIGNATURE);    }    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    /* Check if table is already registered */    for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)    {        if (!AcpiGbl_RootTableList.Tables[i].Pointer)        {            Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);            if (ACPI_FAILURE (Status) ||                !AcpiGbl_RootTableList.Tables[i].Pointer)            {                continue;            }        }        /*         * Check for a table match on the entire table length,         * not just the header.         */        if (TableDesc->Length != AcpiGbl_RootTableList.Tables[i].Length)        {            continue;        }        if (ACPI_MEMCMP (TableDesc->Pointer,                AcpiGbl_RootTableList.Tables[i].Pointer,                AcpiGbl_RootTableList.Tables[i].Length))        {            continue;        }        /*         * Note: the current mechanism does not unregister a table if it is         * dynamically unloaded. The related namespace entries are deleted,         * but the table remains in the root table list.         *         * The assumption here is that the number of different tables that         * will be loaded is actually small, and there is minimal overhead         * in just keeping the table in case it is needed again.         *         * If this assumption changes in the future (perhaps on large         * machines with many table load/unload operations), tables will         * need to be unregistered when they are unloaded, and slots in the         * root table list should be reused when empty.         */        /*         * Table is already registered.         * We can delete the table that was passed as a parameter.         */        AcpiTbDeleteTable (TableDesc);        *TableIndex = i;        if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED)        {            /* Table is still loaded, this is an error */            Status = AE_ALREADY_EXISTS;            goto Release;        }        else        {            /* Table was unloaded, allow it to be reloaded */            TableDesc->Pointer = AcpiGbl_RootTableList.Tables[i].Pointer;            TableDesc->Address = AcpiGbl_RootTableList.Tables[i].Address;            Status = AE_OK;            goto PrintHeader;        }    }    /*     * ACPI Table Override:     * Allow the host to override dynamically loaded tables.     */    Status = AcpiOsTableOverride (TableDesc->Pointer, &OverrideTable);    if (ACPI_SUCCESS (Status) && OverrideTable)    {        ACPI_INFO ((AE_INFO,            "%4.4s @ 0x%p Table override, replaced with:",            TableDesc->Pointer->Signature,            ACPI_CAST_PTR (void, TableDesc->Address)));        /* We can delete the table that was passed as a parameter */        AcpiTbDeleteTable (TableDesc);        /* Setup descriptor for the new table */        TableDesc->Address = ACPI_PTR_TO_PHYSADDR (OverrideTable);        TableDesc->Pointer = OverrideTable;        TableDesc->Length = OverrideTable->Length;        TableDesc->Flags = ACPI_TABLE_ORIGIN_OVERRIDE;    }
开发者ID:apprisi,项目名称:illumos-gate,代码行数:101,



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


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