[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] osbind.S ?
So I propose to remove osbind.S and syscalls from the MiNTLib.
The attached patch does the above.
It may or may not be a good thing.
Please wait for the end of the discussion before committing.
--
Vincent Rivière
diff -aurN -x CVS mintlib.orig/Makefile mintlib.clean/Makefile
--- mintlib.orig/Makefile 2009-05-07 11:05:40.000000000 +0200
+++ mintlib.clean/Makefile 2009-05-21 17:22:59.781250000 +0200
@@ -22,12 +22,12 @@
POSIXRULES = $(TIMEZONE)
endif
-SUBDIRS = include syscall startup argp conf crypt dirent gmp login mintlib \
+SUBDIRS = include startup argp conf crypt dirent gmp login mintlib \
misc posix pwdgrp shadow signal socket stdiio stdio stdlib string sysvipc \
termios time unix lib sunrpc tz
DIST_SUBDIRS = argp conf crypt dirent gmp include lib lib_g lib_p lib020 libv4e \
login mintlib misc posix pwdgrp shadow signal socket startup \
- stdiio stdio stdlib string sunrpc syscall sysvipc termios time tz unix
+ stdiio stdio stdlib string sunrpc sysvipc termios time tz unix
TEST_SUBDIRS = argp crypt dirent login mintlib misc posix pwdgrp shadow signal \
socket startup stdiio stdio stdlib string time tz unix
diff -aurN -x CVS mintlib.orig/buildrules mintlib.clean/buildrules
--- mintlib.orig/buildrules 2009-01-28 16:13:26.000000000 +0100
+++ mintlib.clean/buildrules 2009-05-21 17:53:22.187500000 +0200
@@ -59,7 +59,6 @@
stdlibdir := $(top_srcdir)/stdlib
stringdir := $(top_srcdir)/string
sunrpcdir := $(top_srcdir)/sunrpc
-syscalldir := $(top_srcdir)/syscall
sysvipcdir := $(top_srcdir)/sysvipc
termiosdir := $(top_srcdir)/termios
timedir := $(top_srcdir)/time
@@ -67,7 +66,7 @@
srcdirs := $(argpdir) $(cryptdir) $(direntdir) $(gmpdir) $(logindir) $(mintlibdir) \
$(miscdir) $(posixdir) $(pwdgrpdir) $(shadowdir) $(signaldir) $(socketdir) \
$(stdiiodir) $(stdiodir) $(stdlibdir) $(stringdir) $(sunrpcdir) \
- $(syscalldir) $(sysvipcdir) $(termiosdir) $(timedir) $(unixdir)
+ $(sysvipcdir) $(termiosdir) $(timedir) $(unixdir)
ARGPSRCS := $(addprefix $(argpdir)/, $(ARGPCFILES))
CRYPTSRCS := $(addprefix $(cryptdir)/, $(CRYPTCFILES))
@@ -87,7 +86,6 @@
STDLIBSRCS := $(addprefix $(stdlibdir)/, $(STDLIBCFILES))
STRINGSRCS := $(addprefix $(stringdir)/, $(STRINGCFILES))
SUNRPCSRCS := $(addprefix $(sunrpcdir)/, $(SUNRPCCFILES))
-SYSCALLSRCS := $(addprefix $(syscalldir)/, $(SYSCALLCFILES))
SYSVIPCSRCS := $(addprefix $(sysvipcdir)/, $(SYSVIPCCFILES))
TERMIOSSRCS := $(addprefix $(termiosdir)/, $(TERMIOSCFILES))
TIMESRCS := $(addprefix $(timedir)/, $(TIMECFILES))
@@ -95,7 +93,7 @@
SRCS := $(ARGPSRCS) $(CRYPTSRCS) $(DIRENTSRCS) $(GMPSRCS) $(LOGINSRCS) $(MINTLIBSRCS) \
$(MISCSRCS) $(POSIXSRCS) $(PWDGRPSRCS) $(RPCSVCSRCS) $(SHADOWSRCS) \
$(SIGNALSRCS) $(SOCKETSRCS) $(STDIOSRCS) $(STDIOSRCS) $(STDLIBSRCS) \
- $(STRINGSRCS) $(SUNRPCSRCS) $(SYSCALLSRCS) $(SYSVIPCSRCS) $(TERMIOSSRCS) \
+ $(STRINGSRCS) $(SUNRPCSRCS) $(SYSVIPCSRCS) $(TERMIOSSRCS) \
$(TIMESRCS) $(UNIXSRCS)
ifeq ($(libsize), _p)
@@ -146,7 +144,6 @@
STDLIBOBJS := $(addsuffix .o, $(basename $(notdir $(STDLIBSRCS))))
STRINGOBJS := $(addsuffix .o, $(basename $(notdir $(STRINGSRCS))))
SUNRPCOBJS := $(addsuffix .o, $(basename $(notdir $(SUNRPCSRCS))))
-SYSCALLOBJS := $(addsuffix .o, $(basename $(notdir $(SYSCALLSRCS))))
SYSVIPCOBJS := $(addsuffix .o, $(basename $(notdir $(SYSVIPCSRCS))))
TERMIOSOBJS := $(addsuffix .o, $(basename $(notdir $(TERMIOSSRCS))))
TIMEOBJS := $(addsuffix .o, $(basename $(notdir $(TIMESRCS))))
@@ -154,11 +151,11 @@
OBJS := $(ARGPOBJS) $(CRYPTOBJS) $(DIRENTOBJS) $(GMPOBJS) $(LOGINOBJS) $(MINTLIBOBJS) \
$(MISCOBJS) $(POSIXOBJS) $(PWDGRPOBJS) $(RPCSVCOBJS) $(SHADOWOBJS) \
$(SIGNALOBJS) $(SOCKETOBJS) $(STDIIOOBJS) $(STDIOOBJS) $(STDLIBOBJS) \
- $(STRINGOBJS) $(SUNRPCOBJS) $(SYSCALLOBJS) $(SYSVIPCOBJS) $(TERMIOSOBJS) \
+ $(STRINGOBJS) $(SUNRPCOBJS) $(SYSVIPCOBJS) $(TERMIOSOBJS) \
$(TIMEOBJS) $(UNIXOBJS)
LIBCOBJS := $(ARGPOBJS) $(CRYPTOBJS) $(DIRENTOBJS) $(GMPOBJS) $(LOGINOBJS) $(MINTLIBOBJS) \
$(MISCOBJS) $(POSIXOBJS) $(PWDGRPOBJS) $(SHADOWOBJS) $(SIGNALOBJS) \
- $(STDIOOBJS) $(STDLIBOBJS) $(STRINGOBJS) $(SYSCALLOBJS) $(SYSVIPCOBJS) \
+ $(STDIOOBJS) $(STDLIBOBJS) $(STRINGOBJS) $(SYSVIPCOBJS) \
$(TERMIOSOBJS) $(TIMEOBJS) $(UNIXOBJS) $(SUNRPCOBJS) $(SOCKETOBJS)
# All modules that reference vfprintf or vfscanf should be listed here.
@@ -202,7 +199,7 @@
$(shadowdir)/SRCFILES $(signaldir)/SRCFILES $(socketdir)/SRCFILES \
$(stdiiodir)/SRCFILES $(stdiodir)/SRCFILES $(stdlibdir)/SRCFILES \
$(stringdir)/SRCFILES $(sunrpcdir)/SRCFILES $(sunrpcdir)/RPCSVCCFILES \
- $(syscalldir)/SRCFILES $(sysvipcdir)/SRCFILES $(termiosdir)/SRCFILES \
+ $(sysvipcdir)/SRCFILES $(termiosdir)/SRCFILES \
$(timedir)/SRCFILES $(unixdir)/SRCFILES
rm -f $@
echo "# This file is a generated secondary file. Do not edit." >$@
@@ -226,7 +223,6 @@
sed -e 's,^SRCFILES *=,RPCSVCCFILES =,g' $(sunrpcdir)/RPCSVCCFILES >> $@
sed -e 's,^SRCFILES *=,RPCGENCFILES =,g' $(sunrpcdir)/RPCGENCFILES >> $@
sed -e 's,^SRCFILES *=,RPCINFOCFILES =,g' $(sunrpcdir)/RPCINFOCFILES >> $@
- sed -e 's,^SRCFILES *=,SYSCALLCFILES =,g' $(syscalldir)/SRCFILES >>$@
sed -e 's,^SRCFILES *=,SYSVIPCCFILES =,g' $(sysvipcdir)/SRCFILES >>$@
sed -e 's,^SRCFILES *=,TERMIOSCFILES =,g' $(termiosdir)/SRCFILES >>$@
sed -e 's,^SRCFILES *=,TIMECFILES =,g' $(timedir)/SRCFILES >>$@
diff -aurN -x CVS mintlib.orig/mintlib/SRCFILES mintlib.clean/mintlib/SRCFILES
--- mintlib.orig/mintlib/SRCFILES 2008-04-28 09:26:42.000000000 +0200
+++ mintlib.clean/mintlib/SRCFILES 2009-05-21 17:20:35.375000000 +0200
@@ -63,7 +63,6 @@
malloc.c \
mcount.c \
modf.S \
- osbind.S \
profil-freq.c \
profil-posix.c \
pselect.c \
diff -aurN -x CVS mintlib.orig/syscall/.cvsignore mintlib.clean/syscall/.cvsignore
--- mintlib.orig/syscall/.cvsignore 2002-03-12 17:21:15.000000000 +0100
+++ mintlib.clean/syscall/.cvsignore 1970-01-01 01:00:00.000000000 +0100
@@ -1,32 +0,0 @@
-.deps
-*.o
-*~
-gen-syscall
-pars.c
-pars.h
-scan.c
-syscalls.stmp
-SRCFILES.traps
-trap_1_w.c
-trap_1_wl.c
-trap_1_wll.c
-trap_1_wlll.c
-trap_1_wllll.c
-trap_1_wlllll.c
-trap_1_wllllll.c
-trap_1_wlllw.c
-trap_1_wllw.c
-trap_1_wllwwl.c
-trap_1_wlw.c
-trap_1_wlww.c
-trap_1_ww.c
-trap_1_wwl.c
-trap_1_wwll.c
-trap_1_wwlll.c
-trap_1_wwllll.c
-trap_1_wwlllll.c
-trap_1_wwlw.c
-trap_1_www.c
-trap_1_wwwl.c
-trap_1_wwwll.c
-trap_1_wwww.c
diff -aurN -x CVS mintlib.orig/syscall/BINFILES mintlib.clean/syscall/BINFILES
--- mintlib.orig/syscall/BINFILES 2002-03-12 17:21:15.000000000 +0100
+++ mintlib.clean/syscall/BINFILES 1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-# This file gets included by the Makefile in this directory to determine
-# the files that should go only into binary distributions.
-
-BINFILES =
diff -aurN -x CVS mintlib.orig/syscall/EXTRAFILES mintlib.clean/syscall/EXTRAFILES
--- mintlib.orig/syscall/EXTRAFILES 2002-06-03 14:50:53.000000000 +0200
+++ mintlib.clean/syscall/EXTRAFILES 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-# This file gets included by the Makefile in this directory to determine
-# the files that should go only into source distributions.
-
-SRCFILES += BINFILES EXTRAFILES Makefile MISCFILES SRCFILES \
-check.c check.h generate.c generate.h list.c list.h main.c main.h \
-pars.y scan.l pars.h traps.c traps.h \
-syscalls.master
-
diff -aurN -x CVS mintlib.orig/syscall/MISCFILES mintlib.clean/syscall/MISCFILES
--- mintlib.orig/syscall/MISCFILES 2002-03-12 17:21:15.000000000 +0100
+++ mintlib.clean/syscall/MISCFILES 1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-# This file gets included by the Makefile in this directory to determine
-# the files that should go both into source and binary distributions.
-
-MISCFILES =
diff -aurN -x CVS mintlib.orig/syscall/Makefile mintlib.clean/syscall/Makefile
--- mintlib.orig/syscall/Makefile 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/Makefile 1970-01-01 01:00:00.000000000 +0100
@@ -1,67 +0,0 @@
-# syscall/Makefile -- MiNTLib.
-# Copyright (C) 2001 Frank Naumann <fnaumann@freemint.de>
-# $Id: Makefile,v 1.6 2005/12/22 09:37:57 fna Exp $
-#
-# This file is part of the MiNTLib project, and may only be used
-# modified and distributed under the terms of the MiNTLib project
-# license, COPYMINT. By continuing to use, modify, or distribute
-# this file you indicate that you have read the license and
-# understand and accept it fully.
-
-SHELL = /bin/sh
-
-srcdir = .
-top_srcdir = ..
-subdir = syscall
-
-SUBDIRS =
-
-have_check = no
-
-include $(top_srcdir)/configvars
-
-default: all
-
-gen_objs = check.o generate.o main.o pars.o scan.o traps.o
-gen_objs += syscallparser.c
-
-all-here: syscalls.stmp
-
-dont_install_libs = yes
-include $(top_srcdir)/rules $(top_srcdir)/phony
-
-# FIXME: Tests still missing.
-TESTS = dummy
-include $(top_srcdir)/checkrules
-
-# Override test flags.
-cflags = -O -Wall
-type =
-
-# override (cross)compiler
-CC = gcc
-CFLAGS = -Wall -O
-COMPILE = $(CC) $(CFLAGS)
-
-syscalls.stmp: gen-syscall syscalls.master
- echo "TRAPS=" > SRCFILES.traps
-# ./gen-syscall syscalls.master
- touch $@
-
-gen-syscall: $(gen_objs)
- $(CC) $(gen_objs) -o $@ -lfl
-
-%.c: %.y
- bison -d --output=$@ $<
-
-%.c: %.l
- flex -o$@ $<
-
-install: all-here
-
-uninstall:
-
-install-man:
-
-uninstall-man:
-
diff -aurN -x CVS mintlib.orig/syscall/SRCFILES mintlib.clean/syscall/SRCFILES
--- mintlib.orig/syscall/SRCFILES 2002-03-12 17:21:15.000000000 +0100
+++ mintlib.clean/syscall/SRCFILES 1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-# This file gets included by the Makefile in this directory to determine
-# the files that should go only into source distributions.
-
--include $(top_srcdir)/syscall/SRCFILES.traps /dev/null
-
-SRCFILES = $(TRAPS)
diff -aurN -x CVS mintlib.orig/syscall/check.c mintlib.clean/syscall/check.c
--- mintlib.orig/syscall/check.c 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/check.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,35 +0,0 @@
-/*
- * $Id: check.c,v 1.2 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "check.h"
-
diff -aurN -x CVS mintlib.orig/syscall/check.h mintlib.clean/syscall/check.h
--- mintlib.orig/syscall/check.h 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/check.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,37 +0,0 @@
-/*
- * $Id: check.h,v 1.2 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef _check_h
-#define _check_h
-
-#include "syscallparser.h"
-
-
-#endif /* _check_h */
diff -aurN -x CVS mintlib.orig/syscall/generate.c mintlib.clean/syscall/generate.c
--- mintlib.orig/syscall/generate.c 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/generate.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,282 +0,0 @@
-/*
- * $Id: generate.c,v 1.4 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "generate.h"
-#include "traps.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-static void
-generate_trap(struct syscall *call, char *buf, int trapnr)
-{
- char *s = buf;
- struct arg *l;
-
- l = call->args;
- while (l)
- {
- if ((l->flags & FLAG_POINTER) || (l->flags & FLAG_ARRAY))
- {
- *s++ = 'l';
- }
- else switch (l->type)
- {
- case TYPE_INT:
- case TYPE_CHAR:
- case TYPE_SHORT:
- case TYPE_UNSIGNED:
- case TYPE_UCHAR:
- case TYPE_USHORT:
- *s++ = 'w';
- break;
- case TYPE_LONG:
- case TYPE_ULONG:
- *s++ = 'l';
- break;
- default:
- printf("invalid type specification for %s (%s)\n",
- call->name, l->name);
- exit(1);
- }
-
- l = l->next;
- }
-
- *s = '\0';
- add_trap(trapnr, buf);
-}
-
-static void
-print_casted_args(FILE *out, struct syscall *call)
-{
- struct arg *l;
-
- l = call->args;
- while (l)
- {
- fprintf(out, ", ");
-
- if ((l->flags & FLAG_POINTER) || (l->flags & FLAG_ARRAY))
- {
- fprintf(out, "(long)");
- }
- else switch (l->type)
- {
- case TYPE_INT:
- case TYPE_CHAR:
- case TYPE_SHORT:
- case TYPE_UNSIGNED:
- case TYPE_UCHAR:
- case TYPE_USHORT:
- fprintf(out, "(short)");
- break;
- case TYPE_LONG:
- case TYPE_ULONG:
- fprintf(out, "(long)");
- break;
- default:
- printf("invalid type specification for %s (%s)\n",
- call->name, l->name);
- exit(1);
- }
- fprintf(out, "%s", l->name);
-
- l = l->next;
- }
-}
-
-void
-generate_bindings_proto(FILE *out, struct systab *tab, int trapnr)
-{
- int i;
-
- for (i = 0; i < tab->size; i++)
- {
- struct syscall *call = tab->table[i];
-
- if (call && is_syscall(call))
- {
- fprintf(out, "long __%s", call->name);
-
- fprintf(out, "(");
-
- if (call->args)
- generate_args(out, call->args, "", 1, ", ");
- else
- fprintf(out, "void");
-
- fprintf(out, ");\n");
- }
- }
-
- fprintf(out, "\n");
-}
-
-void
-generate_bindings_impl(FILE *out, struct systab *tab, int trapnr)
-{
- int i;
-
- fprintf(out, "/* forward declarations */\n");
- for (i = 0; i < tab->size; i++)
- {
- struct syscall *call = tab->table[i];
-
- if (call && is_syscall(call))
- {
- struct arg *l;
-
- l = call->args;
- while (l)
- {
- if (l->flags & FLAG_STRUCT
- || l->flags & FLAG_UNION)
- {
- fprintf(out, "%s;\n", l->types);
- }
-
- l = l->next;
- }
- }
- }
- fprintf(out, "\n");
-
- for (i = 0; i < tab->size; i++)
- {
- struct syscall *call = tab->table[i];
-
- if (call && is_syscall(call))
- {
- char trap[128];
-
- fprintf(out, "static inline long __%s", call->name);
- fprintf(out, "(");
-
- if (call->args)
- generate_args(out, call->args, "", 1, ", ");
- else
- fprintf(out, "void");
-
- fprintf(out, ")\n");
- fprintf(out, "{ ");
-
- generate_trap(call, trap, trapnr);
-
- fprintf(out, "return __trap_%i_w%s", trapnr, trap);
- fprintf(out, "(0x%x", i);
-
- print_casted_args(out, call);
-
- fprintf(out, "); }\n\n");
- }
- }
-}
-
-void
-generate_bindings_old(FILE *out, struct systab *tab, int trapnr)
-{
- int i;
-
- for (i = 0; i < tab->size; i++)
- {
- struct syscall *call = tab->table[i];
-
- if (call && is_syscall(call))
- {
- char trap[128];
- struct arg *l;
- char arg;
-
- fprintf(out, "#define %s(", call->name);
- arg = 'a';
- l = call->args;
- while (l)
- {
- fprintf(out, "%c", arg);
-
- arg++;
- l = l->next;
-
- if (l) fprintf(out, ",");
- }
- fprintf(out, ") ");
-
- generate_trap(call, trap, trapnr);
-
- fprintf(out, "__trap_%i_w%s", trapnr, trap);
- fprintf(out, "(0x%x", i);
-
- arg = 'a';
- l = call->args;
- while (l)
- {
- fprintf(out, ",");
-
- if ((l->flags & FLAG_POINTER) || (l->flags & FLAG_ARRAY))
- {
- fprintf(out, "(long)");
- }
- else switch (l->type)
- {
- case TYPE_INT:
- case TYPE_CHAR:
- case TYPE_SHORT:
- case TYPE_UNSIGNED:
- case TYPE_UCHAR:
- case TYPE_USHORT:
- fprintf(out, "(short)");
- break;
- case TYPE_LONG:
- case TYPE_ULONG:
- fprintf(out, "(long)");
- break;
- default:
- printf("invalid type specification for %s (%s)\n",
- call->name, l->name);
- exit (1);
- }
-
- fprintf(out, "%c", arg);
-
- arg++;
- l = l->next;
- }
- fprintf(out, ")");
-
-
- fprintf(out, "\n");
- }
- }
-
- fprintf(out, "\n");
-}
diff -aurN -x CVS mintlib.orig/syscall/generate.h mintlib.clean/syscall/generate.h
--- mintlib.orig/syscall/generate.h 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/generate.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,43 +0,0 @@
-/*
- * $Id: generate.h,v 1.2 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef _generate_h
-#define _generate_h
-
-#include <stdio.h>
-#include "syscallparser.h"
-
-
-void generate_bindings_proto(FILE *out, struct systab *tab, int trapnr);
-void generate_bindings_impl(FILE *out, struct systab *tab, int trapnr);
-void generate_bindings_old(FILE *out, struct systab *tab, int trapnr);
-
-
-#endif /* _generate_h */
diff -aurN -x CVS mintlib.orig/syscall/main.c mintlib.clean/syscall/main.c
--- mintlib.orig/syscall/main.c 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/main.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,109 +0,0 @@
-/*
- * $Id: main.c,v 1.2 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-
-#include "generate.h"
-#include "traps.h"
-
-#include "syscallparser.h"
-
-
-#ifdef __MINT__
-long _stksize = 64 * 1024;
-#endif
-
-
-int
-main(int argc, char **argv)
-{
- const char *myname = *argv++;
- int error;
-
- if (*argv == NULL)
- {
-#if YYDEBUG != 0
- yydebug = 1;
-#endif
- error = parse_syscall_description(NULL);
- }
- else
- {
- FILE *f;
-
- f = fopen(*argv, "rt");
- if (f)
- {
- error = parse_syscall_description(f);
- fclose(f);
- }
- else
- {
- perror(*argv);
- exit(1);
- }
- }
-
- if (!error)
- {
- FILE *f;
-
- /* check_tab(); */
-
- f = fopen("../include/mint/sysbind.h", "w");
- if (!f)
- {
- perror("sysbind.h");
- exit(1);
- }
-
- print_head(f, myname);
- fprintf(f, "#ifndef _sysbind_h\n");
- fprintf(f, "#define _sysbind_h\n\n");
- fprintf(f, "#include <sys/types.h>\n");
- fprintf(f, "#include <mint/trap.h>\n");
- fprintf(f, "\n");
- fprintf(f, "\n");
-
- generate_bindings_old(f, gemdos_table(), 1);
- generate_bindings_old(f, bios_table(), 13);
- generate_bindings_old(f, xbios_table(), 14);
-
- fprintf(f, "\n#endif /* _sysbind_h */\n");
- fclose(f);
-
- generate_trap_h("../include/mint");
- generate_traps(".");
- }
-
- return error;
-}
diff -aurN -x CVS mintlib.orig/syscall/pars.y mintlib.clean/syscall/pars.y
--- mintlib.orig/syscall/pars.y 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/pars.y 1970-01-01 01:00:00.000000000 +0100
@@ -1,591 +0,0 @@
-/*
- * $Id: pars.y,v 1.3 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2004 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-%{
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "syscalldefs.h"
-
-/* from scanner */
-int yylex (void);
-extern int yylinecount;
-extern char *yytext;
-
-extern int errors;
-
-#define OUT_OF_MEM(x) \
- if (!x) \
- { yyerror("out of memory"); YYERROR; }
-
-
-/* local things */
-
-struct systab *gemdos = NULL;
-struct systab *bios = NULL;
-struct systab *xbios = NULL;
-
-struct systab *systab = NULL;
-
-
-/* exported stuff */
-
-struct systab *gemdos_table(void) { return gemdos; }
-struct systab *bios_table(void) { return bios; }
-struct systab *xbios_table(void) { return xbios; }
-
-
-/* prototypes */
-
-static void yyerror(char *s);
-static void insert_string(char *dst, const char *src);
-
-static int resize_tab(struct systab *tab, int newsize);
-static int add_tab(struct systab *tab, int nr, const char *name, struct arg *p, int status);
-
-static void add_arg(struct arg **head, struct arg *t);
-static struct arg *make_arg(int type, const char *s);
-
-
-/* defaults */
-
-#define INITIAL_GEMDOS 100
-#define INITIAL_BIOS 100
-#define INITIAL_XBIOS 100
-
-%}
-
-%union {
- /* terminals */
- char ident[STRMAX];
- long value;
-
- /* nonterminals */
- struct systab *tab;
- struct arg *list;
-}
-
-%token <ident> _IDENT_GEMDOS
-%token <ident> _IDENT_BIOS
-%token <ident> _IDENT_XBIOS
-%token <ident> _IDENT_MAX
-
-%token <ident> _IDENT_VOID
-%token <ident> _IDENT_CONST
-%token <ident> _IDENT_STRUCT
-%token <ident> _IDENT_UNION
-
-%token <ident> _IDENT_CHAR
-%token <ident> _IDENT_SHORT
-%token <ident> _IDENT_LONG
-%token <ident> _IDENT_UNSIGNED
-%token <ident> _IDENT_UCHAR
-%token <ident> _IDENT_USHORT
-%token <ident> _IDENT_ULONG
-
-%token <ident> _IDENT_UNDEFINED
-%token <ident> _IDENT_UNSUPPORTED
-%token <ident> _IDENT_UNIMPLEMENTED
-%token <ident> _IDENT_PASSTHROUGH
-
-%token <ident> Identifier
-%token <value> Integer
-
-
-%type <tab> gemdos
-%type <tab> bios
-%type <tab> xbios
-
-%type <list> parameter_list
-%type <list> simple_parameter_list
-%type <list> simple_parameter
-%type <list> simple_type
-%type <list> type
-%type <value> status
-
-
-%start syscalls
-
-%%
-
-syscalls
-: gemdos bios xbios
- {
- gemdos = $1;
- bios = $2;
- xbios = $3;
- }
-;
-
-gemdos
-: {
- systab = malloc(sizeof(*systab));
- OUT_OF_MEM(systab);
-
- bzero(systab, sizeof(*systab));
-
- systab->size = INITIAL_GEMDOS;
- systab->table = malloc(systab->size * sizeof(*(systab->table)));
- OUT_OF_MEM(systab->table);
-
- bzero(systab->table, systab->size * sizeof(*(systab->table)));
- }
- '[' _IDENT_GEMDOS ']' definition_list
- {
- $$ = systab;
- }
-;
-
-bios
-: {
- systab = malloc(sizeof(*systab));
- OUT_OF_MEM(systab);
-
- bzero(systab, sizeof(*systab));
-
- systab->size = INITIAL_BIOS;
- systab->table = malloc(systab->size * sizeof(*(systab->table)));
- OUT_OF_MEM(systab->table);
-
- bzero(systab->table, systab->size * sizeof(*(systab->table)));
- }
- '[' _IDENT_BIOS ']' definition_list
- {
- $$ = systab;
- }
-;
-
-xbios
-: {
- systab = malloc(sizeof(*systab));
- OUT_OF_MEM(systab);
-
- bzero(systab, sizeof(*systab));
-
- systab->size = INITIAL_XBIOS;
- systab->table = malloc(systab->size * sizeof(*(systab->table)));
- OUT_OF_MEM(systab->table);
-
- bzero(systab->table, systab->size * sizeof(*(systab->table)));
- }
- '[' _IDENT_XBIOS ']' definition_list
- {
- $$ = systab;
- }
-;
-
-definition_list
-: definition
- { }
-| definition_list definition
- { }
-;
-
-definition
-: Integer Identifier '(' parameter_list ')' status
- {
- if (systab->max && $1 >= systab->max)
- { yyerror("entry greater than MAX"); YYERROR; }
-
- if (add_tab(systab, $1, $2, $4, $6))
- { yyerror("out of memory"); YYERROR; }
- }
-| Integer _IDENT_UNDEFINED
- {
- if (systab->max && $1 >= systab->max)
- { yyerror("entry greater than MAX"); YYERROR; }
-
- if (add_tab(systab, $1, $2, NULL, SYSCALL_UNDEFINED))
- { yyerror("out of memory"); YYERROR; }
- }
-| Integer _IDENT_PASSTHROUGH
- {
- if (systab->max && $1 >= systab->max)
- { yyerror("entry greater than MAX"); YYERROR; }
-
- if (add_tab(systab, $1, $2, NULL, SYSCALL_PASSTHROUGH))
- { yyerror("out of memory"); YYERROR; }
- }
-| Integer _IDENT_MAX
- {
- if (systab->max)
- { yyerror("MAX already defined"); YYERROR; }
-
- systab->max = $1;
-
- if (systab->maxused && systab->maxused >= systab->max)
- { yyerror("there are entries greater than MAX"); YYERROR; }
-
- if (!resize_tab(systab, systab->max))
- { yyerror("out of memory"); YYERROR; }
- }
-;
-
-parameter_list
-: _IDENT_VOID
- {
- $$ = NULL;
- }
-| simple_parameter_list
- {
- $$ = $1;
- }
-;
-
-simple_parameter_list
-: simple_parameter
- {
- struct arg *l = $1;
-
- $$ = l;
- }
-| simple_parameter_list ',' simple_parameter
- {
- struct arg *head = $1;
- struct arg *l = $3;
-
- add_arg(&(head->next), l);
-
- $$ = head;
- }
-;
-
-simple_parameter
-: simple_type Identifier
- {
- struct arg *l = $1;
-
- strcpy(l->name, $2);
-
- $$ = l;
- }
-| simple_type '*' Identifier
- {
- struct arg *l = $1;
-
- strcpy(l->name, $3);
- l->flags |= FLAG_POINTER;
-
- $$ = l;
- }
-| simple_type '*' '*' Identifier
- {
- struct arg *l = $1;
-
- strcpy(l->name, $4);
- l->flags |= FLAG_POINTER;
- l->flags |= FLAG_POINTER2;
-
- $$ = l;
- }
-| simple_type Identifier '[' ']'
- {
- struct arg *l = $1;
-
- strcpy(l->name, $2);
- l->flags |= FLAG_POINTER;
-
- $$ = l;
- }
-| simple_type Identifier '[' Integer ']'
- {
- struct arg *l = $1;
-
- strcpy(l->name, $2);
- l->flags |= FLAG_ARRAY;
- l->ar_size = $4;
-
- $$ = l;
- }
-;
-
-simple_type
-: type
- {
- struct arg *l = $1;
-
- $$ = l;
- }
-| _IDENT_CONST type
- {
- struct arg *l = $2;
-
- l->flags |= FLAG_CONST;
- // insert_string(l->types, $1);
-
- $$ = l;
- }
-| _IDENT_STRUCT type
- {
- struct arg *l = $2;
-
- l->flags |= FLAG_STRUCT;
- insert_string(l->types, $1);
-
- $$ = l;
- }
-| _IDENT_CONST _IDENT_STRUCT type
- {
- struct arg *l = $3;
-
- l->flags |= FLAG_CONST;
- l->flags |= FLAG_STRUCT;
- insert_string(l->types, $2);
- // insert_string(l->types, $1);
-
- $$ = l;
- }
-| _IDENT_UNION type
- {
- struct arg *l = $2;
-
- l->flags |= FLAG_UNION;
- insert_string(l->types, $1);
-
- $$ = l;
- }
-;
-
-type
-: _IDENT_CHAR
- {
- struct arg *l;
-
- l = make_arg(TYPE_CHAR, $1);
- OUT_OF_MEM(l);
-
- $$ = l;
- }
-| _IDENT_SHORT
- {
- struct arg *l;
-
- l = make_arg(TYPE_SHORT, $1);
- OUT_OF_MEM(l);
-
- $$ = l;
- }
-| _IDENT_LONG
- {
- struct arg *l;
-
- l = make_arg(TYPE_LONG, $1);
- OUT_OF_MEM(l);
-
- $$ = l;
- }
-| _IDENT_UNSIGNED
- {
- struct arg *l;
-
- l = make_arg(TYPE_UNSIGNED, $1);
- OUT_OF_MEM(l);
-
- $$ = l;
- }
-| _IDENT_UCHAR
- {
- struct arg *l;
-
- l = make_arg(TYPE_UCHAR, $1);
- OUT_OF_MEM(l);
-
- $$ = l;
- }
-| _IDENT_USHORT
- {
- struct arg *l;
-
- l = make_arg(TYPE_USHORT, $1);
- OUT_OF_MEM(l);
-
- $$ = l;
- }
-| _IDENT_ULONG
- {
- struct arg *l;
-
- l = make_arg(TYPE_ULONG, $1);
- OUT_OF_MEM(l);
-
- $$ = l;
- }
-| _IDENT_VOID
- {
- struct arg *l;
-
- l = make_arg(TYPE_VOID, $1);
- OUT_OF_MEM(l);
-
- $$ = l;
- }
-| Identifier
- {
- struct arg *l;
-
- l = make_arg(TYPE_IDENT, $1);
- OUT_OF_MEM(l);
-
- $$ = l;
- }
-;
-
-status
-: /* regular */
- {
- $$ = SYSCALL_REGULAR;
- }
-| _IDENT_UNSUPPORTED
- {
- $$ = SYSCALL_UNSUPPORTED;
- }
-| _IDENT_UNIMPLEMENTED
- {
- $$ = SYSCALL_UNIMPLEMENTED;
- }
-| _IDENT_PASSTHROUGH
- {
- $$ = SYSCALL_PASSTHROUGH;
- }
-;
-
-%%
-
-void
-yyerror(char *s)
-{
- errors++;
- printf("line %i: %s", yylinecount, s);
-
- if (strstr(s, "parse error"))
- printf(" near token \"%s\"", yytext);
-
- printf("\n");
-}
-
-static void
-insert_string(char *dst, const char *src)
-{
- char save[STRMAX];
- int l;
-
- strcpy(save, dst);
- strcpy(dst, src);
-
- l = strlen(dst);
- dst[l++] = ' ';
- strcpy(dst+l, save);
-}
-
-static int
-resize_tab(struct systab *tab, int newsize)
-{
- if (newsize > tab->size)
- {
- struct syscall **newtable = malloc(newsize * sizeof(*newtable));
-
- if (newtable)
- {
- bzero(newtable, newsize * sizeof(*newtable));
- memcpy(newtable, tab->table, tab->size * sizeof(*(tab->table)));
-
- free(tab->table);
- tab->table = newtable;
- tab->size = newsize;
-
- return 1;
- }
- }
- else
- {
- tab->size = newsize;
-
- return 1;
- }
-
- return 0;
-}
-
-static int
-add_tab(struct systab *tab, int nr, const char *name, struct arg *p, int status)
-{
- struct syscall *call = NULL;
-
- if (tab->size <= nr)
- if (!resize_tab(tab, nr + 100))
- return 1;
-
- if (name)
- {
- call = malloc(sizeof(*call));
- if (!call)
- return 1;
-
- bzero(call, sizeof(*call));
-
- strcpy(call->name, name);
- call->args = p;
- call->status = status;
- }
-
- tab->table[nr] = call;
-
- if (tab->maxused < nr)
- tab->maxused = nr;
-
- return 0;
-}
-
-static void
-add_arg(struct arg **head, struct arg *t)
-{
- while (*head)
- head = &((*head)->next);
-
- t->next = NULL;
- *head = t;
-}
-
-static struct arg *
-make_arg(int type, const char *s)
-{
- struct arg *l = malloc(sizeof(*l));
-
- if (l)
- {
- bzero(l, sizeof(*l));
-
- if (s) strcpy(l->types, s);
- l->type = type;
- }
-
- return l;
-}
diff -aurN -x CVS mintlib.orig/syscall/scan.l mintlib.clean/syscall/scan.l
--- mintlib.orig/syscall/scan.l 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/scan.l 1970-01-01 01:00:00.000000000 +0100
@@ -1,208 +0,0 @@
-/*
- * $Id: scan.l,v 1.2 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2004 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-%{
-
-#include <string.h>
-#include "syscalldefs.h"
-#include "pars.h"
-
-int yylex (void);
-int yylinecount = 1;
-
-%}
-
-digit [0-9]
-nonzerodigit [1-9]
-hexdigit [0-9abcdefABCDEF]
-
-letter [a-zA-Z_]
-ident {letter}({letter}|{digit})*
-
-space [ \t\n]
-
-
-%x comment cppcomment
-
-%%
-
-"/*" BEGIN (comment);
-<comment>[^*\n]* /* eat anything that's not a '*' */
-<comment>"*"+[^*/\n]* /* eat up '*'s not followed by '/'s */
-<comment>\n yylinecount++;
-<comment>"*"+"/" BEGIN (INITIAL);
-
-"//" BEGIN (cppcomment);
-<cppcomment>\n yylinecount++; BEGIN (INITIAL);
-<cppcomment>.
-
-
-
-"GEMDOS" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_GEMDOS;
-}
-
-"BIOS" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_BIOS;
-}
-
-"XBIOS" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_XBIOS;
-}
-
-"MAX" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_MAX;
-}
-
-"void" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_VOID;
-}
-
-"const" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_CONST;
-}
-
-"struct" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_STRUCT;
-}
-
-"union" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_UNION;
-}
-
-"char" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_CHAR;
-}
-
-"short" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_SHORT;
-}
-
-"long" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_LONG;
-}
-
-"unsigned" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_UNSIGNED;
-}
-
-"uchar" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_UCHAR;
-}
-
-"ushort" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_USHORT;
-}
-
-"ulong" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_ULONG;
-}
-
-"undefined" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_UNDEFINED;
-}
-
-"unsupported" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_UNSUPPORTED;
-}
-
-"unimplemented" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_UNIMPLEMENTED;
-}
-
-"passthrough" {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return _IDENT_PASSTHROUGH;
-}
-
-{nonzerodigit}{digit}* {
- yylval.value = strtol(yytext, NULL, 0);
- return Integer;
-}
-
-"0"("x"|"X"){hexdigit}+ {
- yylval.value = strtol(yytext, NULL, 0);
- return Integer;
-}
-
-{ident} {
- strncpy(yylval.ident, yytext, STRMAX);
- yylval.ident[STRMAX] = '\0';
- return Identifier;
-}
-
-{space} {
- if (*yytext == '\n')
- yylinecount++;
-}
-
-. {
- return *yytext;
-}
-
-%%
-
diff -aurN -x CVS mintlib.orig/syscall/syscalldefs.h mintlib.clean/syscall/syscalldefs.h
--- mintlib.orig/syscall/syscalldefs.h 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/syscalldefs.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,84 +0,0 @@
-/*
- * $Id: syscalldefs.h,v 1.1 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef _syscalldefs_h
-#define _syscalldefs_h
-
-#define STRMAX 255
-
-struct systab
-{
- struct syscall **table;
- int size;
- int max;
- int maxused;
-};
-
-struct syscall
-{
- char name[STRMAX];
- struct arg *args;
- int status;
-#define SYSCALL_REGULAR 0
-#define SYSCALL_UNIMPLEMENTED 1
-#define SYSCALL_UNSUPPORTED 2
-#define SYSCALL_PASSTHROUGH 3
-#define SYSCALL_UNDEFINED 4
-};
-
-struct arg
-{
- struct arg *next;
-
- int type;
-#define TYPE_VOID 0
-#define TYPE_INT 1
-#define TYPE_CHAR 2
-#define TYPE_SHORT 3
-#define TYPE_LONG 4
-#define TYPE_UNSIGNED 5
-#define TYPE_UCHAR 6
-#define TYPE_USHORT 7
-#define TYPE_ULONG 8
-#define TYPE_IDENT 9
- int flags;
-#define FLAG_CONST 0x01
-#define FLAG_STRUCT 0x02
-#define FLAG_UNION 0x04
-#define FLAG_POINTER 0x08
-#define FLAG_ARRAY 0x10
-#define FLAG_POINTER2 0x20
- int ar_size;
-
- char types[STRMAX];
- char name[STRMAX];
-};
-
-#endif /* _syscalldefs_h */
diff -aurN -x CVS mintlib.orig/syscall/syscallparser.c mintlib.clean/syscall/syscallparser.c
--- mintlib.orig/syscall/syscallparser.c 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/syscallparser.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,217 +0,0 @@
-/*
- * $Id: syscallparser.c,v 1.1 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2004 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-
-#include "syscalldefs.h"
-#include "syscallparser.h"
-
-
-void
-print_head(FILE *out, const char *myname)
-{
- time_t t = time(NULL);
-
- fprintf(out, "/*\n * %s, %s *\n", myname, ctime (&t));
- fprintf(out,
- " * DO NOT EDIT - this file is automatically generated!\n"
- " */\n"
- );
- fprintf(out, "\n");
-
- fprintf(out,
- "/* \n"
- " * This file belongs to FreeMiNT. It's not in the original MiNT 1.12 \n"
- " * distribution. See the file CHANGES for a detailed log of changes. \n"
- " * \n"
- " * \n"
- " * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de> \n"
- " * All rights reserved. \n"
- " * \n"
- " * Please send suggestions, patches or bug reports to me or \n"
- " * the MiNT mailing list. \n"
- " * \n"
- " * \n"
- " * This file is free software; you can redistribute it and/or modify \n"
- " * it under the terms of the GNU General Public License as published by \n"
- " * the Free Software Foundation; either version 2, or (at your option) \n"
- " * any later version. \n"
- " * \n"
- " * This file is distributed in the hope that it will be useful, \n"
- " * but WITHOUT ANY WARRANTY; without even the implied warranty of \n"
- " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n"
- " * GNU General Public License for more details. \n"
- " * \n"
- " * You should have received a copy of the GNU General Public License \n"
- " * along with this program; if not, write to the Free Software \n"
- " * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. \n"
- " * \n"
- " */ \n"
- );
- fprintf(out, "\n");
-}
-
-void
-generate_args(FILE *out, struct arg *l, const char *pre, int flag, const char *post)
-{
- while (l)
- {
- if (l->flags & FLAG_CONST)
- fprintf(out, "%sconst %s ", pre, l->types);
- else
- fprintf(out, "%s%s ", pre, l->types);
-
- if (l->flags & FLAG_POINTER)
- fprintf(out, "*");
-
- if (l->flags & FLAG_POINTER2)
- fprintf(out, "*");
-
- fprintf(out, "%s", l->name);
-
- if (l->flags & FLAG_ARRAY)
- fprintf(out, " [%i]", l->ar_size);
-
- if (l->next || flag)
- fprintf(out, "%s", post);
-
- l = l->next;
- }
-}
-
-int
-arg_length(struct arg *l)
-{
- int length = 0;
-
- while (l)
- {
- length++;
- l = l->next;
- }
-
- return length;
-}
-
-int
-arg_size_bytes(struct arg *l)
-{
- int size = 0;
-
- while (l)
- {
- if (l->flags & (FLAG_POINTER|FLAG_ARRAY))
- {
- size += 4;
- }
- else switch (l->type)
- {
- default:
- assert(0); break;
- case TYPE_IDENT:
- case TYPE_VOID:
- assert(0); break;
- case TYPE_INT:
- case TYPE_CHAR:
- case TYPE_SHORT:
- case TYPE_UNSIGNED:
- case TYPE_UCHAR:
- case TYPE_USHORT:
- size += 2; break;
- case TYPE_LONG:
- case TYPE_ULONG:
- size += 4; break;
- }
-
- l = l->next;
- }
-
- return size;
-}
-
-int
-is_regular_syscall(struct syscall *call)
-{
- return (call->status == SYSCALL_REGULAR);
-}
-
-int
-is_passthrough_syscall(struct syscall *call)
-{
- return (call->status == SYSCALL_PASSTHROUGH);
-}
-
-int
-is_syscall(struct syscall *call)
-{
- int ret = 0;
-
- switch (call->status)
- {
- case SYSCALL_REGULAR:
- case SYSCALL_UNIMPLEMENTED:
- case SYSCALL_UNSUPPORTED:
- ret = 1;
- break;
- case SYSCALL_PASSTHROUGH:
- ret = (strcmp(call->name, "passthrough") != 0);
- break;
- case SYSCALL_UNDEFINED:
- break;
- default:
- assert(0);
- break;
- }
-
- return ret;
-}
-
-/* from parser */
-int yyparse(void);
-extern FILE *yyin, *yyout;
-
-int errors = 0;
-
-int
-parse_syscall_description(FILE *infile)
-{
- yyin = stdin;
-
- if (infile)
- yyin = infile;
-
- yyparse();
-
- return errors;
-}
diff -aurN -x CVS mintlib.orig/syscall/syscallparser.h mintlib.clean/syscall/syscallparser.h
--- mintlib.orig/syscall/syscallparser.h 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/syscallparser.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,53 +0,0 @@
-/*
- * $Id: syscallparser.h,v 1.1 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef _syscallparser_h
-#define _syscallparser_h
-
-#include <stdio.h>
-#include "syscalldefs.h"
-
-struct systab *gemdos_table(void);
-struct systab *bios_table(void);
-struct systab *xbios_table(void);
-
-void print_head(FILE *out, const char *myname);
-void generate_args(FILE *out, struct arg *l, const char *pre, int flag, const char *post);
-
-int arg_length(struct arg *l);
-int arg_size_bytes(struct arg *l);
-
-int is_regular_syscall(struct syscall *call);
-int is_passthrough_syscall(struct syscall *call);
-int is_syscall(struct syscall *call);
-
-int parse_syscall_description(FILE *infile);
-
-#endif /* _syscallparser_h */
diff -aurN -x CVS mintlib.orig/syscall/syscalls.master mintlib.clean/syscall/syscalls.master
--- mintlib.orig/syscall/syscalls.master 2009-02-19 02:27:05.000000000 +0100
+++ mintlib.clean/syscall/syscalls.master 1970-01-01 01:00:00.000000000 +0100
@@ -1,812 +0,0 @@
-/*
- * $Id: syscalls.master,v 1.5 2009/02/19 01:27:05 alanh Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * Author: Frank Naumann <fnaumann@freemint.de>
- * Started: 2000-01-01
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- */
-
-
-/*
- * Syntax:
- *
- * opcode class name args
- * opcode class name args (unimplemented|unsupported|passthrough)
- * opcode (undefined|passthrough)
- *
- *
- * opcode - syscall number
- * class - syscall class
- * name - syscall name
- * args - C style prototype
- *
- * syscall status:
- *
- * - undefined
- * there is no system call defined for this opcode -> ENOSYS
- *
- * - unsupported
- * system call defined but not supported -> ENOSYS
- *
- * - unimplemented
- * system call defined but not yet implemented -> ENOSYS
- *
- * - passthrough
- * no entry in table, e.g. pass through to TOS
- *
- * MAX - size of table
- *
- * missing entries are automatically set to status 'undefined'
- *
- */
-
-
-[ GEMDOS ]
-
-/*
-opcode class name args */
-
-0x000 Pterm0 (void)
-
-0x001 Cconin (void)
-0x002 Cconout (short c)
-0x003 Cauxin (void)
-0x004 Cauxout (short c)
-0x005 Cprnout (short c)
-0x006 Crawio (short c)
-0x007 Crawcin (void)
-0x008 Cnecin (void)
-0x009 Cconws (const char *str)
-0x00a Cconrs (char *buf)
-0x00b Cconis (void)
-0x00c undefined
-0x00d undefined
-0x00e Dsetdrv (short d)
-0x00f undefined
-
-0x010 Cconos (void)
-0x011 Cprnos (void)
-0x012 Cauxis (void)
-0x013 Cauxos (void)
-0x014 Maddalt (long start, long size)
-0x015 Srealloc (long size)
-0x016 Slbopen (char *name, char *path, long min_ver,
- SHARED_LIB **sl, SLB_EXEC *fn) /* since 1.15.3, MagiC 5 */
-0x017 Slbclose (SHARED_LIB *sl) /* since 1.15.3, MagiC 5 */
-0x018 undefined
-0x019 Dgetdrv (void)
-0x01a Fsetdta (struct dtabuf *dta)
-0x01b undefined
-0x01c undefined
-0x01d undefined
-0x01e undefined
-0x01f undefined
-
-/*
- * The next binding is not quite right if used in another than the usual ways:
- * 1. Super(1L) from either user or supervisor mode
- * 2. ret = Super(0L) from user mode and after this Super(ret) from
- * supervisor mode
- * We get the following situations (usp, ssp relative to the start of Super):
- * Parameter Userstack Superstack Calling Mode ret
- * 1L usp ssp user 0L
- * 1L usp ssp supervisor -1L
- * 0L usp-6 usp user ssp
- * 0L ssp ssp-6 supervisor ssp-6
- * ptr usp-6 ptr+6 user ssp
- * ptr usp+6 ptr supervisor sr
- * The usual C-bindings are safe only because the "unlk a6" is compensating
- * the errors when you invoke this function. In this binding the "unlk a6" at
- * the end of the calling function compensates the error made in sequence 2
- * above (the usp is 6 to low after the first call which is not corrected by
- * the second call).
- */
-0x020 Super (long new_ssp)
-0x021 undefined
-0x022 undefined
-0x023 undefined
-0x024 undefined
-0x025 undefined
-0x026 undefined
-0x027 undefined
-0x028 undefined
-0x029 undefined
-0x02a Tgetdate (void)
-0x02b Tsetdate (ushort date)
-0x02c Tgettime (void)
-0x02d Tsettime (ushort date)
-0x02e undefined
-0x02f Fgetdta (void)
-
-0x030 Sversion (void)
-0x031 Ptermres (long save, short code)
-0x032 undefined
-0x033 Sconfig (short subfn, long flags) unsupported /* MagiC */
-0x034 undefined
-0x035 undefined
-0x036 Dfree (long *buf, short d)
-0x037 undefined
-0x038 undefined
-0x039 Dcreate (const char *name)
-0x03a Ddelete (const char *path)
-0x03b Dsetpath (const char *path)
-0x03c Fcreate (const char *name, short attrib)
-0x03d Fopen (const char *name, short mode)
-0x03e Fclose (short fh)
-0x03f Fread (short fh, long count, char *buf)
-
-0x040 Fwrite (short fh, long count, const char *buf)
-0x041 Fdelete (const char *path)
-0x042 Fseek (long place, short fh, short how)
-0x043 Fattrib (const char *name, short rwflag, short attr)
-0x044 Mxalloc (long size, short mode)
-0x045 Fdup (short fh)
-0x046 Fforce (short newh, short oldh)
-0x047 Dgetpath (char *path, short drv)
-0x048 Malloc (long size)
-0x049 Mfree (long block)
-0x04a Mshrink (short dummy, long block, long size)
-0x04b Pexec (short mode, const void *ptr1, const void *ptr2, const void *ptr3)
-0x04c Pterm (short code)
-0x04d undefined
-0x04e Fsfirst (const char *path, short attrib)
-0x04f Fsnext (void)
-
-0x050 undefined
-0x051 undefined
-0x052 undefined
-0x053 undefined
-0x054 undefined
-0x055 undefined
-0x056 Frename (short junk, const char *old, const char *new)
-0x057 Fdatime (short *timeptr, short fh, short wflag)
-0x058 undefined
-0x059 undefined
-0x05a undefined
-0x05b undefined
-0x05c Flock (short fh, short mode, long start, long length)
-0x05d undefined
-0x05e undefined
-0x05f undefined
-
-0x060 undefined
-0x061 undefined
-0x062 undefined
-0x063 undefined
-0x064 undefined
-0x065 undefined
-0x066 undefined
-0x067 undefined
-0x068 undefined
-0x069 undefined
-0x06a undefined
-0x06b undefined
-0x06c undefined
-0x06d undefined
-0x06e undefined
-0x06f undefined
-
-0x070 undefined
-0x071 undefined
-0x072 undefined
-0x073 undefined
-0x074 undefined
-0x075 undefined
-0x076 undefined
-0x077 undefined
-0x078 undefined
-0x079 undefined
-0x07a undefined
-0x07b undefined
-0x07c undefined
-0x07d undefined
-0x07e undefined
-0x07f undefined
-
-0x080 undefined
-0x081 undefined
-0x082 undefined
-0x083 undefined
-0x084 undefined
-0x085 undefined
-0x086 undefined
-0x087 undefined
-0x088 undefined
-0x089 undefined
-0x08a undefined
-0x08b undefined
-0x08c undefined
-0x08d undefined
-0x08e undefined
-0x08f undefined
-
-0x090 undefined
-0x091 undefined
-0x092 undefined
-0x093 undefined
-0x094 undefined
-0x095 undefined
-0x096 undefined
-0x097 undefined
-0x098 undefined
-0x099 undefined
-0x09a undefined
-0x09b undefined
-0x09c undefined
-0x09d undefined
-0x09e undefined
-0x09f undefined
-
-0x0a0 undefined
-0x0a1 undefined
-0x0a2 undefined
-0x0a3 undefined
-0x0a4 undefined
-0x0a5 undefined
-0x0a6 undefined
-0x0a7 undefined
-0x0a8 undefined
-0x0a9 undefined
-0x0aa undefined
-0x0ab undefined
-0x0ac undefined
-0x0ad undefined
-0x0ae undefined
-0x0af undefined
-
-0x0b0 undefined
-0x0b1 undefined
-0x0b2 undefined
-0x0b3 undefined
-0x0b4 undefined
-0x0b5 undefined
-0x0b6 undefined
-0x0b7 undefined
-0x0b8 undefined
-0x0b9 undefined
-0x0ba undefined
-0x0bb undefined
-0x0bc undefined
-0x0bd undefined
-0x0be undefined
-0x0bf undefined
-
-0x0c0 undefined
-0x0c1 undefined
-0x0c2 undefined
-0x0c3 undefined
-0x0c4 undefined
-0x0c5 undefined
-0x0c6 undefined
-0x0c7 undefined
-0x0c8 undefined
-0x0c9 undefined
-0x0ca undefined
-0x0cb undefined
-0x0cc undefined
-0x0cd undefined
-0x0ce undefined
-0x0cf undefined
-
-0x0d0 undefined
-0x0d1 undefined
-0x0d2 undefined
-0x0d3 undefined
-0x0d4 undefined
-0x0d5 undefined
-0x0d6 undefined
-0x0d7 undefined
-0x0d8 undefined
-0x0d9 undefined
-0x0da undefined
-0x0db undefined
-0x0dc undefined
-0x0dd undefined
-0x0de undefined
-0x0df undefined
-
-0x0e0 undefined
-0x0e1 undefined
-0x0e2 undefined
-0x0e3 undefined
-0x0e4 undefined
-0x0e5 undefined
-0x0e6 undefined
-0x0e7 undefined
-0x0e8 undefined
-0x0e9 undefined
-0x0ea undefined
-0x0eb undefined
-0x0ec undefined
-0x0ed undefined
-0x0ee undefined
-0x0ef undefined
-
-/*
- * MiNT extensions to GEMDOS
- */
-
-0x0f0 undefined
-0x0f1 undefined
-0x0f2 undefined
-0x0f3 undefined
-0x0f4 undefined
-0x0f5 undefined
-0x0f6 undefined
-0x0f7 undefined
-0x0f8 undefined
-0x0f9 undefined
-0x0fa undefined
-0x0fb undefined
-0x0fc undefined
-0x0fd undefined
-0x0fe undefined
-0x0ff Syield (void)
-
-0x100 Fpipe (short *usrh)
-0x101 Ffchown (short fh, short uid, short gid) /* since 1.15.2 */
-0x102 Ffchmod (short fh, ushort mode) /* since 1.15.2 */
-0x103 Fsync (short fh) /* since 1.15.10 */
-0x104 Fcntl (short fh, long arg, short cmd)
-0x105 Finstat (short fh)
-0x106 Foutstat (short fh)
-0x107 Fgetchar (short fh, short mode)
-0x108 Fputchar (short fh, long c, short mode)
-0x109 Pwait (void)
-0x10a Pnice (short increment)
-0x10b Pgetpid (void)
-0x10c Pgetppid (void)
-0x10d Pgetpgrp (void)
-0x10e Psetpgrp (short pid, short newgrp)
-0x10f Pgetuid (void)
-
-0x110 Psetuid (ushort id)
-0x111 Pkill (short pid, short sig)
-0x112 Psignal (short sig, long handler)
-0x113 Pvfork (void)
-0x114 Pgetgid (void)
-0x115 Psetgid (ushort id)
-0x116 Psigblock (ulong mask)
-0x117 Psigsetmask (ulong mask)
-0x118 Pusrval (long arg)
-0x119 Pdomain (short arg)
-0x11a Psigreturn (void)
-0x11b Pfork (void)
-0x11c Pwait3 (short nohang, long *rusage)
-0x11d Fselect (unsigned timeout, long *rfdp, long *wfdp, long *xfdp)
-0x11e Prusage (long *r)
-0x11f Psetlimit (short i, long v)
-
-0x120 Talarm (long x)
-0x121 Ppause (void)
-0x122 Ssysconf (short which)
-0x123 Psigpending (void)
-0x124 Dpathconf (const char *name, short which)
-0x125 Pmsg (short mode, long mbid, char *ptr)
-0x126 Fmidipipe (short pid, short in, short out)
-0x127 Prenice (short pid, short increment)
-0x128 Dopendir (const char *path, short flags)
-0x129 Dreaddir (short len, long handle, char *buf)
-0x12a Drewind (long handle)
-0x12b Dclosedir (long handle)
-0x12c Fxattr (short flag, const char *name, struct xattr *xattr)
-0x12d Flink (const char *old, const char *new)
-0x12e Fsymlink (const char *old, const char *new)
-0x12f Freadlink (short buflen, char *buf, const char *linkfile)
-
-0x130 Dcntl (short cmd, const char *name, long arg)
-0x131 Fchown (const char *name, short uid, short gid)
-0x132 Fchmod (const char *name, unsigned mode)
-0x133 Pumask (ushort mode)
-0x134 Psemaphore (short mode, long id, long timeout)
-0x135 Dlock (short mode, short drv)
-0x136 Psigpause (ulong mask)
-0x137 Psigaction (short sig, const struct sigaction *act, struct sigaction *oact)
-0x138 Pgeteuid (void)
-0x139 Pgetegid (void)
-0x13a Pwaitpid (short pid, short nohang, long *rusage)
-0x13b Dgetcwd (char *path, short drv, short size)
-0x13c Salert (char *msg)
-0x13d Tmalarm (long x)
-0x13e Psigintr (ushort vec, ushort sig) unsupported /* cancelled in 1.16 */
-0x13f Suptime (ulong *cur_uptim, ulong loadave[3])
-
-0x140 Ptrace (short request, short pid, void *addr, long data) /* since 1.15.11 */
-0x141 Mvalidate (short pid, void *addr, long size, long *flags) /* since 1.15.11 */
-0x142 Dxreaddir (short len, long handle, char *buf, struct xattr *xattr, long *xret)
-0x143 Pseteuid (ushort id)
-0x144 Psetegid (ushort id)
-0x145 Pgetauid (void)
-0x146 Psetauid (short id)
-0x147 Pgetgroups (short gidsetlen, ushort gidset[])
-0x148 Psetgroups (short ngroups, ushort gidset[])
-0x149 Tsetitimer (short which, long *interval, long *value,
- long *ointerval, long *ovalue)
-0x14a Dchroot (const char *dir) /* since 1.15.3 */
-0x14b Fstat64 (short flag, const char *name, struct stat *stat) /* since 1.15.4 */
-0x14c Fseek64 (long hiplace, long lowplace, short fh, short how,
- void *newpos) /* since 1.15.10 */
-0x14d Dsetkey (long hidev, long lowdev, char *key, short cipher) /* since 1.15.4 */
-0x14e Psetreuid (ushort rid, ushort eid)
-0x14f Psetregid (ushort rid, ushort eid)
-
-0x150 Ssync (void)
-0x151 Shutdown (long restart)
-0x152 Dreadlabel (const char *path, char *label, short maxlen)
-0x153 Dwritelabel (const char *path, const char *label)
-0x154 Ssystem (short mode, ulong arg1, ulong arg2)
-0x155 Tgettimeofday (struct timeval *tv, struct timezone *tz)
-0x156 Tsettimeofday (struct timeval *tv, struct timezone *tz)
-0x157 Tadjtime (const struct timeval *delta, struct timeval *olddelta)
-0x158 Pgetpriority (short which, short who)
-0x159 Psetpriority (short which, short who, short prio)
-0x15a Fpoll (struct pollfd *fds, ulong nfds, ulong timeout) /* since 1.15.10 */
-0x15b Fwritev (short fd, const struct iovec *iov, long niov) /* since 1.16 */
-0x15c Freadv (short fd, const struct iovec *iov, long niov) /* since 1.16 */
-0x15d Ffstat (short fd, struct stat *st) /* since 1.16 */
-0x15e Psysctl (long *name, ulong namelen,
- void *old, ulong *oldlenp,
- const void *new, ulong newlen)
-0x15f Semulation (ushort which, ushort op,
- long a1, long a2, long a3, long a4,
- long a5, long a6, long a7) /* since 1.15.8 */
-
- /* 1.16 - socket extensions */
-
-0x160 Fsocket (long domain, long type, long protocol)
-0x161 Fsocketpair (long domain, long type, long protocol, short fds[2])
-0x162 Faccept (short fd, struct sockaddr *name, ulong *anamelen)
-0x163 Fconnect (short fd, const struct sockaddr *name, ulong namelen)
-0x164 Fbind (short fd, const struct sockaddr *name, ulong namelen)
-0x165 Flisten (short fd, long backlog)
-0x166 Frecvmsg (short fd, struct msghdr *msg, long flags)
-0x167 Fsendmsg (short fd, const struct msghdr *msg, long flags)
-0x168 Frecvfrom (short fd, void *buf, ulong len, long flags,
- struct sockaddr *from, ulong *fromlenaddr)
-0x169 Fsendto (short fd, const void *buf, ulong len, long flags,
- const struct sockaddr *to, ulong tolen)
-0x16a Fsetsockopt (short fd, long level, long name, const void *val, ulong valsize)
-0x16b Fgetsockopt (short fd, long level, long name, void *val, ulong *avalsize)
-0x16c Fgetpeername (short fd, struct sockaddr *asa, ulong *alen)
-0x16d Fgetsockname (short fd, struct sockaddr *asa, ulong *alen)
-0x16e Fshutdown (short fd, long how)
-0x16f undefined
-
- /* 1.16 - svr5 IPC */
-
-0x170 Pshmget (long key, long size, long shmflg)
-0x171 Pshmctl (long shmid, long cmd, struct shmid_ds *buf)
-0x172 Pshmat (long shmid, const void *shmaddr, long shmflg)
-0x173 Pshmdt (const void *shmaddr)
-0x174 Psemget (long key, long nsems, long semflg)
-0x175 Psemctl (long semid, long semnum, long cmd, union __semun *arg)
-0x176 Psemop (long semid, struct sembuf *sops, long nsops)
-0x177 Psemconfig (long flag)
-0x178 Pmsgget (long key, long msgflg)
-0x179 Pmsgctl (long msqid, long cmd, struct msqid_ds *buf)
-0x17a Pmsgsnd (long msqid, const void *msgp, long msgsz, long msgflg)
-0x17b Pmsgrcv (long msqid, void *msgp, long msgsz, long msgtyp, long msgflg)
-0x17c undefined
-0x17d Maccess (void *addr, long size, short mode) /* since 1.15.12 */
-0x17e undefined /* mmap */
-0x17f undefined /* munmap */
-
-0x180 Fchown16 (const char *name, short uid, short gid,
- short follow) /* since 1.16 */
-0x181 Fchdir (short fd) /* since 1.17 */
-0x182 Ffdopendir (short fd) /* since 1.17 */
-0x183 Fdirfd (long handle) /* since 1.17 */
-0x184 undefined
-0x185 undefined
-0x186 undefined
-0x187 undefined
-0x188 undefined
-0x189 undefined
-0x18a undefined
-0x18b undefined
-0x18c undefined
-0x18d undefined
-0x18e undefined
-0x18f undefined
-
-0x190 MAX
-
-
-[ BIOS ]
-
-0x000 Getmpb (long ptr) unsupported
-0x001 Bconstat (short dev)
-0x002 Bconin (short dev)
-0x003 Bconout (short dev, short c)
-0x004 Rwabs (short rwflag, void *buffer, short number,
- short recno, short dev, long lrecno)
-0x005 Setexc (short number, long vector)
-0x006 Tickcal (void)
-0x007 Getbpb (short dev)
-0x008 Bcostat (short dev)
-0x009 Mediach (short dev)
-0x00a Drvmap (void)
-0x00b Kbshift (short mode)
-0x00c passthrough
-0x00d passthrough
-0x00e passthrough
-0x00f passthrough
-
-0x010 MAX
-
-
-[ XBIOS ]
-
-0x000 Initmouse (short type, long param, long vptr) passthrough
-0x001 Ssbrk (short size) passthrough
-0x002 Physbase (void) passthrough
-0x003 Logbase (void) passthrough
-0x004 Getrez (void) passthrough
-0x005 Vsetscreen (long log, long phys, short rez, short mode)
-0x006 Setpalette (long palptr) passthrough
-0x007 Setcolor (short colornum, short mixture) passthrough
-0x008 Floprd (long buf, long x, short d, short sect, short trk,
- short side, short n) passthrough
-0x009 Flopwr (long buf, long x, short d, short sect, short trk,
- short side, short n) passthrough
-0x00a Flopfmt (long buf, long x, short d, short spt, short t,
- short sd, short i, long m, short v) passthrough
-0x00b Dbmsg (short rsrvd, short msg_num, long msg_arg) passthrough /* ATARI Debugger */
-0x00c Midiws (short cnt, const char *buf)
-0x00d Mfpint (short vnum, long vptr) passthrough
-0x00e Iorec (short dev)
-0x00f Rsconf (short baud, short flow, short uc, short rs, short ts, short sc)
-
-0x010 Keytbl (char *unshift, char *shift, char *caps)
-0x011 Random (void)
-0x012 Protobt (long buf, long serial, short dsktyp, short exec) passthrough
-0x013 Flopver (long buf, long x, short d, short sect, short trk,
- short sd, short n) passthrough
-0x014 Scrdmp (void) passthrough
-0x015 Cursconf (short cmd, short op)
-0x016 Settime (ulong datetime)
-0x017 Gettime (void)
-0x018 Bioskeys (void)
-0x019 Ikbdws (short len_minus1, long ptr) passthrough
-0x01a Jdisint (short vnum) passthrough
-0x01b Jenabint (short vnum) passthrough
-0x01c Giaccess (short data, short reg) passthrough
-0x01d Offgibit (short ormask) passthrough
-0x01e Ongibit (short andmask) passthrough
-0x01f Xbtimer (short timer, short ctrl, short data, long vptr) passthrough
-
-0x020 Dosound (const char *ptr)
-0x021 Setprt (short config) passthrough
-0x022 Kbdvbase (void) passthrough
-0x023 Kbrate (short delay, short reprate) passthrough
-0x024 Prtblk (long pblkptr) passthrough
-0x025 Vsync (void) passthrough
-0x026 Supexec (void *funcptr, long a1, long a2, long a3, long a4, long a5)
-0x027 Puntaes (void) passthrough
-0x028 passthrough
-0x029 Floprate (short drive, short rate) passthrough
-0x02a DMAread (long sector, short count, long buffer, short devno) passthrough
-0x02b DMAwrite (long sector, short count, long buffer, short devno) passthrough
-0x02c Bconmap (short dev)
-0x02d passthrough
-0x02e NVMaccess (short op, short start, short count, long buf) passthrough
-0x02f Waketime (ushort w_date, ushort w_time) passthrough
-
- /* MetaDOS XBIOS extensions (0x30 - 0x3f) */
-
-0x030 Metainit (void *metainit) unsupported
-0x031 Metaopen (short drive, void *metaopen) unsupported
-0x032 Metaclose (short drive) unsupported
-0x033 Metaread (short drive, void *buffer, ulong first,
- ushort count) unsupported
-0x034 Metawrite (short drive, void *buffer, ulong first,
- ushort count) unsupported
-0x035 Metaseek (short drive, ulong offset) unsupported
-0x036 Metastatus (short drive, void *extended) unsupported
-0x037 Metaioctl (short drive, long magic, short opcode,
- void *buffer) unsupported
-0x038 undefined /* reserved for MetaDOS */
-0x039 undefined /* reserved for MetaDOS */
-0x03a undefined /* reserved for MetaDOS */
-0x03b Metastartaudio (short drive, ushort dummy, void *tracks) unsupported
-0x03c Metastopaudio (short drive) unsupported
-0x03d Metasetsongtime(short drive, ushort dummy, ulong start,
- ulong end) unsupported
-0x03e Metagettoc (short drive, ushort dummy, void *tocentry) unsupported
-0x03f Metadiscinfo (short drive, void *discinfo) unsupported
-
-/*
- * Flag:
- * -1: get config
- * !-1: set config previous config returned
- * bit
- * 0 0 blit mode soft 1 blit mode hardware
- * 1 0 no blitter 1 blitter present
- * 2..14 reserved
- * 15 must be zero on set/returned as zero
- * blitmode (bit 0) forced to soft if no blitter(bit 1 == 0).
- */
-0x040 Blitmode (short flag) passthrough
-0x041 passthrough
-0x042 passthrough
-0x043 passthrough
-0x044 passthrough
-0x045 passthrough
-0x046 passthrough
-0x047 passthrough
-0x048 passthrough
-0x049 passthrough
-0x04a passthrough
-0x04b passthrough
-0x04c passthrough
-0x04d passthrough
-0x04e passthrough
-0x04f passthrough
-
-0x050 EsetShift (short mode) passthrough
-0x051 EgetShift (void) passthrough
-0x052 EsetBank (short bank) passthrough
-0x053 EsetColor (short num, short val) passthrough
-0x054 EsetPalette (short start, short count, long ptr) passthrough
-0x055 EgetPalette (short start, short count, long ptr) passthrough
-0x056 EsetGray (short mode) passthrough
-0x057 EsetSmear (short mode) passthrough
-0x058 VsetMode (short mode) passthrough
-0x059 VgetMonitor (void) passthrough
-0x05a VsetSync (short ext) passthrough
-0x05b VgetSize (short mode) passthrough
-0x05c passthrough
-0x05d VsetRGB (short index, short count, long *array) passthrough
-0x05e VgetRGB (short index, short count, long *array) passthrough
-0x05f Validmode (short mode) passthrough
-
-0x060 Dsp_DoBlock (long data_in, long size_in, long data_out,
- long size_out) passthrough
-0x061 Dsp_BlkHandShake(long data_in, long size_in, long data_out,
- long size_out) passthrough
-0x062 Dsp_BlkUnpacked (long data_in, long size_in, long data_out,
- long size_out) passthrough
-0x063 Dsp_InStream (long data_in, long blksiz, long numblks, long blksdone) passthrough
-0x064 Dsp_OutStream (long data_out, long blksiz, long numblks, long blksdone) passthrough
-0x065 Dsp_IOStream (long data_in, long data_out, long blkisiz,
- long blkosiz, long numblks, long blksdone) passthrough
-0x066 Dsp_RemoveInterrupts(short mask) passthrough
-0x067 Dsp_GetWordSize (void) passthrough
-0x068 Dsp_Lock (void) passthrough
-0x069 Dsp_Unlock (void) passthrough
-0x06a Dsp_Available (long xmem, long ymem) passthrough
-0x06b Dsp_Reserve (long xmem, long ymem) passthrough
-0x06c Dsp_LoadProg (long file, short ability, long buffer) passthrough
-0x06d Dsp_ExecProg (long codeptr, long codesiz, short ability) passthrough
-0x06e Dsp_ExecBoot (long codeptr, long codesiz, short ability) passthrough
-0x06f Dsp_LodToBinary (long file, long codeptr) passthrough
-
-0x070 Dsp_TriggerHC (short vector) passthrough
-0x071 Dsp_RequestUniqueAbility(void) passthrough
-0x072 Dsp_GetProgAbility(void) passthrough
-0x073 Dsp_FlushSubroutines(void) passthrough
-0x074 Dsp_LoadSubroutine(long ptr, long siz, short ability) passthrough
-0x075 Dsp_InqSubrAbility(short ability) passthrough
-0x076 Dsp_RunSubroutine(short handle) passthrough
-0x077 Dsp_Hf0 (short flag) passthrough
-0x078 Dsp_Hf1 (short flag) passthrough
-0x079 Dsp_Hf2 (void) passthrough
-0x07a Dsp_Hf3 (void) passthrough
-0x07b Dsp_BlkWords (long data_in, long size_in, long data_out,
- long size_out) passthrough
-0x07c Dsp_BlkBytes (long data_in, long size_in, long data_out,
- long size_out) passthrough
-0x07d Dsp_HStat (void) passthrough
-0x07e Dsp_SetVectors (long rcvr, long xmtr) passthrough
-0x07f Dsp_MultBlocks (long numsend, long numrecv, long sendblks,
- long recvblks) passthrough
-
-0x080 Locksnd (void) passthrough
-0x081 Unlocksnd (void) passthrough
-0x082 Soundcmd (short mode, short data) passthrough /* NSoundcmd for MilanBlaster */
-0x083 Setbuffer (short region, long beg, long end) passthrough
-0x084 Setmode (short stereo_mode) passthrough
-0x085 Settracks (short play, short rec) passthrough
-0x086 Setmontracks (short montrack) passthrough
-0x087 Setinterrupt (short src_inter, short cause) passthrough
-0x088 Buffoper (short mode) passthrough
-0x089 Dsptristate (short dspxmit, short dsprec) passthrough
-0x08a Gpio (short mode, short data) passthrough
-0x08b Devconnect (short src, short dst, short sclk, short pre, short proto) passthrough
-0x08c Sndstatus (short reset) passthrough
-0x08d Buffptr (long ptr) passthrough
-0x08e passthrough
-0x08f passthrough
-
-0x090 passthrough
-0x091 passthrough
-0x092 passthrough
-0x093 passthrough
-0x094 passthrough
-0x095 passthrough
-0x096 VsetMask (short andmask, short ormask) passthrough
-0x097 passthrough
-0x098 passthrough
-0x099 passthrough
-0x09a passthrough
-0x09b passthrough
-0x09c passthrough
-0x09d passthrough
-0x09e passthrough
-0x09f passthrough
-
-0x0a0 CacheCtrl (short opcode, short param) passthrough /* Milan TOS, control CPU cache */
-0x0a1 WdgCtrl (short opcode) passthrough /* Milan TOS, control hardware watchdog */
-0x0a2 ExtRsConf (short command, short device, long param) passthrough
- /* Milan TOS, extended RsConf for RS-422/RS-485 ports */
-0x0a3 passthrough
-0x0a4 passthrough
-0x0a5 Waveplay (short flags, long rate, long sptr, long slen) passthrough /* SAM, play a sample */
-0x0a6 passthrough
-0x0a7 passthrough
-0x0a8 passthrough
-0x0a9 passthrough
-0x0aa passthrough
-0x0ab passthrough
-0x0ac passthrough
-0x0ad passthrough
-0x0ae passthrough
-0x0af passthrough
-
-0x0b0 MAX
-
-// 0x00c2 /* Crazy-Dots */ GetScreenDescriptor()
-// 0x00c3 /* Crazy-Dots */ ResetScreen()
-// 0x00c4 /* Crazy-Dots */ GetNumberofPModes()
-// 0x00c5 /* Crazy-Dots */ GetPMode()
-// 0x00c6 /* Crazy-Dots */ ReadMode()
-// 0x00c7 /* Crazy-Dots */ CopyModeToActiveMode()
-// 0x00c8 /* Crazy-Dots */ ActiveModeNumber()
-// 0x00c9 /* Crazy-Dots */ GetActiveModeDesc()
-// 0x00ca /* Crazy-Dots */ GetRegisterbase()
-// 0x00cb /* Crazy-Dots */ GetFeatures()
-// 0x00cf /* Crazy-Dots */ GetActiveFeatures()
-//
-// 0x012c /* PCI-BIOS v2.00 */ Find_PCI_device(long id, short index)
-// 0x012d /* PCI-BIOS v2.00 */ Find_PCI_class_code(long classcode, short index)
-//
-// 0x01f4 /* StarTrack */ StarTrack()
-//
-// 0x022b /* Trapper */ Trapper(short magic, short layer, short install, short opcode, void *func)
-// /* magic must be 555 */
-//
-// 0x1068 /* Overscan */ Oscanis()
-// 0x1069 /* Overscan */ Oscantab()
-// 0x106a /* Overscan */ Oscanphy()
-// 0x106b /* Overscan */ Oscanscr()
-// 0x106c /* Overscan */ Oscanvb()
-// 0x106d /* Overscan */ Oscanpatch()
-// 0x106e /* Overscan */ Oscanswitch()
-//
-// 0xc60a /* CT60 */ ct60_read_core_temperature() /* read CT60 CPU temperature */
-// 0xc60b /* CT60 */ ct60_rw_parameter() /* set/query CT60 parameters */
diff -aurN -x CVS mintlib.orig/syscall/traps.c mintlib.clean/syscall/traps.c
--- mintlib.orig/syscall/traps.c 2009-05-18 20:54:50.718750000 +0200
+++ mintlib.clean/syscall/traps.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,280 +0,0 @@
-/*
- * $Id: traps.c,v 1.4 2009/05/18 18:32:17 alanh Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "traps.h"
-#include "syscallparser.h"
-
-
-struct call
-{
- struct call *next;
- int nr;
- char *call;
-};
-
-static struct call *root = NULL;
-
-void
-add_trap(int nr, const char *call)
-{
- struct call *l;
-
- l = root;
- while (l)
- {
- if ((l->nr == nr) && !strcmp(l->call, call))
- return;
-
- l = l->next;
- }
-
- l = malloc(sizeof(*l));
- if (!l)
- {
- perror("malloc");
- exit(1);
- }
-
- l->nr = nr;
- l->call = strdup(call);
-
- if (!l->call)
- {
- perror("malloc");
- exit(1);
- }
-
- l->next = root;
- root = l;
-}
-
-static void
-generate_trap_impl(FILE *out, int nr, const char *call)
-{
- int size = 2;
- int len = strlen(call);
- int i;
-
- fprintf(out, "\n");
- fprintf(out, "#if __GNUC__ > 2 || __GNUC_MINOR__ > 5\n");
- fprintf(out, "#define AND_MEMORY , \"memory\"\n");
- fprintf(out, "#else\n");
- fprintf(out, "#define AND_MEMORY\n");
-// fprintf(out, "#define __extension__\n");
- fprintf(out, "#endif\n");
- fprintf(out, "\n");
-
- fprintf(out, "long\n");
- fprintf(out, "__trap_%i_w%s(short n", nr, call);
-
- i = 0;
- while (i < len)
- {
- if (call[i] == 'w')
- fprintf(out, ", short a%i", i);
- else if (call[i] == 'l')
- fprintf(out, ", long a%i", i);
- else
- {
- printf("wrong syscall argument: %s\n", call);
- exit(1);
- }
-
- i++;
- }
-
- fprintf(out, ")\n");
- fprintf(out, "{\n");
-
- fprintf(out, "\tregister long ret __asm__(\"d0\");\n");
- fprintf(out, "\t\n");
- fprintf(out, "\t__asm__ volatile\n");
- fprintf(out, "\t(\n");
-
- i = len - 1;
- while (i >= 0)
- {
- fprintf(out, "\t\t\"");
-
- if (call[i] == 'w')
- {
- fprintf(out, "movw");
- size += 2;
- }
- else if (call[i] == 'l')
- {
- fprintf(out, "movl");
- size += 4;
- }
-
- fprintf(out, "\t%%%i,sp@-\\n\\t\"\n", i+2);
-
- i--;
- }
-
- fprintf(out, "\t\t\"movw\t%%1,sp@-\\n\\t\"\n");
- fprintf(out, "\t\t\"trap\t#1\\n\\t\"\n");
- if (size <= 8)
- fprintf(out, "\t\t\"addql\t#%i,sp\"\n", size);
- else
- fprintf(out, "\t\t\"lea\tsp@(%i),sp\"\n", size);
-
- fprintf(out, "\t: \"=r\"(ret) /* outputs */\n");
- fprintf(out, "\t: \"g\"(n)");
- i = 0;
- while (i < len)
- {
- fprintf(out, ", \"r\"(a%i)", i);
- i++;
- }
- fprintf(out, "\n");
- fprintf(out, "\t: \"d0\", \"d1\", \"d2\", \"a0\", \"a1\", \"a2\" /* clobbered regs */\n");
- fprintf(out, "\t AND_MEMORY\n");
- fprintf(out, "\t);\n");
- fprintf(out, "\t\n");
- fprintf(out, "\treturn ret;\n");
-
- fprintf(out, "}\n");
-}
-
-void
-generate_traps(const char *path)
-{
- char srcbuf[1024];
- FILE *src;
- struct call *l;
-
- snprintf(srcbuf, sizeof(srcbuf), "%s/SRCFILES.traps", path);
-
- src = fopen(srcbuf, "w+");
- if (!src)
- {
- perror("fopen");
- exit(1);
- }
-
- fprintf(src, "TRAPS = \\\n");
-
- l = root;
- while (l)
- {
- char buf[1024];
- FILE *f;
-
- fprintf(src, "\ttrap_%i_w%s.c", l->nr, l->call);
- snprintf(buf, sizeof(buf), "%s/trap_%i_w%s.c", path, l->nr, l->call);
-
- f = fopen(buf, "w+");
- if (!f)
- {
- perror("fopen");
- exit(1);
- }
-
- print_head(f, "gen-syscall");
- fprintf(f, "#include <mint/trap.h>\n");
- fprintf(f, "\n");
-
- generate_trap_impl(f, l->nr, l->call);
-
- fclose(f);
- l = l->next;
-
- if (l) fprintf(src, " \\\n");
- }
-
- fprintf(src, "\n");
- fclose(src);
-}
-
-static void
-generate_trap_proto(FILE *out, int nr, const char *call)
-{
- int len = strlen(call);
- int i;
-
- fprintf(out, "long __trap_%i_w%s(short", nr, call);
-
- i = 0;
- while (i < len)
- {
- if (call[i] == 'w')
- fprintf(out, ", short");
- else if (call[i] == 'l')
- fprintf(out, ", long");
- else
- {
- printf("wrong syscall argument: %s\n", call);
- exit(1);
- }
-
- i++;
- }
-
- fprintf(out, ");\n");
-}
-
-void
-generate_trap_h(const char *path)
-{
- char buf[1024];
- FILE *f;
- struct call *l;
-
- snprintf(buf, sizeof(buf), "%s/trap.h", path);
-
- f = fopen(buf, "w+");
- if (!f)
- {
- perror("fopen");
- exit(1);
- }
-
- print_head(f, "gen-syscall");
- fprintf (f, "#ifndef _trap_h\n");
- fprintf (f, "#define _trap_h\n\n");
- fprintf (f, "\n");
-
- l = root;
- while (l)
- {
- generate_trap_proto(f, l->nr, l->call);
-
- l = l->next;
- }
-
- fprintf (f, "\n");
- fprintf (f, "\n#endif /* _trap_h */\n");
- fclose(f);
-}
diff -aurN -x CVS mintlib.orig/syscall/traps.h mintlib.clean/syscall/traps.h
--- mintlib.orig/syscall/traps.h 2005-12-22 10:37:57.000000000 +0100
+++ mintlib.clean/syscall/traps.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,41 +0,0 @@
-/*
- * $Id: traps.h,v 1.2 2005/12/22 09:37:57 fna Exp $
- *
- * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
- * distribution. See the file CHANGES for a detailed log of changes.
- *
- *
- * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
- * All rights reserved.
- *
- * Please send suggestions, patches or bug reports to me or
- * the MiNT mailing list.
- *
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef _traps_h
-#define _traps_h
-
-
-void add_trap(int nr, const char *call);
-
-void generate_traps(const char *path);
-void generate_trap_h(const char *path);
-
-
-#endif /* _traps_h */