40#ifndef THD_STACK_ALIGNMENT
42#define THD_STACK_ALIGNMENT 8
47#define THD_STACK_SIZE 32768
50#ifndef THD_KERNEL_STACK_SIZE
52#define THD_KERNEL_STACK_SIZE (64 * 1024)
63 __asm__ __volatile__(
"sts pr,%0\n" :
"=r"(pr));
79 register uintptr_t fp __asm__(
"r14");
91 return *(uintptr_t *)fptr;
116 uintptr_t *next_sp_out);
Various common macros used throughout the codebase.
static __always_inline uintptr_t arch_get_fptr(void)
DC specific "function" to get the frame pointer from the current function.
Definition stack.h:78
void arch_stk_trace_at(uintptr_t sp, size_t n)
Do a stack trace from the given stack pointer.
static uintptr_t arch_fptr_ret_addr(uintptr_t fptr)
Pass in a frame pointer value to get the return address for the given frame.
Definition stack.h:90
bool arch_stk_unwind_step(uintptr_t sp, uintptr_t *ret_addr_out, uintptr_t *next_sp_out)
Find the next return address by scanning the stack.
static __always_inline uintptr_t arch_get_ret_addr(void)
DC specific "function" to get the return address from the current function.
Definition stack.h:60
void arch_stk_trace(int n)
Do a stack trace from the current function.
static uintptr_t arch_fptr_next(uintptr_t fptr)
Pass in a frame pointer value to get the previous frame pointer for the given frame.
Definition stack.h:100
void arch_stk_setup(kthread_t *nt)
Set up new stack before running.
Structure describing one running thread.
Definition thread.h:168