aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-12-04 17:23:57 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-12-04 17:23:57 +0100
commit22a681a07ab09922435ad0a9f665290a30f6b85b (patch)
tree084fd239e826c8ab03d0d5ade73eac26f05c1e3a /include
parent4c25981400e9d6d7c15df70dac32b6c8819b77a5 (diff)
downloadfbos-22a681a07ab09922435ad0a9f665290a30f6b85b.tar.gz
fbos-22a681a07ab09922435ad0a9f665290a30f6b85b.zip
Pass the hart ID on start_kernel instead
Instead of storing the hard ID as given by the bootloader into a C variable, pass it directly into the 'start_kernel' function since we don't need to tamper the value as originally laid out on the 'a0' register. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/fbos/init.h11
-rw-r--r--include/fbos/printk.h2
2 files changed, 4 insertions, 9 deletions
diff --git a/include/fbos/init.h b/include/fbos/init.h
index f253645..592a7f1 100644
--- a/include/fbos/init.h
+++ b/include/fbos/init.h
@@ -25,11 +25,6 @@
// Instantiated in kernel/main.c
extern atomic32_t hart_lottery;
-// ID of the hart that is running the show.
-//
-// Instantiated in kernel/main.c
-extern uint32_t hart_id;
-
// Tracks the amount of seconds that have elapsed since activating timer
// interrupts.
//
@@ -52,9 +47,9 @@ void setup_interrupts(void);
/*
* This is the main entry point of the kernel after head.S is done. This
- * function can (and will) assume that everything has been reset and that we can
- * start the whole thing.
+ * function expects exactly two arguments, which are exactly the same as they
+ * are passed to the `_start` function in kernel/head.S by the bootloader.
*/
-void start_kernel(void *dtb);
+void start_kernel(uint64_t hart_id, void *dtb);
#endif /* __FBOS_INIT_H */
diff --git a/include/fbos/printk.h b/include/fbos/printk.h
index d6ca71e..d118734 100644
--- a/include/fbos/printk.h
+++ b/include/fbos/printk.h
@@ -13,7 +13,7 @@
extern void die(const char *const message);
// Print the given number as a single digit.
-extern void print_digit(uint32_t digit);
+extern void print_digit(uint64_t digit);
// Print the given message.
extern void printk(const char *const message);