summaryrefslogtreecommitdiff
path: root/kernel/include
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include')
-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>