Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Feb 2006 07:08:50 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 92115 for review
Message-ID:  <200602210708.k1L78oW0096713@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92115

Change 92115 by kmacy@kmacy_storage:sun4v_work on 2006/02/21 07:08:16

	add a couple of functions to ofw support for mmu queries and trap table

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/dev/ofw/openfirm.c#2 edit
.. //depot/projects/kmacy_sun4v/src/sys/dev/ofw/openfirm.h#2 edit
.. //depot/projects/kmacy_sun4v/src/sys/dev/ofw/openfirm_mmu.c#1 add

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/dev/ofw/openfirm.c#2 (text+ko) ====

@@ -73,7 +73,6 @@
 static ihandle_t stdout;
 
 /* Initialiaser */
-
 void
 OF_init(int (*openfirm)(void *))
 {
@@ -85,6 +84,23 @@
 	OF_getprop(chosen, "stdout", &stdout, sizeof(stdout));
 }
 
+
+phandle_t
+OF_chosennode(void)
+{
+	static phandle_t	chosen;
+
+	if (chosen)
+		return (chosen);
+	
+	if ((chosen = OF_finddevice("/chosen")) == -1)
+		OF_exit();
+
+	return (chosen);
+}
+
+
+
 void
 OF_printf(const char *fmt, ...)
 {
@@ -814,3 +830,38 @@
 	entry(0, 0, openfirmware, arg, len);
 }
 #endif
+
+/*
+ * Extensions added for sun4v support
+ *
+ */
+
+
+/*
+ * This interface allows the client to safely take over the %tba by
+ * the prom's service. The prom will take care of the quiescence of
+ * interrupts and handle any pending soft interrupts.
+ * This call also sets the MMU fault status area for the cpu.
+ */
+void
+OF_set_mmfsa_traptable(void *tba_addr, uint64_t mmfsa_ra)
+{
+	static struct {
+		cell_t	 name;
+		cell_t	 nargs;
+		cell_t	 nreturns;
+		cell_t	 tba_addr;
+		cell_t	 mmfsa_ra;
+	} args = {
+		(cell_t)"SUNW,set-trap-table",
+		2,
+		0,
+	};
+
+	args.tba_addr = (cell_t)tba_addr;
+	args.mmfsa_ra = (cell_t)mmfsa_ra;
+	openfirmware(&args);
+}
+
+
+

==== //depot/projects/kmacy_sun4v/src/sys/dev/ofw/openfirm.h#2 (text+ko) ====

@@ -98,6 +98,7 @@
 phandle_t	OF_child(phandle_t);
 phandle_t	OF_parent(phandle_t);
 phandle_t	OF_instance_to_package(ihandle_t);
+phandle_t       OF_chosennode(void);
 int		OF_getproplen(phandle_t, char *);
 int		OF_getprop(phandle_t, char *, void *, int);
 int		OF_getprop_alloc(phandle_t package, char *propname, int elsz,
@@ -138,5 +139,10 @@
 /* Time function */
 int		OF_milliseconds(void);
 
+/* sun4v additions */
+void            OF_set_mmfsa_traptable(void *tba_addr, uint64_t mmfsa_ra);
+int             OF_translate_virt(vm_offset_t va, int *valid, vm_paddr_t *physaddr, int *mode);
+vm_paddr_t      OF_vtophys(vm_offset_t va);
+
 #endif /* _KERNEL */
 #endif /* _OPENFIRM_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602210708.k1L78oW0096713>