Changeset 100023 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- May 31, 2023 8:50:11 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/fdt.cpp
r100022 r100023 442 442 pDump->pbStructs += sizeof(uint32_t); 443 443 pDump->cbLeft -= sizeof(uint32_t); 444 return u32Token; 445 } 446 447 444 return RT_H2BE_U32(u32Token); 445 } 446 447 448 #ifdef LOG_ENABLED 448 449 /** 449 450 * Gets the offset inside the structs block given from the current pointer. … … 453 454 * @param pDump Pointer to the dump state. 454 455 */ 455 DECLINLINE( uint32_t) rtFdtStructsGetOffset(PRTFDTINT pThis, PCRTFDTDTBDUMP pDump)456 DECLINLINE(size_t) rtFdtStructsGetOffset(PRTFDTINT pThis, PCRTFDTDTBDUMP pDump) 456 457 { 457 458 return pThis->DtbHdr.cbDtStruct - pDump->cbLeft - sizeof(uint32_t); 458 459 } 460 #endif 459 461 460 462 … … 619 621 620 622 /** 621 * Dumps a <u32>cell property.623 * Dumps a u32 cell property. 622 624 * 623 625 * @returns IPRT status code. … … 789 791 * 790 792 * @returns IPRT status code. 791 * @param pThis Pointer to the FDT instance.792 793 * @param hVfsIos The VFS I/O stream handle to dump the DTS to. 793 794 * @param pDump The dump state. … … 850 851 /* Skip any NOP tokens. */ 851 852 uint32_t u32Token = rtFdtStructsGetToken(&Dump); 852 while (u32Token == DTB_FDT_TOKEN_NOP _BE)853 while (u32Token == DTB_FDT_TOKEN_NOP) 853 854 u32Token = rtFdtStructsGetToken(&Dump); 854 855 855 856 /* The root node starts with a BEGIN_NODE token. */ 856 if (u32Token != DTB_FDT_TOKEN_BEGIN_NODE _BE)857 if (u32Token != DTB_FDT_TOKEN_BEGIN_NODE) 857 858 return RTErrInfoSetF(pErrInfo, VERR_FDT_DTB_STRUCTS_BLOCK_TOKEN_INVALID, "The structs block doesn't start with the BEGIN_NODE token for the root node: %#RX32", 858 859 RT_BE2H_U32(u32Token)); … … 874 875 uint32_t uNdLvl = 1; 875 876 u32Token = rtFdtStructsGetToken(&Dump); 876 while (u32Token != DTB_FDT_TOKEN_END _BE)877 while (u32Token != DTB_FDT_TOKEN_END) 877 878 { 878 Log4(("rtFdtDumpAsDtsRoot: Token %#RX32 at offset %# RX32\n", RT_BE2H_U32(u32Token), rtFdtStructsGetOffset(pThis, &Dump)));879 Log4(("rtFdtDumpAsDtsRoot: Token %#RX32 at offset %#zx\n", RT_BE2H_U32(u32Token), rtFdtStructsGetOffset(pThis, &Dump))); 879 880 880 881 switch (u32Token) 881 882 { 882 case DTB_FDT_TOKEN_BEGIN_NODE _BE:883 Log3(("rtFdtDumpAsDtsRoot: BEGIN_NODE token at offset %# RX32\n", rtFdtStructsGetOffset(pThis, &Dump)));883 case DTB_FDT_TOKEN_BEGIN_NODE: 884 Log3(("rtFdtDumpAsDtsRoot: BEGIN_NODE token at offset %#zx\n", rtFdtStructsGetOffset(pThis, &Dump))); 884 885 rc = rtFdtStructsDumpNodeAsDts(hVfsIos, &Dump, uNdLvl, pErrInfo); 885 886 if (RT_FAILURE(rc)) … … 888 889 uNdLvl++; 889 890 break; 890 case DTB_FDT_TOKEN_PROPERTY _BE:891 Log3(("rtFdtDumpAsDtsRoot: PROP token at offset %# RX32\n", rtFdtStructsGetOffset(pThis, &Dump)));891 case DTB_FDT_TOKEN_PROPERTY: 892 Log3(("rtFdtDumpAsDtsRoot: PROP token at offset %#zx\n", rtFdtStructsGetOffset(pThis, &Dump))); 892 893 rc = rtFdtStructsDumpPropertyAsDts(pThis, hVfsIos, &Dump, uNdLvl, pErrInfo); 893 894 if (RT_FAILURE(rc)) 894 895 return rc; 895 896 break; 896 case DTB_FDT_TOKEN_NOP _BE:897 Log3(("rtFdtDumpAsDtsRoot: NOP token at offset %# RX32\n", rtFdtStructsGetOffset(pThis, &Dump)));897 case DTB_FDT_TOKEN_NOP: 898 Log3(("rtFdtDumpAsDtsRoot: NOP token at offset %#zx\n", rtFdtStructsGetOffset(pThis, &Dump))); 898 899 break; 899 case DTB_FDT_TOKEN_END_NODE _BE:900 Log3(("rtFdtDumpAsDtsRoot: END_NODE token at offset %# RX32\n", rtFdtStructsGetOffset(pThis, &Dump)));900 case DTB_FDT_TOKEN_END_NODE: 901 Log3(("rtFdtDumpAsDtsRoot: END_NODE token at offset %#zx\n", rtFdtStructsGetOffset(pThis, &Dump))); 901 902 if (!uNdLvl) 902 903 return RTErrInfoSetF(pErrInfo, VERR_FDT_DTB_STRUCTS_BLOCK_PREMATURE_END, … … 916 917 917 918 u32Token = rtFdtStructsGetToken(&Dump); 918 if (u32Token == DTB_FDT_TOKEN_END _BE)919 Log3(("rtFdtDumpAsDtsRoot: END token at offset %# RX32\n", rtFdtStructsGetOffset(pThis, &Dump)));919 if (u32Token == DTB_FDT_TOKEN_END) 920 Log3(("rtFdtDumpAsDtsRoot: END token at offset %#zx\n", rtFdtStructsGetOffset(pThis, &Dump))); 920 921 } 921 922 922 923 /* Need to end on an END token. */ 923 if (u32Token != DTB_FDT_TOKEN_END _BE)924 if (u32Token != DTB_FDT_TOKEN_END) 924 925 return RTErrInfoSetF(pErrInfo, VERR_FDT_DTB_STRUCTS_BLOCK_TOKEN_INVALID, "The structs block doesn't end with an END token (got %#RX32, expected %#RX32)", 925 926 RT_BE2H_U32(u32Token), DTB_FDT_TOKEN_END);
Note:
See TracChangeset
for help on using the changeset viewer.