]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/omap/softfpu.c
pc, pc64: warn when running out of conf.mem[] entries in meminit()
[plan9front.git] / sys / src / 9 / omap / softfpu.c
1 #include "u.h"
2 #include "../port/lib.h"
3 #include "mem.h"
4 #include "dat.h"
5 #include "fns.h"
6
7 int
8 fpudevprocio(Proc* proc, void* a, long n, uintptr offset, int write)
9 {
10         /*
11          * Called from procdevtab.read and procdevtab.write
12          * allow user process access to the FPU registers.
13          * This is the only FPU routine which is called directly
14          * from the port code; it would be nice to have dynamic
15          * creation of entries in the device file trees...
16          */
17         USED(proc, a, n, offset, write);
18
19         return 0;
20 }
21
22 void
23 fpunotify(Ureg*)
24 {
25         /*
26          * Called when a note is about to be delivered to a
27          * user process, usually at the end of a system call.
28          * Note handlers are not allowed to use the FPU so
29          * the state is marked (after saving if necessary) and
30          * checked in the Device Not Available handler.
31          */
32 }
33
34 void
35 fpunoted(void)
36 {
37         /*
38          * Called from sysnoted() via the machine-dependent
39          * noted() routine.
40          * Clear the flag set above in fpunotify().
41          */
42 }
43
44 void
45 fpuprocsave(Proc*)
46 {
47         /*
48          * Called from sched() and sleep() via the machine-dependent
49          * procsave() routine.
50          * About to go in to the scheduler.
51          * If the process wasn't using the FPU
52          * there's nothing to do.
53          */
54 }
55
56 void
57 fpuprocrestore(Proc*)
58 {
59         /*
60          * The process has been rescheduled and is about to run.
61          * Nothing to do here right now. If the process tries to use
62          * the FPU again it will cause a Device Not Available
63          * exception and the state will then be restored.
64          */
65 }
66
67 void
68 fpuprocfork(Proc*)
69 {
70         /*
71          * The current process has been forked, save and copy neccesary
72          * state to child. Nothing to do here, child proc starts with FPinit.
73          */
74 }
75
76 void
77 fpusysprocsetup(Proc*)
78 {
79         /*
80          * Disable the FPU.
81          * Called from sysexec() via sysprocsetup() to
82          * set the FPU for the new process.
83          */
84 }
85
86 void
87 fpuinit(void)
88 {
89 }
90
91 int
92 fpuemu(Ureg* ureg)
93 {
94         int nfp;
95
96         if(waserror()){
97                 splhi();
98                 postnote(up, 1, up->errstr, NDebug);
99                 return 1;
100         }
101         spllo();
102         nfp = fpiarm(ureg);
103         splhi();
104         poperror();
105
106         return nfp;
107 }