aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-02-14 11:19:41 -0500
committerIan Moffett <ian@osmora.org>2024-02-14 11:19:41 -0500
commit34d83987c18df3e06db1528423841376072bb627 (patch)
tree4c2f3d2a8573b9b7ebc2364aeb68b40fc8919747 /sys/kern/init_main.c
parent04144bdc723f253116a777a22ac074dac6150c59 (diff)
kernel: Add __TRY_CALL() macro
This commit adds a macro to make testing if weak functions are implemented, then running them, less messy. This allows you to do so in one line. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index a5d7577..2666b5e 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -76,7 +76,7 @@ main(void)
{
struct cpu_info *ci;
- pre_init();
+ __TRY_CALL(pre_init);
tty_init();
syslog_init();
PRINT_LOGO();
@@ -86,18 +86,13 @@ main(void)
HYRA_BUILDBRANCH);
acpi_init();
-
- if (chips_init == NULL) {
- chips_init();
- }
+ __TRY_CALL(chips_init);
processor_init();
list_timers();
ci = this_cpu();
- if (ap_bootstrap != NULL) {
- ap_bootstrap(ci);
- }
+ __TRY_CALL(ap_bootstrap, ci);
sched_init_processor(ci);
__builtin_unreachable();