Kernel/arm7 - Stubbing functions, now compiles and links
[tpg/acess2.git] / Kernel / arch / arm7 / mm_phys.c
1 /*
2  * Acess2
3  *
4  * ARM7 Physical Memory Manager
5  * arch/arm7/mm_phys.c
6  */
7 #include <acess.h>
8 #include <mm_virt.h>
9
10 #define MM_NUM_RANGES   1       // Single range
11 #define MM_RANGE_MAX    0
12
13 #define NUM_STATIC_ALLOC        4
14
15 char    gStaticAllocPages[NUM_STATIC_ALLOC][PAGE_SIZE] __attribute__ ((section(".padata")));
16 tPAddr  gaiStaticAllocPages[NUM_STATIC_ALLOC] = {
17         (tPAddr)(&gStaticAllocPages[0] - KERNEL_BASE),
18         (tPAddr)(&gStaticAllocPages[1] - KERNEL_BASE),
19         (tPAddr)(&gStaticAllocPages[2] - KERNEL_BASE),
20         (tPAddr)(&gStaticAllocPages[3] - KERNEL_BASE)
21 };
22 extern char     gKernelEnd[];
23
24 #include <tpl_mm_phys_bitmap.h>
25
26 void MM_SetupPhys(void)
27 {
28         MM_Tpl_InitPhys( 16*1024*1024/0x1000, NULL );
29 }
30
31 int MM_int_GetMapEntry( void *Data, int Index, tPAddr *Start, tPAddr *Length )
32 {
33         switch(Index)
34         {
35         case 0:
36                 *Start = ((tVAddr)&gKernelEnd - KERNEL_BASE + 0xFFF) & ~0xFFF;
37                 *Length = 16*1024*1024;
38                 return 1;
39         default:
40                 return 0;
41         }
42 }
43
44 /**
45  * \brief Takes a physical address and returns the ID of its range
46  * \param Addr  Physical address of page
47  * \return Range ID from eMMPhys_Ranges
48  */
49 int MM_int_GetRangeID( tPAddr Addr )
50 {
51         return MM_RANGE_MAX;    // ARM doesn't need ranges
52 }

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