From 675988ffd04789e25aa3cf8b88ca2befcce1647e Mon Sep 17 00:00:00 2001 From: wilkie Date: Sun, 4 Apr 2010 21:50:13 -0400 Subject: [PATCH] Stubbed out newlib. --- newlib-files/crt0.c | 1 - newlib-files/syscalls.c | 26 +++++++------------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/newlib-files/crt0.c b/newlib-files/crt0.c index 9f01029..ac1dec6 100644 --- a/newlib-files/crt0.c +++ b/newlib-files/crt0.c @@ -18,6 +18,5 @@ _start(){ // XXX: get argc and argv - exit(main(0,0, __env)); } diff --git a/newlib-files/syscalls.c b/newlib-files/syscalls.c index ad50d93..f948cc8 100644 --- a/newlib-files/syscalls.c +++ b/newlib-files/syscalls.c @@ -7,7 +7,6 @@ int _exit(int val){ - exit(val); return (-1); } @@ -139,6 +138,7 @@ sbrk(int nbytes){ static caddr_t heap_ptr = NULL; caddr_t base; + // TODO: REPLACE allocPage with a call to a page allocator int temp; if(heap_ptr == NULL){ @@ -160,35 +160,23 @@ sbrk(int nbytes){ } while(nbytes > PAGE_SIZE){ - allocPage(heap_ptr); + // + // allocPage(heap_ptr); + // nbytes -= (int) PAGE_SIZE; heap_ptr = heap_ptr + PAGE_SIZE; } if( nbytes > 0){ - allocPage(heap_ptr); + // + // allocPage(heap_ptr); + // heap_ptr += nbytes; } return base; - /* - static caddr_t heap_ptr = NULL; - caddr_t base; - - if (heap_ptr == NULL) { - heap_ptr = (caddr_t)&_end; - } - - if ((RAMSIZE - heap_ptr) >= 0) { - base = heap_ptr; - heap_ptr += nbytes; - return (base); - } else { - errno = ENOMEM; - return ((caddr_t)-1); - }*/ }