Add base code for custom stack length
This commit is contained in:
10
os/process.h
10
os/process.h
@@ -1,3 +1,4 @@
|
||||
#include <stddef.h>
|
||||
#ifndef PROCESS_H
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -7,9 +8,14 @@
|
||||
#define STACK_SIZE 32
|
||||
#define STACK_START(stack) (&stack[STACK_SIZE-1])
|
||||
|
||||
typedef struct {
|
||||
uint32_t stack_size;
|
||||
uint32_t stack[];
|
||||
} ProcessStack;
|
||||
|
||||
typedef struct {
|
||||
int (*entrypoint)();
|
||||
uint32_t stack[STACK_SIZE];
|
||||
ProcessStack* stack;
|
||||
} Process;
|
||||
|
||||
typedef struct {
|
||||
@@ -19,5 +25,7 @@ typedef struct {
|
||||
|
||||
void create_process_table(ProcessTable **table);
|
||||
|
||||
ProcessStack* create_stack(size_t size);
|
||||
|
||||
int create_process(ProcessTable *table, void *entrypoint);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user