fixup commit for tag 'release-6-0-pre-1'

This commit is contained in:
cvs2hg
2007-02-25 22:49:23 +00:00
parent 6a0dd9377d
commit 2d80c1d2c8
675 changed files with 111 additions and 45781 deletions

View File

@@ -1,225 +0,0 @@
# (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
# $Header$
#
# Don't generate line updating code by default (i.e.: -L flag provided to cem).
# To put it on again: use -NL
var LFLAG=-L
var C_INCLUDES=-I{EM}/include/_tail_cc
var ANSI_C_INCLUDES=-I{EM}/include/tail_ac
callname ack
name cpp
# no from, this is a preprocessor
to .i
program {EM}/lib/cpp{ANSI_C?}
mapflag -I* CPP_F={CPP_F?} -I*
mapflag -U* CPP_F={CPP_F?} -U*
mapflag -D* CPP_F={CPP_F?} -D*
mapflag -P CPP_F={CPP_F?} -P
mapflag -C CPP_F={CPP_F?} -C
mapflag -wo CPP_F={CPP_F?} -o
mapflag -ansi ANSI_C=.ansi
args {CPP_F?} ({SUFFIX?}:.ocm=-I{EM}/include/occam) \
({ANSI_C?}:.ansi={SYSINCLUDES?} {ANSI_C_INCLUDES} {INCLUDES?}) \
({ANSI_C?.c}:{SUFFIX}={SYSINCLUDES?} {C_INCLUDES} {INCLUDES?}) \
-D{NAME} \
({ANSI_C?.xx}:.xx=-DEM_WSIZE={w} -DEM_PSIZE={p} \
-DEM_SSIZE={s} -DEM_LSIZE={l} -DEM_FSIZE={f} -DEM_DSIZE={d}) \
-D_EM_WSIZE={w} -D_EM_PSIZE={p} \
-D_EM_SSIZE={s} -D_EM_LSIZE={l} -D_EM_FSIZE={f} -D_EM_DSIZE={d} \
<
stdout
prep is
end
name cem
from .c
to .k
program {EM}/lib/em_cemcom{ANSI_C?}
mapflag -ansi ANSI=ansi
# mapflag -I* CPP_F={CPP_F?} -I*
# mapflag -U* CPP_F={CPP_F?} -U*
# mapflag -D* CPP_F={CPP_F?} -D*
mapflag -M* CEM_F={CEM_F?} -M*
mapflag -L CEM_F={CEM_F?} -L
mapflag -A CEM_F={CEM_F?} -A
mapflag -NL LFLAG=
mapflag -KR CEM_F={CEM_F?} -R
mapflag -w CEM_F={CEM_F?} -w
mapflag -wa CEM_F={CEM_F?} -a
mapflag -wo CEM_F={CEM_F?} -o
mapflag -ws CEM_F={CEM_F?} -s
mapflag -g CEM_F={CEM_F?} -g
mapflag -p CEM_F={CEM_F?} -p
mapflag -V* CEM_F={CEM_F?} -V*
rts .c
need .c
args \
{CPP_F?} \
{SYSINCLUDES?} \
({ANSI_C?}:.ansi={ANSI_C_INCLUDES}) \
({ANSI_C?.c}:.c={C_INCLUDES}) \
{INCLUDES?} \
-D{NAME} \
-D_EM_WSIZE={w} -D_EM_PSIZE={p} \
-D_EM_SSIZE={s} -D_EM_LSIZE={l} -D_EM_FSIZE={f} -D_EM_DSIZE={d} \
-Vw{w}.{w}i{w}.{w}p{p}.{w}f{f}.{w}s{s}.{s}l{l}.{w}d{d}.{w} \
{CC_ALIGN?} \
{CEM_F?} {LFLAG?} < >
callname acc
callname cc
end
name pc
from .p
to .k
program {EM}/lib/em_pc
mapflag -L PC_F={PC_F?} -L
# mapflag -s PC_F={PC_F?} -s
mapflag -_ PC_F={PC_F?} -U
mapflag -w PC_F={PC_F?} -w
mapflag -V* PC_F={PC_F?} -V*
mapflag -M* PC_F={PC_F?} -M*
# mapflag -i* PC_F={PC_F?} -i*
mapflag -A PC_F={PC_F?} -A
# mapflag -R PC_F={PC_F?} -R
mapflag --* PC_F={PC_F?} -*
#range checks can only be disabled through comments
args \
-Vw{w}.{w}i{w}.{w}l{l}.{w}p{p}.{w}f{d}.{w}S{w}.{w} \
{PC_F?} < > {SOURCE}
prep cond
rts .p
need .p
callname apc
callname pc
end
name m2
from .mod.def
to .k
program {EM}/lib/em_m2
mapflag -I* M2_INCL={M2_INCL?} -I*
mapflag -L M2_F={M2_F?} -L
mapflag -g M2_F={M2_F?} -g
mapflag -w* M2_F={M2_F?} -w*
mapflag -W* M2_F={M2_F?} -W*
mapflag -_ M2_F={M2_F?} -U
mapflag -M* M2_F={M2_F?} -M*
mapflag -x M2_F={M2_F?} -x
mapflag -Xs M2_F={M2_F?} -s
mapflag -V* M2_F={M2_F?} -V*
mapflag --* M2_F={M2_F?} -*
args \
{M2_INCL?} -I{EM}/lib/m2 {M2SYSLIB?} \
-Vw{w}.{w}i{w}.{w}p{p}.{w}l{l}.{w}f{f}.{w}d{d}.{w} \
{M2_ALIGN?} {M2_F?} < >
prep cond
rts .mod
need .mod
callname m2
end
name ocm
from .ocm
to .k
program {EM}/lib/em_occam
mapflag -L OCM_F={OCM_F?} -L
mapflag -V* OCM_F={OCM_F?} -V*
args -Vw{w}p{p}l{l} {OCM_F?}
stdin
stdout
rts .ocm
need .ocm
prep cond
callname ocm
end
name abc
from .b
to .k
program {EM}/lib/em_bem
mapflag -h ABC_F={ABC_F?} -h
mapflag -w ABC_F={ABC_F?} -w
mapflag -L ABC_F={ABC_F?} -L
mapflag -E ABC_F={ABC_F?} -E
# mapflag -d ABC_F={ABC_F?} -d
args -Vw{w}p{p}f{d} {ABC_F?} < > {SOURCE}
prep cond
rts .b
need .b
callname abc
end
var A68INIT={EM}/lib/em_a68s_init
name a68s
from .8.a68
to .k
program {EM}/lib/em_a68s{w}{p}
mapflag -PA* A68INIT=*
args < > {SOURCE}.lst {A68INIT}{w}{p} /dev/null
prep cond
rts .8
need .8
callname a68s
end
name encode
from .e
to .k
program {EM}/lib/em_encode
args <
prep cond
stdout
end
name opt
from .k
to .m
program {EM}/lib/em_opt
mapflag -LIB OPT_F={OPT_F?} -L
args {OPT_F?} <
stdout
optimizer
end
name ego
from .m.ma
to .gk
program {EM}/lib/em_ego
mapflag -EGO-* EGO_F={EGO_F?} -*
# The following lines are obsolete, but here for backwards compatibility.
# They should be removed some day.
mapflag -IL* EGO_F={EGO_F?} -IL*
mapflag -CS* EGO_F={EGO_F?} -CS*
mapflag -SR* EGO_F={EGO_F?} -SR*
mapflag -UD* EGO_F={EGO_F?} -UD*
mapflag -LV* EGO_F={EGO_F?} -LV*
mapflag -SA* EGO_F={EGO_F?} -RA*
mapflag -SP* EGO_F={EGO_F?} -SP*
mapflag -BO* EGO_F={EGO_F?} -BO*
mapflag -CJ* EGO_F={EGO_F?} -CJ*
mapflag -EV EGO_F={EGO_F?} -V
# End of obsolete lines
mapflag -Q* EGO_F={EGO_F?} -Q*
mapflag -T* EGO_F={EGO_F?} -T*
mapflag -S* EGO_F={EGO_F?} -S*
mapflag -s* EGO_F={EGO_F?} -s*
mapflag -a EGO_F={EGO_F?} -a
mapflag -O* EGO_F={EGO_F?} -O*
args \
{EGO_F?} -P {EM}/lib/ego \
-M{EM}/lib/ego/{M}descr <
optimizer 2
stdout
combiner
end
name opt2
# output of the global optimizer is processed by a stripped version
# of the em peephole optimizer
from .gk
to .g
program {EM}/lib/em_opt2
# mapflag -LIB OPT_F={OPT_F?} -L
args {OPT_F?} <
optimizer
stdout
end
name decode
from .k.m.g.gk
to .e
program {EM}/lib/em_decode
args <
stdout
end

