Skip to content

Commit 75f227b

Browse files
author
henesy
committed
add platforms
1 parent 9a22731 commit 75f227b

File tree

116 files changed

+6886
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+6886
-0
lines changed

FreeBSD/386/bin/data2c

39.8 KB
Binary file not shown.

FreeBSD/386/bin/iyacc

92.6 KB
Binary file not shown.

FreeBSD/386/bin/mk

157 KB
Binary file not shown.

FreeBSD/386/bin/mkext

66.4 KB
Binary file not shown.

FreeBSD/386/include/emu.h

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* system- and machine-specific declarations for emu:
3+
* floating-point save and restore, signal handling primitive, and
4+
* implementation of the current-process variable `up'.
5+
*/
6+
7+
/*
8+
* This structure must agree with FPsave and FPrestore asm routines
9+
*/
10+
typedef struct FPU FPU;
11+
struct FPU
12+
{
13+
uchar env[28];
14+
};
15+
16+
#define KSTACK (32 * 1024)
17+
18+
static __inline Proc *getup(void) {
19+
Proc *p;
20+
__asm__( "movl %%esp, %%eax\n\t"
21+
: "=a" (p)
22+
);
23+
return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
24+
};
25+
26+
#define up (getup())
27+
28+
typedef sigjmp_buf osjmpbuf;
29+
#define ossetjmp(buf) sigsetjmp(buf, 1)
30+

FreeBSD/386/include/fpuctl.h

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Linux 386 fpu support
3+
* Mimic Plan9 floating point support
4+
*/
5+
6+
static void
7+
setfcr(ulong fcr)
8+
{
9+
__asm__( "xorb $0x3f, %%al\n\t"
10+
"pushw %%ax\n\t"
11+
"fwait\n\t"
12+
"fldcw (%%esp)\n\t"
13+
"popw %%ax\n\t"
14+
: /* no output */
15+
: "al" (fcr)
16+
);
17+
}
18+
19+
static ulong
20+
getfcr(void)
21+
{
22+
ulong fcr = 0;
23+
24+
__asm__( "pushl %%eax\n\t"
25+
"fwait\n\t"
26+
"fstcw (%%esp)\n\t"
27+
"popl %%eax\n\t"
28+
"xorb $0x3f, %%al\n\t"
29+
: "=a" (fcr)
30+
: "eax" (fcr)
31+
);
32+
return fcr;
33+
}
34+
35+
static ulong
36+
getfsr(void)
37+
{
38+
ulong fsr = -1;
39+
40+
__asm__( "fwait\n\t"
41+
"fstsw (%%eax)\n\t"
42+
"movl (%%eax), %%eax\n\t"
43+
"andl $0xffff, %%eax\n\t"
44+
: "=a" (fsr)
45+
: "eax" (&fsr)
46+
);
47+
return fsr;
48+
}
49+
50+
static void
51+
setfsr(ulong fsr)
52+
{
53+
__asm__("fclex\n\t");
54+
}
55+
56+
/* FCR */
57+
#define FPINEX (1<<5)
58+
#define FPUNFL ((1<<4)|(1<<1))
59+
#define FPOVFL (1<<3)
60+
#define FPZDIV (1<<2)
61+
#define FPINVAL (1<<0)
62+
#define FPRNR (0<<10)
63+
#define FPRZ (3<<10)
64+
#define FPRPINF (2<<10)
65+
#define FPRNINF (1<<10)
66+
#define FPRMASK (3<<10)
67+
#define FPPEXT (3<<8)
68+
#define FPPSGL (0<<8)
69+
#define FPPDBL (2<<8)
70+
#define FPPMASK (3<<8)
71+
/* FSR */
72+
#define FPAINEX FPINEX
73+
#define FPAOVFL FPOVFL
74+
#define FPAUNFL FPUNFL
75+
#define FPAZDIV FPZDIV
76+
#define FPAINVAL FPINVAL

0 commit comments

Comments
 (0)