MyOS Kernel
|
#include "../../tasking.h"
#include "../paging.h"
#include "../tasking_helpers.h"
#include "../../pmem.h"
#include <stddef.h>
#include <stdint.h>
Functions | |
static char | is_kstack_allocated (size_t index) |
static void | mark_kstack_allocated (size_t index) |
static int | new_kstack () |
void | setup_kstack (Thread *thread, void *param1, void *param2, char kmode, void *eip) |
void | free_kstack (void *stack_ptr) |
Variables | |
static void ** | kstacks =(void*)0xC8000000 |
Pointer to all the thread kernel stacks. | |
static char | kstack_bmap [(218 *1024)/8] ={0} |
Bitmap of what kernel stacks have been allocated. | |
void free_kstack | ( | void * | stack_ptr | ) |
Frees a kernel stack so it can be used again
stack_ptr | The kernel stack to free |
|
static |
Check whether a kernel stack is allocated
index | The kernel stack to check |
|
static |
Mark that a kernel stack is allocated
index | The kernel stack to mark |
|
static |
Allocate a kernel stack for a thread
void setup_kstack | ( | Thread * | thread, |
void * | param1, | ||
void * | param2, | ||
char | kmode, | ||
void * | eip | ||
) |
Setup a kernel stack for a thread
thread | The thread to setup a stack for |
param1 | The thread's start function first parameter |
param2 | The thread's start function second parameter |
kmode | Whether the thread is a kernel mode thread |
eip | The start address of the thread |