| 33 | #if defined (_KERNEL) && defined(__linux__) |
| 34 | #include <asm/current.h> |
| 35 | static intptr_t stack_remaining(void) { |
| 36 | intptr_t local; |
| 37 | local = (intptr_t)&local - (intptr_t)current->stack; |
| 38 | return local; |
| 39 | } |
| 40 | #elif defined (_KERNEL) && defined(__FreeBSD__) |
| 41 | #include <sys/pcpu.h> |
| 42 | static intptr_t stack_remaining(void) { |