diff options
-rw-r--r-- | sys/sparc64/include/proc.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/sparc64/include/proc.h b/sys/sparc64/include/proc.h index 006fcfa..4b5e1c9 100644 --- a/sys/sparc64/include/proc.h +++ b/sys/sparc64/include/proc.h @@ -55,6 +55,17 @@ struct mdproc { #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; |