mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-23 01:29:34 +00:00
Remove previous modification in MMU040_logical2physicalAttr()
This commit is contained in:
parent
a7a2a2eabc
commit
ec1075431d
@ -17,9 +17,8 @@
|
|||||||
#define GET_TC_PAGE_SIZE(TC) (IS_8K_PAGE(TC) ? 8192 : 4096)
|
#define GET_TC_PAGE_SIZE(TC) (IS_8K_PAGE(TC) ? 8192 : 4096)
|
||||||
|
|
||||||
|
|
||||||
#define UDT_IS_INVALID(PDT) ((PDT & 3) == 0)
|
#define UDT_IS_INVALID(PDT) (!(PDT & 2))
|
||||||
#define UDT_IS_RESIDENT(PDT) ((PDT & 3) == 1) || (PDT & 3) == 3))
|
#define UDT_IS_RESIDENT(PDT) (PDT & 2)
|
||||||
#define UDT_IS_INDIRECT(PDT) ((PDT & 3) == 2)
|
|
||||||
|
|
||||||
#define GET_RP_UDT(RP) (RP & 0x00000003)
|
#define GET_RP_UDT(RP) (RP & 0x00000003)
|
||||||
#define GET_RP_W(RP) (RP & 0x00000004)
|
#define GET_RP_W(RP) (RP & 0x00000004)
|
||||||
@ -51,6 +50,7 @@ static int isTTSegment(unsigned long addr)
|
|||||||
unsigned long DTT1;
|
unsigned long DTT1;
|
||||||
unsigned long base;
|
unsigned long base;
|
||||||
unsigned long mask;
|
unsigned long mask;
|
||||||
|
unsigned long size;
|
||||||
|
|
||||||
addr >>= 24;
|
addr >>= 24;
|
||||||
|
|
||||||
@ -63,8 +63,9 @@ static int isTTSegment(unsigned long addr)
|
|||||||
|
|
||||||
base &= ~mask;
|
base &= ~mask;
|
||||||
addr &= ~mask;
|
addr &= ~mask;
|
||||||
|
size = mask & 0x000000FF;
|
||||||
|
|
||||||
if ( (base <= addr) && (addr <= base + mask) )
|
if ( (base <= addr) && (addr <= base + size) )
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,8 +78,9 @@ static int isTTSegment(unsigned long addr)
|
|||||||
|
|
||||||
base &= ~mask;
|
base &= ~mask;
|
||||||
addr &= ~mask;
|
addr &= ~mask;
|
||||||
|
size = mask & 0x000000FF;
|
||||||
|
|
||||||
if ( (base <= addr) && (addr <= base + mask) )
|
if ( (base <= addr) && (addr <= base + size) )
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,10 +116,9 @@ int MMU040_logical2physicalAttr(unsigned long logicalAddr, unsigned long *physic
|
|||||||
rootEntry = MMU040_read_phys(rootTable + 4 * rootIndex);
|
rootEntry = MMU040_read_phys(rootTable + 4 * rootIndex);
|
||||||
TRACE("Root Entry: %08lx\n", rootEntry);
|
TRACE("Root Entry: %08lx\n", rootEntry);
|
||||||
|
|
||||||
if (UDT_IS_INVALID(rootEntry) || !UDT_IS_INDIRECT(rootEntry))
|
if (UDT_IS_INVALID(rootEntry))
|
||||||
{
|
{
|
||||||
*physicalAddr = logicalAddr;
|
return -1;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ptrTable = GET_RP_ADDR(rootEntry);
|
ptrTable = GET_RP_ADDR(rootEntry);
|
||||||
@ -125,12 +126,13 @@ int MMU040_logical2physicalAttr(unsigned long logicalAddr, unsigned long *physic
|
|||||||
tableEntry = MMU040_read_phys(ptrTable + 4 * ptrIndex);
|
tableEntry = MMU040_read_phys(ptrTable + 4 * ptrIndex);
|
||||||
TRACE("table Entry: %08lx\n", tableEntry);
|
TRACE("table Entry: %08lx\n", tableEntry);
|
||||||
|
|
||||||
if (UDT_IS_INVALID(rootEntry) || !UDT_IS_INDIRECT(rootEntry))
|
if (UDT_IS_INVALID(tableEntry))
|
||||||
{
|
{
|
||||||
*physicalAddr = logicalAddr;
|
return -1;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (IS_8K_PAGE(TC))
|
if (IS_8K_PAGE(TC))
|
||||||
{
|
{
|
||||||
pageTable = GET_TD_8K_ADDR(tableEntry);
|
pageTable = GET_TD_8K_ADDR(tableEntry);
|
||||||
|
Loading…
Reference in New Issue
Block a user