mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-01-01 16:37:10 +00:00
General aarch64 improvements & Apple Silicon support (#1255)
This commit is contained in:
parent
c8ffff8f41
commit
00ff5549d9
18 changed files with 405 additions and 32 deletions
|
|
@ -15,7 +15,12 @@ Fiber::Fiber(void(*FiberEntryPoint)(void* userParam), void* userParam, void* pri
|
|||
ctx->uc_stack.ss_sp = m_stackPtr;
|
||||
ctx->uc_stack.ss_size = stackSize;
|
||||
ctx->uc_link = &ctx[0];
|
||||
#ifdef __arm64__
|
||||
// https://www.man7.org/linux/man-pages/man3/makecontext.3.html#NOTES
|
||||
makecontext(ctx, (void(*)())FiberEntryPoint, 2, (uint64) userParam >> 32, userParam);
|
||||
#else
|
||||
makecontext(ctx, (void(*)())FiberEntryPoint, 1, userParam);
|
||||
#endif
|
||||
this->m_implData = (void*)ctx;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,11 @@ namespace MemMapper
|
|||
void* r;
|
||||
if(fromReservation)
|
||||
{
|
||||
if( mprotect(baseAddr, size, GetProt(permissionFlags)) == 0 )
|
||||
uint64 page_size = sysconf(_SC_PAGESIZE);
|
||||
void* page = baseAddr;
|
||||
if ( (uint64) baseAddr % page_size != 0 )
|
||||
page = (void*) ((uint64)baseAddr & ~(page_size - 1));
|
||||
if( mprotect(page, size, GetProt(permissionFlags)) == 0 )
|
||||
r = baseAddr;
|
||||
else
|
||||
r = nullptr;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ uint64 HighResolutionTimer::m_freq = []() -> uint64 {
|
|||
LARGE_INTEGER freq;
|
||||
QueryPerformanceFrequency(&freq);
|
||||
return (uint64)(freq.QuadPart);
|
||||
#elif BOOST_OS_MACOS
|
||||
return 1000000000;
|
||||
#else
|
||||
timespec pc;
|
||||
clock_getres(CLOCK_MONOTONIC_RAW, &pc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue