svn commit: r202830 - in head/sys/mips: include mips

Warner Losh imp at FreeBSD.org
Fri Jan 22 20:32:07 UTC 2010


Author: imp
Date: Fri Jan 22 20:32:07 2010
New Revision: 202830
URL: http://svn.freebsd.org/changeset/base/202830

Log:
  Create a method of last resort for rebooting the mips processor: jump
  to the reset vector.  This works for many SoCs where other reset
  hardware is either missing or unknown.

Modified:
  head/sys/mips/include/md_var.h
  head/sys/mips/mips/machdep.c

Modified: head/sys/mips/include/md_var.h
==============================================================================
--- head/sys/mips/include/md_var.h	Fri Jan 22 20:30:54 2010	(r202829)
+++ head/sys/mips/include/md_var.h	Fri Jan 22 20:32:07 2010	(r202830)
@@ -52,6 +52,7 @@ uintptr_t MipsEmulateBranch(struct trapf
 void MipsSwitchFPState(struct thread *, struct trapframe *);
 u_long	kvtop(void *addr);
 int	is_physical_memory(vm_offset_t addr);
+void	mips_generic_reset(void);
 
 #define	is_cacheable_mem(pa)	is_physical_memory((pa))
 

Modified: head/sys/mips/mips/machdep.c
==============================================================================
--- head/sys/mips/mips/machdep.c	Fri Jan 22 20:30:54 2010	(r202829)
+++ head/sys/mips/mips/machdep.c	Fri Jan 22 20:32:07 2010	(r202830)
@@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/cache.h>
 #include <machine/clock.h>
 #include <machine/cpu.h>
+#include <machine/cpuregs.h>
 #include <machine/hwfunc.h>
 #include <machine/intr_machdep.h>
 #include <machine/md_var.h>
@@ -359,6 +360,17 @@ mips_vector_init(void)
 }
 
 /*
+ * Many SoCs have a means to reset the core itself.  Others do not, or
+ * the method is unknown to us.  For those cases, we jump to the mips
+ * reset vector and hope for the best.  This works well in practice.
+ */
+void
+mips_generic_reset()
+{
+	((void(*)(void))(intptr_t)MIPS_VEC_RESET)();
+}
+
+/*
  * Initialise a struct pcpu.
  */
 void


More information about the svn-src-head mailing list