Skip to content

Commit 60a929f

Browse files
committed
permit shutting down and rebooting without kernel linking
1 parent 94658af commit 60a929f

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/kernel/kernel.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,6 @@ void os::register_plugin(Plugin delg, const char* name){
8585
plugins.emplace_back(delg, name);
8686
}
8787

88-
extern void __arch_reboot();
89-
void os::reboot() noexcept
90-
{
91-
__arch_reboot();
92-
}
93-
void os::shutdown() noexcept
94-
{
95-
kernel::state().running = false;
96-
}
97-
9888
void kernel::post_start()
9989
{
10090
// Enable timestamps (if present)

src/kernel/os.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <os.hpp>
1818
#include <kernel.hpp>
19+
#include <arch.hpp>
1920

2021
bool os::is_booted() noexcept {
2122
return kernel::is_booted();
@@ -24,6 +25,16 @@ const char* os::arch() noexcept {
2425
return Arch::name;
2526
}
2627

28+
void os::reboot() noexcept
29+
{
30+
__arch_reboot();
31+
}
32+
33+
void os::shutdown() noexcept
34+
{
35+
kernel::state().running = false;
36+
}
37+
2738
os::Panic_action os::panic_action() noexcept {
2839
return kernel::panic_action();
2940
}

test/misc/lest_util/os_mock.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ void kprint(const char* str)
8989
//void os::default_stdout(const char*, size_t) {}
9090
void os::event_loop() {}
9191
void os::halt() noexcept {}
92-
void os::reboot() noexcept {}
9392

9493
void __x86_init_paging(void*){};
9594
namespace x86 {

0 commit comments

Comments
 (0)