VirtualBox

Changeset 108131 in vbox


Ignore:
Timestamp:
Feb 10, 2025 10:37:31 AM (11 days ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167430
Message:

Runtime/RTAcpi*: Add method to dump the ACPI table to a memory buffer, bugref:10733

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/acpi.h

    r108096 r108131  
    197197 */
    198198RTDECL(int) RTAcpiTblDumpToFile(RTACPITBL hAcpiTbl, RTACPITBLTYPE enmOutType, const char *pszFilename);
     199
     200
     201/**
     202 * Dumps the given ACPI table to a memory buffer allocated with RTMemAlloc() and returns the pointer
     203 * to the allocated memory.
     204 *
     205 * @returns IPRT status code.
     206 * @param   hAcpiTbl            The ACPI table handle.
     207 * @param   enmOutType          The output type.
     208 * @param   ppbAcpiTbl          Where to store the pointer to the ACPI table on success.
     209 * @param   pcbAcpiTbl          Where to store the size of the ACPI table in bytes on success.
     210 *
     211 * @note The caller has to free the buffer with RTMemFree().
     212 */
     213RTDECL(int) RTAcpiTblDumpToBufferA(RTACPITBL hAcpiTbl, RTACPITBLTYPE enmOutType, uint8_t **ppbAcpiTbl, size_t *pcbAcpiTbl);
    199214
    200215
  • trunk/include/iprt/mangling.h

    r108095 r108131  
    400400# define RTAcpiTblDeviceStartF                          RT_MANGLER(RTAcpiTblDeviceStartF)
    401401# define RTAcpiTblDeviceStartV                          RT_MANGLER(RTAcpiTblDeviceStartV)
     402# define RTAcpiTblDumpToBufferA                         RT_MANGLER(RTAcpiTblDumpToBufferA)
    402403# define RTAcpiTblDumpToFile                            RT_MANGLER(RTAcpiTblDumpToFile)
    403404# define RTAcpiTblDumpToVfsIoStrm                       RT_MANGLER(RTAcpiTblDumpToVfsIoStrm)
  • trunk/src/VBox/Runtime/common/acpi/acpi.cpp

    r108095 r108131  
    778778
    779779
     780RTDECL(int) RTAcpiTblDumpToBufferA(RTACPITBL hAcpiTbl, RTACPITBLTYPE enmOutType, uint8_t **ppbAcpiTbl, size_t *pcbAcpiTbl)
     781{
     782    PRTACPITBLINT pThis = hAcpiTbl;
     783    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     784    AssertPtrReturn(ppbAcpiTbl, VERR_INVALID_POINTER);
     785    AssertPtrReturn(pcbAcpiTbl, VERR_INVALID_POINTER);
     786    AssertRCReturn(pThis->rcErr, 0);
     787    AssertReturn(pThis->fFinalized, VERR_INVALID_STATE);
     788    AssertReturn(enmOutType == RTACPITBLTYPE_AML, VERR_NOT_SUPPORTED);
     789
     790    *ppbAcpiTbl = (uint8_t *)RTMemDup(pThis->pbTblBuf, pThis->paPkgStack[0].cbPkg);
     791    *pcbAcpiTbl = pThis->paPkgStack[0].cbPkg;
     792    return *ppbAcpiTbl != NULL ? VINF_SUCCESS : VERR_NO_MEMORY;
     793}
     794
     795
    780796RTDECL(int) RTAcpiTblScopeFinalize(RTACPITBL hAcpiTbl)
    781797{
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