Update of /cvsroot/arcem/arcem
In directory vz-cvs-4.sog:/tmp/cvs-serv14186
Modified Files:
Tag: arcem-fast
armemu.c
Log Message:
Fix issues on 64bit hosts
* armemu.c: Make sure the "are we close to the end of a page?" checks work
properly if (addr<<20) has been implicitly expanded to 64 bits. With the way
the code was written this wouldn't have caused any problems except for some
performance loss due to the optimised path not being taken
* arch/armarc.c, arch/armarc.h: Make FastMap_Phy2Func deal with the use of
64bit function pointers on 64bit hosts
* arch/armarc.c: Fix FastMap_SetEntries truncating the address offset to 32
bits, causing issues if the OS uses pointers above the 4G limit
* arch/armarc.h: Fix FastMap_DecodeRead/FastMap_DecodeWrite truncating the
access mode to 32bits, causing the mode flags to be lost altogether on 64bit
systems
* arch/fastmap.c: Fix ARMul_StoreByte/ARMul_SwapByte masking off the high half
of phy when it should have only been masking off the bottom two bits
Index: armemu.c
===================================================================
RCS file: /cvsroot/arcem/arcem/armemu.c,v
retrieving revision 1.15.2.12
retrieving revision 1.15.2.13
diff -u -d -r1.15.2.12 -r1.15.2.13
--- armemu.c 2 Nov 2011 22:02:30 -0000 1.15.2.12
+++ armemu.c 12 May 2012 17:16:17 -0000 1.15.2.13
@@ -89,7 +89,7 @@
static void
ARMul_LoadInstrTriplet(ARMul_State *state,ARMword addr,PipelineEntry *p)
{
- if ((addr << 20) > 0xff000000) {
+ if (((uint32_t) (addr << 20)) > 0xff000000) {
ARMul_LoadInstr(state,addr,p);
ARMul_LoadInstr(state,addr+4,p+1);
ARMul_LoadInstr(state,addr+8,p+2);
@@ -639,7 +639,7 @@
temp2 = state->Reg[15];
/* Check if we can use the fastmap */
- if(((address<<20) <= 0xfc000000) && !state->Aborted)
+ if((((uint32_t) (address<<20)) <= 0xfc000000) && !state->Aborted)
{
FastMapEntry *entry = FastMap_GetEntry(state,address);
FastMapRes res = FastMap_DecodeRead(entry,state->FastMapMode);
@@ -729,7 +729,7 @@
}
/* Check if we can use the fastmap */
- if(((address<<20) <= 0xfc000000) && !state->Aborted)
+ if((((uint32_t) (address<<20)) <= 0xfc000000) && !state->Aborted)
{
FastMapEntry *entry = FastMap_GetEntry(state,address);
FastMapRes res = FastMap_DecodeRead(entry,state->FastMapMode);
@@ -817,7 +817,7 @@
for (temp = 0; !BIT(temp); temp++); /* N cycle first */
/* Check if we can use the fastmap */
- if(((address<<20) <= 0xfc000000) && !state->Aborted)
+ if((((uint32_t) (address<<20)) <= 0xfc000000) && !state->Aborted)
{
FastMapEntry *entry = FastMap_GetEntry(state,address);
FastMapRes res = FastMap_DecodeWrite(entry,state->FastMapMode);
@@ -904,7 +904,7 @@
for (temp = 0; !BIT(temp); temp++); /* N cycle first */
/* Check if we can use the fastmap */
- if(((address<<20) <= 0xfc000000) && !state->Aborted)
+ if((((uint32_t) (address<<20)) <= 0xfc000000) && !state->Aborted)
{
FastMapEntry *entry = FastMap_GetEntry(state,address);
FastMapRes res = FastMap_DecodeWrite(entry,state->FastMapMode);
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
--
arcem-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/arcem-cvs