View File

@@ -1,40 +0,0 @@
# $Revision$
var w=2
var p=2
var s=2
var l=4
var f=4
var d=8
var NAME=i8086
var M=i86
var LIB=lib/i86/tail_
var LIBIBM=lib/ibm/tail_
var RT=lib/i86/head_
var RTIBM=lib/ibm/head_
var CPP_F=-Dunix
var INCLUDES=-I{EM}/include -I{EM}/lib/ibm/include
name be
from .m.g
to .s
program {EM}/lib/{M}/cg
args <
stdout
need .e
end
name asld
from .s.a
to .out
outfile a.out
program {EM}/lib/{M}/as
mapflag -l* LNAME={EM}/{LIB}*
mapflag -i IFILE={EM}/{RT}i
args {IFILE?} (.e:{HEAD}={EM}/{RTIBM}em) \
({RTS}:.b.c={EM}/{RT}cc) ({RTS}:.p={EM}/{RT}pc) -o > < \
(.p:{TAIL}={EM}/{LIB}pc) \
(.b:{TAIL}={EM}/{LIB}bc) \
(.b.c:{TAIL}={EM}/{LIB}cc.1s {EM}/{LIB}cc.2g) \
(.e:{TAIL}={EM}/{LIBIBM}em) \
(.b.c.p:{TAIL}={EM}/{LIBIBM}mon) \
(.e:{TAIL}={EM}/{LIBIBM}em.vend)
linker
end

View File

@@ -1,35 +0,0 @@
# $Revision$
var w=2
var p=2
var s=2
var l=4
var f=4
var d=8
var M=int
var NAME=int22
var LIB=lib/int22/tail_
var RT=lib/int22/head_
var SIZE_FLAG=-sm
var CPP_F=-Dunix=unix
var INCLUDES=-I{EM}/include/_tail_cc -I{EM}/include/_tail_mon
name asld
from .k.m.a.g
to .out
outfile e.out
program {EM}/lib/em_ass
mapflag -l* LNAME={EM}/{LIB}*
mapflag -+* ASS_F={ASS_F?} -+*
mapflag --* ASS_F={ASS_F?} --*
mapflag -s* SIZE_FLAG=-s*
args {SIZE_FLAG} \
({RTS}:.ocm.b.c={EM}/{RT}cc) \
({RTS}:.mod={EM}/{RT}m2) \
({RTS}:.p={EM}/{RT}pc) -o > < \
(.p:{TAIL}={EM}/{LIB}pc) \
(.b:{TAIL}={EM}/{LIB}bc) \
(.ocm:{TAIL}={EM}/{LIB}ocm) \
(.mod:{TAIL}={EM}/{LIB}m2) \
(.ocm.b.c:{TAIL}={EM}/{LIB}cc.1s {EM}/{LIB}cc.2g) \
(.mod.ocm.b.c.p:{TAIL}={EM}/{LIB}mon)
linker
end

View File

@@ -1,39 +0,0 @@
# $Revision$
var w=2
var p=4
var s=2
var l=4
var f=4
var d=8
var NAME=m68k2
var M=m68k2
var LIBDIR=/lib/{M}
var LIB=lib/{M}/tail_
var RT=lib/{M}/head_
var INCLUDES=-I{EM}/include -I/usr/include
name be
from .m.g
to .s
program {EM}/lib/{M}/cg
args <
stdout
need .e
end
name asld
from .s.a
to .out
outfile a.out
program {EM}/lib/{M}/as
mapflag -l* LNAME={EM}/{LIB}*
args (.e:{HEAD}={EM}/{RT}em) \
({RTS}:.b.c={EM}/{RT}cc) ({RTS}:.p={EM}/{RT}pc) -o > < \
(.p.c.b:{TAIL}={EM}/{LIBDIR}/sys1.s) (.p:{TAIL}={EM}/{LIBDIR}/sys2.s) \
(.c:{TAIL}={EM}/{LIBDIR}/write.s) \
(.p:{TAIL}={EM}/{LIB}pc) \
(.b:{TAIL}={EM}/{LIB}bc) \
(.b.c:{TAIL}={EM}/{LIB}cc.1s {EM}/{LIB}cc.2g) \
(.b.c:{TAIL}={EM}/{LIB}mon {EM}/{LIB}fake) \
(.e:{TAIL}={EM}/{LIB}em.rt {EM}/{LIB}em.vend)
prep cond
linker
end

View File

