diff options
Diffstat (limited to 'sysdeps/standalone')
-rw-r--r-- | sysdeps/standalone/close.c | 8 | ||||
-rw-r--r-- | sysdeps/standalone/m68k/m68020/start.S | 37 | ||||
-rw-r--r-- | sysdeps/standalone/open.c | 23 | ||||
-rw-r--r-- | sysdeps/standalone/read.c | 23 | ||||
-rw-r--r-- | sysdeps/standalone/write.c | 18 |
5 files changed, 55 insertions, 54 deletions
diff --git a/sysdeps/standalone/close.c b/sysdeps/standalone/close.c index 59b607305f..7ef1a5f878 100644 --- a/sysdeps/standalone/close.c +++ b/sysdeps/standalone/close.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. @@ -19,7 +19,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <unistd.h> @@ -28,11 +27,12 @@ Cambridge, MA 02139, USA. */ /* Close the file descriptor FD. */ int -DEFUN(__close, (fd), int fd) +__close (fd) + int fd; { if ( !__FD_Is_valid( fd ) || !__FD_Table[ fd ].in_use ) { - errno = EBADF; + __set_errno (EBADF); return -1; } diff --git a/sysdeps/standalone/m68k/m68020/start.S b/sysdeps/standalone/m68k/m68020/start.S index cbabf5bf07..9d7d779e04 100644 --- a/sysdeps/standalone/m68k/m68020/start.S +++ b/sysdeps/standalone/m68k/m68020/start.S @@ -1,19 +1,19 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1996 Free Software Foundation, Inc. Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil), On-Line Applications Research Corporation. - + This file is part of the GNU C Library. - + The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + The GNU C Library 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 Library General Public License for more details. - + You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, @@ -43,7 +43,7 @@ _M68Kvec: | standard location for vectors .space 4088 | to avoid initial intr stack | from 135BUG on MVME13? as entry | and start code at 0x4000 -around: +around: move.w %sr,initial_sr | save initial values movec %isp,%a0 movel %a0,initial_isp @@ -53,19 +53,19 @@ around: movel %a0,initial_msp oriw #0x0700,%sr | INTERRUPTS OFF!!! - + | | zero out uninitialized data area | zerobss: - moveal #end,%a0 | find end of .bss - moveal #_bss_start,%a1 | find beginning of .bss + moveal #end,%a0 | find end of .bss + moveal #_bss_start,%a1 | find beginning of .bss movel #0,%d0 loop: movel #0,%a1@+ | to zero out uninitialized cmpal %a0,%a1 - jlt loop | loop until _end reached + jlt loop | loop until _end reached movel #heap_size,__C_heap_size | set ___C_heap_size movel #heap_memory,__C_heap_start | set ___C_heap_start @@ -77,14 +77,14 @@ loop: movel #0,%a1@+ | to zero out uninitialized movw #0x3000,%sr | SUPV MODE,INTERRUPTS ON!!! #ifdef NEED_UNDERSCORES - jsr __Board_Initialize | initialize the board + jsr __Board_Initialize | initialize the board #else - jsr _Board_Initialize | initialize the board + jsr _Board_Initialize | initialize the board #endif - move.l #0,%sp@- | envp = NULL - move.l #0,%sp@- | argv = NULL - move.l #0,%sp@- | argc = NULL + move.l #0,%sp@- | envp = NULL + move.l #0,%sp@- | argv = NULL + move.l #0,%sp@- | argc = NULL #ifdef NEED_UNDERSCORES jsr ___libc_init | initialize the library and | call main @@ -93,8 +93,8 @@ loop: movel #0,%a1@+ | to zero out uninitialized | call main #endif add.l #12,%sp - - move.l #0,%sp@- | argc = NULL + + move.l #0,%sp@- | argc = NULL jsr __exit | call the Board specific exit addq.l #4,%sp @@ -121,7 +121,7 @@ _name##: .space _space #define DECLARE_LABEL(_name) \ .globl _name ; \ -_name##: +_name##: #define DECLARE_PTR(_name) DECLARE_SPACE(_name,4,2) #define DECLARE_U32(_name) DECLARE_SPACE(_name,4,2) @@ -139,6 +139,7 @@ DECLARE_U16(initial_sr) DECLARE_LABEL(_environ) DECLARE_PTR(environ) +DECLARE_LABEL(__errno) DECLARE_LABEL(_errno) DECLARE_U32(errno) diff --git a/sysdeps/standalone/open.c b/sysdeps/standalone/open.c index 910e7933e7..87097d9cb0 100644 --- a/sysdeps/standalone/open.c +++ b/sysdeps/standalone/open.c @@ -1,7 +1,7 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. - + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,7 +19,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <fcntl.h> #include <stdarg.h> @@ -36,7 +35,9 @@ Cambridge, MA 02139, USA. */ /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ int -DEFUN(__open, (file, oflag), CONST char *file AND int oflag DOTS) +__open (file, oflag) + const char *file; + int oflag; { int mode; int newfd; @@ -44,7 +45,7 @@ DEFUN(__open, (file, oflag), CONST char *file AND int oflag DOTS) if (file == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -69,17 +70,17 @@ DEFUN(__open, (file, oflag), CONST char *file AND int oflag DOTS) } if ( newfd == -1 ) { - errno = ENFILE; + __set_errno (ENFILE); return -1; } - /* + /* * Initialize the open slot */ __FD_Table[ newfd ].in_use = 1; __FD_Table[ newfd ].flags = oflag; - + return newfd; } @@ -89,8 +90,10 @@ DEFUN(__open, (file, oflag), CONST char *file AND int oflag DOTS) static #endif void -DEFUN(__NONE_init_console_io, (argc, argv, envp), - int argc AND char **argv AND char **envp) +__NONE_init_console_io (argc, argv, envp) + int argc; + char **argv; + char **envp; { int index; diff --git a/sysdeps/standalone/read.c b/sysdeps/standalone/read.c index 284321d717..40322a5e71 100644 --- a/sysdeps/standalone/read.c +++ b/sysdeps/standalone/read.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. @@ -19,7 +19,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <unistd.h> #include <stddef.h> @@ -30,32 +29,31 @@ Cambridge, MA 02139, USA. */ /* Read NBYTES into BUF from FD. Return the number read or -1. */ ssize_t -DEFUN(__read, (fd, buf, nbytes), - int fd AND PTR buf AND size_t nbytes) +__libc_read (int fd, void *buf, size_t nbytes) { char *buffer = (char *) buf; int data; int poll; - errno = 0; + __set_errno (0); if (nbytes == 0) return 0; if ( !__FD_Is_valid( fd ) || !__FD_Table[ fd ].in_use ) { - errno = EBADF; + __set_errno (EBADF); return -1; } if (buf == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } if ( __FD_Table[ fd ].flags & O_WRONLY ) /* is it write only? */ { - errno = EBADF; + __set_errno (EBADF); return -1; } @@ -63,11 +61,11 @@ DEFUN(__read, (fd, buf, nbytes), poll = ( __FD_Table[ fd ].flags & O_NONBLOCK ) ? 1 : 0; - /* Read a single character. This is a cheap way to insure that the - upper layers get every character because _Console_Getc can't timeout + /* Read a single character. This is a cheap way to insure that the + upper layers get every character because _Console_Getc can't timeout or otherwise know when to stop. */ - + data = _Console_Getc(poll); if ( data == -1 ) /* if no data return */ @@ -84,4 +82,5 @@ DEFUN(__read, (fd, buf, nbytes), return 1; } -weak_alias (__read, read) +weak_alias (__libc_read, __read) +weak_alias (__libc_read, read) diff --git a/sysdeps/standalone/write.c b/sysdeps/standalone/write.c index f0ae3888f6..d377dd5e5c 100644 --- a/sysdeps/standalone/write.c +++ b/sysdeps/standalone/write.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. @@ -19,7 +19,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <sysdep.h> #include <errno.h> #include <unistd.h> @@ -31,28 +30,27 @@ Cambridge, MA 02139, USA. */ /* Write NBYTES of BUF to FD. Return the number written, or -1. */ ssize_t -DEFUN(__write, (fd, buf, nbytes), - int fd AND CONST PTR buf AND size_t nbytes) +__libc_write (int fd, const void *buf, size_t nbytes) { int count; - CONST char *data = buf; + const char *data = buf; if (nbytes == 0) return 0; if ( !__FD_Is_valid( fd ) || !__FD_Table[ fd ].in_use ) { - errno = EBADF; + __set_errno (EBADF); return -1; } if (buf == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } if ( !(__FD_Table[ fd ].flags & (O_WRONLY|O_RDWR)) ) /* is it writeable? */ { - errno = EBADF; + __set_errno (EBADF); return -1; } @@ -70,5 +68,5 @@ DEFUN(__write, (fd, buf, nbytes), return count; } - -weak_alias (__write, write) +weak_alias (__libc_write, __write) +weak_alias (__libc_write, write) |