Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mach_override.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mentovai <mark@chromium.org>2011-09-22 06:00:00 +0400
committerMark Mentovai <mark@chromium.org>2011-09-22 06:00:00 +0400
commitc0a35913578078ea3212eab46c5b544a98c3e83d (patch)
tree31a0a75f8642ad8f5901046dae9a050e06907dda
parent87f491f8acef924d2ba90dd55fc23ad64f9d5bbd (diff)
Go back to pre-51ae3d199463fa84548f466d649f0821d579fdaf branch islands for PowerPC. Because PowerPC uses ba (branch absolute) to jump to branch islands, the islands must be somewhere in the lowest or highest 32MB of address space.
-rw-r--r--mach_override/mach_override.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mach_override/mach_override.c b/mach_override/mach_override.c
index 8a4cf95..a4464fd 100644
--- a/mach_override/mach_override.c
+++ b/mach_override/mach_override.c
@@ -370,7 +370,10 @@ allocateBranchIsland(
err = host_page_size( mach_host_self(), &pageSize );
if( !err ) {
assert( sizeof( BranchIsland ) <= pageSize );
-#if defined(__x86_64__)
+#if defined(__ppc__) || defined(__POWERPC__)
+ vm_address_t first = 0xfeffffff;
+ vm_address_t last = 0xfe000000 + pageSize;
+#elif defined(__x86_64__)
vm_address_t first = (uint64_t)originalFunctionAddress & ~(uint64_t)(((uint64_t)1 << 31) - 1) | ((uint64_t)1 << 31); // start in the middle of the page?
vm_address_t last = 0x0;
#else