@@ -1,30 +0,0 @@
# $Revision$
var w=1
var p=2
var s=1
var l=2
var f=4
var d=8
var NAME=nascom
var M=z80a
var LIB=lib/{M}/tail_
var RT=lib/{M}/head_
var INCLUDES=-I{EM}/include -I/usr/include
name be
from .m.g
to .s
program {EM}/lib/{M}/be
args <
stdout
need .e
end
name asld
from .s.a
to .out
outfile a.out
program {EM}/lib/z80/as
mapflag -l* LNAME={EM}/{LIB}*
args (.e:{HEAD}={EM}/{RT}em) ({RTS}:.b.c={EM}/{RT}cc) -o > \
(.e:{TAIL}={EM}/{LIB}em.1 {EM}/{LIB}em.2)
linker
end

View File

@@ -1,32 +0,0 @@
var w=2
var p=2
var s=2
var l=4
var f=4
var d=8
var NAME=i8086
var M=i86
var LIB=mach/i86/lib/tail_
var RT=mach/i86/lib/head_
var INCLUDES=-I{EM}/include -I/usr/include
name be
from .m
to .s
program {EM}/lib/{M}_cg
args <
prop >
need .e
end
name asld
from .s.a
to a.out
program {EM}/lib/{M}_as
mapflag -l* LNAME={EM}/{LIB}*
mapflag -i IFILE={EM}/{RT}i
args {IFILE?} (.e:{HEAD}={EM}/{RT}em) \
({RTS}:.c={EM}/{RT}cc) ({RTS}:.p={EM}/{RT}pc) -o > < \
(.p:{TAIL}={EM}/{LIB}pc) (.c:{TAIL}={EM}/{LIB}cc.1s {EM}/{LIB}cc.2g) \
(.c.p.e:{TAIL}={EM}/{LIB}netio) (.c.p.e:{TAIL}={EM}/{LIB}alo) \
(.c.p:{TAIL}={EM}/{LIB}mon) (.e:{TAIL}={EM}/{LIB}em)
prop C
end

View File

@@ -1,34 +0,0 @@
var w=2
var p=2
var s=2
var l=4
var f=4
var d=8
var NAME=i8086
var M=i86
var LIB=mach/i86/lib/tail_
var ALIB=mach/i86/lib/sat_tail_
var RT=mach/i86/lib/head_
var ART=mach/i86/lib/sat_head_
var CCP_F=-Dunix
var INCLUDES=-I{EM}/include -I/usr/include
name be
from .m
to .s
program {EM}/lib/{M}_cg
args <
prop >
need .e
end
name asld
from .s.a
to a.out
program {EM}/lib/{M}_as
mapflag -l* LNAME={EM}/{LIB}*
args (.e:{HEAD}={EM}/{ART}em) \
({RTS}:.c={EM}/{RT}cc) ({RTS}:.p={EM}/{RT}pc) -o > < \
(.p:{TAIL}={EM}/{LIB}pc) (.c:{TAIL}={EM}/{LIB}cc.1s {EM}/{LIB}cc.2g) \
(.c.p:{TAIL}={EM}/{ALIB}mon) (.c.p.e:{TAIL}={EM}/{LIB}alo) \
(.e:{TAIL}={EM}/{LIB}em)
prop C
end

View File

@@ -1,59 +0,0 @@
/* Error codes. They are negative since a few system calls, such as READ, can
* either return a positive number indicating success, or an error code.
*/
#define NERROR 34
#define OK 0
#define ERROR -1
#define EPERM -1
#define ENOENT -2
#define ESRCH -3
#define EINTR -4
#define EIO -5
#define ENXIO -6
#define E2BIG -7
#define ENOEXEC -8
#define EBADF -9
#define ECHILD -10
#define EAGAIN -11
#define ENOMEM -12
#define EACCES -13
#define EFAULT -14
#define ENOTBLK -15
#define EBUSY -16
#define EEXIST -17
#define EXDEV -18
#define ENODEV -19
#define ENOTDIR -20
#define EISDIR -21
#define EINVAL -22
#define ENFILE -23
#define EMFILE -24
#define ENOTTY -25
#define ETXTBSY -26
#define EFBIG -27
#define ENOSPC -28
#define ESPIPE -29
#define EROFS -30
#define EMLINK -31
#define EPIPE -32
#define EDOM -33
#define ERANGE -34
#define E_LOCKED -101
#define E_BAD_CALL -102
#define E_LONG_STRING -103
#define EOF -104 /* End Of File - used by drivers */
/* The following error codes are generated by the kernel itself. */
#define E_BAD_DEST -1 /* destination address illegal */
#define E_BAD_SRC -2 /* source address illegal */
#define E_TRY_AGAIN -3 /* can't send-- tables full */
#define E_OVERRUN -4 /* interrupt for task that is not waiting */
#define E_BAD_BUF -5 /* message buf outside caller's addr space */
#define E_TASK -6 /* can't send to task */
#define E_NO_MESSAGE -7 /* RECEIVE failed: no message present */
#define E_NO_PERM -8 /* ordinary users can't send to tasks */
#define E_BAD_FCN -9 /* only valid fcns are SEND, RECEIVE, BOTH */
#define E_BAD_ADDR -10 /* bad address given to utility routine */
#define E_BAD_PROC -11 /* bad proc number given to utility */

View File

@@ -1,59 +0,0 @@
/* Error codes. They are negative since a few system calls, such as READ, can
* either return a positive number indicating success, or an error code.
*/
#define NERROR 34
#define OK 0
#define ERROR -1
#define EPERM -1
#define ENOENT -2
#define ESRCH -3
#define EINTR -4
#define EIO -5
#define ENXIO -6
#define E2BIG -7
#define ENOEXEC -8
#define EBADF -9
#define ECHILD -10
#define EAGAIN -11
#define ENOMEM -12
#define EACCES -13
#define EFAULT -14
#define ENOTBLK -15
#define EBUSY -16
#define EEXIST -17
#define EXDEV -18
#define ENODEV -19
#define ENOTDIR -20
#define EISDIR -21
#define EINVAL -22
#define ENFILE -23
#define EMFILE -24
#define ENOTTY -25
#define ETXTBSY -26
#define EFBIG -27
#define ENOSPC -28
#define ESPIPE -29
#define EROFS -30
#define EMLINK -31
#define EPIPE -32
#define EDOM -33
#define ERANGE -34
#define E_LOCKED -101
#define E_BAD_CALL -102
#define E_LONG_STRING -103
#define EOF -104 /* End Of File - used by drivers */
/* The following error codes are generated by the kernel itself. */
#define E_BAD_DEST -1 /* destination address illegal */
#define E_BAD_SRC -2 /* source address illegal */
#define E_TRY_AGAIN -3 /* can't send-- tables full */
#define E_OVERRUN -4 /* interrupt for task that is not waiting */
#define E_BAD_BUF -5 /* message buf outside caller's addr space */
#define E_TASK -6 /* can't send to task */
#define E_NO_MESSAGE -7 /* RECEIVE failed: no message present */
#define E_NO_PERM -8 /* ordinary users can't send to tasks */
#define E_BAD_FCN -9 /* only valid fcns are SEND, RECEIVE, BOTH */
#define E_BAD_ADDR -10 /* bad address given to utility routine */
#define E_BAD_PROC -11 /* bad proc number given to utility */

