mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
i386: take pcb and fpu area into account in GET_STACK_USAGE
On this platform, the pcb and FPU save area are allocated from the top of each kernel stack, so they should be excluded from the calculation of the total and used stack sizes. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32581
This commit is contained in:
parent
b394e16ef0
commit
8bc792b384
1 changed files with 4 additions and 4 deletions
|
|
@ -71,13 +71,13 @@ struct syscall_args {
|
|||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#include <machine/md_var.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; \
|
||||
(used) = (char *)td->td_kstack + \
|
||||
td->td_kstack_pages * PAGE_SIZE - \
|
||||
(char *)&td; \
|
||||
(total) = (vm_offset_t)get_pcb_td(td) - td->td_kstack; \
|
||||
(used) = (vm_offset_t)get_pcb_td(td) - (vm_offset_t)&td; \
|
||||
} while (0)
|
||||
|
||||
void set_user_ldt(struct mdproc *);
|
||||
|
|
|
|||
Loading…
Reference in a new issue