mirror of
https://github.com/xomboverlord/buildtools.git
synced 2026-08-05 22:10:08 +02:00
Stubbed out newlib.
This commit is contained in:
@@ -18,6 +18,5 @@ _start(){
|
|||||||
|
|
||||||
// XXX: get argc and argv
|
// XXX: get argc and argv
|
||||||
|
|
||||||
|
|
||||||
exit(main(0,0, __env));
|
exit(main(0,0, __env));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
int
|
int
|
||||||
_exit(int val){
|
_exit(int val){
|
||||||
exit(val);
|
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,6 +138,7 @@ sbrk(int nbytes){
|
|||||||
static caddr_t heap_ptr = NULL;
|
static caddr_t heap_ptr = NULL;
|
||||||
caddr_t base;
|
caddr_t base;
|
||||||
|
|
||||||
|
// TODO: REPLACE allocPage with a call to a page allocator
|
||||||
int temp;
|
int temp;
|
||||||
|
|
||||||
if(heap_ptr == NULL){
|
if(heap_ptr == NULL){
|
||||||
@@ -160,35 +160,23 @@ sbrk(int nbytes){
|
|||||||
}
|
}
|
||||||
|
|
||||||
while(nbytes > PAGE_SIZE){
|
while(nbytes > PAGE_SIZE){
|
||||||
allocPage(heap_ptr);
|
//
|
||||||
|
// allocPage(heap_ptr);
|
||||||
|
//
|
||||||
nbytes -= (int) PAGE_SIZE;
|
nbytes -= (int) PAGE_SIZE;
|
||||||
heap_ptr = heap_ptr + PAGE_SIZE;
|
heap_ptr = heap_ptr + PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( nbytes > 0){
|
if( nbytes > 0){
|
||||||
allocPage(heap_ptr);
|
//
|
||||||
|
// allocPage(heap_ptr);
|
||||||
|
//
|
||||||
|
|
||||||
heap_ptr += nbytes;
|
heap_ptr += nbytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return base;
|
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);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user