when variables in callback indicate we're running in another app's context, do nothing

This commit is contained in:
ehouse 2008-01-02 01:46:35 +00:00
parent bad6415484
commit 81c3d1681a

View file

@ -1135,6 +1135,8 @@ btLibManagementProcArmEntry( const void* XP_UNUSED_DBG(emulStateP),
data = (unsigned long*)userData68KP;
state = getStorageLoc();
/* This won't be true if we're called in somebody else's context */
if ( emulStateP == state->emulStateP ) {
/* set up stack here too? */
asm( "mov %0, r10" : "=r" (oldR10) );
asm( "mov r10, %0" : : "r" (state->gotTable) );
@ -1152,6 +1154,7 @@ btLibManagementProcArmEntry( const void* XP_UNUSED_DBG(emulStateP),
(*procPtr)( &mEvent, refCon );
asm( "mov r10, %0" : : "r" (oldR10) );
}
return 0L; /* no result to return */
} /* btLibManagementProcArmEntry */
@ -1232,8 +1235,7 @@ btLibSocketEventType68K_TO_ARM( BtLibSocketEventType* out, const unsigned char*
}
static unsigned long
btSocketProcArmEntry( const void* XP_UNUSED_DBG(emulStateP),
void* userData68KP,
btSocketProcArmEntry( const void* emulStateP, void* userData68KP,
Call68KFuncType* XP_UNUSED_DBG(call68KFuncP) )
{
BtLibSocketEventType sEvent;
@ -1246,11 +1248,13 @@ btSocketProcArmEntry( const void* XP_UNUSED_DBG(emulStateP),
= (BtLibSocketProcPtr)read_unaligned32( (unsigned char*)&data[0] );
PNOState* state = getStorageLoc();
/* This won't be true if we're called in somebody else's context */
if ( emulStateP == state->emulStateP ) {
/* set up stack here too? */
asm( "mov %0, r10" : "=r" (oldR10) );
asm( "mov r10, %0" : : "r" (state->gotTable) );
XP_ASSERT( emulStateP == state->emulStateP );
XP_ASSERT( call68KFuncP == state->call68KFuncP );
sEventP = (BtLibSocketEventType*)
@ -1260,7 +1264,7 @@ btSocketProcArmEntry( const void* XP_UNUSED_DBG(emulStateP),
(*procPtr)( &sEvent, refCon );
asm( "mov r10, %0" : : "r" (oldR10) );
}
return 0L; /* no result to return */
} /* btSocketProcArmEntry */