sys: Consistently use ptoa() with td_kstack_pages
Suggested by: kib Reviewed by: kib, andrew (arm changes) Sponsored by: AFRL, DARPA Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
This commit is contained in:
@@ -1367,7 +1367,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
|
||||
|
||||
thread0.td_kstack = (char *)physfree - kernphys + KERNSTART;
|
||||
thread0.td_kstack_pages = kstack_pages;
|
||||
kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE;
|
||||
kstack0_sz = ptoa(kstack_pages);
|
||||
bzero(thread0.td_kstack, kstack0_sz);
|
||||
cpu_thread_new_kstack(&thread0);
|
||||
physfree += kstack0_sz;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/* 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; \
|
||||
(total) = ptoa(td->td_kstack_pages); \
|
||||
(used) = td_kstack_top(td) - (char *)&td; \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ void unwind_module_unloaded(struct linker_file *);
|
||||
/* 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); \
|
||||
(total) = ptoa(td->td_kstack_pages) - sizeof(struct pcb); \
|
||||
(used) = td->td_kstack + (total) - (char *)&td; \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ bool unwind_frame(struct thread *, struct unwind_state *);
|
||||
|
||||
#define GET_STACK_USAGE(total, used) do { \
|
||||
struct thread *td = curthread; \
|
||||
(total) = td->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb); \
|
||||
(total) = ptoa(td->td_kstack_pages) - sizeof(struct pcb); \
|
||||
(used) = td->td_kstack + (total) - (char *)&td; \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ extern int end[];
|
||||
/* 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); \
|
||||
(total) = ptoa(td->td_kstack_pages) - sizeof(struct pcb); \
|
||||
(used) = td->td_kstack + (total) - (char *)&td; \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ bool unwind_frame(struct thread *, struct unwind_state *);
|
||||
/* 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); \
|
||||
(total) = ptoa(td->td_kstack_pages) - sizeof(struct pcb); \
|
||||
(used) = td->td_kstack + (total) - (char *)&td; \
|
||||
} while (0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user