From f41b34e4bf29cc9da8ac9e01d5cbf85dc35d1341 Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Wed, 26 Aug 2009 12:22:46 +0000 Subject: [PATCH] untested --- WEGA/src/lib/libc/TODO | 1 + WEGA/src/lib/libc/gen/tell.c | 10 ++++++++++ WEGA/src/lib/libc/sys/tell.s | 13 ------------- WEGA/src/lib/libc/sys/time.s | 13 +++++++++++++ WEGA/src/lib/libc/sys/times.s | 16 ++++++++++++++++ WEGA/src/lib/libc/sys/ulimit.s | 18 ++++++++++++++++++ WEGA/src/lib/libc/sys/umask.s | 11 +++++++++++ WEGA/src/lib/libc/sys/umount.s | 16 ++++++++++++++++ WEGA/src/lib/libc/sys/uname.s | 16 ++++++++++++++++ WEGA/src/lib/libc/sys/unlink.s | 16 ++++++++++++++++ WEGA/src/lib/libc/sys/ustat.s | 17 +++++++++++++++++ WEGA/src/lib/libc/sys/utime.s | 17 +++++++++++++++++ WEGA/src/lib/libc/sys/wait.s | 17 +++++++++++++++++ WEGA/src/lib/libc/sys/write.s | 17 +++++++++++++++++ 14 files changed, 185 insertions(+), 13 deletions(-) create mode 100644 WEGA/src/lib/libc/TODO create mode 100644 WEGA/src/lib/libc/gen/tell.c delete mode 100644 WEGA/src/lib/libc/sys/tell.s create mode 100644 WEGA/src/lib/libc/sys/time.s create mode 100644 WEGA/src/lib/libc/sys/times.s create mode 100644 WEGA/src/lib/libc/sys/ulimit.s create mode 100644 WEGA/src/lib/libc/sys/umask.s create mode 100644 WEGA/src/lib/libc/sys/umount.s create mode 100644 WEGA/src/lib/libc/sys/uname.s create mode 100644 WEGA/src/lib/libc/sys/unlink.s create mode 100644 WEGA/src/lib/libc/sys/ustat.s create mode 100644 WEGA/src/lib/libc/sys/utime.s create mode 100644 WEGA/src/lib/libc/sys/wait.s create mode 100644 WEGA/src/lib/libc/sys/write.s diff --git a/WEGA/src/lib/libc/TODO b/WEGA/src/lib/libc/TODO new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/WEGA/src/lib/libc/TODO @@ -0,0 +1 @@ + diff --git a/WEGA/src/lib/libc/gen/tell.c b/WEGA/src/lib/libc/gen/tell.c new file mode 100644 index 0000000..801ac06 --- /dev/null +++ b/WEGA/src/lib/libc/gen/tell.c @@ -0,0 +1,10 @@ +/* + * return offset in file. + */ + +long lseek(); + +long tell(f) +{ + return(lseek(f, ((long) 0), 1)); +} diff --git a/WEGA/src/lib/libc/sys/tell.s b/WEGA/src/lib/libc/sys/tell.s deleted file mode 100644 index b97a4a5..0000000 --- a/WEGA/src/lib/libc/sys/tell.s +++ /dev/null @@ -1,13 +0,0 @@ - .psec - .code -_tell:: - { - dec r15,#6 - ld @r15,r7 - ld r6,r7 - subl rr4,rr4 - ldk r3,#1 - call _lseek - inc r15,#6 - ret - } diff --git a/WEGA/src/lib/libc/sys/time.s b/WEGA/src/lib/libc/sys/time.s new file mode 100644 index 0000000..1a63f48 --- /dev/null +++ b/WEGA/src/lib/libc/sys/time.s @@ -0,0 +1,13 @@ +time module + + global + time procedure + entry + sc #13 + ldl rr2,rr4 + test r7 + ret z + ldl @r7,rr2 + ret + end time +end time diff --git a/WEGA/src/lib/libc/sys/times.s b/WEGA/src/lib/libc/sys/times.s new file mode 100644 index 0000000..26e0bf8 --- /dev/null +++ b/WEGA/src/lib/libc/sys/times.s @@ -0,0 +1,16 @@ +times module + + external + _cerror + + global + times procedure + entry + ld r0,r7 + subl rr4,rr4 + sc #43 + ldl rr2,rr4 + ret nc + jp cerror + end times +end times diff --git a/WEGA/src/lib/libc/sys/ulimit.s b/WEGA/src/lib/libc/sys/ulimit.s new file mode 100644 index 0000000..a385ae6 --- /dev/null +++ b/WEGA/src/lib/libc/sys/ulimit.s @@ -0,0 +1,18 @@ +ulimit module + + external + _cerror + + global + ulimit procedure + entry + ld r0,r7 + ld r1,r4 + ld r2,r5 + ldl rr4,0 + sc #54 + ldl rr2,rr4 + ret nc + jp cerror + end ulimit +end ulimit diff --git a/WEGA/src/lib/libc/sys/umask.s b/WEGA/src/lib/libc/sys/umask.s new file mode 100644 index 0000000..b712711 --- /dev/null +++ b/WEGA/src/lib/libc/sys/umask.s @@ -0,0 +1,11 @@ +umask module + + global + umask procedure + entry + ld r0,r7 + sc #60 + ld r2,r4 + ret + end umask +end umask diff --git a/WEGA/src/lib/libc/sys/umount.s b/WEGA/src/lib/libc/sys/umount.s new file mode 100644 index 0000000..ab535ea --- /dev/null +++ b/WEGA/src/lib/libc/sys/umount.s @@ -0,0 +1,16 @@ +umount module + + external + _cerror + + global + umount procedure + entry + ld r0,r7 + xor r4,r4 + sc #22 + ld r2,r4 + ret nc + jp cerror + end umount +end umount diff --git a/WEGA/src/lib/libc/sys/uname.s b/WEGA/src/lib/libc/sys/uname.s new file mode 100644 index 0000000..67e010d --- /dev/null +++ b/WEGA/src/lib/libc/sys/uname.s @@ -0,0 +1,16 @@ +uname module + + external + _cerror + + global + uname procedure + entry + ld r0,r7 + ld r2,#0 + sc #57 + ld r2,r4 + ret nc + jp cerror + end uname +end uname diff --git a/WEGA/src/lib/libc/sys/unlink.s b/WEGA/src/lib/libc/sys/unlink.s new file mode 100644 index 0000000..7ec1ad5 --- /dev/null +++ b/WEGA/src/lib/libc/sys/unlink.s @@ -0,0 +1,16 @@ +unlink module + + external + _cerror + + global + unlink procedure + entry + ld r0,r7 + xor r4,r4 + sc #10 + ld r2,r4 + ret nc + jp cerror + end unlink +end unlink diff --git a/WEGA/src/lib/libc/sys/ustat.s b/WEGA/src/lib/libc/sys/ustat.s new file mode 100644 index 0000000..4ac7f63 --- /dev/null +++ b/WEGA/src/lib/libc/sys/ustat.s @@ -0,0 +1,17 @@ +ustat module + + external + _cerror + + global + ustat procedure + entry + ld r0,r7 + ld r1,r7 + ld r2,#2 + sc #57 + ld r2,r4 + ret nc + jp cerror + end ustat +end ustat diff --git a/WEGA/src/lib/libc/sys/utime.s b/WEGA/src/lib/libc/sys/utime.s new file mode 100644 index 0000000..98dfa3f --- /dev/null +++ b/WEGA/src/lib/libc/sys/utime.s @@ -0,0 +1,17 @@ +utime module + + external + _cerror + + global + utime procedure + entry + ld r0,r7 + ld r1,r6 + xor r4,r4 + sc #30 + ld r2,r4 + ret nc + jp cerror + end utime +end utime diff --git a/WEGA/src/lib/libc/sys/wait.s b/WEGA/src/lib/libc/sys/wait.s new file mode 100644 index 0000000..ce7d156 --- /dev/null +++ b/WEGA/src/lib/libc/sys/wait.s @@ -0,0 +1,17 @@ +wait module + + external + _cerror + + global + wait procedure + entry + sc #7 + ldl rr2,rr4 + jp c,cerror + test r7 + ret z + ld @r7,r3 + ret + end wait +end wait diff --git a/WEGA/src/lib/libc/sys/write.s b/WEGA/src/lib/libc/sys/write.s new file mode 100644 index 0000000..e80d381 --- /dev/null +++ b/WEGA/src/lib/libc/sys/write.s @@ -0,0 +1,17 @@ +write module + + external + _cerror + + global + write procedure + entry + ld r0,r7 + ld r1,r6 + ld r2,r5 + sc #4 + ld r2,r4 + ret nc + jp cerror + end write +end write