Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/machdep.c
Show First 20 Lines • Show All 573 Lines • ▼ Show 20 Lines | |||||
#ifdef VFP | #ifdef VFP | ||||
vfp_reset_state(td, pcb); | vfp_reset_state(td, pcb); | ||||
#endif | #endif | ||||
/* | /* | ||||
* Clear debug register state. It is not applicable to the new process. | * Clear debug register state. It is not applicable to the new process. | ||||
*/ | */ | ||||
bzero(&pcb->pcb_dbg_regs, sizeof(pcb->pcb_dbg_regs)); | bzero(&pcb->pcb_dbg_regs, sizeof(pcb->pcb_dbg_regs)); | ||||
/* Generate new pointer authentication keys */ | |||||
ptrauth_exec(td); | |||||
} | } | ||||
/* Sanity check these are the same size, they will be memcpy'd to and fro */ | /* Sanity check these are the same size, they will be memcpy'd to and fro */ | ||||
CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == | CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == | ||||
sizeof((struct gpregs *)0)->gp_x); | sizeof((struct gpregs *)0)->gp_x); | ||||
CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == | CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == | ||||
sizeof((struct reg *)0)->x); | sizeof((struct reg *)0)->x); | ||||
▲ Show 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | init_proc0(vm_offset_t kstack) | ||||
thread0.td_kstack = kstack; | thread0.td_kstack = kstack; | ||||
thread0.td_kstack_pages = KSTACK_PAGES; | thread0.td_kstack_pages = KSTACK_PAGES; | ||||
thread0.td_pcb = (struct pcb *)(thread0.td_kstack + | thread0.td_pcb = (struct pcb *)(thread0.td_kstack + | ||||
thread0.td_kstack_pages * PAGE_SIZE) - 1; | thread0.td_kstack_pages * PAGE_SIZE) - 1; | ||||
thread0.td_pcb->pcb_fpflags = 0; | thread0.td_pcb->pcb_fpflags = 0; | ||||
thread0.td_pcb->pcb_fpusaved = &thread0.td_pcb->pcb_fpustate; | thread0.td_pcb->pcb_fpusaved = &thread0.td_pcb->pcb_fpustate; | ||||
thread0.td_pcb->pcb_vfpcpu = UINT_MAX; | thread0.td_pcb->pcb_vfpcpu = UINT_MAX; | ||||
thread0.td_frame = &proc0_tf; | thread0.td_frame = &proc0_tf; | ||||
ptrauth_thread0(&thread0); | |||||
pcpup->pc_curpcb = thread0.td_pcb; | pcpup->pc_curpcb = thread0.td_pcb; | ||||
} | } | ||||
typedef struct { | typedef struct { | ||||
uint32_t type; | uint32_t type; | ||||
uint64_t phys_start; | uint64_t phys_start; | ||||
uint64_t virt_start; | uint64_t virt_start; | ||||
uint64_t num_pages; | uint64_t num_pages; | ||||
▲ Show 20 Lines • Show All 398 Lines • ▼ Show 20 Lines | #endif | ||||
cninit(); | cninit(); | ||||
set_ttbr0(abp->kern_ttbr0); | set_ttbr0(abp->kern_ttbr0); | ||||
cpu_tlb_flushID(); | cpu_tlb_flushID(); | ||||
if (!valid) | if (!valid) | ||||
panic("Invalid bus configuration: %s", | panic("Invalid bus configuration: %s", | ||||
kern_getenv("kern.cfg.order")); | kern_getenv("kern.cfg.order")); | ||||
/* | |||||
* Check if pointer authentication is available on this system, and | |||||
* if so enable its use. This needs to be called before init_proc0 | |||||
* as that will configure the thread0 pointer authentication keys. | |||||
*/ | |||||
ptrauth_init(); | |||||
/* | /* | ||||
* Dump the boot metadata. We have to wait for cninit() since console | * Dump the boot metadata. We have to wait for cninit() since console | ||||
* output is required. If it's grossly incorrect the kernel will never | * output is required. If it's grossly incorrect the kernel will never | ||||
* make it this far. | * make it this far. | ||||
*/ | */ | ||||
if (getenv_is_true("debug.dump_modinfo_at_boot")) | if (getenv_is_true("debug.dump_modinfo_at_boot")) | ||||
preload_dump(); | preload_dump(); | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |