From bfef94ce3a4f415043c0e7b97e222a3e9ee14b8d Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sat, 21 Jul 2007 22:52:39 +0000 Subject: * Merge of ioq3-r1119 --- src/qcommon/vm_ppc.c | 13 +++---------- src/unix/unix_main.c | 14 ++++++++------ src/unix/unix_net.c | 4 ---- 3 files changed, 11 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/qcommon/vm_ppc.c b/src/qcommon/vm_ppc.c index 79fc506f..460fe425 100644 --- a/src/qcommon/vm_ppc.c +++ b/src/qcommon/vm_ppc.c @@ -24,10 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // ppc dynamic compiler #include "vm_local.h" - -#ifdef MACOS_X -#include -#endif +#include #define DEBUG_VM 0 @@ -1726,12 +1723,8 @@ void VM_Compile( vm_t *vm, vmHeader_t *header ) { // go back over it in place now to fixup reletive jump targets buf = (unsigned *)vm->codeBase; } else if ( pass == 1 ) { - #ifdef MACOS_X - // On Mac OS X, the following library routine clears the instruction cache for generated code - MakeDataExecutable(vm->codeBase, vm->codeLength); - #else - #warning Need to clear the instruction cache for generated code - #endif + // clear the instruction cache for generated code + msync(vm->codeBase, vm->codeLength, MS_INVALIDATE); } } if(0) diff --git a/src/unix/unix_main.c b/src/unix/unix_main.c index e399140c..86d97a1d 100644 --- a/src/unix/unix_main.c +++ b/src/unix/unix_main.c @@ -73,7 +73,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #if idppc_altivec #ifdef MACOS_X - #include + #include #endif #endif @@ -384,11 +384,13 @@ qboolean Sys_DetectAltivec( void ) #if idppc_altivec #ifdef MACOS_X - long feat = 0; - OSErr err = Gestalt(gestaltPowerPCProcessorFeatures, &feat); - if ((err==noErr) && ((1 << gestaltPowerPCHasVectorInstructions) & feat)) { - altivec = qtrue; - } + int selectors[2] = { CTL_HW, HW_VECTORUNIT }; + int hasVectorUnit = 0; + size_t length = sizeof(hasVectorUnit); + int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); + + if( 0 == error ) + altivec = (hasVectorUnit != 0); #else void (*handler)(int sig); handler = signal(SIGILL, illegal_instruction); diff --git a/src/unix/unix_net.c b/src/unix/unix_net.c index 31d27c8d..86706673 100644 --- a/src/unix/unix_net.c +++ b/src/unix/unix_net.c @@ -383,8 +383,6 @@ void NET_GetLocalAddress( void ) { int interfaceSocket; int family; - Com_Printf("NET_GetLocalAddress: Querying for network interfaces\n"); - // Set this early so we can just return if there is an error numIP = 0; @@ -406,7 +404,6 @@ void NET_GetLocalAddress( void ) { return; } - linkInterface = (struct ifreq *) ifc.ifc_buf; while ((char *) linkInterface < &ifc.ifc_buf[ifc.ifc_len]) { unsigned int nameLength; @@ -470,7 +467,6 @@ void NET_GetLocalAddress( void ) { } linkInterface = IFR_NEXT(linkInterface); } - Com_Printf("NET_GetLocalAddress: DONE querying for network interfaces\n"); close(interfaceSocket); } -- cgit