View File

@@ -1,26 +0,0 @@
struct stat {
short int st_dev;
unsigned short st_ino;
unsigned short st_mode;
short int st_nlink;
short int st_uid;
short int st_gid;
short int st_rdev;
long st_size;
long st_atime;
long st_mtime;
long st_ctime;
};
/* Some common definitions. */
#define S_IFMT 0170000 /* type of file */
#define S_IFDIR 0040000 /* directory */
#define S_IFCHR 0020000 /* character special */
#define S_IFBLK 0060000 /* block special */
#define S_IFREG 0100000 /* regular */
#define S_ISUID 04000 /* set user id on execution */
#define S_ISGID 02000 /* set group id on execution */
#define S_ISVTX 01000 /* save swapped text even after use */
#define S_IREAD 00400 /* read permission, owner */
#define S_IWRITE 00200 /* write permission, owner */
#define S_IEXEC 00100 /* execute/search permission, owner */

View File

@@ -1,17 +0,0 @@
/* The <dir.h> header gives the layout of a directory. */
#ifndef _DIR_H
#define _DIR_H
#define DIRBLKSIZ 512 /* size of directory block */
#ifndef DIRSIZ
#define DIRSIZ 14
#endif
struct direct {
ino_t d_ino;
char d_name[DIRSIZ];
};
#endif /* _DIR_H */

View File

@@ -1,58 +0,0 @@
#define NCALLS 70 /* number of system calls allowed */
#define EXIT 1
#define FORK 2
#define READ 3
#define WRITE 4
#define OPEN 5
#define CLOSE 6
#define WAIT 7
#define CREAT 8
#define LINK 9
#define UNLINK 10
#define CHDIR 12
#define TIME 13
#define MKNOD 14
#define CHMOD 15
#define CHOWN 16
#define BRK 17
#define STAT 18
#define LSEEK 19
#define GETPID 20
#define MOUNT 21
#define UMOUNT 22
#define SETUID 23
#define GETUID 24
#define STIME 25
#define PTRACE 26
#define ALARM 27
#define FSTAT 28
#define PAUSE 29
#define UTIME 30
#define ACCESS 33
#define SYNC 36
#define KILL 37
#define RENAME 38
#define MKDIR 39
#define RMDIR 40
#define DUP 41
#define PIPE 42
#define TIMES 43
#define SETGID 46
#define GETGID 47
#define SIGNAL 48
#define IOCTL 54
#define FCNTL 55
#define EXEC 59
#define UMASK 60
#define CHROOT 61
/* The following are not system calls, but are processed like them. */
#define KSIG 64 /* kernel detected a signal */
#define UNPAUSE 65 /* to MM or FS: check for EINTR */
#define BRK2 66 /* to MM: used to say how big FS & INIT are */
#define REVIVE 67 /* to FS: revive a sleeping process */
#define TASK_REPLY 68 /* to FS: reply code from tty task */
/* The following IS a system call for amoeba transactions */
#define AM_SYSCALL 69

View File

