From 49d7d2df87071728f6f030a8b60b5fbd02efc27d Mon Sep 17 00:00:00 2001 From: uz Date: Sat, 16 Apr 2011 12:15:49 +0000 Subject: [PATCH] Added stub for _osmaperrno. Improve uname info. By Stefan Haubenthal. git-svn-id: svn://svn.cc65.org/cc65/trunk@4985 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/atmos/Makefile | 1 + libsrc/atmos/oserror.s | 11 +++++++++ libsrc/atmos/sysuname.s | 55 +++++++++++++++++++++++------------------ 3 files changed, 43 insertions(+), 24 deletions(-) create mode 100644 libsrc/atmos/oserror.s diff --git a/libsrc/atmos/Makefile b/libsrc/atmos/Makefile index c19fe187b..5fe1792b3 100644 --- a/libsrc/atmos/Makefile +++ b/libsrc/atmos/Makefile @@ -61,6 +61,7 @@ OBJS = _scrsize.o \ kbhit.o \ mainargs.o \ oserrlist.o \ + oserror.o \ revers.o \ systime.o \ sysuname.o \ diff --git a/libsrc/atmos/oserror.s b/libsrc/atmos/oserror.s new file mode 100644 index 000000000..befbdffbf --- /dev/null +++ b/libsrc/atmos/oserror.s @@ -0,0 +1,11 @@ +; +; Stefan Haubenthal, 2011-04-10 +; +; int __fastcall__ _osmaperrno (unsigned char oserror); +; /* Map a system specific error into a system independent code */ +; + + .export __osmaperrno + .import return0 + +__osmaperrno = return0 diff --git a/libsrc/atmos/sysuname.s b/libsrc/atmos/sysuname.s index 85fba9738..d86ce5047 100644 --- a/libsrc/atmos/sysuname.s +++ b/libsrc/atmos/sysuname.s @@ -4,11 +4,11 @@ ; unsigned char __fastcall__ _sysuname (struct utsname* buf); ; - .export __sysuname, utsdata + .export __sysuname, utsdata - .import utscopy + .import utscopy - __sysuname = utscopy + __sysuname = utscopy ;-------------------------------------------------------------------------- ; Data. We define a fixed utsname struct here and just copy it. @@ -16,24 +16,31 @@ .rodata utsdata: - ; sysname - .asciiz "cc65" - - ; nodename - .asciiz "" - - ; release - .byte ((.VERSION >> 8) & $0F) + '0' - .byte '.' - .byte ((.VERSION >> 4) & $0F) + '0' - .byte $00 - - ; version - .byte (.VERSION & $0F) + '0' - .byte $00 - - ; machine - .asciiz "Oric Atmos" - - - + ; sysname + .asciiz "cc65" + + ; nodename + .asciiz "" + + ; release + .byte ((.VERSION >> 8) & $0F) + '0' + .byte '.' + .if ((.VERSION >> 4) & $0F) > 9 + .byte ((.VERSION >> 4) & $0F) / 10 + '0' + .byte ((.VERSION >> 4) & $0F) .MOD 10 + '0' + .else + .byte ((.VERSION >> 4) & $0F) + '0' + .endif + .byte $00 + + ; version + .if (.VERSION & $0F) > 9 + .byte (.VERSION & $0F) / 10 + '0' + .byte (.VERSION & $0F) .MOD 10 + '0' + .else + .byte (.VERSION & $0F) + '0' + .endif + .byte $00 + + ; machine + .asciiz "Oric Atmos" -- 2.39.5