summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-03-12 16:36:48 +0100
committerJustus Winter <justus@gnupg.org>2017-03-18 16:24:59 +0100
commit146c35ddf493623561c261795610a9b5573834fd (patch)
tree497cebc3e48b917eb1b2faf263520be014e29009
parent25f22702f153d62b55cb276152ba5ea935023e6e (diff)
kern: Make kernel task available to bootscript.
* kern/bootstrap.c (bootstrap_create): Insert the variable 'kernel-task' into the bootscript environment. Userspace can use this instead of guessing based on the order of the first tasks.
-rw-r--r--kern/bootstrap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index 7398ea44..c21d3b1c 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -180,6 +180,12 @@ void bootstrap_create(void)
if (losers)
panic ("cannot set boot-script variable device-port: %s",
boot_script_error_string (losers));
+ losers = boot_script_set_variable
+ ("kernel-task", VAL_PORT,
+ (long) kernel_task->itk_self);
+ if (losers)
+ panic ("cannot set boot-script variable kernel-task: %s",
+ boot_script_error_string (losers));
losers = boot_script_set_variable ("kernel-command-line", VAL_STR,
(long) kernel_cmdline);