This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
libgloss ARM tweak
- From: Mark Salter <msalter at redhat dot com>
- To: newlib at sources dot redhat dot com
- Date: Thu, 24 Jan 2002 08:36:37 -0500
- Subject: libgloss ARM tweak
Just checked this in.
--Mark
libgloss/ChangeLog:
2002-01-24 Mark Salter <msalter@redhat.com>
* arm/redboot-crt0.S: Use __get_memtop to put stack in high memory.
* arm/redboot-syscalls.c (_times): Unconditionally use SYS_times.
(__get_memtop): New funtion to return top of memory.
Index: arm/redboot-crt0.S
===================================================================
RCS file: /cvs/src/src/libgloss/arm/redboot-crt0.S,v
retrieving revision 1.1
diff -u -p -5 -r1.1 redboot-crt0.S
--- redboot-crt0.S 2002/01/07 18:12:32 1.1
+++ redboot-crt0.S 2002/01/24 13:30:40
@@ -43,10 +43,14 @@ SYM_NAME(_start):
__change_mode:
#endif
bl SYM_NAME(memset)
+ bl SYM_NAME(__get_memtop)
+ sub r0, r0, #32
+ mov sp, r0
+
mov a1, #0
ldr a2, .LC3
mov a3, a2
bl SYM_NAME(main)
1: bl SYM_NAME(exit)
Index: arm/redboot-syscalls.c
===================================================================
RCS file: /cvs/src/src/libgloss/arm/redboot-syscalls.c,v
retrieving revision 1.1
diff -u -p -5 -r1.1 redboot-syscalls.c
--- redboot-syscalls.c 2002/01/07 18:12:32 1.1
+++ redboot-syscalls.c 2002/01/24 13:30:40
@@ -1,9 +1,9 @@
/*
* redboot-syscalls.c -- provide system call support for RedBoot
*
- * Copyright (c) 1997, 2001 Cygnus Support
+ * Copyright (c) 1997, 2001, 2002 Red Hat, Inc.
*
* The authors hereby grant permission to use, copy, modify, distribute,
* and license this software and its documentation for any purpose, provided
* that existing copyright notices are retained in all copies and that this
* notice is included verbatim in any distributions. No written agreement,
@@ -173,18 +173,14 @@ _sbrk (int nbytes)
clock_t
_times(struct tms * tp)
{
clock_t utime;
-#ifdef HAVE_BSP_CLOCK
int err;
- err = __syscall(SYS_utime, &utime);
+ err = __syscall(SYS_times, &utime);
if (err)
utime = 0;
-#else
- utime = 0;
-#endif
if (tp) {
tp->tms_utime = utime;
tp->tms_stime = 0;
tp->tms_cutime = 0;
@@ -199,5 +195,17 @@ int
_unlink (const char *pathname)
{
return -1;
}
+
+#define SYS_meminfo 1001
+
+void *
+__get_memtop(void)
+{
+ unsigned long totmem = 0, topmem = 0;
+ int numbanks;
+
+ __syscall(SYS_meminfo, (unsigned long)&totmem, (unsigned long)&topmem, 0);
+ return (void*)topmem;
+}