@@ -1,166 +0,0 @@
/* System calls. */
#define SEND 1 /* function code for sending messages */
#define RECEIVE 2 /* function code for receiving messages */
#define BOTH 3 /* function code for SEND + RECEIVE */
#define ANY (NR_PROCS+100) /* receive(ANY, buf) accepts from any source */
/* Task numbers, function codes and reply codes. */
#define TTY -NR_TASKS /* terminal I/O class */
# define TTY_READ 3 /* fcn code for reading from tty */
# define TTY_WRITE 4 /* fcn code for writing to tty */
# define TTY_IOCTL 5 /* fcn code for ioctl */
# define TTY_SETPGRP 6 /* fcn code for setpgrp */
# define TTY_OPEN 7 /* fcn code for opening tty */
# define TTY_CLOSE 8 /* fcn code for closing tty */
# define SUSPEND -998 /* used in interrupts when tty has no data */
#ifdef AM_KERNEL
#define AMOEBA
#endif
#ifdef AMOEBA
/* There are AM_NTASK copies of the amoeba kernel task.
* If you change AM_NTASKS be sure to adjust kernel/table.c and fs/table.c
*/
#define AM_NTASKS 4 /* number of kernel tasks of this class */
#define AMINT_CLASS (TTY+1) /* Amoeba event handler */
#define AMOEBA_CLASS (AMINT_CLASS+AM_NTASKS) /* transaction handlers */
# define ETHER_ARRIV 1 /* fcn code for packet arrival */
# define AM_TRANS 2 /* amoeba transaction */
# define AM_GETREQ 3 /* amoeba getrequest */
# define AM_PUTREP 4 /* amoeba putrep */
# define AM_REVIVE 6 /* used by kernel task to revive luser task */
# define AM_TIMEOUT 8 /* used to talk to clock task */
# define AM_PUTSIG 9 /* when the luser hits the DEL ! */
# define AM_TASK_DIED 10 /* sent if task died during a transaction */
#else /* if AMOEBA not defined */
#define AMOEBA_CLASS TTY
#endif /* AMOEBA */
/*
* New class definitions should go here and should be defined relative
* to AMOEBA_CLASS (ie. as AMOEBA_CLASS+n, for the nth task added).
*/
#define IDLE (AMOEBA_CLASS+1) /* task to run when there's nothing to run */
#define PRINTER -7 /* printer I/O class */
/* The printer uses the same commands as TTY. */
#define WINCHESTER -6 /* winchester (hard) disk class */
#define FLOPPY -5 /* floppy disk class */
# define DISK_READ 3 /* fcn code to DISK (must equal TTY_READ) */
# define DISK_WRITE 4 /* fcn code to DISK (must equal TTY_WRITE) */
# define DISK_IOCTL 5 /* fcn code for setting up RAM disk */
# define SCATTERED_IO 6 /* fcn code for multiple reads/writes */
# define OPTIONAL_IO 16 /* modifier to DISK_* codes within vector */
#define MEM -4 /* /dev/ram, /dev/(k)mem and /dev/null class */
# define RAM_DEV 0 /* minor device for /dev/ram */
# define MEM_DEV 1 /* minor device for /dev/mem */
# define KMEM_DEV 2 /* minor device for /dev/kmem */
# define NULL_DEV 3 /* minor device for /dev/null */
#if (CHIP == INTEL)
# define PORT_DEV 4 /* minor device for /dev/port */
#endif
#define CLOCK -3 /* clock class */
# define SET_ALARM 1 /* fcn code to CLOCK, set up alarm */
# define GET_TIME 3 /* fcn code to CLOCK, get real time */
# define SET_TIME 4 /* fcn code to CLOCK, set real time */
# define REAL_TIME 1 /* reply from CLOCK: here is real time */
#define SYSTASK -2 /* internal functions */
# define SYS_XIT 1 /* fcn code for sys_xit(parent, proc) */
# define SYS_GETSP 2 /* fcn code for sys_sp(proc, &new_sp) */
# define SYS_SIG 3 /* fcn code for sys_sig(proc, sig) */
# define SYS_FORK 4 /* fcn code for sys_fork(parent, child) */
# define SYS_NEWMAP 5 /* fcn code for sys_newmap(procno, map_ptr) */
# define SYS_COPY 6 /* fcn code for sys_copy(ptr) */
# define SYS_EXEC 7 /* fcn code for sys_exec(procno, new_sp) */
# define SYS_TIMES 8 /* fcn code for sys_times(procno, bufptr) */
# define SYS_ABORT 9 /* fcn code for sys_abort() */
# define SYS_FRESH 10 /* fcn code for sys_fresh() (Atari only) */
# define SYS_KILL 11 /* fcn code for sys_kill(proc, sig) */
# define SYS_GBOOT 12 /* fcn code for sys_gboot(procno, bootptr) */
# define SYS_UMAP 13 /* fcn code for sys_umap(procno, etc) */
# define SYS_MEM 14 /* fcn code for sys_mem() */
# define SYS_TRACE 15 /* fcn code for sys_trace(req,pid,addr,data) */
#define HARDWARE -1 /* used as source on interrupt generated msgs*/
/* Names of message fields for messages to CLOCK task. */
#define DELTA_TICKS m6_l1 /* alarm interval in clock ticks */
#define FUNC_TO_CALL m6_f1 /* pointer to function to call */
#define NEW_TIME m6_l1 /* value to set clock to (SET_TIME) */
#define CLOCK_PROC_NR m6_i1 /* which proc (or task) wants the alarm? */
#define SECONDS_LEFT m6_l1 /* how many seconds were remaining */
/* Names of message fields used for messages to block and character tasks. */
#define DEVICE m2_i1 /* major-minor device */
#define PROC_NR m2_i2 /* which (proc) wants I/O? */
#define COUNT m2_i3 /* how many bytes to transfer */
#define POSITION m2_l1 /* file offset */
#define ADDRESS m2_p1 /* core buffer address */
/* Names of message fields for messages to TTY task. */
#define TTY_LINE m2_i1 /* message parameter: terminal line */
#define TTY_REQUEST m2_i3 /* message parameter: ioctl request code */
#define TTY_SPEK m2_l1 /* message parameter: ioctl speed, erasing */
#define TTY_FLAGS m2_l2 /* message parameter: ioctl tty mode */
#define TTY_PGRP m2_i3 /* message parameter: process group */
/* Names of messages fields used in reply messages from tasks. */
#define REP_PROC_NR m2_i1 /* # of proc on whose behalf I/O was done */
#define REP_STATUS m2_i2 /* bytes transferred or error number */
/* Names of fields for copy message to SYSTASK. */
#define SRC_SPACE m5_c1 /* T or D space (stack is also D) */
#define SRC_PROC_NR m5_i1 /* process to copy from */
#define SRC_BUFFER m5_l1 /* virtual address where data come from */
#define DST_SPACE m5_c2 /* T or D space (stack is also D) */
#define DST_PROC_NR m5_i2 /* process to copy to */
#define DST_BUFFER m5_l2 /* virtual address where data go to */
#define COPY_BYTES m5_l3 /* number of bytes to copy */
/* Field names for accounting, SYSTASK and miscellaneous. */
#define USER_TIME m4_l1 /* user time consumed by process */
#define SYSTEM_TIME m4_l2 /* system time consumed by process */
#define CHILD_UTIME m4_l3 /* user time consumed by process' children */
#define CHILD_STIME m4_l4 /* sys time consumed by process' children */
#define PROC1 m1_i1 /* indicates a process */
#define PROC2 m1_i2 /* indicates a process */
#define PID m1_i3 /* process id passed from MM to kernel */
#define STACK_PTR m1_p1 /* used for stack ptr in sys_exec, sys_getsp */
#define PR m6_i1 /* process number for sys_sig */
#define SIGNUM m6_i2 /* signal number for sys_sig */
#define FUNC m6_f1 /* function pointer for sys_sig */
#define MEM_PTR m1_p1 /* tells where memory map is for sys_newmap */
#define CANCEL 0 /* general request to force a task to cancel */
#define SIG_MAP m1_i2 /* used by kernel for passing signal bit map */
#ifdef AMOEBA
/* Names of message fields for amoeba tasks */
#define AM_OP m2_i1 /* one of the above operators */
#define AM_PROC_NR m2_i2 /* process # of proc doing operation */
#define AM_COUNT m2_i3 /* size of buffer for operation */
#define AM_ADDRESS m2_p1 /* address of buffer for operation */
/* For communication between MM and AMOEBA_CLASS kernel tasks */
#define AM_STATUS m2_i3 /* same use as REP_STATUS but for amoeba */
#define AM_FREE_IT m2_l1 /* 1=not a getreq, 0=is a getreq */
/* Special for passing a physical address from the ethernet driver */
#define AM_PADDR m2_l1 /* to the transaction layer */
#endif /* AMOEBA */
#define HARD_INT 2 /* fcn code for all hardware interrupts */

View File

