amd64: Inline set_top_of_stack_td into cpu_thread_new_kstack

Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
This commit is contained in:
John Baldwin
2026-05-05 10:43:10 -04:00
parent 2893bb741b
commit f7524d8fcb
3 changed files with 3 additions and 10 deletions
+1 -1
View File
@@ -1369,6 +1369,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
thread0.td_kstack_pages = kstack_pages;
kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE;
bzero(thread0.td_kstack, kstack0_sz);
cpu_thread_new_kstack(&thread0);
physfree += kstack0_sz;
/*
@@ -1521,7 +1522,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
* We initialize the PCB pointer early so that exception
* handlers will work.
*/
set_top_of_stack_td(&thread0);
thread0.td_pcb = get_pcb_td(&thread0);
/*
+2 -8
View File
@@ -83,13 +83,6 @@
_Static_assert(OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf),
"OFFSETOF_MONITORBUF does not correspond with offset of pc_monitorbuf.");
void
set_top_of_stack_td(struct thread *td)
{
td->td_md.md_stack_base = td->td_kstack +
td->td_kstack_pages * PAGE_SIZE;
}
struct savefpu *
get_pcb_user_save_td(struct thread *td)
{
@@ -384,7 +377,8 @@ cpu_thread_alloc(struct thread *td)
void
cpu_thread_new_kstack(struct thread *td)
{
set_top_of_stack_td(td);
td->td_md.md_stack_base = td->td_kstack +
td->td_kstack_pages * PAGE_SIZE;
td->td_frame = (struct trapframe *)td->td_md.md_stack_base - 1;
}
-1
View File
@@ -94,7 +94,6 @@ void gsbase_load_fault(void) __asm(__STRING(gsbase_load_fault));
void fpstate_drop(struct thread *td);
void pagezero(void *addr);
void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist);
void set_top_of_stack_td(struct thread *td);
struct savefpu *get_pcb_user_save_td(struct thread *td);
struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb);
void pci_early_quirks(void);