CFLAGS =
ASFLAGS = -f elf
+USE_MP=0
+USE_PAE=0
+
ifeq ($(ARCH),i386)
- ASFLAGS += -D USE_MP=0 -D USE_PAE=0
- CPPFLAGS += -DUSE_MP=0 -DUSE_PAE=0
-else
- ifeq ($(ARCH),i486)
- ASFLAGS += -D USE_MP=1 -D USE_PAE=0
- CPPFLAGS += -DUSE_MP=1 -DUSE_PAE=0
- else
- ifeq ($(ARCH),i586)
- ASFLAGS += -D USE_MP=1 -D USE_PAE=1
- CPPFLAGS += -DUSE_MP=1 -DUSE_PAE=1
- endif
- endif
+ USE_MP=0
+ USE_PAE=0
+else ifeq ($(ARCH),i486)
+ USE_MP=1
+else ifeq ($(ARCH),i586)
+ USE_MP=1
+ USE_PAE=1
endif
-
+
+ASFLAGS += -D USE_MP=$(USE_MP) -D USE_PAE=$(USE_PAE)
+CPPFLAGS += -DUSE_MP=$(USE_MP) -DUSE_PAE=$(USE_PAE)
A_OBJ = start.ao main.o lib.o desctab.ao errors.o irq.o
A_OBJ += mm_phys.o mm_virt.o
if( (tVAddr)gHeapEnd == MM_KHEAP_MAX )
return NULL;
+ if( Bytes == 0 ) {
+ Log_Warning("Heap", "Heap_Extend called with Bytes=%i", Bytes);
+ return NULL;
+ }
+
// Bounds Check
if( (tVAddr)gHeapEnd + ((Bytes+0xFFF)&~0xFFF) > MM_KHEAP_MAX ) {
Bytes = MM_KHEAP_MAX - (tVAddr)gHeapEnd;
}
if(head->Magic != MAGIC_USED) {
Log_Warning("Heap", "free - Magic value is invalid (%p, 0x%x)", head, head->Magic);
- Log_Notice("Heap", "Allocated %s:%i", head->File, head->Line);
+ Log_Notice("Heap", "Allocated by %s:%i", head->File, head->Line);
return;
}
foot = (void*)( (Uint)head + head->Size - sizeof(tHeapFoot) );
if(foot->Head != head) {
Log_Warning("Heap", "free - Footer backlink is incorrect (%p, 0x%x)", head, foot->Head);
- Log_Notice("Heap", "Allocated %s:%i", head->File, head->Line);
+ Log_Notice("Heap", "Allocated by %s:%i", head->File, head->Line);
return;
}
if(foot->Magic != MAGIC_FOOT) {
Log_Warning("Heap", "free - Footer magic is invalid (%p, %p = 0x%x)", head, &foot->Magic, foot->Magic);
- Log_Notice("Heap", "Allocated %s:%i", head->File, head->Line);
+ Log_Notice("Heap", "Allocated by %s:%i", head->File, head->Line);
return;
}
return ;
#if !VERBOSE_DUMP
- Log_Log("Heap", "%p (0x%llx): 0x%08lx (%i) %4C",
+ Log_Log("Heap", "%p (0x%llx): 0x%08lx %i %4C",
head, MM_GetPhysAddr((Uint)head), head->Size, head->ValidSize, &head->Magic);
Log_Log("Heap", "%p %4C", foot->Head, &foot->Magic);
if(head->File) {