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:
John Baldwin
2026-04-27 15:05:54 -04:00
parent 8b9023cfc1
commit dcae0f7d7a
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)