Kernel/LibC: Allocate thread stacks in userspace

This adds support for pthread function for stack manipulation.

Also keep track of main threads stack in the uthread
This commit is contained in:
2026-07-02 19:43:55 +03:00
parent 7bdd9d19d0
commit 0dc74beb0f
5 changed files with 51 additions and 25 deletions

View File

@@ -16,6 +16,7 @@ typedef struct
int schedpolicy;
int detachstate;
int scope;
void* stackaddr;
size_t stacksize;
size_t guardsize;
} pthread_attr_t;

View File

@@ -49,6 +49,7 @@ struct uthread
pid_t id;
pthread_attr_t attr;
int errno_;
int libc_owns_stack;
int cancel_type;
int cancel_state;
volatile int canceled;