@@ -1,88 +0,0 @@
/* Copyright (C) 1990 by Prentice-Hall, Inc. Permission is hereby granted
* to redistribute the binary and source programs of this system for
* educational or research purposes. For other use, written permission from
* Prentice-Hall is required.
*/
#define EXTERN extern /* used in *.h files */
#define PRIVATE static /* PRIVATE x limits the scope of x */
#define PUBLIC /* PUBLIC is the opposite of PRIVATE */
#define FORWARD static /* some compilers require this to be 'static'*/
#define TRUE 1 /* used for turning integers into Booleans */
#define FALSE 0 /* used for turning integers into Booleans */
#define HZ 60 /* clock freq (software settable on IBM-PC) */
#define BLOCK_SIZE 1024 /* # bytes in a disk block */
#define SUPER_USER (uid_t) 0 /* uid_t of superuser */
#define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
#define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
#ifdef AM_KERNEL
#define NR_TASKS 14 /* must be 5 more than without amoeba */
#else
#define NR_TASKS 9 /* number of tasks in the transfer vector */
#endif
#define NR_PROCS 32 /* number of slots in proc table */
#define NR_SEGS 3 /* # segments per process */
#define T 0 /* proc[i].mem_map[T] is for text */
#define D 1 /* proc[i].mem_map[D] is for data */
#define S 2 /* proc[i].mem_map[S] is for stack */
#define MAX_P_LONG 2147483647 /* maximum positive long, i.e. 2**31 - 1 */
/* Memory is allocated in clicks. */
#if (CHIP == INTEL) || (CHIP == M68000)
#define CLICK_SIZE 256 /* unit in which memory is allocated */
#define CLICK_SHIFT 8 /* log2 of CLICK_SIZE */
#endif
#define click_to_round_k(n) \
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
#if CLICK_SIZE < 1024
#define k_to_click(n) ((n) * (1024 / CLICK_SIZE))
#else
#define k_to_click(n) ((n) / (CLICK_SIZE / 1024))
#endif
/* Process numbers of some important processes */
#define MM_PROC_NR 0 /* process number of memory manager */
#define FS_PROC_NR 1 /* process number of file system */
#define INIT_PROC_NR 2 /* init -- the process that goes multiuser */
#define LOW_USER 2 /* first user not part of operating system */
/* Miscellaneous */
#define BYTE 0377 /* mask for 8 bits */
#define TO_USER 0 /* flag telling to copy from fs to user */
#define FROM_USER 1 /* flag telling to copy from user to fs */
#define READING 0 /* copy data to user */
#define WRITING 1 /* copy data from user */
#if (MACHINE != ATARI)
#define ABS -999 /* this process means absolute memory */
#endif
#define WORD_SIZE 2 /* number of bytes per word */
#define NIL_PTR (char *) 0 /* generally useful expression */
#define NO_NUM 0x8000 /* used as numerical argument to panic() */
#define SIG_PUSH_BYTES (4*sizeof(int)) /* how many bytes pushed by signal */
/* Flag bits for i_mode in the inode. */
#define I_TYPE 0170000 /* this field gives inode type */
#define I_REGULAR 0100000 /* regular file, not dir or special */
#define I_BLOCK_SPECIAL 0060000 /* block special file */
#define I_DIRECTORY 0040000 /* file is a directory */
#define I_CHAR_SPECIAL 0020000 /* character special file */
#define I_NAMED_PIPE 0010000 /* named pipe (FIFO) */
#define I_SET_UID_BIT 0004000 /* set effective uid_t on exec */
#define I_SET_GID_BIT 0002000 /* set effective gid_t on exec */
#define ALL_MODES 0006777 /* all bits for user, group and others */
#define RWX_MODES 0000777 /* mode bits for RWX only */
#define R_BIT 0000004 /* Rwx protection bit */
#define W_BIT 0000002 /* rWx protection bit */
#define X_BIT 0000001 /* rwX protection bit */
#define I_NOT_ALLOC 0000000 /* this inode is free */

View File

@@ -1,59 +0,0 @@
/* Error codes. They are negative since a few system calls, such as READ, can
* either return a positive number indicating success, or an error code.
*/
#define NERROR 34
#define OK 0
#define ERROR -1
#define EPERM -1
#define ENOENT -2
#define ESRCH -3
#define EINTR -4
#define EIO -5
#define ENXIO -6
#define E2BIG -7
#define ENOEXEC -8
#define EBADF -9
#define ECHILD -10
#define EAGAIN -11
#define ENOMEM -12
#define EACCES -13
#define EFAULT -14
#define ENOTBLK -15
#define EBUSY -16
#define EEXIST -17
#define EXDEV -18
#define ENODEV -19
#define ENOTDIR -20
#define EISDIR -21
#define EINVAL -22
#define ENFILE -23
#define EMFILE -24
#define ENOTTY -25
#define ETXTBSY -26
#define EFBIG -27
#define ENOSPC -28
#define ESPIPE -29
#define EROFS -30
#define EMLINK -31
#define EPIPE -32
#define EDOM -33
#define ERANGE -34
#define E_LOCKED -101
#define E_BAD_CALL -102
#define E_LONG_STRING -103
#define EOF -104 /* End Of File - used by drivers */
/* The following error codes are generated by the kernel itself. */
#define E_BAD_DEST -1 /* destination address illegal */
#define E_BAD_SRC -2 /* source address illegal */
#define E_TRY_AGAIN -3 /* can't send-- tables full */
#define E_OVERRUN -4 /* interrupt for task that is not waiting */
#define E_BAD_BUF -5 /* message buf outside caller's addr space */
#define E_TASK -6 /* can't send to task */
#define E_NO_MESSAGE -7 /* RECEIVE failed: no message present */
#define E_NO_PERM -8 /* ordinary users can't send to tasks */
#define E_BAD_FCN -9 /* only valid fcns are SEND, RECEIVE, BOTH */
#define E_BAD_ADDR -10 /* bad address given to utility routine */
#define E_BAD_PROC -11 /* bad proc number given to utility */

View File

@@ -1,26 +0,0 @@
struct stat {
short int st_dev;
unsigned short st_ino;
unsigned short st_mode;
short int st_nlink;
short int st_uid;
short int st_gid;
short int st_rdev;
long st_size;
long st_atime;
long st_mtime;
long st_ctime;
};
/* Some common definitions. */
#define S_IFMT 0170000 /* type of file */
#define S_IFDIR 0040000 /* directory */
#define S_IFCHR 0020000 /* character special */
#define S_IFBLK 0060000 /* block special */
#define S_IFREG 0100000 /* regular */
#define S_ISUID 04000 /* set user id on execution */
#define S_ISGID 02000 /* set group id on execution */
#define S_ISVTX 01000 /* save swapped text even after use */
#define S_IREAD 00400 /* read permission, owner */
#define S_IWRITE 00200 /* write permission, owner */
#define S_IEXEC 00100 /* execute/search permission, owner */

View File

