Compare commits
64 Commits
master
...
wip-gcc4.2
Author | SHA1 | Date |
---|---|---|
Jan (janneke) Nieuwenhuizen | c1c08d5583 | |
Jan (janneke) Nieuwenhuizen | 25fa1193af | |
Jan (janneke) Nieuwenhuizen | 41d827c7cf | |
Jan (janneke) Nieuwenhuizen | 12b3a82d6a | |
Jan (janneke) Nieuwenhuizen | 9803ffc1e5 | |
Jan (janneke) Nieuwenhuizen | 502b7c1eea | |
Jan (janneke) Nieuwenhuizen | 7cbe2b1152 | |
Jan (janneke) Nieuwenhuizen | cb49899215 | |
Jan (janneke) Nieuwenhuizen | 5421058c84 | |
Jan (janneke) Nieuwenhuizen | d270e5ef24 | |
Jan (janneke) Nieuwenhuizen | 23b101b54b | |
Jan (janneke) Nieuwenhuizen | ecb719f01f | |
Jan (janneke) Nieuwenhuizen | c654786852 | |
Jan (janneke) Nieuwenhuizen | 04123ab49d | |
Jan (janneke) Nieuwenhuizen | c3cdac8d0a | |
Jan (janneke) Nieuwenhuizen | 3fd7ba82a6 | |
Jan (janneke) Nieuwenhuizen | 31679d6e86 | |
Jan (janneke) Nieuwenhuizen | dfab232bbb | |
Jan (janneke) Nieuwenhuizen | 16282f8ecd | |
Jan (janneke) Nieuwenhuizen | 7b3d0c7aa6 | |
Jan (janneke) Nieuwenhuizen | f22d640465 | |
Danny Milosavljevic | 266c207954 | |
Jan Nieuwenhuizen | 895bebf395 | |
Jan Nieuwenhuizen | c45cbff8ba | |
Jan Nieuwenhuizen | 571ea5ce9e | |
Jan Nieuwenhuizen | 130d6c465f | |
Jan (janneke) Nieuwenhuizen | c2784d43de | |
Jan Nieuwenhuizen | f17307c418 | |
Jan Nieuwenhuizen | 48e495189e | |
Jan Nieuwenhuizen | 3f5a2523ac | |
Jan Nieuwenhuizen | 2792233e56 | |
Jan Nieuwenhuizen | 85153b6fa8 | |
Jan Nieuwenhuizen | 7799f3688e | |
Jan Nieuwenhuizen | fc50c1be58 | |
Jan Nieuwenhuizen | c7e08071ee | |
Jan Nieuwenhuizen | d55a7d946b | |
Jan Nieuwenhuizen | 223606b2ca | |
Jan (janneke) Nieuwenhuizen | c2e41ff647 | |
Jan (janneke) Nieuwenhuizen | 75fde18d24 | |
Jan (janneke) Nieuwenhuizen | 3ee3a94525 | |
Jan (janneke) Nieuwenhuizen | cc33dd95c3 | |
Jan (janneke) Nieuwenhuizen | 770ae64ccc | |
Jan (janneke) Nieuwenhuizen | 9af39b008e | |
Jan (janneke) Nieuwenhuizen | 9c7e1550a1 | |
Jan (janneke) Nieuwenhuizen | a2f0f44a96 | |
Jan (janneke) Nieuwenhuizen | 950314486b | |
Jan (janneke) Nieuwenhuizen | d92143cb0a | |
Jan (janneke) Nieuwenhuizen | 7641a5a8a7 | |
Jan (janneke) Nieuwenhuizen | 9f4d81eec4 | |
Jan (janneke) Nieuwenhuizen | 276d895b1e | |
Jan (janneke) Nieuwenhuizen | 12480dfe0c | |
Jan (janneke) Nieuwenhuizen | 34352f53c2 | |
Jan (janneke) Nieuwenhuizen | 514287808f | |
Jan (janneke) Nieuwenhuizen | e7e62923f4 | |
Jan (janneke) Nieuwenhuizen | 3fc272ec31 | |
Jan (janneke) Nieuwenhuizen | b79f0269ac | |
Jan (janneke) Nieuwenhuizen | 010ab9ae74 | |
Jan (janneke) Nieuwenhuizen | 81b680a9c6 | |
Gabriel Wicki | ff3c6ad66b | |
Ekaitz | cfa8f0db84 | |
Ekaitz | 02ffc5da94 | |
Jan (janneke) Nieuwenhuizen | 0f362be1da | |
Jan (janneke) Nieuwenhuizen | f8ea51ae2b | |
Jan (janneke) Nieuwenhuizen | f6c53ac80d |
|
@ -1,3 +1,21 @@
|
|||
# GNU Mes --- Maxwell Equations of Software
|
||||
# Copyright © 2016,2017,2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
# GNU Mes 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 3 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*-
|
||||
*~
|
||||
.#*
|
||||
|
@ -117,6 +135,7 @@
|
|||
/doc/images/gcc-mesboot-graph.pdf
|
||||
/doc/web/
|
||||
/config.sh
|
||||
/include/arch
|
||||
/include/mes/config.h
|
||||
/gcc-lib
|
||||
/mescc-lib
|
||||
|
|
3
HACKING
3
HACKING
|
@ -5,7 +5,8 @@
|
|||
guix shell #64 bit + 32bit
|
||||
|
||||
CC=i686-unknown-linux-gnu-gcc ./configure
|
||||
CC=arm-unknown-linux-gnu-gcc ./configure
|
||||
CC=arm-unknown-linux-gnueabihf-gcc ./configure
|
||||
|
||||
or
|
||||
./configure
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#! @SHELL@
|
||||
|
||||
# GNU Mes --- Maxwell Equations of Software
|
||||
# Copyright © 2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
# Copyright © 2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
|
@ -50,20 +50,22 @@ srcdest=../${srcdest}
|
|||
ln -sf ${srcdest}mes .
|
||||
ln -sf ${srcdest}module .
|
||||
ln -sf ${srcdest}src .
|
||||
AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu"
|
||||
AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ../include -I include"
|
||||
AM_CFLAGS="-L ${srcdest}lib"
|
||||
|
||||
mkdir -p $mes_cpu-mes
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler/crt1.c
|
||||
cp ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler/crt1.c .
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS crt1.c
|
||||
cp crt1.o $mes_cpu-mes
|
||||
cp crt1.s $mes_cpu-mes
|
||||
|
||||
objects=
|
||||
for c in $libc_mini_SOURCES; do
|
||||
o=$(basename $c .c).o
|
||||
b=$(echo $c | sed -re s,^[.]+/,, -e s,/,-,g -e s,[.]c$,,)
|
||||
o=$b.o
|
||||
if test ! -e $o -o ${srcdest}$c -nt $o; then
|
||||
echo " CC $c"
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS -o $o ${srcdest}$c
|
||||
fi
|
||||
objects="$objects $o"
|
||||
done
|
||||
|
@ -72,10 +74,11 @@ $AR crD $mes_cpu-mes/libc-mini.a $objects
|
|||
|
||||
objects=
|
||||
for c in $libmescc_SOURCES; do
|
||||
o=$(basename $c .c).o
|
||||
b=$(echo $c | sed -re s,^[.]+/,, -e s,/,-,g -e s,[.]c$,,)
|
||||
o=$b.o
|
||||
if test ! -e $o -o ${srcdest}$c -nt $o; then
|
||||
echo " CC $c"
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS -o $o ${srcdest}$c
|
||||
fi
|
||||
objects="$objects $o"
|
||||
done
|
||||
|
@ -84,10 +87,11 @@ $AR crD $mes_cpu-mes/libmescc.a $objects
|
|||
|
||||
objects=
|
||||
for c in $libc_SOURCES; do
|
||||
o=$(basename $c .c).o
|
||||
b=$(echo $c | sed -re s,^[.]+/,, -e s,/,-,g -e s,[.]c$,,)
|
||||
o=$b.o
|
||||
if test ! -e $o -o ${srcdest}$c -nt $o; then
|
||||
echo " CC $c"
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS -o $o ${srcdest}$c
|
||||
fi
|
||||
objects="$objects $o"
|
||||
done
|
||||
|
@ -96,10 +100,11 @@ $AR crD $mes_cpu-mes/libc.a $objects
|
|||
|
||||
objects=
|
||||
for c in $libc_tcc_SOURCES; do
|
||||
o=$(basename $c .c).o
|
||||
b=$(echo $c | sed -re s,^[.]+/,, -e s,/,-,g -e s,[.]c$,,)
|
||||
o=$b.o
|
||||
if test ! -e $o -o ${srcdest}$c -nt $o; then
|
||||
echo " CC $c"
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS -o $o ${srcdest}$c
|
||||
fi
|
||||
objects="$objects $o"
|
||||
done
|
||||
|
@ -108,15 +113,16 @@ $AR crD $mes_cpu-mes/libc+tcc.a $objects
|
|||
|
||||
cd ..
|
||||
srcdest=
|
||||
CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu"
|
||||
AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ../include -I include"
|
||||
AM_CFLAGS="-L ${srcdest}lib"
|
||||
|
||||
objects=
|
||||
for c in $mes_SOURCES; do
|
||||
o=$(basename $c .c).o
|
||||
b=$(echo $c | sed -re s,^[.]+/,, -e s,/,-,g -e s,[.]c$,,)
|
||||
o=$b.o
|
||||
if test ! -e $o -o ${srcdest}$c -nt $o; then
|
||||
echo " CC $c"
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c
|
||||
$CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS -o $o ${srcdest}$c
|
||||
fi
|
||||
objects="$objects $o"
|
||||
done
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#! /bin/sh
|
||||
|
||||
# GNU Mes --- Maxwell Equations of Software
|
||||
# Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
# Copyright © 2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
|
@ -26,7 +26,8 @@
|
|||
trap 'test -f .log && cat .log' EXIT
|
||||
|
||||
mkdir -p $mes_cpu-mes
|
||||
compile lib/$mes_kernel/$mes_cpu-mes-$compiler/crt1.c
|
||||
cp ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler/crt1.c .
|
||||
compile crt1.c
|
||||
cp crt1.o $mes_cpu-mes
|
||||
if test -e crt1.s; then
|
||||
cp crt1.s $mes_cpu-mes
|
||||
|
@ -64,16 +65,6 @@ if test -e libc+tcc.s; then
|
|||
cp libc+tcc.s $mes_cpu-mes
|
||||
fi
|
||||
|
||||
if $courageous; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
archive libc+gnu.a $libc_gnu_SOURCES
|
||||
cp libc+gnu.a $mes_cpu-mes
|
||||
if test -e libc+gnu.s; then
|
||||
cp libc+gnu.s $mes_cpu-mes
|
||||
fi
|
||||
|
||||
archive libtcc1.a $libtcc1_SOURCES
|
||||
cp libtcc1.a $mes_cpu-mes
|
||||
if test -e libtcc1.s; then
|
||||
|
@ -85,3 +76,13 @@ cp libgetopt.a $mes_cpu-mes
|
|||
if test -e libgetopt.s; then
|
||||
cp libgetopt.s $mes_cpu-mes
|
||||
fi
|
||||
|
||||
if $courageous; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
archive libc+gnu.a $libc_gnu_SOURCES
|
||||
cp libc+gnu.a $mes_cpu-mes
|
||||
if test -e libc+gnu.s; then
|
||||
cp libc+gnu.s $mes_cpu-mes
|
||||
fi
|
||||
|
|
|
@ -66,9 +66,8 @@ fi
|
|||
AM_CPPFLAGS="
|
||||
-D HAVE_CONFIG_H=1
|
||||
-I ${srcdest}lib
|
||||
-I include
|
||||
-I ${srcdest}include
|
||||
-I ${srcdest}include/$mes_kernel/$mes_cpu
|
||||
-I ../include
|
||||
"
|
||||
if test $mes_kernel = gnu; then
|
||||
AM_CPPFLAGS="$AM_CPPFLAGS
|
||||
|
@ -93,9 +92,9 @@ fi
|
|||
AM_CPPFLAGS="
|
||||
-D HAVE_CONFIG_H=1
|
||||
-I ${srcdest}lib
|
||||
-I include
|
||||
-I ${srcdest}include
|
||||
-I ${srcdest}include/$mes_kernel/$mes_cpu
|
||||
-I ../include
|
||||
-I include
|
||||
"
|
||||
if test "$compiler" != bootstrap; then
|
||||
${SHELL} ${srcdest}build-aux/build-mes.sh
|
||||
|
@ -137,9 +136,9 @@ fi
|
|||
AM_CPPFLAGS="
|
||||
-D HAVE_CONFIG_H=1
|
||||
-I ${srcdest}lib
|
||||
-I include
|
||||
-I ${srcdest}include
|
||||
-I ${srcdest}include/$mes_kernel/$mes_cpu
|
||||
-I ../include
|
||||
-I include
|
||||
"
|
||||
compiler=mescc
|
||||
AR=${MESAR-"${srcdest}pre-inst-env mesar"}
|
||||
|
@ -151,7 +150,6 @@ fi
|
|||
${SHELL} ${srcdest}build-aux/build-lib.sh
|
||||
${SHELL} ${srcdest}build-aux/build-source-lib.sh
|
||||
if $bootstrap; then
|
||||
rm -f globals.* # FIXME: avoid name clash with globals from lib
|
||||
${SHELL} ${srcdest}build-aux/build-mes.sh
|
||||
cp -f bin/mes-mescc ../bin
|
||||
cp -f bin/mes ../bin
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# GNU Mes --- Maxwell Equations of Software
|
||||
# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
# Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
|
@ -18,8 +18,12 @@
|
|||
|
||||
objects=
|
||||
compile () {
|
||||
c=${srcdest}$1
|
||||
b=$(basename $c .c)
|
||||
if test $(dirname $1) = "."; then
|
||||
c=$1
|
||||
else
|
||||
c=${srcdest}$1
|
||||
fi
|
||||
b=$(echo $c | sed -re s,^[.]+/,, -e s,/,-,g -e s,[.]c$,,)
|
||||
o=$b.o
|
||||
objects="$objects $o"
|
||||
if test ! -e $o -o $c -nt $o; then
|
||||
|
@ -34,7 +38,7 @@ archive () {
|
|||
sources="$@"
|
||||
objects=
|
||||
for c in $sources; do
|
||||
b=$(basename $c .c)
|
||||
b=$(echo $c | sed -re s,^[.]+/,, -e s,/,-,g -e s,[.]c$,,)
|
||||
o=$b.o
|
||||
compile $c
|
||||
done
|
||||
|
|
|
@ -201,6 +201,7 @@ lib/tests/setjmp/80-setjmp.c
|
|||
lib/tests/stdio/80-sscanf.c
|
||||
lib/tests/stdlib/80-qsort.c
|
||||
lib/tests/stdlib/80-qsort-dupes.c
|
||||
lib/tests/stdlib/80-qsort-stress.c
|
||||
lib/tests/string/80-strncpy.c
|
||||
lib/tests/string/80-strrchr.c
|
||||
lib/tests/scaffold/82-define.c
|
||||
|
@ -215,6 +216,7 @@ lib/tests/io/90-stat.c
|
|||
lib/tests/mes/90-abtod.c
|
||||
lib/tests/mes/90-dtoab.c
|
||||
lib/tests/posix/90-execlp.c
|
||||
lib/tests/posix/90-mmap.c
|
||||
lib/tests/posix/90-unsetenv.c
|
||||
lib/tests/signal/90-signal.c
|
||||
lib/tests/stdio/90-fopen.c
|
||||
|
@ -222,6 +224,7 @@ lib/tests/stdio/90-fopen-append.c
|
|||
lib/tests/stdio/90-fread-fwrite.c
|
||||
lib/tests/stdio/90-fseek.c
|
||||
lib/tests/stdio/90-sprintf.c
|
||||
lib/tests/stdio/90-sscanf.c
|
||||
lib/tests/stdlib/90-strtol.c
|
||||
lib/tests/string/90-snprintf.c
|
||||
lib/tests/string/90-strpbrk.c
|
||||
|
@ -290,6 +293,7 @@ lib/tests/scaffold/70-extern.c
|
|||
lib/tests/stdio/80-sscanf.c
|
||||
lib/tests/posix/90-execlp.c
|
||||
lib/tests/string/90-snprintf.c
|
||||
lib/tests/stdio/90-sscanf.c
|
||||
"
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -74,7 +74,7 @@ libc_mini_SOURCES="$libc_mini_shared_SOURCES"
|
|||
|
||||
if test $mes_libc = mes; then
|
||||
libc_mini_SOURCES="$libc_mini_SOURCES
|
||||
lib/mes/mini-write.c
|
||||
lib/mes/write.c
|
||||
"
|
||||
fi
|
||||
|
||||
|
@ -215,6 +215,7 @@ lib/linux/malloc.c
|
|||
lib/linux/_read.c
|
||||
lib/linux/time.c
|
||||
lib/linux/unlink.c
|
||||
lib/linux/wait4.c
|
||||
lib/linux/waitpid.c
|
||||
lib/linux/$mes_cpu-mes-$compiler/syscall.c
|
||||
lib/linux/getpid.c
|
||||
|
@ -249,6 +250,7 @@ lib/stdio/fclose.c
|
|||
lib/stdio/fdopen.c
|
||||
lib/stdio/ferror.c
|
||||
lib/stdio/fflush.c
|
||||
lib/stdio/fileno.c
|
||||
lib/stdio/fopen.c
|
||||
lib/stdio/fprintf.c
|
||||
lib/stdio/fread.c
|
||||
|
@ -319,9 +321,11 @@ lib/dirent/__getdirentries.c
|
|||
lib/dirent/closedir.c
|
||||
lib/dirent/opendir.c
|
||||
lib/dirent/readdir.c
|
||||
lib/locale/localeconv.c
|
||||
lib/math/ceil.c
|
||||
lib/math/fabs.c
|
||||
lib/math/floor.c
|
||||
lib/math/labs.c
|
||||
lib/mes/fdgets.c
|
||||
lib/posix/alarm.c
|
||||
lib/posix/execl.c
|
||||
|
@ -333,10 +337,10 @@ lib/posix/unsetenv.c
|
|||
lib/stdio/clearerr.c
|
||||
lib/stdio/feof.c
|
||||
lib/stdio/fgets.c
|
||||
lib/stdio/fileno.c
|
||||
lib/stdio/freopen.c
|
||||
lib/stdio/fscanf.c
|
||||
lib/stdio/perror.c
|
||||
lib/stdio/rewind.c
|
||||
lib/stdio/vfscanf.c
|
||||
lib/stdlib/__exit.c
|
||||
lib/stdlib/abort.c
|
||||
|
@ -357,7 +361,9 @@ lib/string/strerror.c
|
|||
lib/string/strncat.c
|
||||
lib/string/strpbrk.c
|
||||
lib/string/strspn.c
|
||||
lib/string/strtok.c
|
||||
lib/stub/__cleanup.c
|
||||
lib/stub/asctime.c
|
||||
lib/stub/atan2.c
|
||||
lib/stub/bsearch.c
|
||||
lib/stub/chown.c
|
||||
|
@ -370,6 +376,7 @@ lib/stub/frexp.c
|
|||
lib/stub/getgrgid.c
|
||||
lib/stub/getgrnam.c
|
||||
lib/stub/getlogin.c
|
||||
lib/stub/getpagesize.c
|
||||
lib/stub/getpgid.c
|
||||
lib/stub/getpgrp.c
|
||||
lib/stub/getpwnam.c
|
||||
|
@ -382,7 +389,6 @@ lib/stub/pclose.c
|
|||
lib/stub/popen.c
|
||||
lib/stub/pow.c
|
||||
lib/stub/rand.c
|
||||
lib/stub/rewind.c
|
||||
lib/stub/setbuf.c
|
||||
lib/stub/setgrent.c
|
||||
lib/stub/setlocale.c
|
||||
|
@ -394,7 +400,9 @@ lib/stub/sigsetmask.c
|
|||
lib/stub/sin.c
|
||||
lib/stub/sqrt.c
|
||||
lib/stub/strftime.c
|
||||
lib/stub/strsignal.c
|
||||
lib/stub/sys_siglist.c
|
||||
lib/stub/sysconf.c
|
||||
lib/stub/system.c
|
||||
lib/stub/times.c
|
||||
lib/stub/ttyname.c
|
||||
|
@ -419,12 +427,14 @@ lib/linux/link.c
|
|||
lib/linux/lstat.c
|
||||
lib/linux/mkdir.c
|
||||
lib/linux/mknod.c
|
||||
lib/linux/mmap.c
|
||||
lib/linux/munmap.c
|
||||
lib/linux/nanosleep.c
|
||||
lib/linux/pipe.c
|
||||
lib/linux/readlink.c
|
||||
lib/linux/rename.c
|
||||
lib/linux/setgid.c
|
||||
lib/linux/settimer.c
|
||||
lib/linux/setitimer.c
|
||||
lib/linux/setuid.c
|
||||
lib/linux/signal.c
|
||||
lib/linux/sigprogmask.c
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#! @SHELL@
|
||||
|
||||
# GNU Mes --- Maxwell Equations of Software
|
||||
# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
# Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
|
@ -99,6 +99,7 @@ mkdir -p $DESTDIR$includedir
|
|||
mkdir -p $DESTDIR$libdir
|
||||
mkdir -p $DESTDIR$pkgdatadir
|
||||
tar -cf- -C ${srcdir}/include . | tar -${v}xf- -C $DESTDIR$includedir
|
||||
tar -cf- -C include . | tar -${v}xf- -C $DESTDIR$includedir
|
||||
tar -cf- -C ${srcdir}/lib $mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
|
||||
tar -cf- -C ${srcdir}/lib $mes_kernel/$mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
|
||||
if test -z "$srcdest"; then
|
||||
|
|
|
@ -48,7 +48,6 @@ sed -ri \
|
|||
include/mes/mes.h \
|
||||
include/mes/symbols.h \
|
||||
include/mes/builtins.h \
|
||||
include/m2/lib.h \
|
||||
src/builtins.c \
|
||||
src/cc.c \
|
||||
src/core.c \
|
||||
|
|
|
@ -707,6 +707,13 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
|
|||
#define MES_VERSION \"" VERSION "\"
|
||||
")))))
|
||||
(substitute (string-append srcdest "build-aux/config.make.in") pairs #:target ".config.make"))
|
||||
(let ((arch-dir (string-append srcdest "include/" mes-kernel "/" mes-cpu)))
|
||||
(define (copy-header file-name)
|
||||
(system* "cp" "-f" "-v"
|
||||
(string-append arch-dir "/" file-name)
|
||||
(string-append "include/arch/" file-name)))
|
||||
(system* "mkdir" "-p" "include/arch")
|
||||
(for-each copy-header '("kernel-stat.h" "syscall.h")))
|
||||
|
||||
(let ((make (and=> (file-name "make" deps) basename)))
|
||||
(display (string-append "
|
||||
|
|
|
@ -77,8 +77,8 @@ GUILE=${GUILE-$(command -v guile)} || true
|
|||
HEX2=${HEX2-$(command -v hex2)}
|
||||
LDPFLAGS=${LDFLAGS-}
|
||||
M1=${M1-$(command -v M1)}
|
||||
M2_PLANET=${M1-$(command -v M2-Planet)}
|
||||
KAEM=${KAEM-$(command -v kaem)}
|
||||
M2_PLANET=${M2_PLANET-$(command -v M2-Planet)} || true
|
||||
KAEM=${KAEM-$(command -v kaem)} || true
|
||||
MES_FOR_BUILD=${MES_FOR_BUILD-$(command -v mes || command -v guile || echo mes)}
|
||||
GIT=${GIT-$(command -v git)} || true
|
||||
PERL=${PERL-$(command -v perl)} || true
|
||||
|
@ -271,6 +271,10 @@ cat >> include/mes/config.h <<EOF
|
|||
#define MES_VERSION "$VERSION"
|
||||
EOF
|
||||
|
||||
mkdir -p include/arch
|
||||
cp -f -v ${srcdest}include/${mes_kernel}/${mes_cpu}/kernel-stat.h include/arch
|
||||
cp -f -v ${srcdest}include/${mes_kernel}/${mes_cpu}/syscall.h include/arch
|
||||
|
||||
cat <<EOF
|
||||
GNU Mes is configured for
|
||||
compiler: $compiler
|
||||
|
|
|
@ -935,7 +935,7 @@ The @var{option}s can be among the following:
|
|||
align @var{symbol}, the default is @code{functions}; other valid values
|
||||
are: @code{globals}.
|
||||
|
||||
@item --base-address=ADRRESS
|
||||
@item --base-address=ADDRESS
|
||||
use BaseAddress ADDRESS [0x1000000]
|
||||
|
||||
@item -c
|
||||
|
|
|
@ -87,7 +87,7 @@ get_machine.")
|
|||
(define-public m2-planet
|
||||
(package
|
||||
(name "m2-planet")
|
||||
(version "1.9.0")
|
||||
(version "1.10.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
|
@ -97,7 +97,7 @@ get_machine.")
|
|||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0cgvvq91cbxxm93k8ayyvhpaf3c2lv10qw4wyqwn3hc1qb1cfyvr"))))
|
||||
"03ixvfdzhyy1d94iqpwl0p924pdvdp7yq4ggm05w3c013kzy2y12"))))
|
||||
(native-inputs (list mescc-tools))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
|
@ -189,7 +189,7 @@ extensive examples, including parsers for the Javascript and C99 languages.")
|
|||
(uri (string-append
|
||||
"https://ftp.gnu.org/pub/gnu/mes/mes-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32 #!mes!# "0d855agwawjjzwbjmvb5xlbwg77zdpwbjm9kjxc2wqvn0vmhq4im"))))
|
||||
(base32 #!mes!# "0246sy5zm49zw4zs87hrq1j1x74mchijh4rlj2mzlwjccha5cybs"))))
|
||||
(build-system gnu-build-system)
|
||||
(supported-systems '("aarch64-linux" "armhf-linux" "i686-linux" "x86_64-linux"))
|
||||
(propagated-inputs (list mescc-tools nyacc))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -27,8 +27,9 @@
|
|||
#undef __MES_ASSERT_H
|
||||
#include_next <assert.h>
|
||||
#else // ! SYSTEM_LIBC
|
||||
#define assert(x) ((x) ? (void)0 : __assert_fail (#x))
|
||||
void __assert_fail (char *s);
|
||||
#define assert(x) ((x) ? (void)0 : __assert_fail (#x, 0, 0, 0))
|
||||
void __assert_fail (char const *s, char const *file, unsigned line,
|
||||
char const *function);
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
||||
#endif // __MES_ASSERT_H
|
||||
|
|
|
@ -69,8 +69,11 @@
|
|||
#define creat(file_name, mode) open (file_name, O_WRONLY | O_CREAT | O_TRUNC, mode)
|
||||
int dup (int old);
|
||||
int dup2 (int old, int new);
|
||||
|
||||
#if !__M2__
|
||||
int fcntl (int filedes, int command, ...);
|
||||
int open (char const *s, int flags, ...);
|
||||
#endif
|
||||
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
||||
|
|
|
@ -29,6 +29,19 @@
|
|||
#define DBL_MIN_EXP -1021
|
||||
#define LDBL_MIN_EXP -1021
|
||||
|
||||
// gcc-4.6
|
||||
#define DBL_EPSILON 1
|
||||
#define DBL_MANT_DIG 1
|
||||
#define DBL_MAX INT_MAX
|
||||
#define DBL_MIN INT_MIN
|
||||
|
||||
#define FLT_RADIX 10
|
||||
|
||||
#define LDBL_EPSILON 1
|
||||
#define LDBL_MANT_DIG 1
|
||||
#define LDBL_MAX INT_MAX
|
||||
#define LDBL_MIN INT_MIN
|
||||
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
||||
#endif // __MES_FLOAT_H
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -33,6 +33,7 @@
|
|||
|
||||
#define MB_CUR_MAX 1
|
||||
#define NAME_MAX 255
|
||||
#define PAGE_SIZE 4096
|
||||
#define PATH_MAX 512
|
||||
#define _POSIX_OPEN_MAX 16
|
||||
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
* GNU Mes 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 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MES_LINUX_ARM_KERNEL_STAT_H
|
||||
#define __MES_LINUX_ARM_KERNEL_STAT_H 1
|
||||
|
||||
// https://github.com/torvalds/linux/blob/master/arch/arm/include/uapi/asm/stat.h
|
||||
|
||||
#include <arch/syscall.h>
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct stat
|
||||
{
|
||||
unsigned long st_dev;
|
||||
unsigned long st_ino;
|
||||
unsigned short st_mode;
|
||||
unsigned short st_nlink;
|
||||
unsigned short st_uid;
|
||||
unsigned short st_gid;
|
||||
unsigned long st_rdev;
|
||||
unsigned long st_size;
|
||||
unsigned long st_blksize;
|
||||
unsigned long st_blocks;
|
||||
unsigned long st_atime;
|
||||
unsigned long st_atime_usec;
|
||||
unsigned long st_mtime;
|
||||
unsigned long st_mtime_usec;
|
||||
unsigned long st_ctime;
|
||||
unsigned long st_ctime_usec;
|
||||
unsigned long __pad0;
|
||||
unsigned long __pad1;
|
||||
};
|
||||
#if __SIZEOF_LONG_LONG__ == 8
|
||||
struct stat64
|
||||
{
|
||||
unsigned long long st_dev;
|
||||
unsigned char __pad0[4];
|
||||
unsigned long __st_ino;
|
||||
unsigned int st_mode;
|
||||
unsigned int st_nlink;
|
||||
unsigned long st_uid;
|
||||
unsigned long st_gid;
|
||||
unsigned long long st_rdev;
|
||||
unsigned char __pad3[4];
|
||||
long long st_size;
|
||||
unsigned long st_blksize;
|
||||
unsigned long long st_blocks;
|
||||
unsigned long st_atime;
|
||||
unsigned long st_atime_nsec;
|
||||
unsigned long st_mtime;
|
||||
unsigned int st_mtime_nsec;
|
||||
unsigned long st_ctime;
|
||||
unsigned long st_ctime_nsec;
|
||||
unsigned long long st_ino;
|
||||
};
|
||||
|
||||
#define stat stat64
|
||||
#undef SYS_stat
|
||||
#define SYS_stat SYS_stat64
|
||||
#undef SYS_lstat
|
||||
#define SYS_lstat SYS_lstat64
|
||||
#undef SYS_fstat
|
||||
#define SYS_fstat SYS_fstat64
|
||||
|
||||
#endif // HAVE_LONG_LONG
|
||||
|
||||
#endif // __MES_LINUX_ARM_KERNEL_STAT_H
|
|
@ -25,47 +25,29 @@
|
|||
|
||||
/* libc-mini */
|
||||
#ifndef SYS_exit
|
||||
// CONSTANT SYS_exit 0x01
|
||||
#define SYS_exit 0x01
|
||||
#endif
|
||||
#ifndef SYS_write
|
||||
// CONSTANT SYS_write 0x04
|
||||
#define SYS_write 0x04
|
||||
#endif
|
||||
|
||||
/* libc */
|
||||
// CONSTANT SYS_fork 0x02
|
||||
#define SYS_fork 0x02
|
||||
// CONSTANT SYS_read 0x03
|
||||
#define SYS_read 0x03
|
||||
// CONSTANT SYS_open 0x05
|
||||
#define SYS_open 0x05
|
||||
//#define SYS_waitpid
|
||||
// CONSTANT SYS_wait4 0x72
|
||||
#define SYS_wait4 0x72
|
||||
// CONSTANT SYS_execve 0x0b
|
||||
#define SYS_execve 0x0b
|
||||
// CONSTANT SYS_chmod 0x0f
|
||||
#define SYS_chmod 0x0f
|
||||
// CONSTANT SYS_access 0x21
|
||||
#define SYS_access 0x21
|
||||
// CONSTANT SYS_brk 0x2d
|
||||
#define SYS_brk 0x2d
|
||||
// CONSTANT SYS_ioctl 0x36
|
||||
#define SYS_ioctl 0x36
|
||||
// CONSTANT SYS_fsync 0x76
|
||||
#define SYS_fsync 0x76
|
||||
// CONSTANT SYS_getcwd 0xb7
|
||||
#define SYS_getcwd 0xb7
|
||||
// CONSTANT SYS_dup 0x29
|
||||
#define SYS_dup 0x29
|
||||
// CONSTANT SYS_dup2 0x3f
|
||||
#define SYS_dup2 0x3f
|
||||
// CONSTANT SYS_unlink 0x0a
|
||||
#define SYS_unlink 0x0a
|
||||
// CONSTANT SYS_gettimeofday 0x4e
|
||||
#define SYS_gettimeofday 0x4e
|
||||
// CONSTANT SYS_clock_gettime 0x107
|
||||
#define SYS_clock_gettime 0x107
|
||||
|
||||
/* libc+tcc */
|
||||
|
@ -73,6 +55,7 @@
|
|||
#define SYS_lseek 0x13
|
||||
#define SYS_rmdir 0x28
|
||||
#define SYS_stat 0x6a
|
||||
#define SYS_stat64 0xc3
|
||||
|
||||
/* libc+gnu */
|
||||
#define SYS_chdir 0x0c
|
||||
|
@ -89,8 +72,10 @@
|
|||
#define SYS_fcntl 0x37
|
||||
#define SYS_getrusage 0x4d
|
||||
#define SYS_lstat 0x6b
|
||||
#define SYS_lstat64 0xc4
|
||||
#define SYS_setitimer 0x68
|
||||
#define SYS_fstat 0x6c
|
||||
#define SYS_fstat64 0xc5
|
||||
#define SYS_nanosleep 0xa2
|
||||
#define SYS_getdents 0x8d
|
||||
|
||||
|
@ -109,4 +94,8 @@
|
|||
#define SYS_readlink 0x55
|
||||
#define SYS_mknod 0x0e
|
||||
|
||||
// gcc-4.6.4
|
||||
#define SYS_mmap 0x5a
|
||||
#define SYS_munmap 0x5b
|
||||
|
||||
#endif /* __MES_LINUX_ARM_SYSCALL_H */
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
* GNU Mes 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 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __LINUX_M2_KERNEL_STAT_H
|
||||
#define __LINUX_M2_KERNEL_STAT_H
|
||||
|
||||
// https://github.com/torvalds/linux/blob/master/arch/x86/include/uapi/asm/stat.h
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct stat
|
||||
{
|
||||
unsigned st_dev;
|
||||
unsigned st_ino;
|
||||
char st_mode[2];
|
||||
char st_nlink[2];
|
||||
char st_uid[2];
|
||||
char st_gid[2];
|
||||
unsigned st_rdev;
|
||||
unsigned st_size;
|
||||
unsigned st_blksize;
|
||||
unsigned st_blocks;
|
||||
unsigned st_atime;
|
||||
unsigned st_atime_usec;
|
||||
unsigned st_mtime;
|
||||
unsigned st_mtime_usec;
|
||||
unsigned st_ctime;
|
||||
unsigned st_ctime_usec;
|
||||
unsigned __pad0;
|
||||
unsigned __pad1;
|
||||
};
|
||||
#endif // __LINUX_M2_KERNEL_STAT_H
|
|
@ -0,0 +1,83 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
* GNU Mes 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 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MES_LINUX_X86_KERNEL_STAT_H
|
||||
#define __MES_LINUX_X86_KERNEL_STAT_H 1
|
||||
|
||||
// https://github.com/torvalds/linux/blob/master/arch/x86/include/uapi/asm/stat.h
|
||||
|
||||
#include <arch/syscall.h>
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct stat
|
||||
{
|
||||
unsigned long st_dev;
|
||||
unsigned long st_ino;
|
||||
unsigned short st_mode;
|
||||
unsigned short st_nlink;
|
||||
unsigned short st_uid;
|
||||
unsigned short st_gid;
|
||||
unsigned long st_rdev;
|
||||
unsigned long st_size;
|
||||
unsigned long st_blksize;
|
||||
unsigned long st_blocks;
|
||||
unsigned long st_atime;
|
||||
unsigned long st_atime_usec;
|
||||
unsigned long st_mtime;
|
||||
unsigned long st_mtime_usec;
|
||||
unsigned long st_ctime;
|
||||
unsigned long st_ctime_usec;
|
||||
unsigned long __pad0;
|
||||
unsigned long __pad1;
|
||||
};
|
||||
#if __SIZEOF_LONG_LONG__ == 8
|
||||
struct stat64
|
||||
{
|
||||
unsigned long long st_dev;
|
||||
unsigned char __pad0[4];
|
||||
unsigned long __st_ino;
|
||||
unsigned int st_mode;
|
||||
unsigned int st_nlink;
|
||||
unsigned long st_uid;
|
||||
unsigned long st_gid;
|
||||
unsigned long long st_rdev;
|
||||
unsigned char __pad3[4];
|
||||
long long st_size;
|
||||
unsigned long st_blksize;
|
||||
unsigned long long st_blocks;
|
||||
unsigned long st_atime;
|
||||
unsigned long st_atime_nsec;
|
||||
unsigned long st_mtime;
|
||||
unsigned int st_mtime_nsec;
|
||||
unsigned long st_ctime;
|
||||
unsigned long st_ctime_nsec;
|
||||
unsigned long long st_ino;
|
||||
};
|
||||
|
||||
#define stat stat64
|
||||
#undef SYS_stat
|
||||
#define SYS_stat SYS_stat64
|
||||
#undef SYS_lstat
|
||||
#define SYS_lstat SYS_lstat64
|
||||
#undef SYS_fstat
|
||||
#define SYS_fstat SYS_fstat64
|
||||
|
||||
#endif // HAVE_LONG_LONG
|
||||
|
||||
#endif // __MES_LINUX_X86_KERNEL_STAT_H
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -22,50 +22,30 @@
|
|||
|
||||
/* libc-mini */
|
||||
#ifndef SYS_exit
|
||||
// CONSTANT SYS_exit 0x01
|
||||
#define SYS_exit 0x01
|
||||
#endif
|
||||
#ifndef SYS_write
|
||||
// CONSTANT SYS_write 0x04
|
||||
#define SYS_write 0x04
|
||||
#endif
|
||||
|
||||
/* libc */
|
||||
// CONSTANT SYS_fork 0x02
|
||||
#define SYS_fork 0x02
|
||||
// CONSTANT SYS_read 0x03
|
||||
#define SYS_read 0x03
|
||||
// CONSTANT SYS_open 0x05
|
||||
#define SYS_open 0x05
|
||||
// CONSTANT SYS_waitpid 0x07
|
||||
#define SYS_waitpid 0x07
|
||||
// CONSTANT SYS_wait4 0x72
|
||||
#define SYS_wait4 0x72
|
||||
// CONSTANT SYS_execve 0x0b
|
||||
#define SYS_execve 0x0b
|
||||
// CONSTANT SYS_chmod 0x0f
|
||||
#define SYS_chmod 0x0f
|
||||
// CONSTANT SYS_access 0x21
|
||||
#define SYS_access 0x21
|
||||
// CONSTANT SYS_brk 0x2d
|
||||
#define SYS_brk 0x2d
|
||||
// CONSTANT SYS_ioctl 0x36
|
||||
#define SYS_ioctl 0x36
|
||||
// CONSTANT SYS_fsync 0x76
|
||||
#define SYS_fsync 0x76
|
||||
// CONSTANT SYS_getcwd 0xb7
|
||||
#define SYS_getcwd 0xb7
|
||||
// CONSTANT SYS_dup 0x29
|
||||
#define SYS_dup 0x29
|
||||
// CONSTANT SYS_dup2 0x3f
|
||||
#define SYS_dup2 0x3f
|
||||
// CONSTANT SYS_unlink 0x0a
|
||||
#define SYS_unlink 0x0a
|
||||
// CONSTANT SYS_gettimeofday 0x4e
|
||||
#define SYS_gettimeofday 0x4e
|
||||
// CONSTANT SYS_clock_gettime 0x109
|
||||
#define SYS_clock_gettime 0x109
|
||||
// CONSTANT SYS_time 0x0d
|
||||
#define SYS_time 0x0d
|
||||
|
||||
/* libc+tcc */
|
||||
|
@ -73,9 +53,9 @@
|
|||
#define SYS_lseek 0x13
|
||||
#define SYS_rmdir 0x28
|
||||
#define SYS_stat 0x6a
|
||||
#define SYS_stat64 0xc3
|
||||
|
||||
/* libc+gnu */
|
||||
|
||||
#define SYS_chdir 0x0c
|
||||
#define SYS_link 0x09
|
||||
#define SYS_getpid 0x14
|
||||
|
@ -92,8 +72,10 @@
|
|||
#define SYS_fcntl 0x37
|
||||
#define SYS_getrusage 0x4d
|
||||
#define SYS_lstat 0x6b
|
||||
#define SYS_lstat64 0xc4
|
||||
#define SYS_setitimer 0x68
|
||||
#define SYS_fstat 0x6c
|
||||
#define SYS_fstat64 0xc5
|
||||
#define SYS_nanosleep 0xa2
|
||||
#define SYS_getdents 0x8d
|
||||
|
||||
|
@ -112,4 +94,8 @@
|
|||
#define SYS_readlink 0x55
|
||||
#define SYS_mknod 0x0e
|
||||
|
||||
// gcc-4.6.4
|
||||
#define SYS_mmap 0x5a
|
||||
#define SYS_munmap 0x5b
|
||||
|
||||
#endif /* __MES_LINUX_X86_SYSCALL_H */
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
* GNU Mes 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 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MES_LINUX_X86_64_KERNEL_STAT_H
|
||||
#define __MES_LINUX_X86_64_KERNEL_STAT_H 1
|
||||
|
||||
// https://github.com/torvalds/linux/blob/master/arch/x86/include/uapi/asm/stat.h
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct stat
|
||||
{
|
||||
unsigned long st_dev;
|
||||
unsigned long st_ino;
|
||||
unsigned long st_nlink;
|
||||
unsigned int st_mode;
|
||||
unsigned int st_uid;
|
||||
unsigned int st_gid;
|
||||
unsigned int __pad0;
|
||||
unsigned long st_rdev;
|
||||
unsigned long st_size;
|
||||
unsigned long st_atime;
|
||||
unsigned long st_atime_nsec;
|
||||
unsigned long st_mtime;
|
||||
unsigned long st_mtime_nsec;
|
||||
unsigned long st_ctime;
|
||||
unsigned long st_ctime_nsec;
|
||||
unsigned long st_blksize;
|
||||
long st_blocks;
|
||||
unsigned long __pad1;
|
||||
unsigned long __pad2;
|
||||
unsigned long __pad3;
|
||||
unsigned long __pad4;
|
||||
};
|
||||
|
||||
#endif // __MES_LINUX_X86_64_KERNEL_STAT_H
|
|
@ -85,4 +85,8 @@
|
|||
#define SYS_readlink 0x59
|
||||
#define SYS_mknod 0x85
|
||||
|
||||
// gcc-4.6.4
|
||||
#define SYS_mmap 0x09
|
||||
#define SYS_munmap 0x0b
|
||||
|
||||
#endif // __MES_LINUX_X86_64_SYSCALL_H
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -38,6 +38,30 @@
|
|||
#endif
|
||||
// *INDENT-ON*
|
||||
|
||||
struct lconv
|
||||
{
|
||||
char *decimal_point;
|
||||
char *thousands_sep;
|
||||
char *grouping;
|
||||
|
||||
char *int_curr_symbol;
|
||||
char *currency_symbol;
|
||||
char *mon_decimal_point;
|
||||
char *mon_thousands_sep;
|
||||
char *mon_grouping;
|
||||
char *positive_sign;
|
||||
char *negative_sign;
|
||||
char int_frac_digits;
|
||||
char frac_digits;
|
||||
char p_cs_precedes;
|
||||
char p_sep_by_space;
|
||||
char n_cs_precedes;
|
||||
char n_sep_by_space;
|
||||
char p_sign_posn;
|
||||
char n_sign_posn;
|
||||
};
|
||||
|
||||
struct lconv * localeconv (void);
|
||||
char *setlocale (int category, char const *locale);
|
||||
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
* GNU Mes 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 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __M2_LIB_H
|
||||
#define __M2_LIB_H
|
||||
|
||||
char **environ;
|
||||
int __stdin;
|
||||
int __stdout;
|
||||
int __stderr;
|
||||
int errno;
|
||||
|
||||
// CONSTANT EOF 0xffffffff
|
||||
// CONSTANT __FILEDES_MAX 512
|
||||
|
||||
char* cast_intp_to_charp (int *i);
|
||||
char* cast_long_to_charp (long i);
|
||||
long cast_charp_to_long (char const *);
|
||||
long cast_int_to_long (int i);
|
||||
long cast_voidp_to_long (void const *);
|
||||
|
||||
char *itoa (int number);
|
||||
char *ltoa (long number);
|
||||
int __ungetc_p (int filedes);
|
||||
int eputs (char *s);
|
||||
int oputs (char *s);
|
||||
int puts (char *s);
|
||||
size_t strlen (char *s);
|
||||
ssize_t _write ();
|
||||
ssize_t write (int filedes, void *buffer, size_t size);
|
||||
void __ungetc_clear (int filedes);
|
||||
void __ungetc_init ();
|
||||
void __ungetc_set (int filedes, int c);
|
||||
|
||||
struct timezone
|
||||
{
|
||||
int tz_minuteswest;
|
||||
int tz_dsttime;
|
||||
};
|
||||
|
||||
struct timespec
|
||||
{
|
||||
long tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
|
||||
struct timeval
|
||||
{
|
||||
long tv_sec;
|
||||
long tv_usec;
|
||||
};
|
||||
|
||||
#endif /* __M2_LIB_H */
|
|
@ -31,6 +31,7 @@ double cos (double x);
|
|||
double exp (double x);
|
||||
double fabs (double number);
|
||||
double floor (double x);
|
||||
long int labs (long int number);
|
||||
double ldexp (double value, int exponent);
|
||||
double log (double x);
|
||||
double modf (double value, double *integer_part);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -23,76 +23,32 @@
|
|||
|
||||
/* Cell types */
|
||||
|
||||
// CONSTANT TCHAR 0
|
||||
#define TCHAR 0
|
||||
|
||||
// CONSTANT TBYTES 1
|
||||
#define TBYTES 1
|
||||
// CONSTANT TCLOSURE 2
|
||||
#define TCLOSURE 2
|
||||
// CONSTANT TCONTINUATION 3
|
||||
#define TCONTINUATION 3
|
||||
// CONSTANT TKEYWORD 4
|
||||
#define TKEYWORD 4
|
||||
// CONSTANT TMACRO 5
|
||||
#define TMACRO 5
|
||||
// CONSTANT TNUMBER 6
|
||||
#define TNUMBER 6
|
||||
// CONSTANT TPAIR 7
|
||||
#define TPAIR 7
|
||||
// CONSTANT TPORT 8
|
||||
#define TPORT 8
|
||||
// CONSTANT TREF 9
|
||||
#define TREF 9
|
||||
// CONSTANT TSPECIAL 10
|
||||
#define TSPECIAL 10
|
||||
// CONSTANT TSTRING 11
|
||||
#define TSTRING 11
|
||||
// CONSTANT TSTRUCT 12
|
||||
#define TSTRUCT 12
|
||||
// CONSTANT TSYMBOL 13
|
||||
#define TSYMBOL 13
|
||||
// CONSTANT TVALUES 14
|
||||
#define TVALUES 14
|
||||
// CONSTANT TVARIABLE 15
|
||||
#define TVARIABLE 15
|
||||
// CONSTANT TVECTOR 16
|
||||
#define TVECTOR 16
|
||||
// CONSTANT TBROKEN_HEART 17
|
||||
#define TBROKEN_HEART 17
|
||||
|
||||
/* Struct types */
|
||||
|
||||
// CONSTANT STRUCT_TYPE 0
|
||||
#define STRUCT_TYPE 0
|
||||
// CONSTANT STRUCT_PRINTER 1
|
||||
#define STRUCT_PRINTER 1
|
||||
|
||||
// CONSTANT GC_FRAME_SIZE 5
|
||||
#define GC_FRAME_SIZE 5
|
||||
// CONSTANT GC_FRAME_PROCEDURE 4
|
||||
#define GC_FRAME_PROCEDURE 4
|
||||
|
||||
// CONSTANT STDIN 0
|
||||
// CONSTANT STDOUT 1
|
||||
// CONSTANT STDERR 2
|
||||
|
||||
/* Unknown type 1
|
||||
// CONSTANT EOF -1
|
||||
*/
|
||||
|
||||
// CONSTANT O_RDONLY 0
|
||||
// CONSTANT O_WRONLY 1
|
||||
// CONSTANT O_CREAT 0x40
|
||||
// CONSTANT O_TRUNC 0x200
|
||||
|
||||
// CONSTANT PATH_MAX 1024
|
||||
// CONSTANT __FILEDES_MAX 512
|
||||
|
||||
// CONSTANT S_IRUSR 00400
|
||||
// CONSTANT S_IWUSR 00200
|
||||
|
||||
// CONSTANT CLOCK_PROCESS_CPUTIME_ID 2
|
||||
|
||||
|
||||
#endif /* __MES_CONSTANTS_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -25,21 +25,27 @@
|
|||
#include <mes/config.h>
|
||||
#endif
|
||||
|
||||
// CONSTANT STDIN 0
|
||||
#ifndef STDIN
|
||||
#define STDIN 0
|
||||
#endif
|
||||
|
||||
// CONSTANT STDOUT 1
|
||||
#ifndef STDOUT
|
||||
#define STDOUT 1
|
||||
#endif
|
||||
|
||||
// CONSTANT STDERR 2
|
||||
#ifndef STDERR
|
||||
#define STDERR 2
|
||||
#endif
|
||||
|
||||
/* M2-Planet does not support pointer arithmetic. Explicitly compensate
|
||||
for that by multiplying with M2_PTR_SIZE when using (char)
|
||||
pointers. */
|
||||
#if __M2__
|
||||
#define M2_PTR_SIZE 4
|
||||
#else
|
||||
#define M2_PTR_SIZE 1
|
||||
#endif
|
||||
|
||||
extern char **environ;
|
||||
extern int __stdin;
|
||||
extern int __stdout;
|
||||
|
@ -63,10 +69,14 @@ int oputs (char const *s);
|
|||
#ifndef __MES_SIZE_T
|
||||
#define __MES_SIZE_T
|
||||
#undef size_t
|
||||
#if __M2__
|
||||
typedef unsigned size_t;
|
||||
#else
|
||||
typedef unsigned long size_t;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _SSIZE_T
|
||||
#define _SSIZE_T
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -23,6 +23,9 @@
|
|||
|
||||
#include <mes/lib-mini.h>
|
||||
|
||||
#define __FILEDES_MAX 512
|
||||
extern char *__brk;
|
||||
|
||||
char *cast_intp_to_charp (int const *i);
|
||||
char *cast_long_to_charp (long i);
|
||||
long cast_charp_to_long (char const *);
|
||||
|
@ -34,14 +37,11 @@ void __ungetc_init ();
|
|||
void __ungetc_clear (int filedes);
|
||||
void __ungetc_set (int filedes, int c);
|
||||
int __ungetc_p (int filedes);
|
||||
double abtod (char const **p, int base);
|
||||
long abtol (char const **p, int base);
|
||||
char *dtoab (double number, int base, int signed_p);
|
||||
char *itoa (int number);
|
||||
char *ltoa (long number);
|
||||
char *ltoab (long x, int base);
|
||||
char *ntoab (long number, unsigned base, int signed_p);
|
||||
char *ultoa (unsigned long number);
|
||||
char *utoa (unsigned number);
|
||||
int eputc (int c);
|
||||
int fdgetc (int fd);
|
||||
|
@ -61,29 +61,31 @@ char *search_path (char const *file_name);
|
|||
ssize_t _read (int fd, void *buffer, size_t size);
|
||||
void assert_msg (int check, char *msg);
|
||||
|
||||
extern char *__brk;
|
||||
extern void (*__call_at_exit) (void);
|
||||
|
||||
#define __FILEDES_MAX 512
|
||||
long __mesabi_imod (long a, long b);
|
||||
long __mesabi_idiv (long a, long b);
|
||||
void *__memcpy (void *dest, void const *src, size_t n);
|
||||
void *__memmove (void *dest, void const *src, size_t n);
|
||||
void *__memset (void *s, int c, size_t n);
|
||||
int __raise (int signal);
|
||||
|
||||
#if !SYSTEM_LIBC
|
||||
void __assert_fail (char *s);
|
||||
void __assert_fail (char const *s, char const *file, unsigned line,
|
||||
char const *function);
|
||||
ssize_t __buffered_read (int filedes, void *buffer, size_t size);
|
||||
size_t __buffered_read_clear (int filedes);
|
||||
void _exit (int code);
|
||||
long brk (void *addr);
|
||||
#endif // !SYSTEM_LIBC
|
||||
|
||||
long __mesabi_imod (long a, long b);
|
||||
long __mesabi_idiv (long a, long b);
|
||||
#if !__M2__
|
||||
extern void (*__call_at_exit) (void);
|
||||
double abtod (char const **p, int base);
|
||||
char *dtoab (double number, int base, int signed_p);
|
||||
char *ultoa (unsigned long number);
|
||||
unsigned long __mesabi_umod (unsigned long a, unsigned long b);
|
||||
unsigned long __mesabi_udiv (unsigned long a, unsigned long b);
|
||||
unsigned long __mesabi_uldiv (unsigned long a, unsigned long b,
|
||||
unsigned long *remainder);
|
||||
|
||||
void *__memcpy (void *dest, void const *src, size_t n);
|
||||
void *__memmove (void *dest, void const *src, size_t n);
|
||||
void *__memset (void *s, int c, size_t n);
|
||||
int __raise (int signal);
|
||||
#endif
|
||||
|
||||
#endif //__MES_LIB_H
|
||||
|
|
|
@ -53,6 +53,15 @@ struct scm
|
|||
};
|
||||
};
|
||||
|
||||
/* M2-Planet does not support pointer arithmetic. Explicitly compensate
|
||||
for that by multiplying with M2_CELL_SIZE when using cell
|
||||
pointers. */
|
||||
#if __M2__
|
||||
#define M2_CELL_SIZE 12
|
||||
#else
|
||||
#define M2_CELL_SIZE 1
|
||||
#endif
|
||||
|
||||
/* mes */
|
||||
extern char *g_datadir;
|
||||
extern int g_debug;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -137,14 +137,8 @@ extern struct scm *cell_type_broken_heart;
|
|||
extern struct scm *cell_symbol_program;
|
||||
extern struct scm *cell_symbol_test;
|
||||
|
||||
// CONSTANT SYMBOL_MAX 114
|
||||
#define SYMBOL_MAX 114
|
||||
|
||||
// CONSTANT CELL_UNSPECIFIED 7
|
||||
#define CELL_UNSPECIFIED 7
|
||||
|
||||
// CONSTANT CELL_SYMBOL_RECORD_TYPE 82
|
||||
#define CELL_SYMBOL_RECORD_TYPE 82
|
||||
|
||||
|
||||
#endif /* __MES_SYMBOLS_H */
|
||||
|
|
|
@ -29,9 +29,12 @@
|
|||
|
||||
#define _SIGSET_NITEMS (_NSIG / (8 * sizeof(unsigned long)))
|
||||
|
||||
typedef struct {
|
||||
#if !__M2__
|
||||
typedef struct
|
||||
{
|
||||
unsigned long items[_SIGSET_NITEMS];
|
||||
} sigset_t;
|
||||
#endif
|
||||
typedef long stack_t;
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -91,6 +94,7 @@ typedef long stack_t;
|
|||
#define SA_NOMASK SA_NODEFER
|
||||
#define SA_ONESHOT SA_RESETHAND
|
||||
|
||||
#if !__M2__ // lacks short, casts
|
||||
typedef struct siginfo_t
|
||||
{
|
||||
int si_signo;
|
||||
|
@ -120,7 +124,7 @@ typedef struct siginfo_t
|
|||
} siginfo_t;
|
||||
// *INDENT-ON*
|
||||
|
||||
#if __MESC__
|
||||
#if __M2__ || __MESC__
|
||||
typedef long sighandler_t;
|
||||
#else
|
||||
typedef void (*sighandler_t) (int);
|
||||
|
@ -255,6 +259,7 @@ int sigemptyset (sigset_t * set);
|
|||
#endif
|
||||
int sigprocmask (int how, sigset_t const *set, sigset_t * oldset);
|
||||
|
||||
#endif // !__M2__
|
||||
#endif //! SYSTEM_LIBC
|
||||
|
||||
#endif // __MES_SIGNAL_H
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018 Peter De Wachter <pdewacht@gmail.com>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
|
@ -55,10 +55,8 @@ typedef unsigned short uint16_t;
|
|||
typedef short int16_t;
|
||||
typedef unsigned uint32_t;
|
||||
typedef int int32_t;
|
||||
#if __SIZEOF_LONG_LONG__ == 8
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef long long int64_t;
|
||||
#endif // __SIZEOF_LONG_LONG__ == 8
|
||||
|
||||
typedef int intmax_t;
|
||||
typedef unsigned uintmax_t;
|
||||
|
@ -87,6 +85,12 @@ typedef unsigned uintmax_t;
|
|||
|
||||
#define INT_MIN -2147483648
|
||||
#define INT_MAX 2147483647
|
||||
|
||||
#define SHRT_MAX INT16_MAX
|
||||
#define SHRT_MIN INT16_MIN
|
||||
#define USHRT_MAX UINT16_MAX
|
||||
#define USHRT_MIN UINT16_MIN
|
||||
|
||||
#if __i386__ || __arm__
|
||||
#define LONG_MIN INT_MIN
|
||||
#define LONG_MAX INT_MAX
|
||||
|
@ -105,6 +109,8 @@ typedef unsigned uintmax_t;
|
|||
#define SIZE_MAX UINT64_MAX
|
||||
#endif
|
||||
|
||||
#define SSIZE_MAX LONG_MAX
|
||||
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
||||
#endif // __MES_STDINT_H
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -65,30 +65,35 @@ int ferror (FILE * stream);
|
|||
int fflush (FILE * stream);
|
||||
int fgetc (FILE * stream);
|
||||
char *fgets (char *s, int size, FILE * stream);
|
||||
int fprintf (FILE * stream, char const *format, ...);
|
||||
int fileno (FILE *);
|
||||
int fpurge (FILE * stream);
|
||||
int fputc (int c, FILE * stream);
|
||||
int fputs (char const *s, FILE * stream);
|
||||
int fscanf (FILE * stream, char const *template, ...);
|
||||
int fseek (FILE * stream, long offset, int whence);
|
||||
int getc (FILE * stream);
|
||||
int getchar (void);
|
||||
char *getlogin (void);
|
||||
int printf (char const *format, ...);
|
||||
int putc (int c, FILE * stream);
|
||||
int putchar (int c);
|
||||
int puts (char const *s);
|
||||
int remove (char const *file_name);
|
||||
void rewind (FILE * stream);
|
||||
int setvbuf (FILE * stream, char *buf, int mode, size_t size);
|
||||
int snprintf (char *str, size_t size, char const *format, ...);
|
||||
int sprintf (char *str, char const *format, ...);
|
||||
int sscanf (char const *str, char const *format, ...);
|
||||
int ungetc (int c, FILE * stream);
|
||||
long ftell (FILE * stream);
|
||||
size_t fread (void *ptr, size_t size, size_t count, FILE * stream);
|
||||
size_t freadahead (FILE * fp);
|
||||
size_t fwrite (void const *ptr, size_t size, size_t count, FILE * stream);
|
||||
|
||||
#if !__M2__
|
||||
int fprintf (FILE * stream, char const *format, ...);
|
||||
int fscanf (FILE * stream, char const *template, ...);
|
||||
int printf (char const *format, ...);
|
||||
int snprintf (char *str, size_t size, char const *format, ...);
|
||||
int sprintf (char *str, char const *format, ...);
|
||||
int sscanf (char const *str, char const *format, ...);
|
||||
#endif // !__M2__
|
||||
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
||||
#endif // __MES_STDIO_H
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -47,7 +47,9 @@ size_t strlen (char const *);
|
|||
char *strncpy (char *to, char const *from, size_t size);
|
||||
int strncmp (char const *, char const *, size_t);
|
||||
char *strrchr (char const *s, int c);
|
||||
char *strsignal (int signum);
|
||||
char *strstr (char const *haystack, char const *needle);
|
||||
char *strtok (char *new_string, char const *delimiters);
|
||||
char *strlwr (char *string);
|
||||
char *strupr (char *string);
|
||||
|
||||
|
|
|
@ -28,8 +28,13 @@
|
|||
|
||||
#define TCGETS 0x5401
|
||||
#define TCGETA 0x5405
|
||||
#if __M2__
|
||||
int ioctl (int fd, unsigned request, long data);
|
||||
int ioctl3 (int fd, unsigned request, long data);
|
||||
#else
|
||||
int ioctl (int fd, unsigned long request, ...);
|
||||
int ioctl3 (int fd, unsigned long request, long data);
|
||||
#endif
|
||||
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -25,19 +25,25 @@
|
|||
#include_next <sys/mman.h>
|
||||
#else // ! SYSTEM_LIBC
|
||||
|
||||
#ifndef __MES_SIZE_T
|
||||
#define __MES_SIZE_T
|
||||
typedef unsigned long size_t;
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
#define MAP_SHARED 0x01
|
||||
#define MAP_PRIVATE 0x02
|
||||
#define MAP_ANONYMOUS 0x20
|
||||
#define MAP_POPULATE 0x08000
|
||||
|
||||
#define MAP_ANON MAP_ANONYMOUS
|
||||
#define MAP_FAILED ((void*)-1)
|
||||
|
||||
#define PROT_NONE 0
|
||||
#define PROT_READ 1
|
||||
#define PROT_WRITE 2
|
||||
#define PROT_EXEC 4
|
||||
|
||||
void *mmap (void *address, size_t length, int protect, int flags, int filedes, off_t offset);
|
||||
int mprotect (void *addr, size_t len, int prot);
|
||||
int munmap (void *addr, size_t length);
|
||||
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
||||
#endif // __MES_SYS_MMAN_H
|
||||
|
||||
|
|
|
@ -32,20 +32,20 @@ struct rusage
|
|||
{
|
||||
struct timeval ru_utime;
|
||||
struct timeval ru_stime;
|
||||
long int ru_maxrss;
|
||||
long int ru_ixrss;
|
||||
long int ru_idrss;
|
||||
long int ru_isrss;
|
||||
long int ru_minflt;
|
||||
long int ru_majflt;
|
||||
long int ru_nswap;
|
||||
long int ru_inblock;
|
||||
long int ru_oublock;
|
||||
long int ru_msgsnd;
|
||||
long int ru_msgrcv;
|
||||
long int ru_nsignals;
|
||||
long int ru_nvcsw;
|
||||
long int ru_nivcsw;
|
||||
long ru_maxrss;
|
||||
long ru_ixrss;
|
||||
long ru_idrss;
|
||||
long ru_isrss;
|
||||
long ru_minflt;
|
||||
long ru_majflt;
|
||||
long ru_nswap;
|
||||
long ru_inblock;
|
||||
long ru_oublock;
|
||||
long ru_msgsnd;
|
||||
long ru_msgrcv;
|
||||
long ru_nsignals;
|
||||
long ru_nvcsw;
|
||||
long ru_nivcsw;
|
||||
};
|
||||
|
||||
#define RUSAGE_SELF 0
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MES_SYS_STAT_H
|
||||
#define __MES_SYS_STAT_H 1lei
|
||||
#define __MES_SYS_STAT_H 1
|
||||
|
||||
#if SYSTEM_LIBC
|
||||
#undef __MES_SYS_STAT_H
|
||||
|
@ -29,60 +29,13 @@
|
|||
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <arch/kernel-stat.h>
|
||||
|
||||
#ifndef __MES_MODE_T
|
||||
#define __MES_MODE_T
|
||||
typedef int mode_t;
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
#if __i386__ || __arm__
|
||||
struct stat
|
||||
{
|
||||
unsigned long st_dev;
|
||||
unsigned long st_ino;
|
||||
unsigned short st_mode;
|
||||
unsigned short st_nlink;
|
||||
unsigned short st_uid;
|
||||
unsigned short st_gid;
|
||||
unsigned long st_rdev;
|
||||
long st_size; /* Linux: unsigned long; glibc: off_t (i.e. signed) */
|
||||
unsigned long st_blksize;
|
||||
unsigned long st_blocks;
|
||||
time_t st_atime; /* Linux: unsigned long; glibc: time_t */
|
||||
unsigned long st_atime_usec;
|
||||
time_t st_mtime; /* Linux: unsigned long; glibc: time_t */
|
||||
unsigned long st_mtime_usec;
|
||||
time_t st_ctime; /* Linux: unsigned long; glibc: time_t */
|
||||
unsigned long st_ctime_usec;
|
||||
unsigned long __foo0;
|
||||
unsigned long __foo1;
|
||||
};
|
||||
#elif __x86_64__
|
||||
struct stat
|
||||
{
|
||||
unsigned long st_dev;
|
||||
unsigned long st_ino;
|
||||
unsigned int st_mode;
|
||||
unsigned int st_nlink;
|
||||
unsigned int st_uid;
|
||||
unsigned int st_gid;
|
||||
unsigned long st_rdev;
|
||||
long st_size;
|
||||
unsigned long st_blksize;
|
||||
unsigned long st_blocks;
|
||||
time_t st_atime;
|
||||
unsigned long st_atime_usec;
|
||||
time_t st_mtime;
|
||||
unsigned long st_mtime_usec;
|
||||
time_t st_ctime;
|
||||
unsigned long st_ctime_usec;
|
||||
unsigned long __foo0;
|
||||
unsigned long __foo1;
|
||||
};
|
||||
#endif
|
||||
// *INDENT-ON*
|
||||
|
||||
int chmod (char const *file_name, mode_t mode);
|
||||
int fstat (int filedes, struct stat *buf);
|
||||
int mkdir (char const *file_name, mode_t mode);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -32,7 +32,12 @@
|
|||
#endif
|
||||
|
||||
#ifndef EOF
|
||||
#define EOF -1
|
||||
// FIXME M2_Planet chokes on -1, even inside #if ! __M2__
|
||||
#if __arm__ || __i386__
|
||||
#define EOF 0xffffffff
|
||||
#else
|
||||
#define EOF 0xffffffffffffffff
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
|
@ -66,15 +71,23 @@ typedef unsigned gid_t;
|
|||
#ifndef __MES_INO_T
|
||||
#define __MES_INO_T
|
||||
#undef ino_t
|
||||
#if __M2__
|
||||
typedef unsigned ino_t;
|
||||
#else
|
||||
typedef unsigned long ino_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __SIZEOF_LONG_LONG__ == 8
|
||||
#ifndef __MES_INO64_T
|
||||
#define __MES_INO64_T
|
||||
#undef ino64_t
|
||||
#if __M2__
|
||||
typedef unsigned ino64_t;
|
||||
#else
|
||||
typedef unsigned long long ino64_t;
|
||||
#endif
|
||||
#endif
|
||||
#endif // __SIZEOF_LONG_LONG__ == 8
|
||||
|
||||
#if !defined (__MES_INTPTR_T) && !defined (__intptr_t_defined)
|
||||
|
@ -83,8 +96,12 @@ typedef unsigned long long ino64_t;
|
|||
#undef intptr_t
|
||||
typedef long intptr_t;
|
||||
#undef uintptr_t
|
||||
#if __M2__
|
||||
typedef unsigned uintptr_t;
|
||||
#else
|
||||
typedef unsigned long uintptr_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __MES_OFF_T
|
||||
#define __MES_OFF_T
|
||||
|
@ -96,8 +113,12 @@ typedef long off_t;
|
|||
#ifndef __MES_OFF64_T
|
||||
#define __MES_OFF64_T
|
||||
#undef off64_t
|
||||
#if __M2__
|
||||
typedef unsigned off64_t;
|
||||
#else
|
||||
typedef unsigned long long off64_t;
|
||||
#endif
|
||||
#endif
|
||||
#endif // __SIZEOF_LONG_LONG__ == 8
|
||||
|
||||
#ifndef __MES_PID_T
|
||||
|
@ -126,9 +147,13 @@ typedef long sigval_t;
|
|||
#ifndef __MES_SIZE_T
|
||||
#define __MES_SIZE_T
|
||||
#undef size_t
|
||||
#if __M2__
|
||||
typedef unsigned size_t;
|
||||
#else
|
||||
typedef unsigned long size_t;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __MES_SSIZE_T
|
||||
#define __MES_SSIZE_T
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -20,6 +20,8 @@
|
|||
#ifndef __MES_SYS_WAIT_H
|
||||
#define __MES_SYS_WAIT_H 1
|
||||
|
||||
#include <sys/resource.h>
|
||||
|
||||
#if SYSTEM_LIBC
|
||||
#undef __MES_SYS_WAIT_H
|
||||
#include_next <sys/wait.h>
|
||||
|
@ -35,6 +37,8 @@ typedef int pid_t;
|
|||
|
||||
pid_t waitpid (pid_t pid, int *status_ptr, int options);
|
||||
pid_t wait (int *status_ptr);
|
||||
pid_t wait4 (pid_t pid, int *wstatus, int options,
|
||||
struct rusage *rusage);
|
||||
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -27,8 +27,8 @@
|
|||
|
||||
#ifndef __MES_TIME_T
|
||||
#define __MES_TIME_T 1
|
||||
typedef long int clockid_t;
|
||||
typedef long int time_t;
|
||||
typedef long clockid_t;
|
||||
typedef long time_t;
|
||||
#endif
|
||||
|
||||
struct tm
|
||||
|
@ -56,6 +56,7 @@ struct timespec
|
|||
#endif // __MES_STRUCT_TIMESPEC
|
||||
|
||||
#define CLOCK_PROCESS_CPUTIME_ID 2
|
||||
char *asctime (struct tm const *broken_time);
|
||||
int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
||||
struct tm *localtime (time_t const *timep);
|
||||
struct tm *gmtime (time_t const *time);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -74,6 +74,7 @@ int setgid (gid_t newgid);
|
|||
int setuid (uid_t newuid);
|
||||
uid_t geteuid (void);
|
||||
gid_t getegid (void);
|
||||
int getpagesize (void);
|
||||
pid_t getpgrp (void);
|
||||
pid_t getpid (void);
|
||||
pid_t getppid (void);
|
||||
|
@ -90,6 +91,7 @@ char *sbrk (ptrdiff_t delta);
|
|||
void *sbrk (intptr_t delta);
|
||||
#endif
|
||||
int symlink (char const *old_name, char const *new_name);
|
||||
long sysconf (int name);
|
||||
int unlink (char const *file_name);
|
||||
ssize_t write (int filedes, void const *buffer, size_t size);
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#! /bin/sh
|
||||
# Copyright © 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
# GNU Mes 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 3 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Usage:
|
||||
# kaem --verbose --strict
|
||||
|
||||
mes_cpu=arm
|
||||
stage0_cpu=armv7l
|
||||
kaem --verbose --strict
|
39
kaem.run
39
kaem.run
|
@ -25,34 +25,41 @@ stage0_cpu=${stage0_cpu:-x86}
|
|||
mkdir -p m2
|
||||
|
||||
M2-Planet \
|
||||
--bootstrap-mode \
|
||||
--debug \
|
||||
--architecture ${stage0_cpu} \
|
||||
-f include/m2/lib.h \
|
||||
-D __linux__=1 \
|
||||
-f include/mes/config.h \
|
||||
-f include/mes/lib-mini.h \
|
||||
-f include/mes/lib.h \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/crt1.c \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/_exit.c \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/_write.c \
|
||||
-f lib/mes/globals.c \
|
||||
-f lib/m2/cast.c \
|
||||
-f lib/m2/exit.c \
|
||||
-f lib/mes/mini-write.c \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/syscall.c \
|
||||
-f lib/stdlib/exit.c \
|
||||
-f lib/mes/write.c \
|
||||
-f include/linux/${mes_cpu}/syscall.h \
|
||||
-f lib/linux/${mes_cpu}-mes-m2/syscall.c \
|
||||
-f lib/stub/__raise.c \
|
||||
-f lib/linux/brk.c \
|
||||
-f lib/m2/malloc.c \
|
||||
-f lib/linux/malloc.c \
|
||||
-f lib/string/memset.c \
|
||||
-f lib/m2/read.c \
|
||||
-f lib/linux/read.c \
|
||||
-f lib/mes/fdgetc.c \
|
||||
-f lib/stdio/getchar.c \
|
||||
-f lib/stdio/putchar.c \
|
||||
-f lib/m2/open.c \
|
||||
-f lib/m2/mes_open.c \
|
||||
-f lib/stub/__buffered_read.c \
|
||||
-f lib/linux/_open3.c \
|
||||
-f lib/linux/open.c \
|
||||
-f lib/mes/mes_open.c \
|
||||
-f lib/string/strlen.c \
|
||||
-f lib/mes/eputs.c \
|
||||
-f lib/mes/fdputc.c \
|
||||
-f lib/mes/eputc.c \
|
||||
\
|
||||
-f include/time.h \
|
||||
-f include/sys/time.h \
|
||||
-f include/sys/types.h \
|
||||
-f include/mes/mes.h \
|
||||
-f include/mes/builtins.h \
|
||||
-f include/mes/constants.h \
|
||||
|
@ -81,17 +88,23 @@ M2-Planet \
|
|||
-f lib/mes/fdungetc.c \
|
||||
-f lib/posix/setenv.c \
|
||||
-f lib/linux/access.c \
|
||||
-f lib/m2/chmod.c \
|
||||
-f include/linux/m2/kernel-stat.h \
|
||||
-f include/sys/stat.h \
|
||||
-f lib/linux/chmod.c \
|
||||
-f lib/linux/ioctl3.c \
|
||||
-f include/sys/ioctl.h \
|
||||
-f lib/m2/isatty.c \
|
||||
-f lib/linux/fork.c \
|
||||
-f lib/m2/execve.c \
|
||||
-f lib/m2/execv.c \
|
||||
-f lib/m2/waitpid.c \
|
||||
-f include/sys/resource.h \
|
||||
-f lib/linux/wait4.c \
|
||||
-f lib/linux/waitpid.c \
|
||||
-f lib/linux/gettimeofday.c \
|
||||
-f lib/m2/clock_gettime.c \
|
||||
-f lib/linux/clock_gettime.c \
|
||||
-f lib/m2/time.c \
|
||||
-f lib/linux/_getcwd.c \
|
||||
-f include/limits.h \
|
||||
-f lib/m2/getcwd.c \
|
||||
-f lib/linux/dup.c \
|
||||
-f lib/linux/dup2.c \
|
||||
|
@ -102,6 +115,7 @@ M2-Planet \
|
|||
-f src/core.c \
|
||||
-f src/display.c \
|
||||
-f src/eval-apply.c \
|
||||
-f include/fcntl.h \
|
||||
-f src/gc.c \
|
||||
-f src/hash.c \
|
||||
-f src/lib.c \
|
||||
|
@ -109,6 +123,7 @@ M2-Planet \
|
|||
-f src/math.c \
|
||||
-f src/mes.c \
|
||||
-f src/module.c \
|
||||
-f include/signal.h \
|
||||
-f src/posix.c \
|
||||
-f src/reader.c \
|
||||
-f src/stack.c \
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#! /bin/sh
|
||||
# Copyright © 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Mes.
|
||||
#
|
||||
# GNU Mes 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 3 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Usage:
|
||||
# kaem --verbose --strict
|
||||
|
||||
mes_cpu=x86
|
||||
stage0_cpu=x86
|
||||
kaem --verbose --strict
|
|
@ -39,7 +39,7 @@ struct dirent *
|
|||
readdir (DIR * dirp)
|
||||
{
|
||||
struct dirent *dp;
|
||||
int saved_errno = errno;
|
||||
int save_errno = errno;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ readdir (DIR * dirp)
|
|||
{
|
||||
/* Don't modifiy errno when reaching EOF. */
|
||||
if (bytes == 0)
|
||||
errno = saved_errno;
|
||||
errno = save_errno;
|
||||
dp = 0;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
char *
|
||||
_getcwd (char *buffer, size_t size)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,14 +19,16 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <mes/lib.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int
|
||||
_open3 (char const *file_name, int flags, int mask)
|
||||
{
|
||||
int r = _sys_call3 (SYS_open, (long) file_name, (int) flags, (int) mask);
|
||||
long long_file_name = cast_voidp_to_long (file_name);
|
||||
int r = _sys_call3 (SYS_open, long_file_name, flags, mask);
|
||||
__ungetc_init ();
|
||||
if (r > 2)
|
||||
{
|
||||
__ungetc_clear (r);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <mes/lib.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
int
|
||||
access (char const *file_name, int how)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <linux/x86/syscall.h>
|
||||
#include <linux/arm/syscall.h>
|
||||
|
||||
#if !__TINYC__
|
||||
// *INDENT-OFF*
|
||||
|
@ -187,7 +187,6 @@ __sys_call4 (long sys_call, long one, long two, long three, long four)
|
|||
}
|
||||
#endif //__TINYC__
|
||||
|
||||
#if 0
|
||||
long
|
||||
__sys_call6 (long sys_call, long one, long two, long three, long four, long five, long six)
|
||||
{
|
||||
|
@ -208,7 +207,6 @@ __sys_call6 (long sys_call, long one, long two, long three, long four, long five
|
|||
);
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
// *INDENT-ON*
|
||||
|
||||
|
@ -282,7 +280,6 @@ _sys_call4 (long sys_call, long one, long two, long three, long four)
|
|||
return r;
|
||||
}
|
||||
|
||||
#if 0
|
||||
long
|
||||
_sys_call6 (long sys_call, long one, long two, long three, long four, long five, long six)
|
||||
{
|
||||
|
@ -296,4 +293,3 @@ _sys_call6 (long sys_call, long one, long two, long three, long four, long five,
|
|||
errno = 0;
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
long
|
||||
brk (void *addr)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
int
|
||||
chdir (char const *file_name)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <time.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <mes/lib.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
int
|
||||
dup (int old)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
int
|
||||
dup2 (int old, int new)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
int
|
||||
execve (char const *file_name, char *const argv[], char *const env[])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
int
|
||||
fork ()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
int
|
||||
fsync (int filedes)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
gid_t
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
uid_t
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
gid_t
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
pid_t
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
pid_t
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
uid_t
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <mes/lib.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
int
|
||||
link (char const *old_name, char const *new_name)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -20,27 +20,27 @@
|
|||
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if !__MESC__ /* FIXME: We want bin/mes-mescc's x86-linux sha256sum to stay the same. */
|
||||
off_t
|
||||
_lseek (int filedes, off_t offset, int whence)
|
||||
{
|
||||
return _sys_call3 (SYS_lseek, (int) filedes, (long) offset, (int) whence);
|
||||
long long_offset = offset;
|
||||
return _sys_call3 (SYS_lseek, filedes, long_offset, whence);
|
||||
}
|
||||
#endif
|
||||
|
||||
off_t
|
||||
lseek (int filedes, off_t offset, int whence)
|
||||
{
|
||||
#if !__MESC__ /* FIXME: We want bin/mes-mescc's x86-linux sha256sum to stay the same. */
|
||||
#if !__MESC__ && !__M2__
|
||||
if (_lseek (filedes, 0, SEEK_CUR) == -1)
|
||||
return -1;
|
||||
#endif
|
||||
size_t skip = __buffered_read_clear (filedes);
|
||||
if (whence == SEEK_CUR)
|
||||
offset -= skip;
|
||||
return _sys_call3 (SYS_lseek, (int) filedes, (long) offset, (int) whence);
|
||||
long long_offset = offset;
|
||||
return _sys_call3 (SYS_lseek, filedes, long_offset, whence);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2021 Danny Milosavljevic <dannym@scratchpost.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
|
@ -31,9 +31,11 @@ malloc (size_t size)
|
|||
{
|
||||
if (!__brk)
|
||||
__brk = cast_long_to_charp (brk (0));
|
||||
#if !__M2__
|
||||
/* align what we give back. */
|
||||
__brk = (char*) (((uintptr_t) __brk
|
||||
+ sizeof (max_align_t) - 1) & -sizeof (max_align_t));
|
||||
#endif
|
||||
if (brk (__brk + size) == -1)
|
||||
return 0;
|
||||
char *p = __brk;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,13 +19,11 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <sys/stat.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
int
|
||||
chmod (char const *file_name, int mask)
|
||||
void *
|
||||
mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
|
||||
{
|
||||
long long_file_name = file_name;
|
||||
long long_mask = mask;
|
||||
return _sys_call2 (SYS_chmod, long_file_name, long_mask);
|
||||
return (void *)_sys_call6 (SYS_mmap, (long) addr, (long) len, (int) prot, (int) flags, (int) fd, (long) offset);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,12 +19,11 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <time.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
int
|
||||
clock_gettime (long clk_id, struct timespec *tp)
|
||||
munmap (void *addr, size_t length)
|
||||
{
|
||||
long long_tp = tp;
|
||||
return _sys_call2 (SYS_clock_gettime, clk_id, tp);
|
||||
return _sys_call2 (SYS_munmap, (long) addr, (long) length);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
* GNU Mes 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 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <mes/lib.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#if __M2__
|
||||
int
|
||||
open (char *file_name, int flags, int mask)
|
||||
{
|
||||
int r = _sys_call3 (SYS_open, file_name, flags, mask);
|
||||
if (r > 2)
|
||||
__ungetc_clear (r);
|
||||
return r;
|
||||
}
|
||||
#else // !__M2__
|
||||
int
|
||||
open (char const *file_name, int flags, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, flags);
|
||||
int mask = va_arg (ap, int);
|
||||
int r = _sys_call3 (SYS_open, (long) file_name, flags, mask);
|
||||
va_end (ap);
|
||||
if (r > 2)
|
||||
__ungetc_clear (r);
|
||||
return r;
|
||||
}
|
||||
#endif // !__M2__
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -18,16 +18,18 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <mes/lib.h>
|
||||
#include <linux/syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
ssize_t
|
||||
read (int filedes, void *buffer, size_t size)
|
||||
{
|
||||
long long_filedes = filedes;
|
||||
ssize_t bytes = _sys_call3 (SYS_read, long_filedes, buffer, size);
|
||||
long long_buffer = cast_voidp_to_long (buffer);
|
||||
ssize_t bytes = _sys_call3 (SYS_read, long_filedes, long_buffer, size);
|
||||
#if !__M2__
|
||||
if (__mes_debug () > 4)
|
||||
{
|
||||
if (bytes == 1)
|
||||
|
@ -48,5 +50,6 @@ read (int filedes, void *buffer, size_t size)
|
|||
eputs ("\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return bytes;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
ssize_t
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
|
||||
int
|
||||
rmdir (char const *file_name)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/syscall.h>
|
||||
#include <syscall.h>
|
||||
#include <arch/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue