diff options
author | marius <marius@FreeBSD.org> | 2013-09-29 13:09:25 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2013-09-29 13:09:25 +0000 |
commit | fe39ca00e6754caf3b1302fc7fb2a1e4521c9339 (patch) | |
tree | d6d4f42f07b5dda30be52d55f868cdff3adbd1b2 /sys/sparc64 | |
parent | 974f9452c8413133f0270ec632b7e925c1a66d9f (diff) | |
download | FreeBSD-src-fe39ca00e6754caf3b1302fc7fb2a1e4521c9339.zip FreeBSD-src-fe39ca00e6754caf3b1302fc7fb2a1e4521c9339.tar.gz |
Implement GET_STACK_USAGE.
Discussed with: mav
Approved by: re (kib)
MFC after: 1 week
Diffstat (limited to 'sys/sparc64')
-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; |