[kernel] Add userspace threading
Implement the syscalls necessary for threads to create other threads in their same process. This involved rearranging a number of syscalls, as well as implementing object_wait and a basic implementation of a process' list of handles.
This commit is contained in:
@@ -6,8 +6,13 @@
|
||||
#define j6_signal_no_handles (1ull << 0)
|
||||
|
||||
// Signals 16-47 are defined per-object-type
|
||||
|
||||
// Process signals
|
||||
#define j6_signal_process_exit (1ull << 16)
|
||||
|
||||
// Thread signals
|
||||
#define j6_signal_thread_exit (1ull << 16)
|
||||
|
||||
// Signals 48-63 are user-defined signals
|
||||
#define j6_signal_user0 (1ull << 48)
|
||||
#define j6_signal_user1 (1ull << 49)
|
||||
|
||||
@@ -18,3 +18,5 @@ typedef uint64_t j6_signal_t;
|
||||
|
||||
/// The rights of a handle/capability are a bitmap of 64 possible rights
|
||||
typedef uint64_t j6_rights_t;
|
||||
|
||||
#define j6_handle_invalid 0xffffffff
|
||||
|
||||
@@ -16,9 +16,6 @@ namespace memory {
|
||||
/// Offset from physical where page tables are mapped.
|
||||
constexpr uintptr_t page_offset = 0xffffc00000000000;
|
||||
|
||||
/// Initial process thread's stack address
|
||||
constexpr uintptr_t initial_stack = 0x0000800000000000;
|
||||
|
||||
/// Initial process thread's stack size, in pages
|
||||
constexpr unsigned initial_stack_pages = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user