@@ -1,134 +0,0 @@
#ifndef _TYPE_H
#define _TYPE_H
/* Macros */
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
/* Type definitions */
typedef unsigned short unshort; /* must be 16-bit unsigned */
typedef unshort block_nr; /* block number */
typedef unshort zone_nr; /* zone number */
#define MAX_BLOCK_NR ((block_nr) 0177777) /* largest block number */
#define HIGHEST_ZONE ((zone_nr) 0177777) /* largest zone number */
#define MAX_INODE_NR ((ino_t 0177777) /* largest inode number */
#define MAX_FILE_POS 017777777777L /* largest legal file offset */
#define NO_BLOCK ((block_nr) 0) /* absence of a block number */
#define NO_ENTRY ((ino_t) 0) /* absence of a dir entry */
#define NO_ZONE ((zone_nr) 0) /* absence of a zone number */
#define NO_DEV ((dev_t) ~0) /* absence of a device numb */
typedef unshort bit_nr; /* if ino_t & zone_nr both unshort,
then also unshort, else long */
typedef long zone_type; /* zone size */
#if (CHIP == INTEL)
typedef unsigned vir_bytes; /* virtual addresses and lengths in bytes */
#endif
#if (CHIP == M68000)
typedef long vir_bytes; /* virtual addresses and lengths in bytes */
#endif
typedef unsigned vir_clicks; /* virtual addresses and lengths in clicks */
typedef long phys_bytes; /* physical addresses and lengths in bytes */
typedef unsigned phys_clicks; /* physical addresses and lengths in clicks */
typedef int signed_clicks; /* same length as phys_clicks, but signed */
/* Types relating to messages. */
#define M1 1
#define M3 3
#define M4 4
#define M3_STRING 14
typedef struct {int m1i1, m1i2, m1i3; char *m1p1, *m1p2, *m1p3;} mess_1;
typedef struct {int m2i1, m2i2, m2i3; long m2l1, m2l2; char *m2p1;} mess_2;
typedef struct {int m3i1, m3i2; char *m3p1; char m3ca1[M3_STRING];} mess_3;
typedef struct {long m4l1, m4l2, m4l3, m4l4;} mess_4;
typedef struct {char m5c1, m5c2; int m5i1, m5i2; long m5l1, m5l2, m5l3;} mess_5;
#if _ANSI
typedef struct {int m6i1, m6i2, m6i3; long m6l1; void (*m6f1)(int);} mess_6;
#else
typedef struct {int m6i1, m6i2, m6i3; long m6l1; void (*m6f1)();} mess_6;
#endif
typedef struct {
int m_source; /* who sent the message */
int m_type; /* what kind of message is it */
union {
mess_1 m_m1;
mess_2 m_m2;
mess_3 m_m3;
mess_4 m_m4;
mess_5 m_m5;
mess_6 m_m6;
} m_u;
} message;
#define MESS_SIZE (sizeof(message))
#define NIL_MESS (message *) 0
/* The following defines provide names for useful members. */
#define m1_i1 m_u.m_m1.m1i1
#define m1_i2 m_u.m_m1.m1i2
#define m1_i3 m_u.m_m1.m1i3
#define m1_p1 m_u.m_m1.m1p1
#define m1_p2 m_u.m_m1.m1p2
#define m1_p3 m_u.m_m1.m1p3
#define m2_i1 m_u.m_m2.m2i1
#define m2_i2 m_u.m_m2.m2i2
#define m2_i3 m_u.m_m2.m2i3
#define m2_l1 m_u.m_m2.m2l1
#define m2_l2 m_u.m_m2.m2l2
#define m2_p1 m_u.m_m2.m2p1
#define m3_i1 m_u.m_m3.m3i1
#define m3_i2 m_u.m_m3.m3i2
#define m3_p1 m_u.m_m3.m3p1
#define m3_ca1 m_u.m_m3.m3ca1
#define m4_l1 m_u.m_m4.m4l1
#define m4_l2 m_u.m_m4.m4l2
#define m4_l3 m_u.m_m4.m4l3
#define m4_l4 m_u.m_m4.m4l4
#define m5_c1 m_u.m_m5.m5c1
#define m5_c2 m_u.m_m5.m5c2
#define m5_i1 m_u.m_m5.m5i1
#define m5_i2 m_u.m_m5.m5i2
#define m5_l1 m_u.m_m5.m5l1
#define m5_l2 m_u.m_m5.m5l2
#define m5_l3 m_u.m_m5.m5l3
#define m6_i1 m_u.m_m6.m6i1
#define m6_i2 m_u.m_m6.m6i2
#define m6_i3 m_u.m_m6.m6i3
#define m6_l1 m_u.m_m6.m6l1
#define m6_f1 m_u.m_m6.m6f1
struct mem_map {
vir_clicks mem_vir; /* virtual address */
phys_clicks mem_phys; /* physical address */
vir_clicks mem_len; /* length */
};
struct copy_info { /* used by sys_copy(src, dst, bytes) */
int cp_src_proc;
int cp_src_space;
vir_bytes cp_src_vir;
int cp_dst_proc;
int cp_dst_space;
vir_bytes cp_dst_vir;
vir_bytes cp_bytes;
};
struct iorequest_s {
long io_position; /* position in device file (really off_t) */
char *io_buf; /* buffer in user space */
unsigned short io_nbytes; /* size of request */
unsigned short io_request; /* read, write (optionally) */
};
#endif /* _TYPE_H */

View File

@@ -1,74 +0,0 @@
# $Revision$
var w=4
var p=4
var s=2
var l=4
var f=4
var d=8
var NAME=vax4
var M=vax4
var LIB=lib/{M}/tail_
var RT=lib/{M}/head_
var CPP_F=-Dunix -Dvax
var CC_ALIGN=-Vw4.1
# 413 align is the default, rom in text
var ALIGN=-a0:4 -a1:4 -a2:0x400 -a3:4
var C_LIB={EM}/{LIB}cc.1s {EM}/{LIB}cc.2g
var OLD_C_LIB={C_LIB}
name be
from .m.g
to .s
program {EM}/lib/{M}/cg
args <
stdout
need .e
end
name asopt
from .s
to .so
program {EM}/lib/{M}/top
args
optimizer
stdin
stdout
end
name as
from .s.so
to .o
program {EM}/lib/{M}/as
args - -o > <
prep cond
end
name led
from .o.a
to .out
program {EM}/lib/em_led
mapflag -l* LNAME={EM}/{LIB}*
mapflag -N ALIGN=-a0:4 -a1:4 -a2:4 -a3:4
mapflag -r ALIGN=-a0:4 -a1:0x400 -a2:4 -a3:4
mapflag -ansi C_LIB={EM}/{LIB}ac
args {ALIGN} (.e:{HEAD}= {EM}/{RT}em) \
({RTS}:.ocm.b={EM}/{RT}cc) \
({RTS}{ANSI?}:.c={EM}/{RT}cc) \
({RTS}{ANSI?}:.cansi={EM}/{RT}ac) \
({RTS}:.mod={EM}/{RT}m2) \
({RTS}:.p.8={EM}/{RT}pc) \
-o > < \
(.8:{TAIL}={EM}/{LIB}a68s) \
(.p.8:{TAIL}={EM}/{LIB}pc) \
(.b:{TAIL}={EM}/{LIB}bc) \
(.ocm:{TAIL}={EM}/{LIB}ocm) \
(.mod:{TAIL}={EM}/{LIB}m2) \
(.ocm.b:{TAIL}={OLD_C_LIB}) \
(.c:{TAIL}={C_LIB}) \
(.e:{TAIL}={EM}/{LIB}em {EM}/{LIB}mon {EM}/lib/{M}/end_em)
linker
end
name cv
from .out
to .cv
program {EM}/lib/{M}/cv
mapflag -n CV_ARG=-n
args {CV_ARG?} < >
outfile a.out
end

