]> Chaos Git - corbenik/corbenik.git/commitdiff
Fix a missed bit (ugh)
authorchaoskagami <chaos.kagami@gmail.com>
Thu, 4 Aug 2016 05:10:33 +0000 (01:10 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Thu, 4 Aug 2016 05:10:33 +0000 (01:10 -0400)
include/common.h
source/std/allocator.c
source/std/fs.c

index d120c7d9ed49fd9aa53f27039353a8f870f46fa2..4f2e52133cef8e88a4c1302c3f6a3123a4faa797 100644 (file)
@@ -15,7 +15,7 @@
 #include <std/draw.h>
 
 #include <firm/headers.h>
-#include <firm/fcram.h>
+#include <std/allocator.h>
 #include <firm/decryptor.h>
 #include <firm/firm.h>
 
index 0479be3975880796147b2881ecf09529d2dfaf3f..7cda16e65e311d2b263dbbc3e768daae4cc86a21 100644 (file)
@@ -4,19 +4,17 @@
 #define SALLOC_ALIGN 16
 
 struct alloc_info* first_mem = NULL;
+static uint32_t *heap_end = NULL;
+extern uint32_t __end__; /* Defined by the linker */
 
-void* sbrk(int incr) {
-  extern uint32_t __end__; /* Defined by the linker */
-  static uint32_t *heap_end;
+void* sbrk(size_t incr) {
   uint32_t        *prev_heap_end;
 
-  if (heap_end == 0) {
+  if (heap_end == NULL) {
     heap_end = &__end__;
   }
 
   prev_heap_end = heap_end;
-  if (heap_end + incr > stack_ptr)
-    abort("Heap overflowed!\n");
 
   heap_end += incr;
   return (void*) prev_heap_end;
index 9ef5e1e26cc04cc6d649caea13f19759abc28c22..aa654d726f1ae94e88312e1fefea7bdba4718eea 100644 (file)
@@ -1,7 +1,6 @@
 #include <stddef.h>
 #include <ctr9/io.h>
 #include <common.h>
-#include <firm/fcram.h>
 
 // ctr_nand_crypto_interface ctr_io;
 // ctr_nand_crypto_interface twl_io;