]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/common: Add `dtb` field `bootinfo` structure
authorSergiu Moga <sergiu.moga@protonmail.com>
Wed, 5 Apr 2023 10:16:14 +0000 (13:16 +0300)
committerUnikraft <monkey@unikraft.io>
Fri, 11 Aug 2023 10:18:44 +0000 (10:18 +0000)
Add a pointer to the devicetree blob's address. Since it is a
frequently accessed resource, it comes in handy to be able to
quickly have access to it.

Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #848

plat/common/include/uk/plat/common/bootinfo.h
support/scripts/mkbootinfo.py

index b19c314962db08bd76cef4ff2a99d4170425fb25..3d9656e88ce5ead5e69ff067be086c27e0adf634 100644 (file)
@@ -36,6 +36,9 @@ struct ukplat_bootinfo {
        /** Size of the kernel command-line without the null terminator */
        __u64 cmdline_len;
 
+       /** Address of the devicetree blob */
+       __u64 dtb;
+
        /**
         * List of memory regions. Must be the last member as the
         * memory regions directly follow this boot information structure
@@ -43,7 +46,7 @@ struct ukplat_bootinfo {
        struct ukplat_memregion_list mrds;
 } __packed __align(__SIZEOF_LONG__);
 
-UK_CTASSERT(sizeof(struct ukplat_bootinfo) == 64);
+UK_CTASSERT(sizeof(struct ukplat_bootinfo) == 72);
 
 #ifdef CONFIG_UKPLAT_MEMRNAME
 #if __SIZEOF_LONG__ == 8
index e1834c5e489870d58a3cc22dbb3c29af8ded1f30..e57347bef0fd92e4be0b74fcd7e0ac372f885883 100755 (executable)
@@ -23,7 +23,7 @@ UKPLAT_MEMRF_EXECUTE    = 0x0004   # Region is executable
 UKPLAT_MEMR_NAME_LEN    = 36
 
 # Boot info structure (see include/uk/plat/common/bootinfo.h)
-UKPLAT_BOOTINFO_SIZE    = 64
+UKPLAT_BOOTINFO_SIZE    = 72
 
 UKPLAT_BOOTINFO_MAGIC   = 0xB007B0B0 # Boot Bobo
 UKPLAT_BOOTINFO_VERSION = 0x01
@@ -95,6 +95,7 @@ def main():
         secobj.write(b'\0' * 16) # bootprotocol
         secobj.write(b'\0' * 8) # cmdline
         secobj.write(b'\0' * 8) # cmdline_len
+        secobj.write(b'\0' * 8) # dtb
         secobj.write(cap.to_bytes(4, endianness)) # mrds.capacity
         secobj.write(b'\0' * 4) # mrds.count