summaryrefslogtreecommitdiff
path: root/kernel/include/hilbert
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-07-27 16:57:39 -0400
committerBenji Dial <benji@benjidial.net>2024-07-27 16:57:39 -0400
commitfbfc078e9f44c1c1e95c9c484f1d5650bcf631b7 (patch)
treecab539c8cbbac81d895b6f8be695f3f53bf8f4d5 /kernel/include/hilbert
parent9af5588c30c4126a2800aae1afcb0de2c373dc6c (diff)
downloadhilbert-os-fbfc078e9f44c1c1e95c9c484f1d5650bcf631b7.tar.gz
lots and lots of userspace stuff
Diffstat (limited to 'kernel/include/hilbert')
-rw-r--r--kernel/include/hilbert/kernel/application.hpp13
-rw-r--r--kernel/include/hilbert/kernel/panic.hpp2
-rw-r--r--kernel/include/hilbert/kernel/utility.hpp4
3 files changed, 12 insertions, 7 deletions
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 <class t>