Changeset 101470 in vbox
- Timestamp:
- Oct 17, 2023 10:33:30 AM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 159539
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/fdt.h
r101453 r101470 286 286 287 287 /** 288 * Adds a property with a variable number of u32 items passed as an array. 289 * 290 * @returns IPRT staus code. 291 * @param hFdt The flattened devicetree handle. 292 * @param pszProperty The property name. 293 * @param cCells The number of cells. 294 * @param pau32Cells Pointer to the array of u32 cell data items. 295 */ 296 RTDECL(int) RTFdtNodePropertyAddCellsU32AsArray(RTFDT hFdt, const char *pszProperty, uint32_t cCells, uint32_t *pau32Cells); 297 298 299 /** 288 300 * Adds a property with a variable number of u64 items (each as two 32-bit cells). 289 301 * -
trunk/include/iprt/mangling.h
r101453 r101470 961 961 # define RTFdtNodeFinalize RT_MANGLER(RTFdtNodeFinalize) 962 962 # define RTFdtNodePropertyAddCellsU32 RT_MANGLER(RTFdtNodePropertyAddCellsU32) 963 # define RTFdtNodePropertyAddCellsU32AsArray RT_MANGLER(RTFdtNodePropertyAddCellsU32AsArray) 963 964 # define RTFdtNodePropertyAddCellsU32V RT_MANGLER(RTFdtNodePropertyAddCellsU32V) 964 965 # define RTFdtNodePropertyAddCellsU64 RT_MANGLER(RTFdtNodePropertyAddCellsU64) -
trunk/src/VBox/Runtime/common/misc/fdt.cpp
r101453 r101470 1595 1595 1596 1596 1597 RTDECL(int) RTFdtNodePropertyAddCellsU32AsArray(RTFDT hFdt, const char *pszProperty, uint32_t cCells, uint32_t *pau32Cells) 1598 { 1599 PRTFDTINT pThis = hFdt; 1600 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 1601 1602 /* Insert the property name into the strings block. */ 1603 uint32_t offStr; 1604 int rc = rtFdtStringsInsertString(pThis, pszProperty, &offStr); 1605 if (RT_FAILURE(rc)) 1606 return rc; 1607 1608 uint32_t cbProp = cCells * sizeof(uint32_t) + 3 * sizeof(uint32_t); 1609 1610 rc = rtFdtStructEnsureSpace(pThis, cbProp); 1611 if (RT_FAILURE(rc)) 1612 return rc; 1613 1614 uint32_t *pu32 = (uint32_t *)(pThis->pbStruct + pThis->cbStruct); 1615 *pu32++ = DTB_FDT_TOKEN_PROPERTY_BE; 1616 *pu32++ = RT_H2BE_U32(cCells * sizeof(uint32_t)); 1617 *pu32++ = RT_H2BE_U32(offStr); 1618 for (uint32_t i = 0; i < cCells; i++) 1619 *pu32++ = RT_H2BE_U32(pau32Cells[i]); 1620 1621 pThis->cbStruct += cbProp; 1622 return VINF_SUCCESS; 1623 } 1624 1625 1597 1626 RTDECL(int) RTFdtNodePropertyAddCellsU64(RTFDT hFdt, const char *pszProperty, uint32_t cCells, ...) 1598 1627 {
Note:
See TracChangeset
for help on using the changeset viewer.