本文整理匯總了C++中ACPI_PTR_TO_PHYSADDR函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACPI_PTR_TO_PHYSADDR函數的具體用法?C++ ACPI_PTR_TO_PHYSADDR怎麽用?C++ ACPI_PTR_TO_PHYSADDR使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ACPI_PTR_TO_PHYSADDR函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AcpiTbUninstallTable
void
AcpiTbUninstallTable (
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;
}
示例2: AcpiOsGetRootPointer
ACPI_PHYSICAL_ADDRESS
AcpiOsGetRootPointer (
void)
{
return (ACPI_PTR_TO_PHYSADDR (&LocalRSDP));
}
示例3: AcpiOsGetRootPointer
ACPI_PHYSICAL_ADDRESS
AcpiOsGetRootPointer (
void)
{
return (ACPI_PTR_TO_PHYSADDR (RsdpCode));
}
示例4: AcpiLoadTable
ACPI_STATUS
AcpiLoadTable (
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);
}
示例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);
}
示例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);
}
示例7: AcpiLoadTable
ACPI_STATUS
AcpiLoadTable (
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);
}
示例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;
}
示例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);
}
示例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);
}
示例11: AcpiEfiGetRsdpViaGuid
static ACPI_PHYSICAL_ADDRESS
AcpiEfiGetRsdpViaGuid (
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);
}
示例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);
}
示例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);
}
示例14: AdStoreTable
static ACPI_STATUS
AdStoreTable (
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);
}
示例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);
}