Fix compile time warning messages.

Add "cc" to list of registers clobbered bu do_AgelSWI
This commit is contained in:
Nick Clifton 2000-03-24 18:17:17 +00:00
parent 7684ddaf52
commit 79908d67bc
2 changed files with 32 additions and 21 deletions

View File

@ -1,3 +1,8 @@
2000-03-24 Nick Clifton <nickc@cygnus.com>
* libc/sys/arm/syscalls.c: Fix compile time warnings.
(do_AngelSWI): Add "cc" to list o registers clobbered.
Thu Mar 22 14:57:00 2000 Fernando Nasser <fnasser@redhat.com> Thu Mar 22 14:57:00 2000 Fernando Nasser <fnasser@redhat.com>
* libc/sys/arm/syscalls.c (do_AngelSWI): Prevent registers with valid * libc/sys/arm/syscalls.c (do_AngelSWI): Prevent registers with valid

View File

@ -15,9 +15,6 @@
#include "swi.h" #include "swi.h"
/* Forward prototypes. */ /* Forward prototypes. */
#ifndef _PARAMS
#error UGG
#endif
int isatty _PARAMS ((int)); int isatty _PARAMS ((int));
clock_t _times _PARAMS ((struct tms *)); clock_t _times _PARAMS ((struct tms *));
int _gettimeofday _PARAMS ((struct timeval *, struct timezone *)); int _gettimeofday _PARAMS ((struct timeval *, struct timezone *));
@ -64,7 +61,7 @@ extern void _EXFUN(__sinit,(struct _reent *));
} \ } \
while (0) while (0)
/* Adjust our internal handles to stay away from std* handles */ /* Adjust our internal handles to stay away from std* handles. */
#define FILE_HANDLE_OFFSET (0x20) #define FILE_HANDLE_OFFSET (0x20)
static int std_files_checked; static int std_files_checked;
@ -103,18 +100,18 @@ do_AngelSWI (int reason, void * arg)
asm volatile ("mov r0, %1; mov r1, %2; swi %a3; mov %0, r0" asm volatile ("mov r0, %1; mov r1, %2; swi %a3; mov %0, r0"
: "=r" (value) /* Outputs */ : "=r" (value) /* Outputs */
: "r" (reason), "r" (arg), "i" (AngelSWI) /* Inputs */ : "r" (reason), "r" (arg), "i" (AngelSWI) /* Inputs */
: "r0", "r1", "r2", "r3", "ip", "lr", "memory" : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc"
/* Clobbers r0 and r1, and lr if in supervisor mode */); /* Clobbers r0 and r1, and lr if in supervisor mode */);
/* Accordingly to page 13-77 of ARM DUI 0040D other registers /* Accordingly to page 13-77 of ARM DUI 0040D other registers
can also be clobbered. Some memory positions may also be can also be clobbered. Some memory positions may also be
changed by a system call, so they should not be kept in changed by a system call, so they should not be kept in
registers. Note: we are assuming the manual is right and registers. Note: we are assuming the manual is right and
Angel is respecting the APCS */ Angel is respecting the APCS. */
return value; return value;
} }
#endif /* ARM_RDI_MONITOR */ #endif /* ARM_RDI_MONITOR */
/* Function to convert std(in|out|err) handles to internal versions */ /* Function to convert std(in|out|err) handles to internal versions. */
static int static int
remap_handle (int fh) remap_handle (int fh)
{ {
@ -205,8 +202,7 @@ wrap (int result)
return result; return result;
} }
/* Returns # chars not! written */ /* Returns # chars not! written. */
int int
_swiread (int file, _swiread (int file,
char * ptr, char * ptr,
@ -243,7 +239,7 @@ _read (int file,
if (slot != MAX_OPEN_FILES) if (slot != MAX_OPEN_FILES)
openfiles [slot].pos += len - x; openfiles [slot].pos += len - x;
/* x == len is not an error, at least if we want feof() to work */ /* x == len is not an error, at least if we want feof() to work. */
return len - x; return len - x;
} }
@ -274,7 +270,7 @@ _swilseek (int file,
ptr += do_AngelSWI (AngelSWI_Reason_FLen, block); ptr += do_AngelSWI (AngelSWI_Reason_FLen, block);
} }
/* This code only does absolute seeks */ /* This code only does absolute seeks. */
block[0] = remap_handle (file); block[0] = remap_handle (file);
block[1] = ptr; block[1] = ptr;
res = do_AngelSWI (AngelSWI_Reason_Seek, block); res = do_AngelSWI (AngelSWI_Reason_Seek, block);
@ -288,7 +284,7 @@ _swilseek (int file,
ptr += res; ptr += res;
} }
/* This code only does absolute seeks */ /* This code only does absolute seeks. */
asm ("mov r0, %2; mov r1, %3; swi %a1; mov %0, r0" asm ("mov r0, %2; mov r1, %3; swi %a1; mov %0, r0"
: "=r" (res) : "=r" (res)
: "i" (SWI_Seek), "r" (fh), "r" (ptr) : "i" (SWI_Seek), "r" (fh), "r" (ptr)
@ -298,7 +294,7 @@ _swilseek (int file,
if (slot != MAX_OPEN_FILES && res == 0) if (slot != MAX_OPEN_FILES && res == 0)
openfiles[slot].pos = ptr; openfiles[slot].pos = ptr;
/* This is expected to return the position in the file */ /* This is expected to return the position in the file. */
return res == 0 ? ptr : -1; return res == 0 ? ptr : -1;
} }
@ -310,7 +306,7 @@ _lseek (int file,
return wrap (_swilseek (file, ptr, dir)); return wrap (_swilseek (file, ptr, dir));
} }
/* Returns #chars not! written */ /* Returns #chars not! written. */
int int
_swiwrite ( _swiwrite (
int file, int file,
@ -351,6 +347,8 @@ _write (int file,
return len - x; return len - x;
} }
extern int strlen (const char *);
int int
_swiopen (const char * path, _swiopen (const char * path,
int flags) int flags)
@ -365,7 +363,7 @@ _swiopen (const char * path,
if (i == MAX_OPEN_FILES) if (i == MAX_OPEN_FILES)
return -1; return -1;
/* The flags are Unix-style, so we need to convert them */ /* The flags are Unix-style, so we need to convert them. */
#ifdef O_BINARY #ifdef O_BINARY
if (flags & O_BINARY) if (flags & O_BINARY)
aflags |= 1; aflags |= 1;
@ -382,7 +380,7 @@ _swiopen (const char * path,
if (flags & O_APPEND) if (flags & O_APPEND)
{ {
aflags &= ~4; /* Can't ask for w AND a; means just 'a' */ aflags &= ~4; /* Can't ask for w AND a; means just 'a'. */
aflags |= 8; aflags |= 8;
} }
@ -450,6 +448,7 @@ _exit (int n)
#else #else
asm ("swi %a0" :: "i" (SWI_Exit)); asm ("swi %a0" :: "i" (SWI_Exit));
#endif #endif
n = n;
} }
int int
@ -461,18 +460,22 @@ _kill (int n, int m)
#else #else
asm ("swi %a0" :: "i" (SWI_Exit)); asm ("swi %a0" :: "i" (SWI_Exit));
#endif #endif
n = n; m = m;
} }
int int
_getpid (int n) _getpid (int n)
{ {
return 1; return 1;
n = n;
} }
extern void abort (void);
caddr_t caddr_t
_sbrk (int incr) _sbrk (int incr)
{ {
extern char end asm ("end"); /* Defined by the linker */ extern char end asm ("end"); /* Defined by the linker. */
static char * heap_end; static char * heap_end;
char * prev_heap_end; char * prev_heap_end;
@ -492,6 +495,8 @@ _sbrk (int incr)
return (caddr_t) prev_heap_end; return (caddr_t) prev_heap_end;
} }
extern void memset (struct stat *, int, unsigned int);
int int
_fstat (int file, struct stat * st) _fstat (int file, struct stat * st)
{ {
@ -499,6 +504,7 @@ _fstat (int file, struct stat * st)
st->st_mode = S_IFCHR; st->st_mode = S_IFCHR;
st->st_blksize = 1024; st->st_blksize = 1024;
return 0; return 0;
file = file;
} }
int int
@ -525,7 +531,7 @@ _gettimeofday (struct timeval * tp, struct timezone * tzp)
if (tp) if (tp)
{ {
/* Ask the host for the seconds since the Unix epoch */ /* Ask the host for the seconds since the Unix epoch. */
#ifdef ARM_RDI_MONITOR #ifdef ARM_RDI_MONITOR
tp->tv_sec = do_AngelSWI (AngelSWI_Reason_Time,NULL); tp->tv_sec = do_AngelSWI (AngelSWI_Reason_Time,NULL);
#else #else
@ -538,7 +544,7 @@ _gettimeofday (struct timeval * tp, struct timezone * tzp)
tp->tv_usec = 0; tp->tv_usec = 0;
} }
/* Return fixed data for the timezone */ /* Return fixed data for the timezone. */
if (tzp) if (tzp)
{ {
tzp->tz_minuteswest = 0; tzp->tz_minuteswest = 0;
@ -576,5 +582,5 @@ int
isatty (int fd) isatty (int fd)
{ {
return 1; return 1;
fd = fd;
} }