arm64, powerpc: fix calculation of 'used' in GET_STACK_USAGE
We do not consider the space reserved for the pcb to be part of the total kstack size, so it should not be included in the calculation of the used stack size. MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
8bc792b384
commit
b02908b051
@ -62,9 +62,7 @@ struct syscall_args {
|
||||
#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; \
|
||||
(used) = td->td_kstack + (total) - (vm_offset_t)&td; \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
@ -75,9 +75,7 @@ struct syscall_args {
|
||||
#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; \
|
||||
(used) = td->td_kstack + (total) - (vm_offset_t)&td; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user