aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2026-04-27 19:05:54 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2026-05-27 13:45:26 +0000
commitdcae0f7d7aa67ed6ec6b8da5e1b444a828898595 (patch)
treec7b1089f4f03bfa1e7084eafc159e287c608b887 /sys/amd64
parent8b9023cfc1851a18518111d286ebd59b573008c1 (diff)
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/machdep.c2
-rw-r--r--sys/amd64/include/stack.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 510c6d375a2d..dbad85096a1d 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -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;
diff --git a/sys/amd64/include/stack.h b/sys/amd64/include/stack.h
index 765a8e78daed..7d821348be0e 100644
--- a/sys/amd64/include/stack.h
+++ b/sys/amd64/include/stack.h
@@ -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)