15    stack->top = maxAddress;
 
   29    stack->lastPageFault = 0;
 
 
   52    stack->lastPageFault = 0;
 
 
   71    stack->guardBottom = 0;
 
   72    stack->lastPageFault = 0;
 
 
   85    stack->guardBottom = 0;
 
   86    stack->lastPageFault = 0;
 
 
  102    return addr >= 
stack->bottom && endAddr < 
stack->top;
 
 
  118    return !(endAddr <= 
stack->guardBottom || addr >= 
stack->guardTop);
 
 
void stack_pointer_deinit_buffer(stack_pointer_t *stack)
Deinitializes a stack pointer structure that was initialized using stack_pointer_init_buffer().
#define STACK_POINTER_GUARD_PAGES
The amount of guard pages to use for stacks.
uint64_t stack_pointer_init_buffer(stack_pointer_t *stack, void *buffer, uint64_t pages)
Initializes a stack pointer structure using a provided buffer, does not allocate or map any memory.
void stack_pointer_deinit(stack_pointer_t *stack, thread_t *thread)
Deinitializes a stack pointer structure and unmaps any mapped memory.
bool stack_pointer_overlaps_guard(stack_pointer_t *stack, uintptr_t addr, uint64_t length)
Check if an region overlaps the guard.
uint64_t stack_pointer_init(stack_pointer_t *stack, uintptr_t maxAddress, uint64_t maxPages)
Initializes a stack pointer structure, does not allocate or map any memory.
bool stack_pointer_is_in_stack(stack_pointer_t *stack, uintptr_t addr, uint64_t length)
Check if an region is within the stack.
#define VMM_IS_PAGE_ALIGNED(addr)
Check if an address is page aligned.
uint64_t vmm_unmap(space_t *space, void *virtAddr, uint64_t length)
Unmaps virtual memory from a given address space.
#define EINVAL
Invalid argument.
#define EOVERFLOW
Value too large for defined data type.
#define errno
Error number variable.
#define PAGE_SIZE
Memory page size.
#define BYTES_TO_PAGES(amount)
Convert bytes to pages.
#define NULL
Pointer error value.
#define ERR
Integer error value.
EFI_PHYSICAL_ADDRESS buffer
__UINTPTR_TYPE__ uintptr_t
_PUBLIC void * memset(void *s, int c, size_t n)
Structure to define a stack in memory.
Thread of execution structure.
process_t * process
The parent process that the thread executes within.