summaryrefslogtreecommitdiff
path: root/sys/src/9/teg2/softfpu.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-01-26 17:33:21 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2013-01-26 17:33:21 +0100
commitea108c8ca6e726ac008f75775ab83775ec233171 (patch)
tree982816b58d50e1b12b7eeb2c29fe22ca8d9c195b /sys/src/9/teg2/softfpu.c
parent43e09c468b4c6562c93c9375a316012e238d21b2 (diff)
add tegra2 soc kernel (from sources)
Diffstat (limited to 'sys/src/9/teg2/softfpu.c')
-rw-r--r--sys/src/9/teg2/softfpu.c129
1 files changed, 129 insertions, 0 deletions
diff --git a/sys/src/9/teg2/softfpu.c b/sys/src/9/teg2/softfpu.c
new file mode 100644
index 000000000..752391f2c
--- /dev/null
+++ b/sys/src/9/teg2/softfpu.c
@@ -0,0 +1,129 @@
+#include "u.h"
+#include "../port/lib.h"
+#include "mem.h"
+#include "dat.h"
+#include "fns.h"
+
+int
+fpudevprocio(Proc* proc, void* a, long n, uintptr offset, int write)
+{
+ /*
+ * Called from procdevtab.read and procdevtab.write
+ * allow user process access to the FPU registers.
+ * This is the only FPU routine which is called directly
+ * from the port code; it would be nice to have dynamic
+ * creation of entries in the device file trees...
+ */
+ USED(proc, a, n, offset, write);
+
+ return 0;
+}
+
+void
+fpunotify(Ureg*)
+{
+ /*
+ * Called when a note is about to be delivered to a
+ * user process, usually at the end of a system call.
+ * Note handlers are not allowed to use the FPU so
+ * the state is marked (after saving if necessary) and
+ * checked in the Device Not Available handler.
+ */
+}
+
+void
+fpunoted(void)
+{
+ /*
+ * Called from sysnoted() via the machine-dependent
+ * noted() routine.
+ * Clear the flag set above in fpunotify().
+ */
+}
+
+void
+fpusysrfork(Ureg*)
+{
+ /*
+ * Called early in the non-interruptible path of
+ * sysrfork() via the machine-dependent syscall() routine.
+ * Save the state so that it can be easily copied
+ * to the child process later.
+ */
+}
+
+void
+fpusysrforkchild(Proc*, Ureg *, Proc*)
+{
+ /*
+ * Called later in sysrfork() via the machine-dependent
+ * sysrforkchild() routine.
+ * Copy the parent FPU state to the child.
+ */
+}
+
+void
+fpuprocsave(Proc*)
+{
+ /*
+ * Called from sched() and sleep() via the machine-dependent
+ * procsave() routine.
+ * About to go in to the scheduler.
+ * If the process wasn't using the FPU
+ * there's nothing to do.
+ */
+}
+
+void
+fpuprocrestore(Proc*)
+{
+ /*
+ * The process has been rescheduled and is about to run.
+ * Nothing to do here right now. If the process tries to use
+ * the FPU again it will cause a Device Not Available
+ * exception and the state will then be restored.
+ */
+}
+
+void
+fpusysprocsetup(Proc*)
+{
+ /*
+ * Disable the FPU.
+ * Called from sysexec() via sysprocsetup() to
+ * set the FPU for the new process.
+ */
+}
+
+void
+fpuinit(void)
+{
+}
+
+int
+fpuemu(Ureg* ureg)
+{
+ int nfp;
+
+ if(waserror()){
+ splhi();
+ postnote(up, 1, up->errstr, NDebug);
+ return 1;
+ }
+ spllo();
+ nfp = fpiarm(ureg);
+ splhi();
+ poperror();
+
+ return nfp;
+}
+
+void
+fpon(void)
+{
+}
+
+void
+fpoff(void)
+{
+}