Renamed tpl_drv_* to api_drv_* (a more fitting name)
[tpg/acess2.git] / Kernel / arch / arm7 / mm_phys.c
index d91f889..0a7632c 100644 (file)
@@ -4,6 +4,8 @@
  * ARM7 Physical Memory Manager
  * arch/arm7/mm_phys.c
  */
+#define DEBUG  0
+
 #include <acess.h>
 #include <mm_virt.h>
 
 
 char   gStaticAllocPages[NUM_STATIC_ALLOC][PAGE_SIZE] __attribute__ ((section(".padata")));
 tPAddr gaiStaticAllocPages[NUM_STATIC_ALLOC] = {
-       (tPAddr)(&gStaticAllocPages[0] - KERNEL_BASE),
-       (tPAddr)(&gStaticAllocPages[1] - KERNEL_BASE),
-       (tPAddr)(&gStaticAllocPages[2] - KERNEL_BASE),
-       (tPAddr)(&gStaticAllocPages[3] - KERNEL_BASE)
+       (tPAddr)(&gStaticAllocPages[0]) - KERNEL_BASE,
+       (tPAddr)(&gStaticAllocPages[1]) - KERNEL_BASE,
+       (tPAddr)(&gStaticAllocPages[2]) - KERNEL_BASE,
+       (tPAddr)(&gStaticAllocPages[3]) - KERNEL_BASE
 };
 extern char    gKernelEnd[];
 
@@ -34,7 +36,7 @@ int MM_int_GetMapEntry( void *Data, int Index, tPAddr *Start, tPAddr *Length )
        {
        case 0:
                *Start = ((tVAddr)&gKernelEnd - KERNEL_BASE + 0xFFF) & ~0xFFF;
-               *Length = 16*1024*1024;
+               *Length = 16*1024*1024 - *Start;
                return 1;
        default:
                return 0;

UCC git Repository :: git.ucc.asn.au