mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-10 20:00:22 +02:00
Which requires moving LinuxEmulation to its own independent folder as well. Since both IRLoader and FEXLoader rely on it. No functional change, just moves the the code around.
36 lines
1.0 KiB
C++
36 lines
1.0 KiB
C++
// SPDX-License-Identifier: MIT
|
|
/*
|
|
$info$
|
|
tags: LinuxSyscalls|syscalls-shared
|
|
$end_info$
|
|
*/
|
|
|
|
#include "LinuxSyscalls/Syscalls.h"
|
|
#include "LinuxSyscalls/x64/Syscalls.h"
|
|
#include "LinuxSyscalls/x32/Syscalls.h"
|
|
|
|
#include <FEXCore/IR/IR.h>
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <sys/shm.h>
|
|
|
|
namespace FEX::HLE {
|
|
void RegisterSHM(FEX::HLE::SyscallHandler *Handler) {
|
|
using namespace FEXCore::IR;
|
|
|
|
REGISTER_SYSCALL_IMPL_PASS_FLAGS(_shmget, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY,
|
|
[](FEXCore::Core::CpuStateFrame *Frame, key_t key, size_t size, int shmflg) -> uint64_t {
|
|
uint64_t Result = shmget(key, size, shmflg);
|
|
SYSCALL_ERRNO();
|
|
});
|
|
|
|
// XXX: shmid_ds is definitely not correct for 32-bit
|
|
REGISTER_SYSCALL_IMPL_PASS_FLAGS(_shmctl, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY,
|
|
[](FEXCore::Core::CpuStateFrame *Frame, int shmid, int cmd, struct shmid_ds *buf) -> uint64_t {
|
|
uint64_t Result = ::shmctl(shmid, cmd, buf);
|
|
SYSCALL_ERRNO();
|
|
});
|
|
}
|
|
}
|