Implement GET_STACK_USAGE() on PowerPC. This implementation is identical

to that on x86 and sparc64.

Approved by:	re (kib)
This commit is contained in:
Nathan Whitehorn 2013-10-02 20:40:21 +00:00
parent 8298c17c6c
commit a5ff1d66de

View File

@ -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;