diff options
-rw-r--r-- | sys/powerpc/include/proc.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/powerpc/include/proc.h b/sys/powerpc/include/proc.h index 627fbf2..4981581 100644 --- a/sys/powerpc/include/proc.h +++ b/sys/powerpc/include/proc.h @@ -54,6 +54,18 @@ struct mdproc { #endif #ifdef _KERNEL + +#include <machine/pcb.h> + +/* Get the current kernel thread stack usage. */ +#define GET_STACK_USAGE(total, used) do { \ + struct thread *td = curthread; \ + (total) = td->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb); \ + (used) = (char *)td->td_kstack + \ + td->td_kstack_pages * PAGE_SIZE - \ + (char *)&td; \ +} while (0) + struct syscall_args { u_int code; struct sysent *callp; |