Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@geoffk.org>2002-02-01 21:00:41 +0300
committerGeoffrey Keating <geoffk@geoffk.org>2002-02-01 21:00:41 +0300
commit9c2e764253356b5207267e64acbfb155713a3370 (patch)
treeed87935883700d1745737b34e09e1af6520668bf /libgloss/xstormy16
parent2c8d73598c360a079215758061c644ed1f88960a (diff)
In ld/ChangeLog:
* scripttempl/xstormy16.sc: Don't allocate extra space for the stack. In libgloss/ChangeLog: * xstormy16/Makefile.in (SIM_OBJS): Remove sbrk.o, add sim_malloc_start.o. * xstormy16/eva_app.ld: Add __malloc_start. * xstormy16/sbrk.c: Remove. * xstormy16/sim_malloc_start.s: New file. * xstormy16/sim_high.ld: Make the stack start immediately at the end of the program. In newlib/ChangeLog: * configure.host (xstormy16): Don't use the generic malloc. * libc/machine/xstormy16/Makefile.am: Build tiny-malloc. * libc/machine/xstormy16/Makefile.in: Regenerate. * libc/machine/xstormy16/mallocr.c: New file. * libc/machine/xstormy16/tiny-malloc.c: New file.
Diffstat (limited to 'libgloss/xstormy16')
-rw-r--r--libgloss/xstormy16/Makefile.in2
-rw-r--r--libgloss/xstormy16/eva_app.ld1
-rw-r--r--libgloss/xstormy16/sbrk.c55
-rw-r--r--libgloss/xstormy16/sim_high.ld1
-rw-r--r--libgloss/xstormy16/sim_malloc_start.s5
5 files changed, 7 insertions, 57 deletions
diff --git a/libgloss/xstormy16/Makefile.in b/libgloss/xstormy16/Makefile.in
index 827a6f2f8..a4d50d963 100644
--- a/libgloss/xstormy16/Makefile.in
+++ b/libgloss/xstormy16/Makefile.in
@@ -48,7 +48,7 @@ CRT = crt0.o crti.o crtn.o
SIM_SCRIPTS = sim_high.ld
SIM_LDFLAGS =
SIM_BSP = libsim.a
-SIM_OBJS = syscalls.o sbrk.o
+SIM_OBJS = syscalls.o sim_malloc_start.o
# Here is stuff for building apps for GDB on the EVA board
EVA_APP_BSP = libeva_app.a
diff --git a/libgloss/xstormy16/eva_app.ld b/libgloss/xstormy16/eva_app.ld
index b95526db9..cf72dca7b 100644
--- a/libgloss/xstormy16/eva_app.ld
+++ b/libgloss/xstormy16/eva_app.ld
@@ -13,6 +13,7 @@ MEMORY
SECTIONS
{
__stack = 2 ;
+ __malloc_start = 0x800;
.data :
{
*(.data)
diff --git a/libgloss/xstormy16/sbrk.c b/libgloss/xstormy16/sbrk.c
deleted file mode 100644
index cb18d68bf..000000000
--- a/libgloss/xstormy16/sbrk.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* sbrk.c -- allocate memory dynamically.
- *
- * Copyright (c) 1995,1996 Cygnus Support
- *
- * 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,
- * license, or royalty fee is required for any of the authorized uses.
- * Modifications to this software may be copyrighted by their authors
- * and need not follow the licensing terms described here, provided that
- * the new terms are clearly indicated on the first page of each file where
- * they apply.
- */
-#include <errno.h>
-#include "glue.h"
-
-/* just in case, most boards have at least some memory */
-#ifndef RAMSIZE
-# define RAMSIZE (caddr_t)0x100000
-#endif
-
-char *heap_ptr;
-
-/*
- * sbrk -- changes heap size size. Get nbytes more
- * RAM. We just increment a pointer in what's
- * left of memory on the board.
- */
-char *
-_sbrk (nbytes)
- int nbytes;
-{
- char *base;
-
- if (!heap_ptr)
- heap_ptr = (char *)&_end;
- base = heap_ptr;
- heap_ptr += nbytes;
-
- return base;
-/* FIXME: We really want to make sure we don't run out of RAM, but this
- * isn't very portable.
- */
-#if 0
- if ((RAMSIZE - heap_ptr - nbytes) >= 0) {
- base = heap_ptr;
- heap_ptr += nbytes;
- return (base);
- } else {
- errno = ENOMEM;
- return ((char *)-1);
- }
-#endif
-}
diff --git a/libgloss/xstormy16/sim_high.ld b/libgloss/xstormy16/sim_high.ld
index 7a3ae97a1..8226d870f 100644
--- a/libgloss/xstormy16/sim_high.ld
+++ b/libgloss/xstormy16/sim_high.ld
@@ -39,7 +39,6 @@ SECTIONS
} > RAM
. = ALIGN(2);
__stack = .;
- . = . + 4096;
_end = .;
PROVIDE (end = .);
/* Read-only sections in ROM. */
diff --git a/libgloss/xstormy16/sim_malloc_start.s b/libgloss/xstormy16/sim_malloc_start.s
new file mode 100644
index 000000000..143053f3b
--- /dev/null
+++ b/libgloss/xstormy16/sim_malloc_start.s
@@ -0,0 +1,5 @@
+# This file just defines __malloc_start for newlib for the simulator.
+# The simulator has RAM up to the I/O area at 0x7F00.
+ .globl __malloc_start
+ .set __malloc_start,0x7F00
+