Simplify AT_SEL4_BOOT_INFO environment handling.
The runtime environment setup was setting bootinfo, ipc_buffer, and
the thread tcb when processing AT_SEL4_BOOT_INFO. Instead set only the
bootinfo reference and require the caller pass AT_SEL4_IPC_BUFFER and
AT_SEL4_TCB to setup the other data.
Change-Id: I06e01ff7e600318bc428f7506c38413aa1893019
diff --git a/src/env.c b/src/env.c
index ed627f8..f00bf61 100644
--- a/src/env.c
+++ b/src/env.c
@@ -302,13 +302,7 @@
break;
}
case AT_SEL4_BOOT_INFO: {
- seL4_BootInfo *bootinfo = auxv[i].a_un.a_ptr;
- if (bootinfo == SEL4RUNTIME_NULL) {
- break;
- }
- env.bootinfo = bootinfo;
- env.initial_thread_ipc_buffer = bootinfo->ipcBuffer;
- env.initial_thread_tcb = seL4_CapInitThreadTCB;
+ env.bootinfo = auxv[i].a_un.a_ptr;
break;
}
case AT_SEL4_IPC_BUFFER_PTR: {
diff --git a/src/start_root.c b/src/start_root.c
index fe6aa39..374d7f5 100644
--- a/src/start_root.c
+++ b/src/start_root.c
@@ -58,7 +58,7 @@
struct {
char const *const argv[2];
char const *const envp[2];
- auxv_t auxv[7];
+ auxv_t auxv[8];
} info = {
.argv = {
"rootserver",
@@ -85,6 +85,9 @@
.a_type = AT_SEL4_BOOT_INFO,
.a_un.a_ptr = boot_info,
}, {
+ .a_type = AT_SEL4_IPC_BUFFER_PTR,
+ .a_un.a_ptr = boot_info->ipcBuffer,
+ }, {
.a_type = AT_SEL4_TCB,
.a_un.a_val = seL4_CapInitThreadTCB,
}, {