Index: head/sys/arm64/include/proc.h =================================================================== --- head/sys/arm64/include/proc.h +++ head/sys/arm64/include/proc.h @@ -54,4 +54,18 @@ int narg; }; +#ifdef _KERNEL + +#include + +#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) + +#endif + #endif /* !_MACHINE_PROC_H_ */