svn commit: r265762 - projects/arm64/sys/arm64/arm64

Andrew Turner andrew at FreeBSD.org
Fri May 9 09:06:20 UTC 2014


Author: andrew
Date: Fri May  9 09:06:19 2014
New Revision: 265762
URL: http://svnweb.freebsd.org/changeset/base/265762

Log:
  More early initialisation.

Modified:
  projects/arm64/sys/arm64/arm64/machdep.c

Modified: projects/arm64/sys/arm64/arm64/machdep.c
==============================================================================
--- projects/arm64/sys/arm64/arm64/machdep.c	Fri May  9 09:02:29 2014	(r265761)
+++ projects/arm64/sys/arm64/arm64/machdep.c	Fri May  9 09:06:19 2014	(r265762)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/cpu.h>
 #include <sys/efi.h>
 #include <sys/imgact.h>
+#include <sys/kdb.h> 
 #include <sys/linker.h>
 #include <sys/pcpu.h>
 #include <sys/proc.h>
@@ -55,6 +56,8 @@ __FBSDID("$FreeBSD$");
 struct pcpu __pcpu[MAXCPU];
 struct pcpu *pcpup = &__pcpu[0];
 
+static struct trapframe proc0_tf;
+
 vm_paddr_t phys_avail[PHYS_AVAIL_SIZE];
 
 int cold = 1;
@@ -279,6 +282,17 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, 
 	panic("sendsig");
 }
 
+static void
+init_proc0(vm_offset_t kstack)
+{
+	proc_linkup0(&proc0, &thread0);
+	thread0.td_kstack = kstack;
+	thread0.td_pcb = (struct pcb *)
+	   (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1;
+	thread0.td_frame = &proc0_tf;
+	pcpup->pc_curpcb = thread0.td_pcb;
+}
+
 #ifdef EARLY_PRINTF
 static void 
 foundation_early_putc(int c)
@@ -499,10 +513,18 @@ initarm(struct arm64_bootparams *abp)
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
 	PCPU_SET(curthread, &thread0);
 
+	/* Do basic tuning, hz etc */
+	init_param1();
+
 	/* Bootstrap enough of pmap  to enter the kernel proper */
 	pmap_bootstrap(abp->kern_l1pt, KERNBASE - abp->kern_delta,
 	    lastaddr - KERNBASE);
 
+	init_proc0(abp->kern_stack);
+	mutex_init();
+	init_param2(physmem);
+	kdb_init();
+
 	printf("End initarm\n");
 }
 


More information about the svn-src-projects mailing list