Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement GET_STACK_USAGE() on PowerPC. This implementation is identical

to that on x86 and sparc64.

Approved by:	re (kib)
  • Loading branch information...
commit 3f1d7fea0ef65364bd48c79e15a8adb62926b908 1 parent 8ff2d52
nwhitehorn authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 sys/powerpc/include/proc.h
12 sys/powerpc/include/proc.h
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.