Align libgloss/arm and libc/sys/arm sources: miscellaneous fixes
1. Trim trailing spaces 2. Align comments, function declarations and definitions
This commit is contained in:
parent
bd5596f4fd
commit
bf56973edc
|
@ -440,7 +440,7 @@ __change_mode:
|
||||||
beq .LC10
|
beq .LC10
|
||||||
|
|
||||||
/* See whether we are scanning a string. */
|
/* See whether we are scanning a string. */
|
||||||
cmp r3, #'"'
|
cmp r3, #'\"'
|
||||||
#ifdef __thumb__
|
#ifdef __thumb__
|
||||||
beq .LC20
|
beq .LC20
|
||||||
cmp r3, #'\''
|
cmp r3, #'\''
|
||||||
|
|
|
@ -143,7 +143,7 @@ initialise_monitor_handles (void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Open the standard file descriptors by opening the special
|
/* Open the standard file descriptors by opening the special
|
||||||
* teletype device, ":tt", read-only to obtain a descritpor for
|
* teletype device, ":tt", read-only to obtain a descriptor for
|
||||||
* standard input and write-only to obtain a descriptor for standard
|
* standard input and write-only to obtain a descriptor for standard
|
||||||
* output. Finally, open ":tt" in append mode to obtain a descriptor
|
* output. Finally, open ":tt" in append mode to obtain a descriptor
|
||||||
* for standard error. Since this is a write mode, most kernels will
|
* for standard error. Since this is a write mode, most kernels will
|
||||||
|
@ -351,9 +351,7 @@ checkerror (int result)
|
||||||
len, is the length in bytes to read.
|
len, is the length in bytes to read.
|
||||||
Returns the number of bytes *not* written. */
|
Returns the number of bytes *not* written. */
|
||||||
int
|
int
|
||||||
_swiread (int fh,
|
_swiread (int fh, void * ptr, size_t len)
|
||||||
void * ptr,
|
|
||||||
size_t len)
|
|
||||||
{
|
{
|
||||||
#ifdef ARM_RDI_MONITOR
|
#ifdef ARM_RDI_MONITOR
|
||||||
int block[3];
|
int block[3];
|
||||||
|
@ -381,9 +379,7 @@ _swiread (int fh,
|
||||||
Translates the return of _swiread into
|
Translates the return of _swiread into
|
||||||
bytes read. */
|
bytes read. */
|
||||||
int __attribute__((weak))
|
int __attribute__((weak))
|
||||||
_read (int fd,
|
_read (int fd, void * ptr, size_t len)
|
||||||
void * ptr,
|
|
||||||
size_t len)
|
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
struct fdent *pfd;
|
struct fdent *pfd;
|
||||||
|
@ -409,9 +405,7 @@ _read (int fd,
|
||||||
|
|
||||||
/* fd, is a user file descriptor. */
|
/* fd, is a user file descriptor. */
|
||||||
off_t
|
off_t
|
||||||
_swilseek (int fd,
|
_swilseek (int fd, off_t ptr, int dir)
|
||||||
off_t ptr,
|
|
||||||
int dir)
|
|
||||||
{
|
{
|
||||||
off_t res;
|
off_t res;
|
||||||
struct fdent *pfd;
|
struct fdent *pfd;
|
||||||
|
@ -494,9 +488,7 @@ _swilseek (int fd,
|
||||||
}
|
}
|
||||||
|
|
||||||
off_t
|
off_t
|
||||||
_lseek (int fd,
|
_lseek (int fd, off_t ptr, int dir)
|
||||||
off_t ptr,
|
|
||||||
int dir)
|
|
||||||
{
|
{
|
||||||
return _swilseek (fd, ptr, dir);
|
return _swilseek (fd, ptr, dir);
|
||||||
}
|
}
|
||||||
|
@ -504,10 +496,7 @@ _lseek (int fd,
|
||||||
/* fh, is a valid internal file handle.
|
/* fh, is a valid internal file handle.
|
||||||
Returns the number of bytes *not* written. */
|
Returns the number of bytes *not* written. */
|
||||||
int
|
int
|
||||||
_swiwrite (
|
_swiwrite (int fh, const void * ptr, size_t len)
|
||||||
int fh,
|
|
||||||
const void * ptr,
|
|
||||||
size_t len)
|
|
||||||
{
|
{
|
||||||
#ifdef ARM_RDI_MONITOR
|
#ifdef ARM_RDI_MONITOR
|
||||||
int block[3];
|
int block[3];
|
||||||
|
@ -533,9 +522,7 @@ _swiwrite (
|
||||||
|
|
||||||
/* fd, is a user file descriptor. */
|
/* fd, is a user file descriptor. */
|
||||||
int __attribute__((weak))
|
int __attribute__((weak))
|
||||||
_write (int fd,
|
_write (int fd, const void * ptr, size_t len)
|
||||||
const void * ptr,
|
|
||||||
size_t len)
|
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
struct fdent *pfd;
|
struct fdent *pfd;
|
||||||
|
@ -611,8 +598,7 @@ _swiopen (const char * path, int flags)
|
||||||
|
|
||||||
if (flags & O_APPEND)
|
if (flags & O_APPEND)
|
||||||
{
|
{
|
||||||
/* Can't ask for w AND a; means just 'a'. */
|
aflags &= ~4; /* Can't ask for w AND a; means just 'a'. */
|
||||||
aflags &= ~4;
|
|
||||||
aflags |= 8;
|
aflags |= 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,8 +770,8 @@ _stat (const char *fname, struct stat *st)
|
||||||
{
|
{
|
||||||
int fd, res;
|
int fd, res;
|
||||||
memset (st, 0, sizeof (* st));
|
memset (st, 0, sizeof (* st));
|
||||||
/* The best we can do is try to open the file readonly.
|
/* The best we can do is try to open the file readonly. If it exists,
|
||||||
If it exists, then we can guess a few things about it. */
|
then we can guess a few things about it. */
|
||||||
if ((fd = _open (fname, O_RDONLY)) == -1)
|
if ((fd = _open (fname, O_RDONLY)) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
st->st_mode |= S_IFREG | S_IREAD;
|
st->st_mode |= S_IFREG | S_IREAD;
|
||||||
|
|
|
@ -85,6 +85,6 @@
|
||||||
#define CPSR_F_MASK 0x40 /* FIQ bit. */
|
#define CPSR_F_MASK 0x40 /* FIQ bit. */
|
||||||
#define CPSR_I_MASK 0x80 /* IRQ bit. */
|
#define CPSR_I_MASK 0x80 /* IRQ bit. */
|
||||||
|
|
||||||
#define CPSR_M_MASK 0x0F /* Mode mask except M[4] */
|
#define CPSR_M_MASK 0x0F /* Mode mask except M[4]. */
|
||||||
|
|
||||||
#endif /* _LIBGLOSS_ARM_H */
|
#endif /* _LIBGLOSS_ARM_H */
|
||||||
|
|
|
@ -115,6 +115,16 @@ initialise_monitor_handles (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* Open the standard file descriptors by opening the special
|
||||||
|
* teletype device, ":tt", read-only to obtain a descriptor for
|
||||||
|
* standard input and write-only to obtain a descriptor for standard
|
||||||
|
* output. Finally, open ":tt" in append mode to obtain a descriptor
|
||||||
|
* for standard error. Since this is a write mode, most kernels will
|
||||||
|
* probably return the same value as for standard output, but the
|
||||||
|
* kernel can differentiate the two using the mode flag and return a
|
||||||
|
* different descriptor for standard error.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef ARM_RDI_MONITOR
|
#ifdef ARM_RDI_MONITOR
|
||||||
int volatile block[3];
|
int volatile block[3];
|
||||||
|
|
||||||
|
@ -168,6 +178,7 @@ get_errno (void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set errno and return result. */
|
||||||
static int
|
static int
|
||||||
error (int result)
|
error (int result)
|
||||||
{
|
{
|
||||||
|
@ -183,7 +194,10 @@ wrap (int result)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns # chars not! written. */
|
/* file, is a valid user file handle.
|
||||||
|
ptr, is a null terminated string.
|
||||||
|
len, is the length in bytes to read.
|
||||||
|
Returns the number of bytes *not* written. */
|
||||||
int
|
int
|
||||||
_swiread (int file, void * ptr, size_t len)
|
_swiread (int file, void * ptr, size_t len)
|
||||||
{
|
{
|
||||||
|
@ -207,6 +221,9 @@ _swiread (int file, void * ptr, size_t len)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* file, is a valid user file handle.
|
||||||
|
Translates the return of _swiread into
|
||||||
|
bytes read. */
|
||||||
int __attribute__((weak))
|
int __attribute__((weak))
|
||||||
_read (int file, void * ptr, size_t len)
|
_read (int file, void * ptr, size_t len)
|
||||||
{
|
{
|
||||||
|
@ -223,15 +240,13 @@ _read (int file, void * ptr, size_t len)
|
||||||
return len - x;
|
return len - x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* file, is a user file descriptor. */
|
||||||
off_t
|
off_t
|
||||||
_swilseek (int file, off_t ptr, int dir)
|
_swilseek (int file, off_t ptr, int dir)
|
||||||
{
|
{
|
||||||
_off_t res;
|
_off_t res;
|
||||||
int fh = remap_handle (file);
|
int fh = remap_handle (file);
|
||||||
int slot = findslot (fh);
|
int slot = findslot (fh);
|
||||||
#ifdef ARM_RDI_MONITOR
|
|
||||||
int block[2];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (dir == SEEK_CUR)
|
if (dir == SEEK_CUR)
|
||||||
{
|
{
|
||||||
|
@ -249,6 +264,7 @@ _swilseek (int file, off_t ptr, int dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARM_RDI_MONITOR
|
#ifdef ARM_RDI_MONITOR
|
||||||
|
int block[2];
|
||||||
if (dir == SEEK_END)
|
if (dir == SEEK_END)
|
||||||
{
|
{
|
||||||
block[0] = fh;
|
block[0] = fh;
|
||||||
|
@ -294,7 +310,8 @@ _lseek (int file, off_t ptr, int dir)
|
||||||
return wrap (_swilseek (file, ptr, dir));
|
return wrap (_swilseek (file, ptr, dir));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns #chars not! written. */
|
/* file, is a valid internal file handle.
|
||||||
|
Returns the number of bytes *not* written. */
|
||||||
int
|
int
|
||||||
_swiwrite (int file, const void * ptr, size_t len)
|
_swiwrite (int file, const void * ptr, size_t len)
|
||||||
{
|
{
|
||||||
|
@ -319,6 +336,7 @@ _swiwrite (int file, const void * ptr, size_t len)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* file, is a user file descriptor. */
|
||||||
int __attribute__((weak))
|
int __attribute__((weak))
|
||||||
_write (int file, const void * ptr, size_t len)
|
_write (int file, const void * ptr, size_t len)
|
||||||
{
|
{
|
||||||
|
@ -527,7 +545,7 @@ _sbrk (ptrdiff_t incr)
|
||||||
|
|
||||||
extern void memset (struct stat *, int, unsigned int);
|
extern void memset (struct stat *, int, unsigned int);
|
||||||
|
|
||||||
int
|
int __attribute__((weak))
|
||||||
_fstat (int file, struct stat * st)
|
_fstat (int file, struct stat * st)
|
||||||
{
|
{
|
||||||
memset (st, 0, sizeof (* st));
|
memset (st, 0, sizeof (* st));
|
||||||
|
@ -537,7 +555,8 @@ _fstat (int file, struct stat * st)
|
||||||
file = file;
|
file = file;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _stat (const char *fname, struct stat *st)
|
int __attribute__((weak))
|
||||||
|
_stat (const char *fname, struct stat *st)
|
||||||
{
|
{
|
||||||
int file;
|
int file;
|
||||||
|
|
||||||
|
@ -553,16 +572,15 @@ int _stat (const char *fname, struct stat *st)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int __attribute__((weak))
|
||||||
_link (const char *__path1 __attribute__ ((unused)),
|
_link (const char *__path1 __attribute__ ((unused)), const char *__path2 __attribute__ ((unused)))
|
||||||
const char *__path2 __attribute__ ((unused)))
|
|
||||||
{
|
{
|
||||||
errno = ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_unlink (const char *path __attribute__ ((unused)))
|
_unlink (const char *path)
|
||||||
{
|
{
|
||||||
#ifdef ARM_RDI_MONITOR
|
#ifdef ARM_RDI_MONITOR
|
||||||
int block[2];
|
int block[2];
|
||||||
|
|
Loading…
Reference in New Issue