Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm/arm/machdep.c
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
#include <sys/cpu.h> | #include <sys/cpu.h> | ||||
#include <sys/devmap.h> | #include <sys/devmap.h> | ||||
#include <sys/efi.h> | #include <sys/efi.h> | ||||
#include <sys/imgact.h> | #include <sys/imgact.h> | ||||
#include <sys/kdb.h> | #include <sys/kdb.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/linker.h> | #include <sys/linker.h> | ||||
#include <sys/msgbuf.h> | #include <sys/msgbuf.h> | ||||
#include <sys/reboot.h> | |||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/sched.h> | #include <sys/sched.h> | ||||
#include <sys/syscallsubr.h> | #include <sys/syscallsubr.h> | ||||
#include <sys/sysent.h> | #include <sys/sysent.h> | ||||
#include <sys/sysproto.h> | #include <sys/sysproto.h> | ||||
#include <sys/vmmeter.h> | #include <sys/vmmeter.h> | ||||
#include <vm/vm_object.h> | #include <vm/vm_object.h> | ||||
▲ Show 20 Lines • Show All 703 Lines • ▼ Show 20 Lines | set_stackptr(PSR_IRQ32_MODE, | ||||
irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); | irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); | ||||
set_stackptr(PSR_ABT32_MODE, | set_stackptr(PSR_ABT32_MODE, | ||||
abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); | abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); | ||||
set_stackptr(PSR_UND32_MODE, | set_stackptr(PSR_UND32_MODE, | ||||
undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); | undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); | ||||
} | } | ||||
#endif | #endif | ||||
static void | |||||
arm_kdb_init(void) | |||||
{ | |||||
kdb_init(); | |||||
#ifdef KDB | |||||
if (boothowto & RB_KDB) | |||||
kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); | |||||
#endif | |||||
} | |||||
#ifdef FDT | #ifdef FDT | ||||
#if __ARM_ARCH < 6 | #if __ARM_ARCH < 6 | ||||
void * | void * | ||||
initarm(struct arm_boot_params *abp) | initarm(struct arm_boot_params *abp) | ||||
{ | { | ||||
struct mem_region mem_regions[FDT_MEM_REGIONS]; | struct mem_region mem_regions[FDT_MEM_REGIONS]; | ||||
struct pv_addr kernel_l1pt; | struct pv_addr kernel_l1pt; | ||||
struct pv_addr dpcpu; | struct pv_addr dpcpu; | ||||
▲ Show 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | #define alloc_pages(var, np) \ | ||||
* Prepare the list of physical memory available to the vm subsystem. | * Prepare the list of physical memory available to the vm subsystem. | ||||
*/ | */ | ||||
arm_physmem_exclude_region(abp->abp_physaddr, | arm_physmem_exclude_region(abp->abp_physaddr, | ||||
(virtual_avail - KERNVIRTADDR), EXFLAG_NOALLOC); | (virtual_avail - KERNVIRTADDR), EXFLAG_NOALLOC); | ||||
arm_physmem_init_kernel_globals(); | arm_physmem_init_kernel_globals(); | ||||
init_param2(physmem); | init_param2(physmem); | ||||
dbg_monitor_init(); | dbg_monitor_init(); | ||||
kdb_init(); | arm_kdb_init(); | ||||
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - | return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - | ||||
sizeof(struct pcb))); | sizeof(struct pcb))); | ||||
} | } | ||||
#else /* __ARM_ARCH < 6 */ | #else /* __ARM_ARCH < 6 */ | ||||
void * | void * | ||||
initarm(struct arm_boot_params *abp) | initarm(struct arm_boot_params *abp) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | #endif | ||||
arm_physmem_exclude_region(abp->abp_physaddr, | arm_physmem_exclude_region(abp->abp_physaddr, | ||||
pmap_preboot_get_pages(0) - abp->abp_physaddr, EXFLAG_NOALLOC); | pmap_preboot_get_pages(0) - abp->abp_physaddr, EXFLAG_NOALLOC); | ||||
arm_physmem_init_kernel_globals(); | arm_physmem_init_kernel_globals(); | ||||
init_param2(physmem); | init_param2(physmem); | ||||
/* Init message buffer. */ | /* Init message buffer. */ | ||||
msgbufinit(msgbufp, msgbufsize); | msgbufinit(msgbufp, msgbufsize); | ||||
dbg_monitor_init(); | dbg_monitor_init(); | ||||
kdb_init(); | arm_kdb_init(); | ||||
/* Apply possible BP hardening. */ | /* Apply possible BP hardening. */ | ||||
cpuinfo_init_bp_hardening(); | cpuinfo_init_bp_hardening(); | ||||
return ((void *)STACKALIGN(thread0.td_pcb)); | return ((void *)STACKALIGN(thread0.td_pcb)); | ||||
} | } | ||||
#endif /* __ARM_ARCH < 6 */ | #endif /* __ARM_ARCH < 6 */ | ||||
#endif /* FDT */ | #endif /* FDT */ |