From 9c2e764253356b5207267e64acbfb155713a3370 Mon Sep 17 00:00:00 2001 From: Geoffrey Keating Date: Fri, 1 Feb 2002 18:00:41 +0000 Subject: 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. --- libgloss/xstormy16/Makefile.in | 2 +- libgloss/xstormy16/eva_app.ld | 1 + libgloss/xstormy16/sbrk.c | 55 ----------------------------------- libgloss/xstormy16/sim_high.ld | 1 - libgloss/xstormy16/sim_malloc_start.s | 5 ++++ 5 files changed, 7 insertions(+), 57 deletions(-) delete mode 100644 libgloss/xstormy16/sbrk.c create mode 100644 libgloss/xstormy16/sim_malloc_start.s (limited to 'libgloss/xstormy16') 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 -#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 + -- cgit v1.2.3