From fbfc078e9f44c1c1e95c9c484f1d5650bcf631b7 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sat, 27 Jul 2024 16:57:39 -0400 Subject: lots and lots of userspace stuff --- kernel/include/hilbert/kernel/application.hpp | 13 +++++++------ kernel/include/hilbert/kernel/panic.hpp | 2 +- kernel/include/hilbert/kernel/utility.hpp | 4 ++++ 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'kernel/include/hilbert') diff --git a/kernel/include/hilbert/kernel/application.hpp b/kernel/include/hilbert/kernel/application.hpp index 56c2a15..a4b59ff 100644 --- a/kernel/include/hilbert/kernel/application.hpp +++ b/kernel/include/hilbert/kernel/application.hpp @@ -22,7 +22,8 @@ namespace hilbert::kernel::application { socket_listener_closed, other_end_closed, already_exists, - not_sized + not_sized, + not_readable }; struct [[gnu::packed]] cpu_state { @@ -57,10 +58,10 @@ namespace hilbert::kernel::application { class process; class thread; - class file_stream; - class socket; - class socket_stream_end; - class socket_listener; + struct file_stream; + struct socket; + struct socket_stream_end; + struct socket_listener; struct generic_stream_ptr { bool is_socket; @@ -93,7 +94,7 @@ namespace hilbert::kernel::application { //saves running thread state, and switches to new task. when the thread is //resumed, returns to caller. - extern "C" void yield(); + extern "C" void yield(cpu_state &save_state_into); extern "C" [[noreturn]] void resume_next_thread(); diff --git a/kernel/include/hilbert/kernel/panic.hpp b/kernel/include/hilbert/kernel/panic.hpp index 0478142..3aadddb 100644 --- a/kernel/include/hilbert/kernel/panic.hpp +++ b/kernel/include/hilbert/kernel/panic.hpp @@ -1,5 +1,5 @@ #pragma once namespace hilbert::kernel { - [[noreturn]] void panic(uint32_t code); + extern "C" [[noreturn]] void panic(uint32_t code); } diff --git a/kernel/include/hilbert/kernel/utility.hpp b/kernel/include/hilbert/kernel/utility.hpp index 0247fee..b7f1a1b 100644 --- a/kernel/include/hilbert/kernel/utility.hpp +++ b/kernel/include/hilbert/kernel/utility.hpp @@ -381,6 +381,10 @@ namespace hilbert::kernel::utility { count = written; } + void clear() { + count = 0; + } + }; template -- cgit v1.2.3