[Mirmince-commits] {mirmince} branch master updated. a4ce42c1e4ebf0051779b9fcb734c06c9837a921
tg at freewrt.org
tg at freewrt.org
Sun Jan 6 23:44:28 UTC 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main git repository for FreeWRT project mirmince".
The branch, master has been updated
via a4ce42c1e4ebf0051779b9fcb734c06c9837a921 (commit)
via 058a11a6a0971873f9a81a22909f7a41941026a0 (commit)
from 6de85ec4b35a1cebbf8566c2db4f038c969c1e94 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a4ce42c1e4ebf0051779b9fcb734c06c9837a921
Author: Thorsten Glaser <tg at mirbsd.org>
Date: Sun Jan 6 23:44:24 2013 +0000
make the syscalls look more nice in the objdump -d -Mintel
and use jupp24 for correct indentation
commit 058a11a6a0971873f9a81a22909f7a41941026a0
Author: Thorsten Glaser <tg at mirbsd.org>
Date: Sun Jan 6 23:30:01 2013 +0000
first hello-world program, workink!
-----------------------------------------------------------------------
Summary of changes:
BSDmakefile | 89 ++++++++++++++++++++++++++----
do-install | 6 ++
gcc-spec | 22 +++++---
gcc-wrap | 3 +-
include/fcntl.h | 47 ++++++++++++++++
include/mirmince/c.h | 4 ++
include/mirmince/types.h | 21 +++++++
include/stdlib.h | 2 +-
include/sys/types.h | 12 ++++
include/unistd.h | 27 +++++++++
md/i386/asm.h | 26 ++++++---
mi/Makefile.inc | 3 +
mi/{mincebeg_mi.c => exit.c} | 15 +----
mi/mincebeg_mi.c | 2 +-
mi/vars.c | 13 +++++
gcc-wrap => mkmkfg | 38 +++----------
gcc-wrap => mksysch | 38 +++----------
osdep/mirbsd/Makefile.inc | 14 +++--
osdep/mirbsd/{mincebeg_os.S => cerror.S} | 28 +++++-----
osdep/mirbsd/syscalls | 7 +++
20 files changed, 295 insertions(+), 122 deletions(-)
create mode 100644 include/fcntl.h
create mode 100644 include/mirmince/types.h
create mode 100644 include/sys/types.h
create mode 100644 include/unistd.h
copy mi/{mincebeg_mi.c => exit.c} (73%)
create mode 100644 mi/vars.c
copy gcc-wrap => mkmkfg (62%)
copy gcc-wrap => mksysch (62%)
copy osdep/mirbsd/{mincebeg_os.S => cerror.S} (75%)
create mode 100644 osdep/mirbsd/syscalls
diff --git a/BSDmakefile b/BSDmakefile
index be64e02..7cb8fca 100644
--- a/BSDmakefile
+++ b/BSDmakefile
@@ -30,21 +30,27 @@ SHELL= /bin/mksh
LIBCDIR= ${.CURDIR}
TG_CC:= ${CC}
CC:= ${DST:Q}/bin/cc
+_CONF:= ${LIBCDIR}/obj/.conf-${TG_ARCH:Q}-${TG_OS:Q}
+
+.if defined(V) && $V > 0
+CC+= -v
+.endif
all:
obj:
mkdir -p ${.CURDIR:Q}/obj
-depend:
-
clean:
test -d ${.CURDIR:Q}/obj/.
- rm -f *.o *.a
+ rm -f *~ *.o *.a .conf-* ${CLEANFILES}
+
+cleandir: clean
+ rm -f ${DCLEANFILES}
install:
${SHELL} ${.CURDIR:Q}/do-install ${TG_CC:Q} ${DST:Q} \
- ${TG_ARCH:Q} ${TG_OS:Q}
+ ${TG_ARCH:Q} ${TG_OS:Q} ${TG_CFLAGS:M*:Q}
CPPFLAGS:= -D_ALL_SOURCE
CFLAGS:=
@@ -60,11 +66,15 @@ LDADD:=
.include "${LIBCDIR}/md/${TG_ARCH}/Makefile.inc"
.include "${LIBCDIR}/osdep/${TG_OS}/Makefile.inc"
+.if !make(obj) && !make(depend) && !make(clean)
+.include "${LIBCDIR}/obj/Makefile.gen"
+.endif
+
.ifdef DEBUG
CFLAGS+= -g3
.endif
-.SUFFIXES: .a .o .S .c .h
+.SUFFIXES: .a .o .S .i .c .h
.LIBS: .a
COMPILE.S:= ${CC} -D_ASM_SOURCE ${CPPFLAGS} ${AFLAGS} -c
@@ -73,14 +83,73 @@ LINK.c:= ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS}
.o:
${LINK.c} -o $@ ${.IMPSRC} ${LDADD}
-.c.o:
- ${COMPILE.c} ${CFLAGS_${.TARGET:T:R}:M*} ${.IMPSRC}
.S.o:
${COMPILE.S} ${AFLAGS_${.TARGET:T:R}:M*} ${.IMPSRC}
+.c.o:
+ ${COMPILE.c} ${CFLAGS_${.TARGET:T:R}:M*} ${.IMPSRC}
+.c.i:
+ ${COMPILE.c} ${CFLAGS_${.TARGET:T:R}:M*} ${.IMPSRC} -E -o $@
+all: ${GENHDRS}
all: mincebeg.o
mincebeg.o: mincebeg_os.o mincebeg_md.o mincebeg_mi.o
- ${LD} -r -o $@.o $>
- #XXX the presence of environ here is only temporary
- objcopy -x -G _mince_csu_init -G environ $@.o $@
+ ${LD} -X -r -o $@.o $>
+ objcopy -G _mince_csu_init -x $@.o $@
+ @rm -f $@.o
+
+GENHDRS+= syscall.h
+
+${_CONF}:
+ @:>$@
+
+DCLEANFILES+= syscall.h
+
+syscall.h: ${_CONF} mksysch
+ ${SHELL} ${LIBCDIR:Q}/mksysch \
+ ${LIBCDIR:Q}/osdep/${TG_OS}/syscalls
+
+DCLEANFILES+= Makefile.gen
+
+Makefile.gen: ${_CONF} mkmkfg
+ ${SHELL} ${LIBCDIR:Q}/mkmkfg \
+ ${LIBCDIR:Q}/osdep/${TG_OS}/syscalls
+
+SYSCALLS+=${SYSCALLS_${TG_ARCH}}
+
+CLEANFILES+= sys_*.S
+.for _n _k _a in ${SYSCALLS}
+SOBJS+= sys_${_n}.o
+
+sys_${_n}.S:
+ x='#include <mirmince/asm.h>'; \
+ x+=$$'\n#include <mirmince/syscall.h>'; \
+ x+=$$'\nSYSCALL_PREP'; \
+ x+=$$'\nSYSCALL${_a}(${_n}, ${_k})'; \
+ print -r -- "$$x" >$@
+
+sys_${_n}.o: sys_${_n}.S
+ ${COMPILE.S} -o $@.o $>
+ ${LD} -X -r -o $@ $@.o
+ @rm -f $@.o
+.endfor
+
+depend: ${GENHDRS} Makefile.gen
+
+all: libminze.a
+
+SOBJS+= ${SRCS:M*.S:.S=.o}
+
+libminze.a: ${SOBJS}
+ ar rc $@~ ${SOBJS}
+ ranlib $@~
+ mv -f $@~ $@
+
+all: libmince.a
+
+COBJS+= ${SRCS:M*.c:.c=.o}
+
+libmince.a: ${COBJS}
+ ar rc $@~ ${COBJS}
+ ranlib $@~
+ mv -f $@~ $@
diff --git a/do-install b/do-install
index ff866d7..850de82 100644
--- a/do-install
+++ b/do-install
@@ -24,6 +24,7 @@ cc=$1
dst=$2
arch=$3
os=$4
+cflags=$5
cd "$(dirname "$0")"
rm -rf "$dst"/{bin,include,lib,libdata}
@@ -36,6 +37,7 @@ while IFS= read -r line; do
line=${line//@@CC@@/"${cc at Q}"}
line=${line//@@MD@@/"${arch at Q}"}
line=${line//@@OS@@/"${os at Q}"}
+ line=${line//@@DEFCFLAGS@@/"${cflags at Q}"}
print -r -- "${line//@@DST@@/"${dst at Q}"}"
done <gcc-wrap >"$dst"/bin/cc
chmod +x "$dst"/bin/cc
@@ -44,6 +46,10 @@ find include -name \*.h -print0 | pax -rw -0 "$dst"/
pax -rw -0 "$dst"/include/mirmince/md/)
(cd osdep/"$os" && find . -name \*.h -print0 | \
pax -rw -0 "$dst"/include/mirmince/osdep/)
+for f in obj/syscall.h; do
+ [[ -s $f ]] || continue
+ cp "$f" "$dst"/include/mirmince/
+done
for f in obj/mince{beg,end}.o obj/*.a; do
[[ -s $f ]] || continue
cp "$f" "$dst"/lib/
diff --git a/gcc-spec b/gcc-spec
index 011cded..6be71e3 100644
--- a/gcc-spec
+++ b/gcc-spec
@@ -1,27 +1,33 @@
+*lib:
+-lmince -lminze
+
+*libgcc:
+
+
*link_gcc_c_sequence:
--start-group %L --end-group
+*startfile:
+@@DST@@/lib/mincebeg.o
+
*endfile:
+
*link:
%{assert*} %{R*} %{rpath*} -dc -dp %{!nostdlib:%{!r*:%{!e*:-e _mince_csu_init}}} -Bstatic
-*lib:
--lmince -lminse
-
-*libgcc:
-
-*startfile:
-@@DST@@/lib/mincebeg.o
-
*multilib:
+. ;
*multilib_matches:
+
*multilib_options:
+
*link_libgcc:
-L@@DST@@/lib
*linker:
/usr/bin/ld
+
diff --git a/gcc-wrap b/gcc-wrap
index f23a72d..c2fc474 100644
--- a/gcc-wrap
+++ b/gcc-wrap
@@ -21,6 +21,7 @@
# GCC wrapper for mirₘᵢₙcⒺ (experimental)
cc=@@CC@@
+defcflags=@@DEFCFLAGS@@
dst=@@DST@@
if [[ $cc != /* ]] && ! cc=$(whence -p "$cc"); then
@@ -38,7 +39,7 @@ fi
set -A cmd -- "$cc" -nostdinc -I"$dst"/include -D__mirmincE__ \
-D__mirmincE_arch_@@MD@@ -D__mirmincE_arch__=\"@@MD@@\" \
-D__mirmincE_os_@@OS@@ -D__mirmincE_os__=\"@@OS@@\" \
- "$@"
+ $defcflags -specs="$dst"/libdata/gcc-spec "$@"
if (( v )); then
print -nu2 +
diff --git a/include/fcntl.h b/include/fcntl.h
new file mode 100644
index 0000000..7ee8585
--- /dev/null
+++ b/include/fcntl.h
@@ -0,0 +1,47 @@
+#ifndef FCNTL_H
+#define FCNTL_H
+
+#ifndef MIRMINCE_C_H
+#include <mirmince/c.h>
+#endif
+
+#define MIRMINCE_NT_MODE_T
+#define MIRMINCE_NT_OFF_T
+#define MIRMINCE_NT_PID_T
+#include <mirmince/types.h>
+
+#if defined(__mirmincE_os_mirbsd)
+/*#define O_EXEC*/
+#define O_RDONLY 0x0000
+#define O_RDWR 0x0002
+/*#define O_SEARCH*/
+#define O_WRONLY 0x0001
+#ifndef _ALL_SOURCE
+#define O_ACCMODE 0x0003
+#endif
+#define O_APPEND 0x0008
+/*#define O_CLOEXEC*/
+#define O_CREAT 0x0200
+/*#define O_DIRECTORY*/
+#define O_DSYNC O_SYNC
+#define O_EXCL 0x0800
+#define O_NOCTTY 0x8000
+#define O_NOFOLLOW 0x0100
+#define O_NONBLOCK 0x0004
+#define O_RSYNC O_SYNC
+#define O_SYNC 0x0080
+#define O_TRUNC 0x0400
+/*#define O_TTY_INIT*/
+#ifndef _ALL_SOURCE
+#define O_SHLOCK 0x0010
+#define O_EXLOCK 0x0020
+#define O_ASYNC 0x0040
+#define O_FSYNC O_SYNC
+#endif
+#endif /* OS:MirBSD */
+
+__BEGIN_DECLS
+int open(const char *path, int oflag, ...);
+__END_DECLS
+
+#endif
diff --git a/include/mirmince/c.h b/include/mirmince/c.h
index 1e95211..ba22016 100644
--- a/include/mirmince/c.h
+++ b/include/mirmince/c.h
@@ -13,12 +13,14 @@
#endif
#ifdef __GNUC__
+#define mirmince_bss __attribute__((__section__ (".bss")))
#define mirmince_cc_cdecl __attribute__((__cdecl__))
#define mirmince_cc_regparm(x) __attribute__((__regparm__ (x)))
#define mirmince_dead __attribute__((__noreturn__))
#define mirmince_printf(x) __attribute__((__printf__ x))
#define mirmince_unused __attribute__((__unused__))
#else
+#define mirmince_bss
#define mirmince_cc_cdecl /* default */
#define mirmince_cc_regparm(x) /* not used */
#define mirmince_dead
@@ -30,4 +32,6 @@
#define mirmince_cc_fast mirmince_cc_cdecl
#endif
+#define NULL ((void *)0)
+
#endif
diff --git a/include/mirmince/types.h b/include/mirmince/types.h
new file mode 100644
index 0000000..306c6fb
--- /dev/null
+++ b/include/mirmince/types.h
@@ -0,0 +1,21 @@
+#ifdef MIRMINCE_NT_SIZE_T
+#ifndef MIRMINCE_DT_SIZE_T
+#ifdef __SIZE_TYPE__
+typedef __SIZE_TYPE__ size_t;
+#endif
+#define MIRMINCE_DT_SIZE_T
+#endif
+#undef MIRMINCE_NT_SIZE_T
+#endif
+
+#ifdef MIRMINCE_NT_SSIZE_T
+#ifndef MIRMINCE_DT_SSIZE_T
+#ifdef __SIZE_TYPE__
+#define unsigned /* nothing */
+typedef signed __SIZE_TYPE__ ssize_t;
+#undef unsigned
+#endif
+#define MIRMINCE_DT_SSIZE_T
+#endif
+#undef MIRMINCE_NT_SSIZE_T
+#endif
diff --git a/include/stdlib.h b/include/stdlib.h
index 6545706..9ac85a0 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -6,7 +6,7 @@
#endif
__BEGIN_DECLS
-void exit(int status);
+void exit(int status) mirmince_dead;
__END_DECLS
#endif
diff --git a/include/sys/types.h b/include/sys/types.h
new file mode 100644
index 0000000..8d38699
--- /dev/null
+++ b/include/sys/types.h
@@ -0,0 +1,12 @@
+#ifndef SYS_TYPES_H
+#define SYS_TYPES_H
+
+#ifndef MIRMINCE_C_H
+#include <mirmince/c.h>
+#endif
+
+/* incomplete list */
+#define MIRMINCE_NT_SIZE_T
+#include <mirmince/types.h>
+
+#endif
diff --git a/include/unistd.h b/include/unistd.h
new file mode 100644
index 0000000..2604e5e
--- /dev/null
+++ b/include/unistd.h
@@ -0,0 +1,27 @@
+#ifndef UNISTD_H
+#define UNISTD_H
+
+#ifndef MIRMINCE_C_H
+#include <mirmince/c.h>
+#endif
+
+#define MIRMINCE_NT_GID_T
+#define MIRMINCE_NT_INTPTR_T
+#define MIRMINCE_NT_OFF_T
+#define MIRMINCE_NT_PID_T
+#define MIRMINCE_NT_SIZE_T
+#define MIRMINCE_NT_SSIZE_T
+#define MIRMINCE_NT_UID_T
+#include <mirmince/types.h>
+
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+
+__BEGIN_DECLS
+int close(int fd);
+ssize_t read(int fd, void *buf, size_t nbytes);
+ssize_t write(int fd, const void *buf, size_t nbytes);
+__END_DECLS
+
+#endif
diff --git a/md/i386/asm.h b/md/i386/asm.h
index 1edff3f..aa39352 100644
--- a/md/i386/asm.h
+++ b/md/i386/asm.h
@@ -6,13 +6,23 @@
#define _ALIGN_TEXT .p2align 2,0x90
#endif
+#if defined(__mirmincE_os_mirbsd)
#define SYSCALL_PREP \
.globl _C_LABEL(_mince_cerror)
-#define SYSCALL(cname,kname) \
- _TEXT; \
- _ALIGN_TEXT; \
- ENTRY(cname) \
- mov eax,SYS_ ## kname; \
- int 0x80; \
- jc _C_LABEL(_mince_cerror); \
- ret
+#define SYSCALL(cname,kname) \
+ ENTRY(cname) \
+ mov eax,SYS_ ## kname; \
+ int 0x80; \
+ jc _mince_cerror; \
+ ret
+#define SYSCALLV SYSCALL
+#define SYSCALL0 SYSCALL
+#define SYSCALL1 SYSCALL
+#define SYSCALL2 SYSCALL
+#define SYSCALL3 SYSCALL
+#define SYSCALL4 SYSCALL
+#define SYSCALL5 SYSCALL
+#define SYSCALL6 SYSCALL
+#else
+#error define a syscall convention for the OS
+#endif
diff --git a/mi/Makefile.inc b/mi/Makefile.inc
index e69de29..26fd8e6 100644
--- a/mi/Makefile.inc
+++ b/mi/Makefile.inc
@@ -0,0 +1,3 @@
+SRCS+= vars.c
+
+SRCS+= exit.c
diff --git a/mi/mincebeg_mi.c b/mi/exit.c
similarity index 73%
copy from mi/mincebeg_mi.c
copy to mi/exit.c
index f7aa174..648d4ec 100644
--- a/mi/mincebeg_mi.c
+++ b/mi/exit.c
@@ -20,19 +20,10 @@
#include <stdlib.h>
-void _mince_csu_run(int argc, char *argv[], char *envp[])
- /* actually more, machdep, not yet used */
- mirmince_dead
- mirmince_cc_cdecl;
-extern int main(int argc, char *argv[], char *envp[]);
-
-char **environ;
+extern int _exit__(int status) mirmince_dead;
void
-_mince_csu_run(int argc, char *argv[], char *envp[])
+exit(int status)
{
- /* we will want __progname later */
- environ = envp;
-
- exit(main(argc, argv, envp));
+ _exit__(status);
}
diff --git a/mi/mincebeg_mi.c b/mi/mincebeg_mi.c
index f7aa174..cbc600c 100644
--- a/mi/mincebeg_mi.c
+++ b/mi/mincebeg_mi.c
@@ -26,7 +26,7 @@ void _mince_csu_run(int argc, char *argv[], char *envp[])
mirmince_cc_cdecl;
extern int main(int argc, char *argv[], char *envp[]);
-char **environ;
+extern char **environ;
void
_mince_csu_run(int argc, char *argv[], char *envp[])
diff --git a/mi/vars.c b/mi/vars.c
new file mode 100644
index 0000000..ccf3b5e
--- /dev/null
+++ b/mi/vars.c
@@ -0,0 +1,13 @@
+/*
+ * global variables that every program needs
+ */
+
+#include <mirmince/c.h>
+
+/* required by the CSU */
+
+char **environ mirmince_bss = NULL;
+
+/* required by the CRT */
+
+int errno mirmince_bss = 0;
diff --git a/gcc-wrap b/mkmkfg
similarity index 62%
copy from gcc-wrap
copy to mkmkfg
index f23a72d..43af505 100644
--- a/gcc-wrap
+++ b/mkmkfg
@@ -1,5 +1,3 @@
-#!/bin/mksh
-#-
# Copyright © 2013
# Thorsten Glaser <tg at mirbsd.org>
#
@@ -17,34 +15,12 @@
# of dealing in the work, even if advised of the possibility of such
# damage or existence of a defect, except proven that it results out
# of said person’s immediate fault when using the work as intended.
-#-
-# GCC wrapper for mirₘᵢₙcⒺ (experimental)
-cc=@@CC@@
-dst=@@DST@@
+syscalls=$1
-if [[ $cc != /* ]] && ! cc=$(whence -p "$cc"); then
- print -u2 Error: could not find C compiler
- exit 255
-fi
-
-if [[ $1 = -v ]]; then
- v=1
- shift
-else
- v=0
-fi
-
-set -A cmd -- "$cc" -nostdinc -I"$dst"/include -D__mirmincE__ \
- -D__mirmincE_arch_@@MD@@ -D__mirmincE_arch__=\"@@MD@@\" \
- -D__mirmincE_os_@@OS@@ -D__mirmincE_os__=\"@@OS@@\" \
- "$@"
-
-if (( v )); then
- print -nu2 +
- for x in "${cmd[@]}"; do
- print -nru2 -- " ${x at Q}"
- done
- print -u2
-fi
-exec "${cmd[@]}"
+while read arch num args name kname rest; do
+ [[ -z $arch || $arch = '#' ]] && continue
+ mv=SYSCALLS_$arch
+ [[ $arch = '*' ]] && mv=SYSCALLS
+ print -r "${mv}+= ${name:-!} ${kname:-${name:-!}} ${args:-!}"
+done <"$syscalls" >Makefile.gen
diff --git a/gcc-wrap b/mksysch
similarity index 62%
copy from gcc-wrap
copy to mksysch
index f23a72d..b3bf7b5 100644
--- a/gcc-wrap
+++ b/mksysch
@@ -1,5 +1,3 @@
-#!/bin/mksh
-#-
# Copyright © 2013
# Thorsten Glaser <tg at mirbsd.org>
#
@@ -17,34 +15,12 @@
# of dealing in the work, even if advised of the possibility of such
# damage or existence of a defect, except proven that it results out
# of said person’s immediate fault when using the work as intended.
-#-
-# GCC wrapper for mirₘᵢₙcⒺ (experimental)
-cc=@@CC@@
-dst=@@DST@@
+syscalls=$1
-if [[ $cc != /* ]] && ! cc=$(whence -p "$cc"); then
- print -u2 Error: could not find C compiler
- exit 255
-fi
-
-if [[ $1 = -v ]]; then
- v=1
- shift
-else
- v=0
-fi
-
-set -A cmd -- "$cc" -nostdinc -I"$dst"/include -D__mirmincE__ \
- -D__mirmincE_arch_@@MD@@ -D__mirmincE_arch__=\"@@MD@@\" \
- -D__mirmincE_os_@@OS@@ -D__mirmincE_os__=\"@@OS@@\" \
- "$@"
-
-if (( v )); then
- print -nu2 +
- for x in "${cmd[@]}"; do
- print -nru2 -- " ${x at Q}"
- done
- print -u2
-fi
-exec "${cmd[@]}"
+while read arch num args name kname rest; do
+ [[ -z $arch || $arch = '#' ]] && continue
+ [[ $arch = '*' ]] || print "#ifdef __mirmincE_arch_$arch"
+ print "#define SYS_${kname:-${name:-!}} $num"
+ [[ $arch = '*' ]] || print "#endif"
+done <"$syscalls" >syscall.h
diff --git a/osdep/mirbsd/Makefile.inc b/osdep/mirbsd/Makefile.inc
index e1d93d4..21981dd 100644
--- a/osdep/mirbsd/Makefile.inc
+++ b/osdep/mirbsd/Makefile.inc
@@ -1,17 +1,19 @@
#XXX this is gcc only right now
-CFLAGS+= -Os -fweb -frename-registers
-CFLAGS+= -fno-align-functions -fno-align-labels \
+TG_CFLAGS+= -Os -fweb -frename-registers
+TG_CFLAGS+= -fno-align-functions -fno-align-labels \
-falign-loops=4 -falign-jumps=4
.if ${TG_ARCH} == "i386"
-CFLAGS+= -march=i486 -mpush-args -mpreferred-stack-boundary=2 \
+TG_CFLAGS+= -march=i486 -mpush-args -mpreferred-stack-boundary=2 \
-momit-leaf-frame-pointer
.elif ${TG_ARCH} == "sparc"
-CFLAGS+= -mcpu=v8 -mtune=hypersparc
+TG_CFLAGS+= -mcpu=v8 -mtune=hypersparc
.else
.error Unknown MirBSD architecture "${TG_ARCH}"
.endif
-CFLAGS+= -Wformat -Wstrict-aliasing -Wbounded
-CFLAGS+= -fwrapv -fhonour-copts
+TG_CFLAGS+= -Wformat -Wstrict-aliasing -Wbounded -Wmissing-declarations
+TG_CFLAGS+= -fwrapv -fhonour-copts
+
+SRCS+= cerror.S
diff --git a/osdep/mirbsd/mincebeg_os.S b/osdep/mirbsd/cerror.S
similarity index 75%
copy from osdep/mirbsd/mincebeg_os.S
copy to osdep/mirbsd/cerror.S
index 0c3d09c..1e3c925 100644
--- a/osdep/mirbsd/mincebeg_os.S
+++ b/osdep/mirbsd/cerror.S
@@ -1,5 +1,5 @@
/*-
- * Copyright © 2003, 2004, 2005, 2013
+ * Copyright © 2013
* Thorsten Glaser <tg at mirbsd.org>
*
* Provided that these terms and disclaimer and all copyright notices
@@ -20,16 +20,18 @@
#include <mirmince/asm.h>
-#ifndef __ELF__
-#error huh?
-#endif
+ _TEXT
+
+ .globl _C_LABEL(errno)
- .section .note.miros.ident,"a", at progbits
- .p2align 2
- .long 2f-1f /* name size */
- .long 4f-3f /* desc size */
- .long 1 /* type (OS version note) */
-1: .asciz "MirOS BSD" /* name */
-2: .p2align 2
-3: .long 0 /* desc */
-4: .p2align 2
+ _ALIGN_TEXT
+ASENTRY(_mince_cerror)
+
+#if defined(__mirmincE_arch_i386)
+ mov [_C_LABEL(errno)],eax
+ mov edx,0xFFFFFFFF
+ mov eax,edx
+ ret
+#else
+#error define cerror for this architecture
+#endif
diff --git a/osdep/mirbsd/syscalls b/osdep/mirbsd/syscalls
new file mode 100644
index 0000000..1a1a6ef
--- /dev/null
+++ b/osdep/mirbsd/syscalls
@@ -0,0 +1,7 @@
+# arch num args name kname
+* 0 V syscall
+* 1 1 _exit__ exit
+* 3 3 read
+* 4 3 write
+* 5 V open
+* 6 1 close
hooks/post-receive
--
Main git repository for FreeWRT project mirmince
(FreeWRT project mirmince repository mirmince)
More information about the Mirmince-commits
mailing list