View File

@@ -1,104 +0,0 @@
# $Header$
/movab/ {
s/movab 1(\(.*\)),\1$/incl \1/
s/movab -1(\(.*\)),\1$/decl \1/
s/movab \([0-9]*\)(\(.*\)),\2$/addl2 $\1,\2/
s/movab -\([0-9]*\)(\(.*\)),\2$/subl2 $\1,\2/
s/movab 0(\(.*\)) \[\(.*\)\],\1$/addl2 \2,\1/
s/movab 0(\(.*\)) \[\(.*\)\],\2$/addl2 \1,\2/
}
/$0/ {
s/movz[bw]\([wl]\) $0,/clr\1 /
s/mov\([bwl]\) $0,/clr\1 /
s/cvt[bw]\([wl]\) $0,/clr\1 /
}
/add/ {
s/\(add[fdlw]\)3 \(.*\),\(.*\),\3$/\12 \2,\3/
s/\(add[fdlw]\)3 \(.*\),\(.*\),\2$/\12 \3,\2/
s/add\([wl]\)2 \$-\([0-9]*\),/sub\12 $\2,/
s/add\([wl]\)3 \$-\([0-9]*\),/sub\13 $\2,/
s/add\([wl]\)3 \(.*\),\$-\([0-9]*\),/sub\13 $\3,\2,/
}
/mul/ {
s/\(mul[fdlw]\)3 \(.*\),\(.*\),\3$/\12 \2,\3/
s/\(mul[fdlw]\)3 \(.*\),\(.*\),\2$/\12 \3,\2/
}
/sub/ {
s/\(sub[fdlw]\)3 \(.*\),\(.*\),\3$/\12 \2,\3/
s/sub\([wl]\)2 \$-\([0-9]*\),/add\12 $\2,/
s/sub\([wl]\)3 \$-\([0-9]*\),/add\13 $\2,/
}
/div/s/\(div[fdlw]\)3 \(.*\),\(.*\),\3$/\12 \2,\3/
/bi/s/\(bi[cs][lw]\)3 \(.*\),\(.*\),\3$/\12 \2,\3/
/bis/s/\(bis[lw]\)3 \(.*\),\(.*\),\2$/\12 \3,\2/
/xor/ {
s/\(xor[lw]\)3 \(.*\),\(.*\),\3$/\12 \2,\3/
s/\(xor[lw]\)3 \(.*\),\(.*\),\2$/\12 \3,\2/
}
/$1/ {
s/add\([wl]\)2 \$1,/inc\1 /
s/sub\([wl]\)2 \$1,/dec\1 /
}
/$-1/ {
s/add\([wl]\)2 \$-1,/dec\1 /
s/sub\([wl]\)2 \$-1,/inc\1 /
}
/cmp[bwl].*$0/ {
N
s/cmp\([bwl]\) \(.*\),$0$/tst\1 \2/
s/cmp\([bwl]\) $0,\(.*\)\njneq/tst\1 \2\
jneq/
s/cmp\([bwl]\) $0,\(.*\)\njeql/tst\1 \2\
jeql/
s/cmp\([bwl]\) $0,\(.*\)\njgtr/tst\1 \2\
jlss/
s/cmp\([bwl]\) $0,\(.*\)\njlss/tst\1 \2\
jgtr/
s/cmp\([bwl]\) $0,\(.*\)\njgeq/tst\1 \2\
jleq/
s/cmp\([bwl]\) $0,\(.*\)\njleq/tst\1 \2\
jgeq/
P
D
}
/(sp)+/ {
N
s/movl (sp)+,\(.*\)\npushl \1$/movl (sp),\1/
s/tst[wl] (sp)+\nmovl fp,sp$/movl fp,sp/
s/tst\([wl]\) (sp)+\nmov\1 \(.*\),-(sp)/mov\1 \2,(sp)/
s/tst\([wl]\) (sp)+\nclr\1 -(sp)/clr\1 (sp)/
s/tst\([wl]\) (sp)+\nmovzb\1 \(.*\),-(sp)/movzb\1 \2,(sp)/
s/tst\([wl]\) (sp)+\ncvtb\1 \(.*\),-(sp)/cvtb\1 \2,(sp)/
s/tst\([wl]\) (sp)+\ntst\1 \(.*\)$/mov\1 \2,(sp)+/
s/tstl (sp)+\npushl \(.*\)$/movl \1,(sp)/
s/tstl (sp)+\npusha\([bwlq]\) \(.*\)$/mova\1 \2,(sp)/
P
D
}
/^addl2 .*,sp/ {
N
s/addl2 .*,sp\nmovl fp,sp$/movl fp,sp/
s/^addl2 $6,sp\nmovw \(.*\),-(sp)/tstl (sp)+\
movw \1,(sp)/
s/^addl2 $6,sp\nclrw -(sp)/tstl (sp)+\
clrw (sp)/
s/^addl2 $8,sp\nmovq \(.*\),-(sp)/movq \1,(sp)/
P
D
}
/clrw -(sp)/ {
N
s/clrw -(sp)\nmovw \($[0-9]*\),-(sp)/pushl \1/
s/clrw -(sp)\nmnegw $\([0-9]*\),-(sp)/movzwl $-\1,-(sp)/
s/clrw -(sp)\nmovw \(.*\),-(sp)/movzwl \1,-(sp)/
s/clrw -(sp)\ncvtbw \(\$[0-9]*\),-(sp)/pushl \1/
s/clrw -(sp)\ncvtbw \(\$.*\),-(sp)/movzwl \1,-(sp)/
P
D
}
/mov/ {
N
s/mov\([wl]\) \(.*\),\(.*\)\ntst\1 \3$/mov\1 \2,\3/
P
D
}