VirtualBox

Changeset 107064 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Nov 20, 2024 8:21:23 PM (2 months ago)
Author:
vboxsync
Message:

Runtime/RTAcpi*: Support more statements, an extended variant of the Region() API, bugref:10733

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/acpi.cpp

    r107063 r107064  
    750750
    751751
     752RTDECL(int) RTAcpiTblNullNameAppend(RTACPITBL hAcpiTbl)
     753{
     754    PRTACPITBLINT pThis = hAcpiTbl;
     755    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     756
     757    rtAcpiTblAppendByte(pThis, 0x00);
     758    return pThis->rcErr;
     759}
     760
     761
     762RTDECL(int) RTAcpiTblNameStringAppend(RTACPITBL hAcpiTbl, const char *pszName)
     763{
     764    PRTACPITBLINT pThis = hAcpiTbl;
     765    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     766
     767    rtAcpiTblAppendNameString(pThis, pszName);
     768    return pThis->rcErr;
     769}
     770
     771
    752772RTDECL(int) RTAcpiTblStringAppend(RTACPITBL hAcpiTbl, const char *psz)
    753773{
     
    849869        case kAcpiStmt_Break:      bOp = ACPI_AML_BYTE_CODE_OP_BREAK;       break;
    850870        case kAcpiStmt_Continue:   bOp = ACPI_AML_BYTE_CODE_OP_CONTINUE;    break;
     871        case kAcpiStmt_Add:        bOp = ACPI_AML_BYTE_CODE_OP_ADD;         break;
     872        case kAcpiStmt_Subtract:   bOp = ACPI_AML_BYTE_CODE_OP_SUBTRACT;    break;
     873        case kAcpiStmt_And:        bOp = ACPI_AML_BYTE_CODE_OP_AND;         break;
     874        case kAcpiStmt_Nand:       bOp = ACPI_AML_BYTE_CODE_OP_NAND;        break;
     875        case kAcpiStmt_Or:         bOp = ACPI_AML_BYTE_CODE_OP_OR;          break;
     876        case kAcpiStmt_Xor:        bOp = ACPI_AML_BYTE_CODE_OP_XOR;         break;
     877        case kAcpiStmt_Not:        bOp = ACPI_AML_BYTE_CODE_OP_NOT;         break;
     878        case kAcpiStmt_Store:      bOp = ACPI_AML_BYTE_CODE_OP_STORE;       break;
     879        case kAcpiStmt_Index:      bOp = ACPI_AML_BYTE_CODE_OP_INDEX;       break;
     880        case kAcpiStmt_DerefOf:    bOp = ACPI_AML_BYTE_CODE_OP_DEREF_OF;    break;
    851881        default:
    852882            AssertFailedReturn(VERR_INVALID_PARAMETER);
     
    9771007
    9781008
    979 RTDECL(int) RTAcpiTblOpRegionAppend(RTACPITBL hAcpiTbl, const char *pszName, RTACPIOPREGIONSPACE enmSpace,
    980                                     uint64_t offRegion, uint64_t cbRegion)
     1009RTDECL(int) RTAcpiTblOpRegionAppendEx(RTACPITBL hAcpiTbl, const char *pszName, RTACPIOPREGIONSPACE enmSpace)
    9811010{
    9821011    PRTACPITBLINT pThis = hAcpiTbl;
     
    10061035    }
    10071036    rtAcpiTblAppendByte(pThis, bRegionSpace);
     1037    return pThis->rcErr;
     1038}
     1039
     1040
     1041RTDECL(int) RTAcpiTblOpRegionAppend(RTACPITBL hAcpiTbl, const char *pszName, RTACPIOPREGIONSPACE enmSpace,
     1042                                    uint64_t offRegion, uint64_t cbRegion)
     1043{
     1044    PRTACPITBLINT pThis = hAcpiTbl;
     1045    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     1046
     1047    int rc = RTAcpiTblOpRegionAppendEx(pThis, pszName, enmSpace);
     1048    if (RT_FAILURE(rc))
     1049        return rc;
     1050
    10081051    RTAcpiTblIntegerAppend(pThis, offRegion);
    10091052    RTAcpiTblIntegerAppend(pThis, cbRegion);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette