mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 10:42:36 +01:00
Compilation fix
This commit is contained in:
parent
5f8cf18a5a
commit
8587ae5883
@ -464,7 +464,7 @@ typedef ucontext_t x64_context;
|
||||
#ifdef __APPLE__
|
||||
|
||||
#define X64REG(context, reg) (darwin_x64reg(context, reg))
|
||||
#define XMMREG(context, reg) (reinterpret_cast<u128*>(&(context)->uc_mcontext->__fs.__fpu_xmm0[reg]))
|
||||
#define XMMREG(context, reg) (reinterpret_cast<u128*>(&(context)->uc_mcontext->__fs.__fpu_xmm0.__xmm_reg[reg]))
|
||||
#define EFLAGS(context) ((context)->uc_mcontext->__ss.__rflags)
|
||||
|
||||
uint64_t* darwin_x64reg(x64_context *context, int reg)
|
||||
|
@ -34,7 +34,7 @@ if (NOT MSVC)
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -Os -D_NDEBUG")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O1 -D_NDEBUG")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O1 -g -D_NDEBUG")
|
||||
add_definitions(-msse2)
|
||||
add_definitions(-msse2 -mcx16)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
|
@ -210,13 +210,13 @@ void SPUThread::do_dma_transfer(u32 cmd, spu_mfc_arg_t args)
|
||||
else
|
||||
{
|
||||
LOG_ERROR(SPU, "do_dma_transfer(cmd=0x%x, lsa=0x%x, ea=0x%llx, tag=0x%x, size=0x%x): invalid MMIO offset", cmd, args.lsa, args.ea, args.tag, args.size);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(SPU, "do_dma_transfer(cmd=0x%x, lsa=0x%x, ea=0x%llx, tag=0x%x, size=0x%x): invalid thread type", cmd, args.lsa, args.ea, args.tag, args.size);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ void SPUThread::do_dma_transfer(u32 cmd, spu_mfc_arg_t args)
|
||||
}
|
||||
|
||||
LOG_ERROR(SPU, "do_dma_transfer(cmd=0x%x, lsa=0x%x, ea=0x%llx, tag=0x%x, size=0x%x): invalid cmd (%s)", cmd, args.lsa, args.ea, args.tag, args.size, get_mfc_cmd_name(cmd));
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
void SPUThread::do_dma_list_cmd(u32 cmd, spu_mfc_arg_t args)
|
||||
@ -245,7 +245,7 @@ void SPUThread::do_dma_list_cmd(u32 cmd, spu_mfc_arg_t args)
|
||||
if (!(cmd & MFC_LIST_MASK))
|
||||
{
|
||||
LOG_ERROR(SPU, "do_dma_list_cmd(cmd=0x%x, lsa=0x%x, ea=0x%llx, tag=0x%x, size=0x%x): invalid cmd (%s)", cmd, args.lsa, args.ea, args.tag, args.size, get_mfc_cmd_name(cmd));
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
const u32 list_addr = args.ea & 0x3ffff;
|
||||
@ -395,7 +395,7 @@ void SPUThread::process_mfc_cmd(u32 cmd)
|
||||
}
|
||||
|
||||
LOG_ERROR(SPU, "Unknown DMA %s: cmd=0x%x, lsa=0x%x, ea=0x%llx, tag=0x%x, size=0x%x", get_mfc_cmd_name(cmd), ch_mfc_args.lsa, ch_mfc_args.ea, ch_mfc_args.tag, ch_mfc_args.size, cmd);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
u32 SPUThread::get_ch_count(u32 ch)
|
||||
@ -422,7 +422,7 @@ u32 SPUThread::get_ch_count(u32 ch)
|
||||
}
|
||||
|
||||
LOG_ERROR(SPU, "get_ch_count(ch=%d [%s]): unknown/illegal channel", ch, ch < 128 ? spu_ch_name[ch] : "???");
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
u32 SPUThread::get_ch_value(u32 ch)
|
||||
@ -439,12 +439,17 @@ u32 SPUThread::get_ch_value(u32 ch)
|
||||
// break;
|
||||
case SPU_RdInMbox:
|
||||
{
|
||||
u32 result;
|
||||
while (!ch_in_mbox.pop(result) && !Emu.IsStopped())
|
||||
u32 result, count;
|
||||
while (!ch_in_mbox.pop(result, count) && !Emu.IsStopped())
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
}
|
||||
|
||||
if (count + 1 == 4 /* SPU_IN_MBOX_THRESHOLD */) // TODO: check this
|
||||
{
|
||||
int2.set(SPU_INT2_STAT_SPU_MAILBOX_THRESHOLD_INT);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -536,7 +541,7 @@ u32 SPUThread::get_ch_value(u32 ch)
|
||||
}
|
||||
|
||||
LOG_ERROR(SPU, "get_ch_value(ch=%d [%s]): unknown/illegal channel", ch, ch < 128 ? spu_ch_name[ch] : "???");
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
void SPUThread::set_ch_value(u32 ch, u32 value)
|
||||
@ -576,7 +581,7 @@ void SPUThread::set_ch_value(u32 ch, u32 value)
|
||||
if (!ch_out_mbox.pop(data))
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_spu_thread_send_event(value=0x%x, spup=%d): Out_MBox is empty", value, spup);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue())
|
||||
@ -614,7 +619,7 @@ void SPUThread::set_ch_value(u32 ch, u32 value)
|
||||
if (!ch_out_mbox.pop(data))
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_spu_thread_throw_event(value=0x%x, spup=%d): Out_MBox is empty", value, spup);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue())
|
||||
@ -650,13 +655,13 @@ void SPUThread::set_ch_value(u32 ch, u32 value)
|
||||
if (!ch_out_mbox.pop(data))
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_event_flag_set_bit(value=0x%x (flag=%d)): Out_MBox is empty", value, flag);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
if (flag > 63)
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_event_flag_set_bit(id=%d, value=0x%x): flag > 63", data, value, flag);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue())
|
||||
@ -692,13 +697,13 @@ void SPUThread::set_ch_value(u32 ch, u32 value)
|
||||
if (!ch_out_mbox.pop(data))
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_event_flag_set_bit_impatient(value=0x%x (flag=%d)): Out_MBox is empty", value, flag);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
if (flag > 63)
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_event_flag_set_bit_impatient(id=%d, value=0x%x): flag > 63", data, value, flag);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue())
|
||||
@ -734,7 +739,7 @@ void SPUThread::set_ch_value(u32 ch, u32 value)
|
||||
LOG_ERROR(SPU, "SPU_WrOutIntrMbox: unknown data (value=0x%x)", value);
|
||||
}
|
||||
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -874,7 +879,7 @@ void SPUThread::set_ch_value(u32 ch, u32 value)
|
||||
}
|
||||
|
||||
LOG_ERROR(SPU, "set_ch_value(ch=%d [%s], value=0x%x): unknown/illegal channel", ch, ch < 128 ? spu_ch_name[ch] : "???", value);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
void SPUThread::stop_and_signal(u32 code)
|
||||
@ -934,7 +939,7 @@ void SPUThread::stop_and_signal(u32 code)
|
||||
if (!ch_out_mbox.pop(spuq))
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_spu_thread_receive_event(): cannot read Out_MBox");
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
if (ch_in_mbox.get_count())
|
||||
@ -1028,14 +1033,14 @@ void SPUThread::stop_and_signal(u32 code)
|
||||
if (!ch_out_mbox.pop(value))
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_spu_thread_group_exit(): cannot read Out_MBox");
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
std::shared_ptr<SpuGroupInfo> tg;
|
||||
if (!Emu.GetIdManager().GetIDData(tg_id, tg))
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_spu_thread_group_exit(status=0x%x): invalid group (%d)", value, tg_id);
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue())
|
||||
@ -1064,7 +1069,7 @@ void SPUThread::stop_and_signal(u32 code)
|
||||
if (!ch_out_mbox.get_count())
|
||||
{
|
||||
LOG_ERROR(SPU, "sys_spu_thread_exit(): Out_MBox is empty");
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue())
|
||||
@ -1087,7 +1092,7 @@ void SPUThread::stop_and_signal(u32 code)
|
||||
LOG_ERROR(SPU, "Unknown STOP code: 0x%x; Out_MBox=0x%x", code, ch_out_mbox.get_value());
|
||||
}
|
||||
|
||||
throw "";
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
void SPUThread::halt()
|
||||
|
@ -79,7 +79,7 @@ enum : u64
|
||||
SPU_INT2_STAT_SPU_STOP_AND_SIGNAL_INT = (1ull << 1),
|
||||
SPU_INT2_STAT_SPU_HALT_OR_STEP_INT = (1ull << 2),
|
||||
SPU_INT2_STAT_DMA_TAG_GROUP_COMPLETION_INT = (1ull << 3),
|
||||
SPU_INT2_STAT_SPU_MAILBOX_THESHOLD_INT = (1ull << 4),
|
||||
SPU_INT2_STAT_SPU_MAILBOX_THRESHOLD_INT = (1ull << 4),
|
||||
};
|
||||
|
||||
enum
|
||||
@ -253,19 +253,20 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
bool pop(u32& out_value)
|
||||
// out_count: count after removing first element
|
||||
bool pop(u32& out_value, u32& out_count)
|
||||
{
|
||||
bool out_result;
|
||||
|
||||
const u32 last_value = value3.read_sync();
|
||||
|
||||
sync_var.atomic_op([&out_result, &out_value, last_value](sync_var_t& data)
|
||||
sync_var.atomic_op([&out_result, &out_value, &out_count, last_value](sync_var_t& data)
|
||||
{
|
||||
if ((out_result = data.count != 0))
|
||||
{
|
||||
out_value = data.value0;
|
||||
out_count = --data.count;
|
||||
|
||||
data.count--;
|
||||
data.value0 = data.value1;
|
||||
data.value1 = data.value2;
|
||||
data.value2 = last_value;
|
||||
|
@ -37,7 +37,7 @@ namespace vm
|
||||
|
||||
return base_addr;
|
||||
#else
|
||||
int memory_handle = shm_open("/rpcs3_vm", O_RDWR | O_CREAT | O_EXCL, 0);
|
||||
int memory_handle = shm_open("/rpcs3_vm", O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||
|
||||
if (memory_handle == -1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user