Module Name:    src
Committed By:   matt
Date:           Mon Mar  1 23:54:49 UTC 2010

Modified Files:
        src/sys/arch/mips/include [matt-nb5-mips64]: locore.h
        src/sys/arch/mips/mips [matt-nb5-mips64]: cpu_subr.c

Log Message:
Add a chip-dependent hook to locorew which cpu_hatch will call to do some
initialization that can only be done while running on the local CPU.


To generate a diff of this commit:
cvs rdiff -u -r1.78.36.1.2.20 -r1.78.36.1.2.21 \
    src/sys/arch/mips/include/locore.h
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/mips/cpu_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.78.36.1.2.20 src/sys/arch/mips/include/locore.h:1.78.36.1.2.21
--- src/sys/arch/mips/include/locore.h:1.78.36.1.2.20	Mon Mar  1 19:29:41 2010
+++ src/sys/arch/mips/include/locore.h	Mon Mar  1 23:54:49 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.78.36.1.2.20 2010/03/01 19:29:41 matt Exp $ */
+/* $NetBSD: locore.h,v 1.78.36.1.2.21 2010/03/01 23:54:49 matt Exp $ */
 
 /*
  * This file should not be included by MI code!!!
@@ -349,6 +349,7 @@
 	uintptr_t	lsw_setfunc_trampoline;
 	int		(*lsw_send_ipi)(struct cpu_info *, int);
 	void		(*lsw_cpu_offline_md)(void);
+	void		(*lsw_cpu_init)(struct cpu_info *);
 };
 
 struct mips_vmfreelist {

Index: src/sys/arch/mips/mips/cpu_subr.c
diff -u src/sys/arch/mips/mips/cpu_subr.c:1.1.2.2 src/sys/arch/mips/mips/cpu_subr.c:1.1.2.3
--- src/sys/arch/mips/mips/cpu_subr.c:1.1.2.2	Mon Mar  1 19:29:41 2010
+++ src/sys/arch/mips/mips/cpu_subr.c	Mon Mar  1 23:54:49 2010
@@ -32,7 +32,7 @@
 #include "opt_multiprocessor.h"
 #include "opt_sa.h"
 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.1.2.2 2010/03/01 19:29:41 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.1.2.3 2010/03/01 23:54:49 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -600,6 +600,12 @@
 	mips_icache_sync_all();
 
 	/*
+	 * Let this CPU do its own initialization (for things that have to be
+	 * done on the local CPU).
+	 */
+	(*mips_locoresw.lsw_cpu_init)(ci);
+
+	/*
 	 * Announce we are hatched
 	 */
 	atomic_or_ulong(&cpus_hatched, cpu_mask);

Reply via email to