mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-26 04:32:35 +01:00
Partial commit: ARMv7
This commit is contained in:
parent
0c7f763889
commit
643c15c4e9
@ -1,17 +1,17 @@
|
||||
#pragma once
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
|
||||
#include "ARMv7Function.h"
|
||||
|
||||
namespace vm
|
||||
{
|
||||
template<typename AT, typename RT, typename... T>
|
||||
force_inline RT _ptr_base<RT(T...), AT>::operator()(ARMv7Thread& context, T... args) const
|
||||
force_inline RT _ptr_base<RT(T...), AT>::operator()(ARMv7Thread& cpu, T... args) const
|
||||
{
|
||||
return psv_func_detail::func_caller<RT, T...>::call(context, VM_CAST(this->addr()), args...);
|
||||
return arm_func_detail::func_caller<RT, T...>::call(cpu, vm::cast(this->addr(), HERE), args...);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename RT, typename... T> inline RT cb_call(ARMv7Thread& context, u32 addr, T... args)
|
||||
template<typename RT, typename... T> inline RT cb_call(ARMv7Thread& cpu, u32 addr, T... args)
|
||||
{
|
||||
return psv_func_detail::func_caller<RT, T...>::call(context, addr, args...);
|
||||
return arm_func_detail::func_caller<RT, T...>::call(cpu, addr, args...);
|
||||
}
|
||||
|
@ -1,324 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Emu/Memory/Memory.h"
|
||||
|
||||
enum ARMv7InstructionSet
|
||||
{
|
||||
ARM,
|
||||
Thumb,
|
||||
Jazelle,
|
||||
ThumbEE
|
||||
};
|
||||
|
||||
enum armv7_debug_flags : u32
|
||||
{
|
||||
DF_DISASM = 1 << 0,
|
||||
DF_PRINT = 1 << 1,
|
||||
DF_NO_EXE = 1 << 2,
|
||||
};
|
||||
|
||||
struct ARMv7Context
|
||||
{
|
||||
union
|
||||
{
|
||||
u32 GPR[15];
|
||||
|
||||
struct
|
||||
{
|
||||
u32 pad[13];
|
||||
|
||||
union
|
||||
{
|
||||
u32 SP;
|
||||
|
||||
struct { u16 SP_main, SP_process; };
|
||||
};
|
||||
|
||||
u32 LR;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u32 reserved0 : 16;
|
||||
u32 GE : 4;
|
||||
u32 reserved1 : 4;
|
||||
u32 dummy : 3;
|
||||
u32 Q : 1; // Set to 1 if an SSAT or USAT instruction changes (saturates) the input value for the signed or unsigned range of the result
|
||||
u32 V : 1; // Overflow condition code flag
|
||||
u32 C : 1; // Carry condition code flag
|
||||
u32 Z : 1; // Zero condition code flag
|
||||
u32 N : 1; // Negative condition code flag
|
||||
};
|
||||
|
||||
u32 APSR;
|
||||
|
||||
} APSR;
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
u64 GPR_D[8];
|
||||
};
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u32 dummy : 24;
|
||||
u32 exception : 8;
|
||||
};
|
||||
|
||||
u32 IPSR;
|
||||
|
||||
} IPSR;
|
||||
|
||||
ARMv7InstructionSet ISET;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u8 shift_state : 5;
|
||||
u8 cond_base : 3;
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
u8 check_state : 4;
|
||||
u8 condition : 4;
|
||||
};
|
||||
|
||||
u8 IT;
|
||||
|
||||
u32 advance()
|
||||
{
|
||||
const u32 res = check_state ? condition : 0xe /* always true */;
|
||||
|
||||
shift_state <<= 1;
|
||||
if (!check_state)
|
||||
{
|
||||
IT = 0; // clear
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return check_state != 0;
|
||||
}
|
||||
|
||||
} ITSTATE;
|
||||
|
||||
u32 TLS;
|
||||
|
||||
struct perf_counter
|
||||
{
|
||||
u32 event;
|
||||
u32 value;
|
||||
};
|
||||
|
||||
std::array<perf_counter, 6> counters;
|
||||
|
||||
u32 PC;
|
||||
s32 prio;
|
||||
u32 stack_addr;
|
||||
u32 stack_size;
|
||||
u32 hle_func; // current function ID
|
||||
|
||||
u32 debug;
|
||||
std::string debug_str;
|
||||
|
||||
void write_pc(u32 value, u32 size)
|
||||
{
|
||||
ISET = value & 1 ? Thumb : ARM;
|
||||
PC = (value & ~1) - size;
|
||||
}
|
||||
|
||||
u32 read_pc()
|
||||
{
|
||||
return ISET == ARM ? PC + 8 : PC + 4;
|
||||
}
|
||||
|
||||
u32 get_stack_arg(u32 pos)
|
||||
{
|
||||
return vm::psv::read32(SP + sizeof(u32) * (pos - 5));
|
||||
}
|
||||
|
||||
void fast_call(u32 addr);
|
||||
|
||||
void write_gpr(u32 n, u32 value, u32 size)
|
||||
{
|
||||
assert(n < 16);
|
||||
|
||||
if (n < 15)
|
||||
{
|
||||
GPR[n] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
write_pc(value, size);
|
||||
}
|
||||
}
|
||||
|
||||
u32 read_gpr(u32 n)
|
||||
{
|
||||
assert(n < 16);
|
||||
|
||||
if (n < 15)
|
||||
{
|
||||
return GPR[n];
|
||||
}
|
||||
|
||||
return read_pc();
|
||||
}
|
||||
|
||||
// function for processing va_args in printf-like functions
|
||||
u32 get_next_gpr_arg(u32& g_count, u32& f_count, u32& v_count)
|
||||
{
|
||||
assert(!f_count && !v_count); // not supported
|
||||
|
||||
if (g_count < 4)
|
||||
{
|
||||
return GPR[g_count++];
|
||||
}
|
||||
else
|
||||
{
|
||||
return get_stack_arg(g_count++);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename... T>
|
||||
never_inline void fmt_debug_str(const char* fmt, T... args)
|
||||
{
|
||||
debug_str = fmt::format(fmt, args...);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, bool is_enum = std::is_enum<T>::value>
|
||||
struct cast_armv7_gpr
|
||||
{
|
||||
static_assert(is_enum, "Invalid type for cast_armv7_gpr");
|
||||
|
||||
force_inline static u32 to_gpr(const T& value)
|
||||
{
|
||||
return cast_armv7_gpr<std::underlying_type_t<T>>::to_gpr(static_cast<std::underlying_type_t<T>>(value));
|
||||
}
|
||||
|
||||
force_inline static T from_gpr(const u32 reg)
|
||||
{
|
||||
return static_cast<T>(cast_armv7_gpr<std::underlying_type_t<T>>::from_gpr(reg));
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct cast_armv7_gpr<u8, false>
|
||||
{
|
||||
force_inline static u32 to_gpr(const u8& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
force_inline static u8 from_gpr(const u32 reg)
|
||||
{
|
||||
return static_cast<u8>(reg);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct cast_armv7_gpr<u16, false>
|
||||
{
|
||||
force_inline static u32 to_gpr(const u16& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
force_inline static u16 from_gpr(const u32 reg)
|
||||
{
|
||||
return static_cast<u16>(reg);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct cast_armv7_gpr<u32, false>
|
||||
{
|
||||
force_inline static u32 to_gpr(const u32& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
force_inline static u32 from_gpr(const u32 reg)
|
||||
{
|
||||
return reg;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct cast_armv7_gpr<s8, false>
|
||||
{
|
||||
force_inline static u32 to_gpr(const s8& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
force_inline static s8 from_gpr(const u32 reg)
|
||||
{
|
||||
return static_cast<s8>(reg);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct cast_armv7_gpr<s16, false>
|
||||
{
|
||||
force_inline static u32 to_gpr(const s16& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
force_inline static s16 from_gpr(const u32 reg)
|
||||
{
|
||||
return static_cast<s16>(reg);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct cast_armv7_gpr<s32, false>
|
||||
{
|
||||
force_inline static u32 to_gpr(const s32& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
force_inline static s32 from_gpr(const u32 reg)
|
||||
{
|
||||
return static_cast<s32>(reg);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct cast_armv7_gpr<b8, false>
|
||||
{
|
||||
force_inline static u32 to_gpr(const b8& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
force_inline static b8 from_gpr(const u32& reg)
|
||||
{
|
||||
return reg != 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
force_inline u32 cast_to_armv7_gpr(const T& value)
|
||||
{
|
||||
return cast_armv7_gpr<T>::to_gpr(value);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
force_inline T cast_from_armv7_gpr(const u32 reg)
|
||||
{
|
||||
return cast_armv7_gpr<T>::from_gpr(reg);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
#include "Emu/CPU/CPUDecoder.h"
|
||||
|
||||
struct ARMv7Context;
|
||||
|
||||
class ARMv7Decoder : public CPUDecoder
|
||||
{
|
||||
ARMv7Context& m_ctx;
|
||||
|
||||
public:
|
||||
ARMv7Decoder(ARMv7Context& context) : m_ctx(context)
|
||||
{
|
||||
}
|
||||
|
||||
virtual u32 DecodeMemory(const u32 address);
|
||||
};
|
||||
|
||||
void armv7_decoder_initialize(u32 addr, u32 end_addr, bool dump = false);
|
File diff suppressed because it is too large
Load Diff
@ -1,328 +1,459 @@
|
||||
#pragma once
|
||||
|
||||
#include "Emu/CPU/CPUDisAsm.h"
|
||||
|
||||
static const char* g_arm_cond_name[16] =
|
||||
{
|
||||
"eq", "ne", "cs", "cc",
|
||||
"mi", "pl", "vs", "vc",
|
||||
"hi", "ls", "ge", "lt",
|
||||
"gt", "le", "al", "al",
|
||||
};
|
||||
enum class arm_encoding;
|
||||
|
||||
static const char* g_arm_reg_name[16] =
|
||||
{
|
||||
"r0", "r1", "r2", "r3",
|
||||
"r4", "r5", "r6", "r7",
|
||||
"r8", "r9", "r10", "r11",
|
||||
"r12", "sp", "lr", "pc",
|
||||
};
|
||||
|
||||
class ARMv7DisAsm
|
||||
: public CPUDisAsm
|
||||
class ARMv7DisAsm final : public CPUDisAsm
|
||||
{
|
||||
public:
|
||||
ARMv7DisAsm() : CPUDisAsm(CPUDisAsm_InterpreterMode)
|
||||
ARMv7DisAsm(CPUDisAsmMode mode) : CPUDisAsm(mode)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual u32 DisAsmBranchTarget(const s32 imm)
|
||||
virtual u32 DisAsmBranchTarget(const s32 imm) override
|
||||
{
|
||||
return (u32)dump_pc + imm;
|
||||
// TODO: ARM
|
||||
return dump_pc + (true ? 4 : 8) + imm;
|
||||
}
|
||||
|
||||
#if 0
|
||||
std::string GetRegsListString(u16 regs_list)
|
||||
virtual void Write(const std::string& value) override;
|
||||
|
||||
private:
|
||||
template<typename... Args>
|
||||
void write(const char* fmt, const Args&... args)
|
||||
{
|
||||
std::string regs_str;
|
||||
|
||||
for(u16 mask=0x1, i=0; mask; mask <<= 1, i++)
|
||||
{
|
||||
if(regs_list & mask)
|
||||
{
|
||||
if(!regs_str.empty())
|
||||
{
|
||||
regs_str += ", ";
|
||||
}
|
||||
|
||||
regs_str += g_arm_reg_name[i];
|
||||
}
|
||||
}
|
||||
|
||||
return regs_str;
|
||||
Write(fmt::format(fmt, args...));
|
||||
}
|
||||
|
||||
virtual void UNK(const u32 data);
|
||||
public:
|
||||
void UNK(const u32 op, const u32 cond);
|
||||
|
||||
virtual void NULL_OP(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void HACK(const u32, const u32);
|
||||
template<arm_encoding type> void MRC_(const u32, const u32);
|
||||
|
||||
virtual void HACK(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void ADC_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void ADC_REG(const u32, const u32);
|
||||
template<arm_encoding type> void ADC_RSR(const u32, const u32);
|
||||
|
||||
virtual void ADC_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ADC_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ADC_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void ADD_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void ADD_REG(const u32, const u32);
|
||||
template<arm_encoding type> void ADD_RSR(const u32, const u32);
|
||||
template<arm_encoding type> void ADD_SPI(const u32, const u32);
|
||||
template<arm_encoding type> void ADD_SPR(const u32, const u32);
|
||||
|
||||
virtual void ADD_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ADD_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ADD_RSR(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ADD_SPI(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ADD_SPR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void ADR(const u32, const u32);
|
||||
|
||||
virtual void ADR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void AND_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void AND_REG(const u32, const u32);
|
||||
template<arm_encoding type> void AND_RSR(const u32, const u32);
|
||||
|
||||
virtual void AND_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void AND_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void AND_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void ASR_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void ASR_REG(const u32, const u32);
|
||||
|
||||
virtual void ASR_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ASR_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void B(const u32, const u32);
|
||||
|
||||
virtual void B(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void BFC(const u32, const u32);
|
||||
template<arm_encoding type> void BFI(const u32, const u32);
|
||||
|
||||
virtual void BFC(const u32 data, const ARMv7_encoding type);
|
||||
virtual void BFI(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void BIC_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void BIC_REG(const u32, const u32);
|
||||
template<arm_encoding type> void BIC_RSR(const u32, const u32);
|
||||
|
||||
virtual void BIC_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void BIC_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void BIC_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void BKPT(const u32, const u32);
|
||||
|
||||
virtual void BKPT(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void BL(const u32, const u32);
|
||||
template<arm_encoding type> void BLX(const u32, const u32);
|
||||
template<arm_encoding type> void BX(const u32, const u32);
|
||||
|
||||
virtual void BL(const u32 data, const ARMv7_encoding type);
|
||||
virtual void BLX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void BX(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void CB_Z(const u32, const u32);
|
||||
|
||||
virtual void CB_Z(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void CLZ(const u32, const u32);
|
||||
|
||||
virtual void CLZ(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void CMN_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void CMN_REG(const u32, const u32);
|
||||
template<arm_encoding type> void CMN_RSR(const u32, const u32);
|
||||
|
||||
virtual void CMN_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void CMN_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void CMN_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void CMP_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void CMP_REG(const u32, const u32);
|
||||
template<arm_encoding type> void CMP_RSR(const u32, const u32);
|
||||
|
||||
virtual void CMP_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void CMP_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void CMP_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void DBG(const u32, const u32);
|
||||
template<arm_encoding type> void DMB(const u32, const u32);
|
||||
template<arm_encoding type> void DSB(const u32, const u32);
|
||||
|
||||
virtual void EOR_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void EOR_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void EOR_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void EOR_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void EOR_REG(const u32, const u32);
|
||||
template<arm_encoding type> void EOR_RSR(const u32, const u32);
|
||||
|
||||
virtual void IT(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void IT(const u32, const u32);
|
||||
|
||||
virtual void LDM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDMDA(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDMDB(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDMIB(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LDM(const u32, const u32);
|
||||
template<arm_encoding type> void LDMDA(const u32, const u32);
|
||||
template<arm_encoding type> void LDMDB(const u32, const u32);
|
||||
template<arm_encoding type> void LDMIB(const u32, const u32);
|
||||
|
||||
virtual void LDR_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDR_LIT(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDR_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LDR_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void LDR_LIT(const u32, const u32);
|
||||
template<arm_encoding type> void LDR_REG(const u32, const u32);
|
||||
|
||||
virtual void LDRB_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRB_LIT(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRB_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LDRB_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void LDRB_LIT(const u32, const u32);
|
||||
template<arm_encoding type> void LDRB_REG(const u32, const u32);
|
||||
|
||||
virtual void LDRD_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRD_LIT(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRD_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LDRD_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void LDRD_LIT(const u32, const u32);
|
||||
template<arm_encoding type> void LDRD_REG(const u32, const u32);
|
||||
|
||||
virtual void LDRH_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRH_LIT(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRH_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LDRH_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void LDRH_LIT(const u32, const u32);
|
||||
template<arm_encoding type> void LDRH_REG(const u32, const u32);
|
||||
|
||||
virtual void LDRSB_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRSB_LIT(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRSB_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LDRSB_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void LDRSB_LIT(const u32, const u32);
|
||||
template<arm_encoding type> void LDRSB_REG(const u32, const u32);
|
||||
|
||||
virtual void LDRSH_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRSH_LIT(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LDRSH_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LDRSH_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void LDRSH_LIT(const u32, const u32);
|
||||
template<arm_encoding type> void LDRSH_REG(const u32, const u32);
|
||||
|
||||
virtual void LSL_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LSL_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LDREX(const u32, const u32);
|
||||
template<arm_encoding type> void LDREXB(const u32, const u32);
|
||||
template<arm_encoding type> void LDREXD(const u32, const u32);
|
||||
template<arm_encoding type> void LDREXH(const u32, const u32);
|
||||
|
||||
virtual void LSR_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void LSR_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LSL_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void LSL_REG(const u32, const u32);
|
||||
|
||||
virtual void MLA(const u32 data, const ARMv7_encoding type);
|
||||
virtual void MLS(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void LSR_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void LSR_REG(const u32, const u32);
|
||||
|
||||
virtual void MOV_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void MOV_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void MOVT(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void MLA(const u32, const u32);
|
||||
template<arm_encoding type> void MLS(const u32, const u32);
|
||||
|
||||
virtual void MRS(const u32 data, const ARMv7_encoding type);
|
||||
virtual void MSR_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void MSR_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void MOV_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void MOV_REG(const u32, const u32);
|
||||
template<arm_encoding type> void MOVT(const u32, const u32);
|
||||
|
||||
virtual void MUL(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void MRS(const u32, const u32);
|
||||
template<arm_encoding type> void MSR_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void MSR_REG(const u32, const u32);
|
||||
|
||||
virtual void MVN_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void MVN_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void MVN_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void MUL(const u32, const u32);
|
||||
|
||||
virtual void NOP(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void MVN_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void MVN_REG(const u32, const u32);
|
||||
template<arm_encoding type> void MVN_RSR(const u32, const u32);
|
||||
|
||||
virtual void ORN_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ORN_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void NOP(const u32, const u32);
|
||||
|
||||
virtual void ORR_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ORR_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ORR_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void ORN_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void ORN_REG(const u32, const u32);
|
||||
|
||||
virtual void PKH(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void ORR_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void ORR_REG(const u32, const u32);
|
||||
template<arm_encoding type> void ORR_RSR(const u32, const u32);
|
||||
|
||||
virtual void POP(const u32 data, const ARMv7_encoding type);
|
||||
virtual void PUSH(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void PKH(const u32, const u32);
|
||||
|
||||
virtual void QADD(const u32 data, const ARMv7_encoding type);
|
||||
virtual void QADD16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void QADD8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void QASX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void QDADD(const u32 data, const ARMv7_encoding type);
|
||||
virtual void QDSUB(const u32 data, const ARMv7_encoding type);
|
||||
virtual void QSAX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void QSUB(const u32 data, const ARMv7_encoding type);
|
||||
virtual void QSUB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void QSUB8(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void POP(const u32, const u32);
|
||||
template<arm_encoding type> void PUSH(const u32, const u32);
|
||||
|
||||
virtual void RBIT(const u32 data, const ARMv7_encoding type);
|
||||
virtual void REV(const u32 data, const ARMv7_encoding type);
|
||||
virtual void REV16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void REVSH(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void QADD(const u32, const u32);
|
||||
template<arm_encoding type> void QADD16(const u32, const u32);
|
||||
template<arm_encoding type> void QADD8(const u32, const u32);
|
||||
template<arm_encoding type> void QASX(const u32, const u32);
|
||||
template<arm_encoding type> void QDADD(const u32, const u32);
|
||||
template<arm_encoding type> void QDSUB(const u32, const u32);
|
||||
template<arm_encoding type> void QSAX(const u32, const u32);
|
||||
template<arm_encoding type> void QSUB(const u32, const u32);
|
||||
template<arm_encoding type> void QSUB16(const u32, const u32);
|
||||
template<arm_encoding type> void QSUB8(const u32, const u32);
|
||||
|
||||
virtual void ROR_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void ROR_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void RBIT(const u32, const u32);
|
||||
template<arm_encoding type> void REV(const u32, const u32);
|
||||
template<arm_encoding type> void REV16(const u32, const u32);
|
||||
template<arm_encoding type> void REVSH(const u32, const u32);
|
||||
|
||||
virtual void RRX(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void ROR_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void ROR_REG(const u32, const u32);
|
||||
|
||||
virtual void RSB_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void RSB_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void RSB_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void RRX(const u32, const u32);
|
||||
|
||||
virtual void RSC_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void RSC_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void RSC_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void RSB_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void RSB_REG(const u32, const u32);
|
||||
template<arm_encoding type> void RSB_RSR(const u32, const u32);
|
||||
|
||||
virtual void SADD16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SADD8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SASX(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void RSC_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void RSC_REG(const u32, const u32);
|
||||
template<arm_encoding type> void RSC_RSR(const u32, const u32);
|
||||
|
||||
virtual void SBC_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SBC_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SBC_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SADD16(const u32, const u32);
|
||||
template<arm_encoding type> void SADD8(const u32, const u32);
|
||||
template<arm_encoding type> void SASX(const u32, const u32);
|
||||
|
||||
virtual void SBFX(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SBC_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void SBC_REG(const u32, const u32);
|
||||
template<arm_encoding type> void SBC_RSR(const u32, const u32);
|
||||
|
||||
virtual void SDIV(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SBFX(const u32, const u32);
|
||||
|
||||
virtual void SEL(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SDIV(const u32, const u32);
|
||||
|
||||
virtual void SHADD16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SHADD8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SHASX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SHSAX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SHSUB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SHSUB8(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SEL(const u32, const u32);
|
||||
|
||||
virtual void SMLA__(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMLAD(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMLAL(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMLAL__(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMLALD(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMLAW_(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMLSD(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMLSLD(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMMLA(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMMLS(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMMUL(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMUAD(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMUL__(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMULL(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMULW_(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SMUSD(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SHADD16(const u32, const u32);
|
||||
template<arm_encoding type> void SHADD8(const u32, const u32);
|
||||
template<arm_encoding type> void SHASX(const u32, const u32);
|
||||
template<arm_encoding type> void SHSAX(const u32, const u32);
|
||||
template<arm_encoding type> void SHSUB16(const u32, const u32);
|
||||
template<arm_encoding type> void SHSUB8(const u32, const u32);
|
||||
|
||||
virtual void SSAT(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SSAT16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SSAX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SSUB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SSUB8(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SMLA__(const u32, const u32);
|
||||
template<arm_encoding type> void SMLAD(const u32, const u32);
|
||||
template<arm_encoding type> void SMLAL(const u32, const u32);
|
||||
template<arm_encoding type> void SMLAL__(const u32, const u32);
|
||||
template<arm_encoding type> void SMLALD(const u32, const u32);
|
||||
template<arm_encoding type> void SMLAW_(const u32, const u32);
|
||||
template<arm_encoding type> void SMLSD(const u32, const u32);
|
||||
template<arm_encoding type> void SMLSLD(const u32, const u32);
|
||||
template<arm_encoding type> void SMMLA(const u32, const u32);
|
||||
template<arm_encoding type> void SMMLS(const u32, const u32);
|
||||
template<arm_encoding type> void SMMUL(const u32, const u32);
|
||||
template<arm_encoding type> void SMUAD(const u32, const u32);
|
||||
template<arm_encoding type> void SMUL__(const u32, const u32);
|
||||
template<arm_encoding type> void SMULL(const u32, const u32);
|
||||
template<arm_encoding type> void SMULW_(const u32, const u32);
|
||||
template<arm_encoding type> void SMUSD(const u32, const u32);
|
||||
|
||||
virtual void STM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void STMDA(const u32 data, const ARMv7_encoding type);
|
||||
virtual void STMDB(const u32 data, const ARMv7_encoding type);
|
||||
virtual void STMIB(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SSAT(const u32, const u32);
|
||||
template<arm_encoding type> void SSAT16(const u32, const u32);
|
||||
template<arm_encoding type> void SSAX(const u32, const u32);
|
||||
template<arm_encoding type> void SSUB16(const u32, const u32);
|
||||
template<arm_encoding type> void SSUB8(const u32, const u32);
|
||||
|
||||
virtual void STR_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void STR_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void STM(const u32, const u32);
|
||||
template<arm_encoding type> void STMDA(const u32, const u32);
|
||||
template<arm_encoding type> void STMDB(const u32, const u32);
|
||||
template<arm_encoding type> void STMIB(const u32, const u32);
|
||||
|
||||
virtual void STRB_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void STRB_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void STR_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void STR_REG(const u32, const u32);
|
||||
|
||||
virtual void STRD_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void STRD_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void STRB_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void STRB_REG(const u32, const u32);
|
||||
|
||||
virtual void STRH_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void STRH_REG(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void STRD_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void STRD_REG(const u32, const u32);
|
||||
|
||||
virtual void SUB_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SUB_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SUB_RSR(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SUB_SPI(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SUB_SPR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void STRH_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void STRH_REG(const u32, const u32);
|
||||
|
||||
virtual void SVC(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void STREX(const u32, const u32);
|
||||
template<arm_encoding type> void STREXB(const u32, const u32);
|
||||
template<arm_encoding type> void STREXD(const u32, const u32);
|
||||
template<arm_encoding type> void STREXH(const u32, const u32);
|
||||
|
||||
virtual void SXTAB(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SXTAB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SXTAH(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SXTB(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SXTB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void SXTH(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SUB_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void SUB_REG(const u32, const u32);
|
||||
template<arm_encoding type> void SUB_RSR(const u32, const u32);
|
||||
template<arm_encoding type> void SUB_SPI(const u32, const u32);
|
||||
template<arm_encoding type> void SUB_SPR(const u32, const u32);
|
||||
|
||||
virtual void TB_(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SVC(const u32, const u32);
|
||||
|
||||
virtual void TEQ_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void TEQ_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void TEQ_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void SXTAB(const u32, const u32);
|
||||
template<arm_encoding type> void SXTAB16(const u32, const u32);
|
||||
template<arm_encoding type> void SXTAH(const u32, const u32);
|
||||
template<arm_encoding type> void SXTB(const u32, const u32);
|
||||
template<arm_encoding type> void SXTB16(const u32, const u32);
|
||||
template<arm_encoding type> void SXTH(const u32, const u32);
|
||||
|
||||
virtual void TST_IMM(const u32 data, const ARMv7_encoding type);
|
||||
virtual void TST_REG(const u32 data, const ARMv7_encoding type);
|
||||
virtual void TST_RSR(const u32 data, const ARMv7_encoding type);
|
||||
template<arm_encoding type> void TB_(const u32, const u32);
|
||||
|
||||
virtual void UADD16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UADD8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UASX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UBFX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UDIV(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UHADD16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UHADD8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UHASX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UHSAX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UHSUB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UHSUB8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UMAAL(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UMLAL(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UMULL(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UQADD16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UQADD8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UQASX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UQSAX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UQSUB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UQSUB8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void USAD8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void USADA8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void USAT(const u32 data, const ARMv7_encoding type);
|
||||
virtual void USAT16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void USAX(const u32 data, const ARMv7_encoding type);
|
||||
virtual void USUB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void USUB8(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UXTAB(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UXTAB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UXTAH(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UXTB(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UXTB16(const u32 data, const ARMv7_encoding type);
|
||||
virtual void UXTH(const u32 data, const ARMv7_encoding type);
|
||||
#endif
|
||||
template<arm_encoding type> void TEQ_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void TEQ_REG(const u32, const u32);
|
||||
template<arm_encoding type> void TEQ_RSR(const u32, const u32);
|
||||
|
||||
template<arm_encoding type> void TST_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void TST_REG(const u32, const u32);
|
||||
template<arm_encoding type> void TST_RSR(const u32, const u32);
|
||||
|
||||
template<arm_encoding type> void UADD16(const u32, const u32);
|
||||
template<arm_encoding type> void UADD8(const u32, const u32);
|
||||
template<arm_encoding type> void UASX(const u32, const u32);
|
||||
template<arm_encoding type> void UBFX(const u32, const u32);
|
||||
template<arm_encoding type> void UDIV(const u32, const u32);
|
||||
template<arm_encoding type> void UHADD16(const u32, const u32);
|
||||
template<arm_encoding type> void UHADD8(const u32, const u32);
|
||||
template<arm_encoding type> void UHASX(const u32, const u32);
|
||||
template<arm_encoding type> void UHSAX(const u32, const u32);
|
||||
template<arm_encoding type> void UHSUB16(const u32, const u32);
|
||||
template<arm_encoding type> void UHSUB8(const u32, const u32);
|
||||
template<arm_encoding type> void UMAAL(const u32, const u32);
|
||||
template<arm_encoding type> void UMLAL(const u32, const u32);
|
||||
template<arm_encoding type> void UMULL(const u32, const u32);
|
||||
template<arm_encoding type> void UQADD16(const u32, const u32);
|
||||
template<arm_encoding type> void UQADD8(const u32, const u32);
|
||||
template<arm_encoding type> void UQASX(const u32, const u32);
|
||||
template<arm_encoding type> void UQSAX(const u32, const u32);
|
||||
template<arm_encoding type> void UQSUB16(const u32, const u32);
|
||||
template<arm_encoding type> void UQSUB8(const u32, const u32);
|
||||
template<arm_encoding type> void USAD8(const u32, const u32);
|
||||
template<arm_encoding type> void USADA8(const u32, const u32);
|
||||
template<arm_encoding type> void USAT(const u32, const u32);
|
||||
template<arm_encoding type> void USAT16(const u32, const u32);
|
||||
template<arm_encoding type> void USAX(const u32, const u32);
|
||||
template<arm_encoding type> void USUB16(const u32, const u32);
|
||||
template<arm_encoding type> void USUB8(const u32, const u32);
|
||||
template<arm_encoding type> void UXTAB(const u32, const u32);
|
||||
template<arm_encoding type> void UXTAB16(const u32, const u32);
|
||||
template<arm_encoding type> void UXTAH(const u32, const u32);
|
||||
template<arm_encoding type> void UXTB(const u32, const u32);
|
||||
template<arm_encoding type> void UXTB16(const u32, const u32);
|
||||
template<arm_encoding type> void UXTH(const u32, const u32);
|
||||
|
||||
template<arm_encoding type> void VABA_(const u32, const u32);
|
||||
template<arm_encoding type> void VABD_(const u32, const u32);
|
||||
template<arm_encoding type> void VABD_FP(const u32, const u32);
|
||||
template<arm_encoding type> void VABS(const u32, const u32);
|
||||
template<arm_encoding type> void VAC__(const u32, const u32);
|
||||
template<arm_encoding type> void VADD(const u32, const u32);
|
||||
template<arm_encoding type> void VADD_FP(const u32, const u32);
|
||||
template<arm_encoding type> void VADDHN(const u32, const u32);
|
||||
template<arm_encoding type> void VADD_(const u32, const u32);
|
||||
template<arm_encoding type> void VAND(const u32, const u32);
|
||||
template<arm_encoding type> void VBIC_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void VBIC_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VB__(const u32, const u32);
|
||||
template<arm_encoding type> void VCEQ_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VCEQ_ZERO(const u32, const u32);
|
||||
template<arm_encoding type> void VCGE_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VCGE_ZERO(const u32, const u32);
|
||||
template<arm_encoding type> void VCGT_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VCGT_ZERO(const u32, const u32);
|
||||
template<arm_encoding type> void VCLE_ZERO(const u32, const u32);
|
||||
template<arm_encoding type> void VCLS(const u32, const u32);
|
||||
template<arm_encoding type> void VCLT_ZERO(const u32, const u32);
|
||||
template<arm_encoding type> void VCLZ(const u32, const u32);
|
||||
template<arm_encoding type> void VCMP_(const u32, const u32);
|
||||
template<arm_encoding type> void VCNT(const u32, const u32);
|
||||
template<arm_encoding type> void VCVT_FIA(const u32, const u32);
|
||||
template<arm_encoding type> void VCVT_FIF(const u32, const u32);
|
||||
template<arm_encoding type> void VCVT_FFA(const u32, const u32);
|
||||
template<arm_encoding type> void VCVT_FFF(const u32, const u32);
|
||||
template<arm_encoding type> void VCVT_DF(const u32, const u32);
|
||||
template<arm_encoding type> void VCVT_HFA(const u32, const u32);
|
||||
template<arm_encoding type> void VCVT_HFF(const u32, const u32);
|
||||
template<arm_encoding type> void VDIV(const u32, const u32);
|
||||
template<arm_encoding type> void VDUP_S(const u32, const u32);
|
||||
template<arm_encoding type> void VDUP_R(const u32, const u32);
|
||||
template<arm_encoding type> void VEOR(const u32, const u32);
|
||||
template<arm_encoding type> void VEXT(const u32, const u32);
|
||||
template<arm_encoding type> void VHADDSUB(const u32, const u32);
|
||||
template<arm_encoding type> void VLD__MS(const u32, const u32);
|
||||
template<arm_encoding type> void VLD1_SL(const u32, const u32);
|
||||
template<arm_encoding type> void VLD1_SAL(const u32, const u32);
|
||||
template<arm_encoding type> void VLD2_SL(const u32, const u32);
|
||||
template<arm_encoding type> void VLD2_SAL(const u32, const u32);
|
||||
template<arm_encoding type> void VLD3_SL(const u32, const u32);
|
||||
template<arm_encoding type> void VLD3_SAL(const u32, const u32);
|
||||
template<arm_encoding type> void VLD4_SL(const u32, const u32);
|
||||
template<arm_encoding type> void VLD4_SAL(const u32, const u32);
|
||||
template<arm_encoding type> void VLDM(const u32, const u32);
|
||||
template<arm_encoding type> void VLDR(const u32, const u32);
|
||||
template<arm_encoding type> void VMAXMIN(const u32, const u32);
|
||||
template<arm_encoding type> void VMAXMIN_FP(const u32, const u32);
|
||||
template<arm_encoding type> void VML__(const u32, const u32);
|
||||
template<arm_encoding type> void VML__FP(const u32, const u32);
|
||||
template<arm_encoding type> void VML__S(const u32, const u32);
|
||||
template<arm_encoding type> void VMOV_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void VMOV_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VMOV_RS(const u32, const u32);
|
||||
template<arm_encoding type> void VMOV_SR(const u32, const u32);
|
||||
template<arm_encoding type> void VMOV_RF(const u32, const u32);
|
||||
template<arm_encoding type> void VMOV_2RF(const u32, const u32);
|
||||
template<arm_encoding type> void VMOV_2RD(const u32, const u32);
|
||||
template<arm_encoding type> void VMOVL(const u32, const u32);
|
||||
template<arm_encoding type> void VMOVN(const u32, const u32);
|
||||
template<arm_encoding type> void VMRS(const u32, const u32);
|
||||
template<arm_encoding type> void VMSR(const u32, const u32);
|
||||
template<arm_encoding type> void VMUL_(const u32, const u32);
|
||||
template<arm_encoding type> void VMUL_FP(const u32, const u32);
|
||||
template<arm_encoding type> void VMUL_S(const u32, const u32);
|
||||
template<arm_encoding type> void VMVN_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void VMVN_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VNEG(const u32, const u32);
|
||||
template<arm_encoding type> void VNM__(const u32, const u32);
|
||||
template<arm_encoding type> void VORN_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VORR_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void VORR_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VPADAL(const u32, const u32);
|
||||
template<arm_encoding type> void VPADD(const u32, const u32);
|
||||
template<arm_encoding type> void VPADD_FP(const u32, const u32);
|
||||
template<arm_encoding type> void VPADDL(const u32, const u32);
|
||||
template<arm_encoding type> void VPMAXMIN(const u32, const u32);
|
||||
template<arm_encoding type> void VPMAXMIN_FP(const u32, const u32);
|
||||
template<arm_encoding type> void VPOP(const u32, const u32);
|
||||
template<arm_encoding type> void VPUSH(const u32, const u32);
|
||||
template<arm_encoding type> void VQABS(const u32, const u32);
|
||||
template<arm_encoding type> void VQADD(const u32, const u32);
|
||||
template<arm_encoding type> void VQDML_L(const u32, const u32);
|
||||
template<arm_encoding type> void VQDMULH(const u32, const u32);
|
||||
template<arm_encoding type> void VQDMULL(const u32, const u32);
|
||||
template<arm_encoding type> void VQMOV_N(const u32, const u32);
|
||||
template<arm_encoding type> void VQNEG(const u32, const u32);
|
||||
template<arm_encoding type> void VQRDMULH(const u32, const u32);
|
||||
template<arm_encoding type> void VQRSHL(const u32, const u32);
|
||||
template<arm_encoding type> void VQRSHR_N(const u32, const u32);
|
||||
template<arm_encoding type> void VQSHL_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VQSHL_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void VQSHR_N(const u32, const u32);
|
||||
template<arm_encoding type> void VQSUB(const u32, const u32);
|
||||
template<arm_encoding type> void VRADDHN(const u32, const u32);
|
||||
template<arm_encoding type> void VRECPE(const u32, const u32);
|
||||
template<arm_encoding type> void VRECPS(const u32, const u32);
|
||||
template<arm_encoding type> void VREV__(const u32, const u32);
|
||||
template<arm_encoding type> void VRHADD(const u32, const u32);
|
||||
template<arm_encoding type> void VRSHL(const u32, const u32);
|
||||
template<arm_encoding type> void VRSHR(const u32, const u32);
|
||||
template<arm_encoding type> void VRSHRN(const u32, const u32);
|
||||
template<arm_encoding type> void VRSQRTE(const u32, const u32);
|
||||
template<arm_encoding type> void VRSQRTS(const u32, const u32);
|
||||
template<arm_encoding type> void VRSRA(const u32, const u32);
|
||||
template<arm_encoding type> void VRSUBHN(const u32, const u32);
|
||||
template<arm_encoding type> void VSHL_IMM(const u32, const u32);
|
||||
template<arm_encoding type> void VSHL_REG(const u32, const u32);
|
||||
template<arm_encoding type> void VSHLL(const u32, const u32);
|
||||
template<arm_encoding type> void VSHR(const u32, const u32);
|
||||
template<arm_encoding type> void VSHRN(const u32, const u32);
|
||||
template<arm_encoding type> void VSLI(const u32, const u32);
|
||||
template<arm_encoding type> void VSQRT(const u32, const u32);
|
||||
template<arm_encoding type> void VSRA(const u32, const u32);
|
||||
template<arm_encoding type> void VSRI(const u32, const u32);
|
||||
template<arm_encoding type> void VST__MS(const u32, const u32);
|
||||
template<arm_encoding type> void VST1_SL(const u32, const u32);
|
||||
template<arm_encoding type> void VST2_SL(const u32, const u32);
|
||||
template<arm_encoding type> void VST3_SL(const u32, const u32);
|
||||
template<arm_encoding type> void VST4_SL(const u32, const u32);
|
||||
template<arm_encoding type> void VSTM(const u32, const u32);
|
||||
template<arm_encoding type> void VSTR(const u32, const u32);
|
||||
template<arm_encoding type> void VSUB(const u32, const u32);
|
||||
template<arm_encoding type> void VSUB_FP(const u32, const u32);
|
||||
template<arm_encoding type> void VSUBHN(const u32, const u32);
|
||||
template<arm_encoding type> void VSUB_(const u32, const u32);
|
||||
template<arm_encoding type> void VSWP(const u32, const u32);
|
||||
template<arm_encoding type> void VTB_(const u32, const u32);
|
||||
template<arm_encoding type> void VTRN(const u32, const u32);
|
||||
template<arm_encoding type> void VTST(const u32, const u32);
|
||||
template<arm_encoding type> void VUZP(const u32, const u32);
|
||||
template<arm_encoding type> void VZIP(const u32, const u32);
|
||||
|
||||
template<arm_encoding type> void WFE(const u32, const u32);
|
||||
template<arm_encoding type> void WFI(const u32, const u32);
|
||||
template<arm_encoding type> void YIELD(const u32, const u32);
|
||||
|
||||
public:
|
||||
u32 disasm(u32 pc) override;
|
||||
};
|
||||
|
59
rpcs3/Emu/ARMv7/ARMv7Function.cpp
Normal file
59
rpcs3/Emu/ARMv7/ARMv7Function.cpp
Normal file
@ -0,0 +1,59 @@
|
||||
#include "stdafx.h"
|
||||
#include "ARMv7Module.h"
|
||||
|
||||
// Get function name by FNID
|
||||
extern std::string arm_get_function_name(const std::string& module, u32 fnid)
|
||||
{
|
||||
// Check registered functions
|
||||
if (const auto sm = arm_module_manager::get_module(module))
|
||||
{
|
||||
const auto found = sm->functions.find(fnid);
|
||||
|
||||
if (found != sm->functions.end())
|
||||
{
|
||||
return found->second.name;
|
||||
}
|
||||
}
|
||||
|
||||
return fmt::format("0x%08X", fnid);
|
||||
}
|
||||
|
||||
// Get variable name by VNID
|
||||
extern std::string arm_get_variable_name(const std::string& module, u32 vnid)
|
||||
{
|
||||
// Check registered variables
|
||||
if (const auto sm = arm_module_manager::get_module(module))
|
||||
{
|
||||
const auto found = sm->variables.find(vnid);
|
||||
|
||||
if (found != sm->variables.end())
|
||||
{
|
||||
return found->second.name;
|
||||
}
|
||||
}
|
||||
|
||||
return fmt::format("0x%08X", vnid);
|
||||
}
|
||||
|
||||
s32 arm_error_code::report(s32 error, const char* text)
|
||||
{
|
||||
if (auto thread = get_current_cpu_thread())
|
||||
{
|
||||
if (thread->type == cpu_type::arm)
|
||||
{
|
||||
if (auto func = static_cast<ARMv7Thread*>(thread)->last_function)
|
||||
{
|
||||
LOG_ERROR(ARMv7, "Function '%s' failed with 0x%08x : %s", func, error, text);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(ARMv7, "Unknown function failed with 0x%08x : %s", error, text);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_ERROR(ARMv7, "Illegal call to ppu_report_error(0x%x, '%s')!");
|
||||
return error;
|
||||
}
|
487
rpcs3/Emu/ARMv7/ARMv7Function.h
Normal file
487
rpcs3/Emu/ARMv7/ARMv7Function.h
Normal file
@ -0,0 +1,487 @@
|
||||
#pragma once
|
||||
|
||||
#include "ARMv7Thread.h"
|
||||
|
||||
using arm_function_t = void(*)(ARMv7Thread&);
|
||||
|
||||
#define BIND_FUNC(func) [](ARMv7Thread& cpu){ cpu.last_function = #func; arm_func_detail::do_call(cpu, func); }
|
||||
|
||||
struct arm_va_args_t
|
||||
{
|
||||
u32 count; // Number of 32-bit args passed
|
||||
};
|
||||
|
||||
namespace arm_func_detail
|
||||
{
|
||||
enum arg_class : u32
|
||||
{
|
||||
ARG_GENERAL,
|
||||
ARG_FLOAT,
|
||||
ARG_VECTOR,
|
||||
ARG_STACK,
|
||||
ARG_CONTEXT,
|
||||
ARG_VARIADIC,
|
||||
ARG_UNKNOWN,
|
||||
};
|
||||
|
||||
static const auto FIXED_STACK_FRAME_SIZE = 0x80;
|
||||
|
||||
template<typename T, arg_class type, u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg
|
||||
{
|
||||
static_assert(type == ARG_GENERAL, "Unknown function argument type");
|
||||
static_assert(!std::is_pointer<T>::value, "Invalid function argument type (pointer)");
|
||||
static_assert(!std::is_reference<T>::value, "Invalid function argument type (reference)");
|
||||
static_assert(sizeof(T) <= 4, "Invalid function argument type for ARG_GENERAL");
|
||||
|
||||
force_inline static T get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
return arm_gpr_cast<T>(cpu.GPR[g_count - 1]);
|
||||
}
|
||||
|
||||
force_inline static void put_arg(ARMv7Thread& cpu, const T& arg)
|
||||
{
|
||||
cpu.GPR[g_count - 1] = arm_gpr_cast(arg);
|
||||
}
|
||||
};
|
||||
|
||||
template<u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg<u64, ARG_GENERAL, g_count, f_count, v_count>
|
||||
{
|
||||
// first u64 argument is passed in r0-r1, second one is passed in r2-r3 (if g_count = 3)
|
||||
static_assert(g_count == 2 || g_count == 4, "Wrong u64 argument position");
|
||||
|
||||
force_inline static u64 get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
return cpu.GPR_D[(g_count - 1) >> 1];
|
||||
}
|
||||
|
||||
force_inline static void put_arg(ARMv7Thread& cpu, u64 arg)
|
||||
{
|
||||
cpu.GPR_D[(g_count - 1) >> 1] = arg;
|
||||
}
|
||||
};
|
||||
|
||||
template<u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg<s64, ARG_GENERAL, g_count, f_count, v_count>
|
||||
{
|
||||
static_assert(g_count == 2 || g_count == 4, "Wrong s64 argument position");
|
||||
|
||||
force_inline static s64 get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
return cpu.GPR_D[(g_count - 1) >> 1];
|
||||
}
|
||||
|
||||
force_inline static void put_arg(ARMv7Thread& cpu, s64 arg)
|
||||
{
|
||||
cpu.GPR_D[(g_count - 1) >> 1] = arg;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg<T, ARG_FLOAT, g_count, f_count, v_count>
|
||||
{
|
||||
static_assert(f_count <= 0, "TODO: Unsupported argument type (float)");
|
||||
static_assert(sizeof(T) <= 8, "Invalid function argument type for ARG_FLOAT");
|
||||
|
||||
force_inline static T get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
}
|
||||
|
||||
force_inline static void put_arg(ARMv7Thread& cpu, const T& arg)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg<T, ARG_VECTOR, g_count, f_count, v_count>
|
||||
{
|
||||
static_assert(v_count <= 0, "TODO: Unsupported argument type (vector)");
|
||||
static_assert(std::is_same<CV T, CV v128>::value, "Invalid function argument type for ARG_VECTOR");
|
||||
|
||||
force_inline static T get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
}
|
||||
|
||||
force_inline static void put_arg(ARMv7Thread& cpu, const T& arg)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg<T, ARG_STACK, g_count, f_count, v_count>
|
||||
{
|
||||
static_assert(f_count <= 0, "TODO: Unsupported stack argument type (float)");
|
||||
static_assert(v_count <= 0, "TODO: Unsupported stack argument type (vector)");
|
||||
static_assert(sizeof(T) <= 4, "Invalid function argument type for ARG_STACK");
|
||||
|
||||
force_inline static T get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
// TODO: check
|
||||
return arm_gpr_cast<T, u32>(vm::psv::read32(cpu.SP + sizeof(u32) * (g_count - 5)));
|
||||
}
|
||||
|
||||
force_inline static void put_arg(ARMv7Thread& cpu, const T& arg)
|
||||
{
|
||||
// TODO: check
|
||||
const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE;
|
||||
static_assert(stack_pos < 0, "TODO: Increase fixed stack frame size (arg count limit broken)");
|
||||
|
||||
vm::psv::write32(cpu.SP + stack_pos, arm_gpr_cast(arg));
|
||||
}
|
||||
};
|
||||
|
||||
template<u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg<u64, ARG_STACK, g_count, f_count, v_count>
|
||||
{
|
||||
force_inline static u64 get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
// TODO: check
|
||||
return vm::psv::read64(cpu.SP + sizeof(u32) * (g_count - 6));
|
||||
}
|
||||
|
||||
force_inline static void put_arg(ARMv7Thread& cpu, u64 arg)
|
||||
{
|
||||
// TODO: check
|
||||
const int stack_pos = (g_count - 6) * 4 - FIXED_STACK_FRAME_SIZE;
|
||||
static_assert(stack_pos < -4, "TODO: Increase fixed stack frame size (arg count limit broken)");
|
||||
|
||||
vm::psv::write64(cpu.SP + stack_pos, arg);
|
||||
}
|
||||
};
|
||||
|
||||
template<u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg<s64, ARG_STACK, g_count, f_count, v_count>
|
||||
{
|
||||
force_inline static s64 get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
// TODO: check
|
||||
return vm::psv::read64(cpu.SP + sizeof(u32) * (g_count - 6));
|
||||
}
|
||||
|
||||
force_inline static void put_arg(ARMv7Thread& cpu, s64 arg)
|
||||
{
|
||||
// TODO: check
|
||||
const int stack_pos = (g_count - 6) * 4 - FIXED_STACK_FRAME_SIZE;
|
||||
static_assert(stack_pos < -4, "TODO: Increase fixed stack frame size (arg count limit broken)");
|
||||
|
||||
vm::psv::write64(cpu.SP + stack_pos, arg);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg<T, ARG_CONTEXT, g_count, f_count, v_count>
|
||||
{
|
||||
static_assert(std::is_same<T, ARMv7Thread&>::value, "Invalid function argument type for ARG_CONTEXT");
|
||||
|
||||
force_inline static ARMv7Thread& get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
return cpu;
|
||||
}
|
||||
|
||||
force_inline static void put_arg(ARMv7Thread& cpu, ARMv7Thread& arg)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, u32 g_count, u32 f_count, u32 v_count>
|
||||
struct bind_arg<T, ARG_VARIADIC, g_count, f_count, v_count>
|
||||
{
|
||||
static_assert(std::is_same<CV T, CV arm_va_args_t>::value, "Invalid function argument type for ARG_VARIADIC");
|
||||
|
||||
force_inline static arm_va_args_t get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
return{ g_count };
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, arg_class type>
|
||||
struct bind_result
|
||||
{
|
||||
static_assert(type != ARG_FLOAT, "TODO: Unsupported funcion result type (float)");
|
||||
static_assert(type != ARG_VECTOR, "TODO: Unsupported funcion result type (vector)");
|
||||
static_assert(type == ARG_GENERAL, "Wrong use of bind_result template");
|
||||
static_assert(sizeof(T) <= 4, "Invalid function result type for ARG_GENERAL");
|
||||
|
||||
force_inline static T get_result(ARMv7Thread& cpu)
|
||||
{
|
||||
return arm_gpr_cast<T>(cpu.GPR[0]);
|
||||
}
|
||||
|
||||
force_inline static void put_result(ARMv7Thread& cpu, const T& result)
|
||||
{
|
||||
cpu.GPR[0] = arm_gpr_cast(result);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct bind_result<u64, ARG_GENERAL>
|
||||
{
|
||||
force_inline static u64 get_result(ARMv7Thread& cpu)
|
||||
{
|
||||
return cpu.GPR_D[0];
|
||||
}
|
||||
|
||||
force_inline static void put_result(ARMv7Thread& cpu, u64 result)
|
||||
{
|
||||
cpu.GPR_D[0] = result;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct bind_result<s64, ARG_GENERAL>
|
||||
{
|
||||
force_inline static s64 get_result(ARMv7Thread& cpu)
|
||||
{
|
||||
return cpu.GPR_D[0];
|
||||
}
|
||||
|
||||
force_inline static void put_result(ARMv7Thread& cpu, s64 result)
|
||||
{
|
||||
cpu.GPR_D[0] = result;
|
||||
}
|
||||
};
|
||||
|
||||
//template<typename T>
|
||||
//struct bind_result<T, ARG_FLOAT>
|
||||
//{
|
||||
// static_assert(sizeof(T) <= 8, "Invalid function result type for ARG_FLOAT");
|
||||
|
||||
// static force_inline void put_result(ARMv7Thread& cpu, const T& result)
|
||||
// {
|
||||
// }
|
||||
//};
|
||||
|
||||
//template<typename T>
|
||||
//struct bind_result<T, ARG_VECTOR>
|
||||
//{
|
||||
// static_assert(std::is_same<std::remove_cv_t<T>, v128>::value, "Invalid function result type for ARG_VECTOR");
|
||||
|
||||
// static force_inline void put_result(ARMv7Thread& cpu, const T& result)
|
||||
// {
|
||||
// }
|
||||
//};
|
||||
|
||||
template<typename RT>
|
||||
struct result_type
|
||||
{
|
||||
static_assert(!std::is_pointer<RT>::value, "Invalid function result type (pointer)");
|
||||
static_assert(!std::is_reference<RT>::value, "Invalid function result type (reference)");
|
||||
static const bool is_float = std::is_floating_point<RT>::value;
|
||||
static const bool is_vector = std::is_same<CV RT, CV v128>::value;
|
||||
static const arg_class value = is_float ? ARG_FLOAT : (is_vector ? ARG_VECTOR : ARG_GENERAL);
|
||||
};
|
||||
|
||||
template<typename T, u32 g_count, u32 f_count, u32 v_count>
|
||||
struct arg_type
|
||||
{
|
||||
// TODO: check calculations
|
||||
static const bool is_float = std::is_floating_point<T>::value;
|
||||
static const bool is_vector = std::is_same<CV T, CV v128>::value;
|
||||
static const bool is_context = std::is_same<T, ARMv7Thread&>::value;
|
||||
static const bool is_variadic = std::is_same<CV T, CV arm_va_args_t>::value;
|
||||
static const bool is_general = !is_float && !is_vector && !is_context && !is_variadic;
|
||||
|
||||
static const u32 g_align = ALIGN_32(T) > 4 ? ALIGN_32(T) >> 2 : 1;
|
||||
static const u32 g_value = is_general ? ((g_count + (g_align - 1)) & ~(g_align - 1)) + (g_align) : g_count;
|
||||
static const u32 f_value = f_count + is_float;
|
||||
static const u32 v_value = v_count + is_vector;
|
||||
|
||||
static const arg_class value =
|
||||
is_general ? (g_value > 4 ? ARG_STACK : ARG_GENERAL) :
|
||||
is_float ? (f_value > 9000 ? ARG_STACK : ARG_FLOAT) :
|
||||
is_vector ? (v_value > 9000 ? ARG_STACK : ARG_VECTOR) :
|
||||
is_context ? ARG_CONTEXT :
|
||||
is_variadic ? ARG_VARIADIC :
|
||||
ARG_UNKNOWN;
|
||||
};
|
||||
|
||||
// wrapper for variadic argument info list, each value contains packed argument type and counts of GENERAL, FLOAT and VECTOR arguments
|
||||
template<u32... Values> struct arg_info_pack_t;
|
||||
|
||||
template<u32 First, u32... Values> struct arg_info_pack_t<First, Values...>
|
||||
{
|
||||
static const u32 last_value = arg_info_pack_t<Values...>::last_value;
|
||||
};
|
||||
|
||||
template<u32 First> struct arg_info_pack_t<First>
|
||||
{
|
||||
static const u32 last_value = First;
|
||||
};
|
||||
|
||||
template<> struct arg_info_pack_t<>
|
||||
{
|
||||
static const u32 last_value = 0;
|
||||
};
|
||||
|
||||
// argument type + g/f/v_count unpacker
|
||||
template<typename T, u32 type_pack> struct bind_arg_packed
|
||||
{
|
||||
force_inline static T get_arg(ARMv7Thread& cpu)
|
||||
{
|
||||
return bind_arg<T, static_cast<arg_class>(type_pack & 0xff), (type_pack >> 8) & 0xff, (type_pack >> 16) & 0xff, (type_pack >> 24)>::get_arg(cpu);
|
||||
}
|
||||
};
|
||||
|
||||
template<u32... Info, typename RT, typename... Args>
|
||||
force_inline RT call(ARMv7Thread& cpu, RT(*func)(Args...), arg_info_pack_t<Info...> info)
|
||||
{
|
||||
// do the actual function call when all arguments are prepared (simultaneous unpacking of Args... and Info...)
|
||||
return func(bind_arg_packed<Args, Info>::get_arg(cpu)...);
|
||||
}
|
||||
|
||||
template<typename T, typename... Types, u32... Info, typename RT, typename... Args>
|
||||
force_inline RT call(ARMv7Thread& cpu, RT(*func)(Args...), arg_info_pack_t<Info...> info)
|
||||
{
|
||||
// unpack previous type counts (0/0/0 for the first time)
|
||||
const u32 g_count = (info.last_value >> 8) & 0xff;
|
||||
const u32 f_count = (info.last_value >> 16) & 0xff;
|
||||
const u32 v_count = (info.last_value >> 24);
|
||||
|
||||
using type = arg_type<T, g_count, f_count, v_count>;
|
||||
const arg_class t = type::value;
|
||||
const u32 g = type::g_value;
|
||||
const u32 f = type::f_value;
|
||||
const u32 v = type::v_value;
|
||||
|
||||
return call<Types...>(cpu, func, arg_info_pack_t<Info..., t | (g << 8) | (f << 16) | (v << 24)>{});
|
||||
}
|
||||
|
||||
template<u32 g_count, u32 f_count, u32 v_count>
|
||||
force_inline static bool put_func_args(ARMv7Thread& cpu)
|
||||
{
|
||||
// terminator
|
||||
return false;
|
||||
}
|
||||
|
||||
template<u32 g_count, u32 f_count, u32 v_count, typename T1, typename... T>
|
||||
force_inline static bool put_func_args(ARMv7Thread& cpu, T1 arg, T... args)
|
||||
{
|
||||
using type = arg_type<T1, g_count, f_count, v_count>;
|
||||
const arg_class t = type::value;
|
||||
const u32 g = type::g_value;
|
||||
const u32 f = type::f_value;
|
||||
const u32 v = type::v_value;
|
||||
|
||||
bind_arg<T1, t, g, f, v>::put_arg(cpu, arg);
|
||||
|
||||
// return true if stack was used
|
||||
return put_func_args<g, f, v>(cpu, args...) || (t == ARG_STACK);
|
||||
}
|
||||
|
||||
template<typename RT, typename... T>
|
||||
struct func_binder;
|
||||
|
||||
template<typename... T>
|
||||
struct func_binder<void, T...>
|
||||
{
|
||||
using func_t = void(*)(T...);
|
||||
|
||||
static void do_call(ARMv7Thread& cpu, func_t func)
|
||||
{
|
||||
call<T...>(cpu, func, arg_info_pack_t<>{});
|
||||
}
|
||||
};
|
||||
|
||||
template<typename RT, typename... T>
|
||||
struct func_binder
|
||||
{
|
||||
using func_t = RT(*)(T...);
|
||||
|
||||
static void do_call(ARMv7Thread& cpu, func_t func)
|
||||
{
|
||||
bind_result<RT, result_type<RT>::value>::put_result(cpu, call<T...>(cpu, func, arg_info_pack_t<>{}));
|
||||
}
|
||||
};
|
||||
|
||||
template<typename RT, typename... T>
|
||||
struct func_caller
|
||||
{
|
||||
force_inline static RT call(ARMv7Thread& cpu, u32 addr, T... args)
|
||||
{
|
||||
func_caller<void, T...>::call(cpu, addr, args...);
|
||||
|
||||
return bind_result<RT, result_type<RT>::value>::get_result(cpu);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... T>
|
||||
struct func_caller<void, T...>
|
||||
{
|
||||
force_inline static void call(ARMv7Thread& cpu, u32 addr, T... args)
|
||||
{
|
||||
if (put_func_args<0, 0, 0, T...>(cpu, args...))
|
||||
{
|
||||
cpu.SP -= FIXED_STACK_FRAME_SIZE;
|
||||
cpu.fast_call(addr);
|
||||
cpu.SP += FIXED_STACK_FRAME_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
cpu.fast_call(addr);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename RT, typename... T> force_inline void do_call(ARMv7Thread& cpu, RT(*func)(T...))
|
||||
{
|
||||
func_binder<RT, T...>::do_call(cpu, func);
|
||||
}
|
||||
}
|
||||
|
||||
class arm_function_manager
|
||||
{
|
||||
// Global variable for each registered function
|
||||
template<typename T, T Func>
|
||||
struct registered
|
||||
{
|
||||
static u32 index;
|
||||
};
|
||||
|
||||
// Access global function list
|
||||
static never_inline auto& access()
|
||||
{
|
||||
static std::vector<arm_function_t> list
|
||||
{
|
||||
nullptr,
|
||||
[](ARMv7Thread& cpu) { cpu.state += cpu_state::ret; },
|
||||
};
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
static never_inline u32 add_function(arm_function_t function)
|
||||
{
|
||||
auto& list = access();
|
||||
|
||||
list.push_back(function);
|
||||
|
||||
return ::size32(list) - 1;
|
||||
}
|
||||
|
||||
public:
|
||||
// Register function (shall only be called during global initialization)
|
||||
template<typename T, T Func>
|
||||
static inline u32 register_function(arm_function_t func)
|
||||
{
|
||||
return registered<T, Func>::index = add_function(func);
|
||||
}
|
||||
|
||||
// Get function index
|
||||
template<typename T, T Func>
|
||||
static inline u32 get_index()
|
||||
{
|
||||
return registered<T, Func>::index;
|
||||
}
|
||||
|
||||
// Read all registered functions
|
||||
static inline const auto& get()
|
||||
{
|
||||
return access();
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, T Func>
|
||||
u32 arm_function_manager::registered<T, Func>::index = 0;
|
||||
|
||||
#define FIND_FUNC(func) arm_function_manager::get_index<decltype(&func), &func>()
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
578
rpcs3/Emu/ARMv7/ARMv7Module.cpp
Normal file
578
rpcs3/Emu/ARMv7/ARMv7Module.cpp
Normal file
@ -0,0 +1,578 @@
|
||||
#include "stdafx.h"
|
||||
#include "Loader/ELF.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/IdManager.h"
|
||||
|
||||
#include "ARMv7Thread.h"
|
||||
#include "ARMv7Opcodes.h"
|
||||
#include "ARMv7Function.h"
|
||||
#include "ARMv7Module.h"
|
||||
|
||||
extern void armv7_init_tls();
|
||||
|
||||
extern std::string arm_get_function_name(const std::string& module, u32 fnid);
|
||||
extern std::string arm_get_variable_name(const std::string& module, u32 vnid);
|
||||
|
||||
// Function lookup table. Not supposed to grow after emulation start.
|
||||
std::vector<arm_function_t> g_arm_function_cache;
|
||||
|
||||
extern void arm_execute_function(ARMv7Thread& cpu, u32 index)
|
||||
{
|
||||
if (index < g_arm_function_cache.size())
|
||||
{
|
||||
if (const auto func = g_arm_function_cache[index])
|
||||
{
|
||||
const auto previous_function = cpu.last_function; // TODO: use gsl::finally or something
|
||||
|
||||
try
|
||||
{
|
||||
func(cpu);
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
LOG_ERROR(ARMv7, "Function '%s' aborted", cpu.last_function);
|
||||
cpu.last_function = previous_function;
|
||||
throw;
|
||||
}
|
||||
catch (EmulationStopped)
|
||||
{
|
||||
LOG_WARNING(ARMv7, "Function '%s' aborted", cpu.last_function);
|
||||
cpu.last_function = previous_function;
|
||||
throw;
|
||||
}
|
||||
|
||||
LOG_TRACE(ARMv7, "Function '%s' finished, r0=0x%x", cpu.last_function, cpu.GPR[0]);
|
||||
cpu.last_function = previous_function;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
throw fmt::exception("Function not registered (%u)" HERE, index);
|
||||
}
|
||||
|
||||
arm_static_module::arm_static_module(const char* name)
|
||||
: name(name)
|
||||
{
|
||||
arm_module_manager::register_module(this);
|
||||
}
|
||||
|
||||
static void arm_initialize_modules()
|
||||
{
|
||||
const std::initializer_list<const arm_static_module*> registered
|
||||
{
|
||||
&arm_module_manager::SceAppMgr,
|
||||
&arm_module_manager::SceAppUtil,
|
||||
&arm_module_manager::SceAudio,
|
||||
&arm_module_manager::SceAudiodec,
|
||||
&arm_module_manager::SceAudioenc,
|
||||
&arm_module_manager::SceAudioIn,
|
||||
&arm_module_manager::SceCamera,
|
||||
&arm_module_manager::SceCodecEngine,
|
||||
&arm_module_manager::SceCommonDialog,
|
||||
&arm_module_manager::SceCpu,
|
||||
&arm_module_manager::SceCtrl,
|
||||
&arm_module_manager::SceDbg,
|
||||
&arm_module_manager::SceDebugLed,
|
||||
&arm_module_manager::SceDeci4p,
|
||||
&arm_module_manager::SceDeflt,
|
||||
&arm_module_manager::SceDipsw,
|
||||
&arm_module_manager::SceDisplay,
|
||||
&arm_module_manager::SceDisplayUser,
|
||||
&arm_module_manager::SceFiber,
|
||||
&arm_module_manager::SceFios,
|
||||
&arm_module_manager::SceFpu,
|
||||
&arm_module_manager::SceGxm,
|
||||
&arm_module_manager::SceHttp,
|
||||
&arm_module_manager::SceIme,
|
||||
&arm_module_manager::SceIofilemgr,
|
||||
&arm_module_manager::SceJpeg,
|
||||
&arm_module_manager::SceJpegEnc,
|
||||
&arm_module_manager::SceLibc,
|
||||
&arm_module_manager::SceLibKernel,
|
||||
&arm_module_manager::SceLibm,
|
||||
&arm_module_manager::SceLibstdcxx,
|
||||
&arm_module_manager::SceLibXml,
|
||||
&arm_module_manager::SceLiveArea,
|
||||
&arm_module_manager::SceLocation,
|
||||
&arm_module_manager::SceMd5,
|
||||
&arm_module_manager::SceModulemgr,
|
||||
&arm_module_manager::SceMotion,
|
||||
&arm_module_manager::SceMt19937,
|
||||
&arm_module_manager::SceNet,
|
||||
&arm_module_manager::SceNetCtl,
|
||||
&arm_module_manager::SceNgs,
|
||||
&arm_module_manager::SceNpBasic,
|
||||
&arm_module_manager::SceNpCommon,
|
||||
&arm_module_manager::SceNpManager,
|
||||
&arm_module_manager::SceNpMatching,
|
||||
&arm_module_manager::SceNpScore,
|
||||
&arm_module_manager::SceNpUtility,
|
||||
&arm_module_manager::ScePerf,
|
||||
&arm_module_manager::ScePgf,
|
||||
&arm_module_manager::ScePhotoExport,
|
||||
&arm_module_manager::SceProcessmgr,
|
||||
&arm_module_manager::SceRazorCapture,
|
||||
&arm_module_manager::SceRtc,
|
||||
&arm_module_manager::SceSas,
|
||||
&arm_module_manager::SceScreenShot,
|
||||
&arm_module_manager::SceSfmt,
|
||||
&arm_module_manager::SceSha,
|
||||
&arm_module_manager::SceSqlite,
|
||||
&arm_module_manager::SceSsl,
|
||||
&arm_module_manager::SceStdio,
|
||||
&arm_module_manager::SceSulpha,
|
||||
&arm_module_manager::SceSysmem,
|
||||
&arm_module_manager::SceSysmodule,
|
||||
&arm_module_manager::SceSystemGesture,
|
||||
&arm_module_manager::SceThreadmgr,
|
||||
&arm_module_manager::SceTouch,
|
||||
&arm_module_manager::SceUlt,
|
||||
&arm_module_manager::SceVideodec,
|
||||
&arm_module_manager::SceVoice,
|
||||
&arm_module_manager::SceVoiceQoS,
|
||||
};
|
||||
|
||||
// Reinitialize function cache
|
||||
g_arm_function_cache = arm_function_manager::get();
|
||||
|
||||
// "Use" all the modules for correct linkage
|
||||
for (auto& module : registered)
|
||||
{
|
||||
LOG_TRACE(LOADER, "Registered static module: %s", module->name);
|
||||
|
||||
for (auto& function : module->functions)
|
||||
{
|
||||
LOG_TRACE(LOADER, "** 0x%08X: %s", function.first, function.second.name);
|
||||
}
|
||||
|
||||
for (auto& variable : module->variables)
|
||||
{
|
||||
LOG_TRACE(LOADER, "** &0x%08X: %s (size=0x%x, align=0x%x)", variable.first, variable.second.name, variable.second.size, variable.second.align);
|
||||
variable.second.var->set(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct psv_moduleinfo_t
|
||||
{
|
||||
le_t<u16> attr; // ???
|
||||
u8 major; // ???
|
||||
u8 minor; // ???
|
||||
char name[24]; // ???
|
||||
le_t<u32> unk0;
|
||||
le_t<u32> unk1;
|
||||
le_t<u32> libent_top;
|
||||
le_t<u32> libent_end;
|
||||
le_t<u32> libstub_top;
|
||||
le_t<u32> libstub_end;
|
||||
le_t<u32> data[1]; // ...
|
||||
};
|
||||
|
||||
struct psv_libent_t
|
||||
{
|
||||
le_t<u16> size; // ???
|
||||
le_t<u16> unk0;
|
||||
le_t<u16> unk1;
|
||||
le_t<u16> fcount;
|
||||
le_t<u16> vcount;
|
||||
le_t<u16> unk2;
|
||||
le_t<u32> unk3;
|
||||
le_t<u32> data[1]; // ...
|
||||
};
|
||||
|
||||
struct psv_libstub_t
|
||||
{
|
||||
le_t<u16> size; // 0x2C, 0x34
|
||||
le_t<u16> unk0; // (usually 1, 5 for sceLibKernel)
|
||||
le_t<u16> unk1; // (usually 0)
|
||||
le_t<u16> fcount;
|
||||
le_t<u16> vcount;
|
||||
le_t<u16> unk2;
|
||||
le_t<u32> unk3;
|
||||
le_t<u32> data[1]; // ...
|
||||
};
|
||||
|
||||
struct psv_libcparam_t
|
||||
{
|
||||
le_t<u32> size;
|
||||
le_t<u32> unk0;
|
||||
|
||||
vm::lcptr<u32> sceLibcHeapSize;
|
||||
vm::lcptr<u32> sceLibcHeapSizeDefault;
|
||||
vm::lcptr<u32> sceLibcHeapExtendedAlloc;
|
||||
vm::lcptr<u32> sceLibcHeapDelayedAlloc;
|
||||
|
||||
le_t<u32> unk1;
|
||||
le_t<u32> unk2;
|
||||
|
||||
vm::lptr<u32> __sce_libcmallocreplace;
|
||||
vm::lptr<u32> __sce_libcnewreplace;
|
||||
};
|
||||
|
||||
struct psv_process_param_t
|
||||
{
|
||||
le_t<u32> size; // 0x00000030
|
||||
nse_t<u32> ver; // 'PSP2'
|
||||
le_t<u32> unk0; // 0x00000005
|
||||
le_t<u32> unk1;
|
||||
|
||||
vm::lcptr<char> sceUserMainThreadName;
|
||||
vm::lcptr<s32> sceUserMainThreadPriority;
|
||||
vm::lcptr<u32> sceUserMainThreadStackSize;
|
||||
vm::lcptr<u32> sceUserMainThreadAttribute;
|
||||
vm::lcptr<char> sceProcessName;
|
||||
vm::lcptr<u32> sce_process_preload_disabled;
|
||||
vm::lcptr<u32> sceUserMainThreadCpuAffinityMask;
|
||||
|
||||
vm::lcptr<psv_libcparam_t> sce_libcparam;
|
||||
};
|
||||
|
||||
static void arm_patch_refs(u32 refs, u32 addr)
|
||||
{
|
||||
auto ptr = vm::cptr<u32>::make(refs);
|
||||
LOG_NOTICE(LOADER, "**** Processing refs at 0x%x:", ptr);
|
||||
|
||||
if (ptr[0] != 0xff || ptr[1] != addr)
|
||||
{
|
||||
LOG_ERROR(LOADER, "**** Unexpected ref format ([0]=0x%x, [1]=0x%x)", ptr[0], ptr[1]);
|
||||
}
|
||||
else for (ptr += 2; *ptr; ptr++)
|
||||
{
|
||||
switch (u32 code = *ptr)
|
||||
{
|
||||
case 0x0000002f: // movw r*,# instruction
|
||||
{
|
||||
const u32 raddr = *++ptr;
|
||||
vm::write16(raddr + 0, vm::read16(raddr + 0) | (addr & 0x800) >> 1 | (addr & 0xf000) >> 12);
|
||||
vm::write16(raddr + 2, vm::read16(raddr + 2) | (addr & 0x700) << 4 | (addr & 0xff));
|
||||
|
||||
LOG_NOTICE(LOADER, "**** MOVW written at *0x%x", raddr);
|
||||
break;
|
||||
}
|
||||
case 0x00000030: // movt r*,# instruction
|
||||
{
|
||||
const u32 raddr = *++ptr;
|
||||
vm::write16(raddr + 0, vm::read16(raddr + 0) | (addr & 0x8000000) >> 17 | (addr & 0xf0000000) >> 28);
|
||||
vm::write16(raddr + 2, vm::read16(raddr + 2) | (addr & 0x7000000) >> 12 | (addr & 0xff0000) >> 16);
|
||||
|
||||
LOG_NOTICE(LOADER, "**** MOVT written at *0x%x", raddr);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
LOG_ERROR(LOADER, "**** Unknown ref code found (0x%08x)", code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
void arm_exec_loader::load() const
|
||||
{
|
||||
arm_initialize_modules();
|
||||
|
||||
vm::cptr<psv_moduleinfo_t> module_info{};
|
||||
vm::cptr<psv_libent_t> libent{};
|
||||
vm::cptr<psv_libstub_t> libstub{};
|
||||
vm::cptr<psv_process_param_t> proc_param{};
|
||||
|
||||
u32 entry_point{};
|
||||
u32 start_addr{};
|
||||
u32 arm_exidx{};
|
||||
u32 arm_extab{};
|
||||
u32 tls_faddr{};
|
||||
u32 tls_fsize{};
|
||||
u32 tls_vsize{};
|
||||
|
||||
for (const auto& prog : progs)
|
||||
{
|
||||
if (prog.p_type == 0x1 /* LOAD */ && prog.p_memsz)
|
||||
{
|
||||
if (!vm::falloc(prog.p_vaddr, prog.p_memsz, vm::main))
|
||||
{
|
||||
throw fmt::exception("vm::falloc() failed (addr=0x%x, size=0x%x)", prog.p_vaddr, prog.p_memsz);
|
||||
}
|
||||
|
||||
if (prog.p_paddr)
|
||||
{
|
||||
module_info.set(prog.p_vaddr + (prog.p_paddr - prog.p_offset));
|
||||
LOG_NOTICE(LOADER, "Found program with p_paddr=0x%x", prog.p_paddr);
|
||||
}
|
||||
|
||||
if (!start_addr)
|
||||
{
|
||||
start_addr = prog.p_vaddr;
|
||||
}
|
||||
|
||||
std::memcpy(vm::base(prog.p_vaddr), prog.bin.data(), prog.p_filesz);
|
||||
}
|
||||
}
|
||||
|
||||
if (!module_info) module_info.set(start_addr + header.e_entry);
|
||||
if (!libent) libent.set(start_addr + module_info->libent_top);
|
||||
if (!libstub) libstub.set(start_addr + module_info->libstub_top);
|
||||
|
||||
LOG_NOTICE(LOADER, "__sce_moduleinfo(*0x%x) analysis...", module_info);
|
||||
|
||||
if (module_info->data[2] == 0xffffffff)
|
||||
{
|
||||
arm_exidx = module_info->data[3];
|
||||
arm_extab = module_info->data[4];
|
||||
tls_faddr = module_info->data[5];
|
||||
tls_fsize = module_info->data[6];
|
||||
tls_vsize = module_info->data[7];
|
||||
}
|
||||
else if (module_info->data[5] == 0xffffffff)
|
||||
{
|
||||
tls_faddr = module_info->data[1]; // Guess
|
||||
tls_fsize = module_info->data[2];
|
||||
tls_vsize = module_info->data[3];
|
||||
arm_exidx = module_info->data[6];
|
||||
arm_extab = module_info->data[8];
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(LOADER, "Failed to recognize __sce_moduleinfo format");
|
||||
}
|
||||
|
||||
LOG_NOTICE(LOADER, "** arm_exidx=0x%x", arm_exidx);
|
||||
LOG_NOTICE(LOADER, "** arm_extab=0x%x", arm_extab);
|
||||
LOG_NOTICE(LOADER, "** tls_faddr=0x%x", tls_faddr);
|
||||
LOG_NOTICE(LOADER, "** tls_fsize=0x%x", tls_fsize);
|
||||
LOG_NOTICE(LOADER, "** tls_vsize=0x%x", tls_vsize);
|
||||
|
||||
Emu.SetTLSData(tls_faddr + start_addr, tls_fsize, tls_vsize);
|
||||
|
||||
// Process exports
|
||||
while (libent.addr() < start_addr + module_info->libent_end)
|
||||
{
|
||||
const u32 size = libent->size;
|
||||
|
||||
// TODO: check addresses
|
||||
if (size != 0x1c && size != 0x20)
|
||||
{
|
||||
LOG_ERROR(LOADER, "Unknown libent size (0x%x) at *0x%x", libent->size, libent);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_NOTICE(LOADER, "Loading libent at *0x%x", libent);
|
||||
LOG_NOTICE(LOADER, "** 0x%x, 0x%x", libent->unk0, libent->unk1);
|
||||
LOG_NOTICE(LOADER, "** Functions: %u", libent->fcount);
|
||||
LOG_NOTICE(LOADER, "** Variables: %u", libent->vcount);
|
||||
LOG_NOTICE(LOADER, "** 0x%x, 0x%08x", libent->unk2, libent->unk3);
|
||||
|
||||
const auto export_nids = vm::cptr<u32>::make(libent->data[size == 0x20 ? 2 : 1]);
|
||||
const auto export_data = vm::cptr<u32>::make(libent->data[size == 0x20 ? 3 : 2]);
|
||||
|
||||
for (u32 i = 0, count = export_data - export_nids; i < count; i++)
|
||||
{
|
||||
const u32 nid = export_nids[i];
|
||||
const u32 addr = export_data[i];
|
||||
|
||||
// Known exports
|
||||
switch (nid)
|
||||
{
|
||||
case 0x935cd196: // set entry point
|
||||
{
|
||||
entry_point = addr;
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x6c2224ba: // __sce_moduleinfo
|
||||
{
|
||||
ASSERT(addr == module_info.addr());
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x70fba1e7: // __sce_process_param
|
||||
{
|
||||
proc_param.set(addr);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
LOG_ERROR(LOADER, "** Unknown export '0x%08X' (*0x%x)", nid, addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Next entry
|
||||
libent.set(libent.addr() + libent->size);
|
||||
}
|
||||
|
||||
// Process imports
|
||||
while (libstub.addr() < start_addr + module_info->libstub_end)
|
||||
{
|
||||
const u32 size = libstub->size;
|
||||
|
||||
// TODO: check addresses
|
||||
if (size != 0x2c && size != 0x34)
|
||||
{
|
||||
LOG_ERROR(LOADER, "Unknown libstub size (0x%x) at *0x%x)", libstub->size, libstub);
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::string module_name(vm::_ptr<char>(libstub->data[size == 0x34 ? 1 : 0]));
|
||||
|
||||
LOG_NOTICE(LOADER, "Loading libstub at 0x%x: %s", libstub, module_name);
|
||||
|
||||
const auto _sm = arm_module_manager::get_module(module_name);
|
||||
|
||||
if (!_sm)
|
||||
{
|
||||
LOG_ERROR(LOADER, "** Unknown module '%s'", module_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Allocate HLE variables (TODO)
|
||||
for (auto& var : _sm->variables)
|
||||
{
|
||||
var.second.var->set(vm::alloc(var.second.size, vm::main, std::max<u32>(var.second.align, 4096)));
|
||||
LOG_WARNING(LOADER, "** Allocated variable '%s' in module '%s' at *0x%x", var.second.name, module_name, var.second.var->addr());
|
||||
}
|
||||
|
||||
// Initialize HLE variables (TODO)
|
||||
for (auto& var : _sm->variables)
|
||||
{
|
||||
var.second.init();
|
||||
}
|
||||
}
|
||||
|
||||
LOG_NOTICE(LOADER, "** 0x%x, 0x%x", libstub->unk0, libstub->unk1);
|
||||
LOG_NOTICE(LOADER, "** Functions: %u", libstub->fcount);
|
||||
LOG_NOTICE(LOADER, "** Variables: %u", libstub->vcount);
|
||||
LOG_NOTICE(LOADER, "** 0x%x, 0x%08x", libstub->unk2, libstub->unk3);
|
||||
|
||||
const auto fnids = vm::cptr<u32>::make(libstub->data[size == 0x34 ? 3 : 1]);
|
||||
const auto fstubs = vm::cptr<u32>::make(libstub->data[size == 0x34 ? 4 : 2]);
|
||||
|
||||
for (u32 j = 0; j < libstub->fcount; j++)
|
||||
{
|
||||
const u32 fnid = fnids[j];
|
||||
const u32 faddr = fstubs[j];
|
||||
|
||||
u32 index = 0;
|
||||
|
||||
const auto fstub = vm::ptr<u32>::make(faddr);
|
||||
const auto fname = arm_get_function_name(module_name, fnid);
|
||||
|
||||
if (_sm && _sm->functions.count(fnid))
|
||||
{
|
||||
index = _sm->functions.at(fnid).index;
|
||||
LOG_NOTICE(LOADER, "** Imported function '%s' in module '%s' (*0x%x)", fname, module_name, faddr);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
index = ::size32(g_arm_function_cache);
|
||||
g_arm_function_cache.emplace_back();
|
||||
|
||||
LOG_ERROR(LOADER, "** Unknown function '%s' in module '%s' (*0x%x) -> index %u", fname, module_name, faddr, index);
|
||||
}
|
||||
|
||||
// Check import stub
|
||||
if (fstub[2] != 0xE1A00000)
|
||||
{
|
||||
LOG_ERROR(LOADER, "**** Unexpected import function stub (*0x%x, [2]=0x%08x)", faddr, fstub[2]);
|
||||
}
|
||||
|
||||
// Process refs
|
||||
if (const u32 refs = fstub[3])
|
||||
{
|
||||
arm_patch_refs(refs, faddr);
|
||||
}
|
||||
|
||||
// Install HACK instruction (ARM)
|
||||
fstub[0] = 0xe0700090 | arm_code::hack<arm_encoding::A1>::index::insert(index);
|
||||
}
|
||||
|
||||
const auto vnids = vm::cptr<u32>::make(libstub->data[size == 0x34 ? 5 : 3]);
|
||||
const auto vstub = vm::cptr<u32>::make(libstub->data[size == 0x34 ? 6 : 4]);
|
||||
|
||||
for (u32 j = 0; j < libstub->vcount; j++)
|
||||
{
|
||||
const u32 vnid = vnids[j];
|
||||
const u32 refs = vstub[j];
|
||||
|
||||
// Static variable
|
||||
if (const auto _sv = _sm && _sm->variables.count(vnid) ? &_sm->variables.at(vnid) : nullptr)
|
||||
{
|
||||
LOG_NOTICE(LOADER, "** Imported variable '%s' in module '%s' (refs=*0x%x)", arm_get_variable_name(module_name, vnid), module_name, refs);
|
||||
arm_patch_refs(refs, _sv->var->addr());
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_FATAL(LOADER, "** Unknown variable '%s' in module '%s' (refs=*0x%x)", arm_get_variable_name(module_name, vnid), module_name, refs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Next lib
|
||||
libstub.set(libstub.addr() + size);
|
||||
}
|
||||
|
||||
LOG_NOTICE(LOADER, "__sce_process_param(*0x%x) analysis...", proc_param);
|
||||
|
||||
ASSERT(proc_param->size >= sizeof(psv_process_param_t));
|
||||
ASSERT(proc_param->ver == "PSP2"_u32);
|
||||
|
||||
LOG_NOTICE(LOADER, "*** size=0x%x; 0x%x, 0x%x, 0x%x", proc_param->size, proc_param->ver, proc_param->unk0, proc_param->unk1);
|
||||
|
||||
LOG_NOTICE(LOADER, "*** &sceUserMainThreadName = 0x%x", proc_param->sceUserMainThreadName);
|
||||
LOG_NOTICE(LOADER, "*** &sceUserMainThreadPriority = 0x%x", proc_param->sceUserMainThreadPriority);
|
||||
LOG_NOTICE(LOADER, "*** &sceUserMainThreadStackSize = 0x%x", proc_param->sceUserMainThreadStackSize);
|
||||
LOG_NOTICE(LOADER, "*** &sceUserMainThreadAttribute = 0x%x", proc_param->sceUserMainThreadAttribute);
|
||||
LOG_NOTICE(LOADER, "*** &sceProcessName = 0x%x", proc_param->sceProcessName);
|
||||
LOG_NOTICE(LOADER, "*** &sce_process_preload_disabled = 0x%x", proc_param->sce_process_preload_disabled);
|
||||
LOG_NOTICE(LOADER, "*** &sceUserMainThreadCpuAffinityMask = 0x%x", proc_param->sceUserMainThreadCpuAffinityMask);
|
||||
|
||||
const auto libc_param = proc_param->sce_libcparam;
|
||||
|
||||
LOG_NOTICE(LOADER, "__sce_libcparam(*0x%x) analysis...", libc_param);
|
||||
|
||||
ASSERT(libc_param->size >= 0x1c);
|
||||
|
||||
LOG_NOTICE(LOADER, "*** size=0x%x; 0x%x, 0x%x, 0x%x", libc_param->size, libc_param->unk0, libc_param->unk1, libc_param->unk2);
|
||||
|
||||
LOG_NOTICE(LOADER, "*** &sceLibcHeapSize = 0x%x", libc_param->sceLibcHeapSize);
|
||||
LOG_NOTICE(LOADER, "*** &sceLibcHeapSizeDefault = 0x%x", libc_param->sceLibcHeapSizeDefault);
|
||||
LOG_NOTICE(LOADER, "*** &sceLibcHeapExtendedAlloc = 0x%x", libc_param->sceLibcHeapExtendedAlloc);
|
||||
LOG_NOTICE(LOADER, "*** &sceLibcHeapDelayedAlloc = 0x%x", libc_param->sceLibcHeapDelayedAlloc);
|
||||
|
||||
const auto stop_code = vm::ptr<u32>::make(vm::alloc(3 * 4, vm::main));
|
||||
stop_code[0] = 0xf870; // HACK instruction (Thumb)
|
||||
stop_code[1] = 1; // Predefined function index (HLE return)
|
||||
Emu.SetCPUThreadStop(stop_code.addr());
|
||||
|
||||
armv7_init_tls();
|
||||
|
||||
const std::string& thread_name = proc_param->sceUserMainThreadName ? proc_param->sceUserMainThreadName.get_ptr() : "main_thread";
|
||||
const u32 stack_size = proc_param->sceUserMainThreadStackSize ? proc_param->sceUserMainThreadStackSize->value() : 256 * 1024;
|
||||
const u32 priority = proc_param->sceUserMainThreadPriority ? proc_param->sceUserMainThreadPriority->value() : 160;
|
||||
|
||||
auto thread = idm::make_ptr<ARMv7Thread>(thread_name);
|
||||
|
||||
thread->PC = entry_point;
|
||||
thread->stack_size = stack_size;
|
||||
thread->prio = priority;
|
||||
thread->cpu_init();
|
||||
|
||||
// Initialize args
|
||||
std::vector<char> argv_data;
|
||||
|
||||
for (const auto& arg : { Emu.GetPath(), "-emu"s })
|
||||
{
|
||||
argv_data.insert(argv_data.end(), arg.begin(), arg.end());
|
||||
argv_data.insert(argv_data.end(), '\0');
|
||||
|
||||
thread->GPR[0]++; // argc
|
||||
}
|
||||
|
||||
const u32 argv = vm::alloc(::size32(argv_data), vm::main);
|
||||
std::memcpy(vm::base(argv), argv_data.data(), argv_data.size()); // copy arg list
|
||||
thread->GPR[1] = argv;
|
||||
}
|
222
rpcs3/Emu/ARMv7/ARMv7Module.h
Normal file
222
rpcs3/Emu/ARMv7/ARMv7Module.h
Normal file
@ -0,0 +1,222 @@
|
||||
#pragma once
|
||||
|
||||
#include "Utilities/Config.h"
|
||||
#include "ARMv7Function.h"
|
||||
#include "ARMv7Callback.h"
|
||||
#include "ErrorCodes.h"
|
||||
|
||||
namespace vm { using namespace psv; }
|
||||
|
||||
// HLE function information
|
||||
struct arm_static_function
|
||||
{
|
||||
const char* name;
|
||||
u32 index; // Index for arm_function_manager
|
||||
u32 flags;
|
||||
};
|
||||
|
||||
// HLE variable information
|
||||
struct arm_static_variable
|
||||
{
|
||||
const char* name;
|
||||
vm::gvar<void>* var; // Pointer to variable address storage
|
||||
void(*init)(); // Variable initialization function
|
||||
u32 size;
|
||||
u32 align;
|
||||
};
|
||||
|
||||
// HLE module information
|
||||
class arm_static_module final
|
||||
{
|
||||
public:
|
||||
const std::string name;
|
||||
|
||||
task_stack on_load;
|
||||
task_stack on_unload;
|
||||
|
||||
std::unordered_map<u32, arm_static_function> functions;
|
||||
std::unordered_map<u32, arm_static_variable> variables;
|
||||
|
||||
public:
|
||||
arm_static_module(const char* name);
|
||||
|
||||
arm_static_module(const char* name, void(*init)())
|
||||
: arm_static_module(name)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
arm_static_module(const char* name, void(*init)(arm_static_module* _this))
|
||||
: arm_static_module(name)
|
||||
{
|
||||
init(this);
|
||||
}
|
||||
};
|
||||
|
||||
class arm_module_manager final
|
||||
{
|
||||
friend class arm_static_module;
|
||||
|
||||
static never_inline auto& access()
|
||||
{
|
||||
static std::unordered_map<std::string, arm_static_module*> map;
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
static never_inline void register_module(arm_static_module* module)
|
||||
{
|
||||
access().emplace(module->name, module);
|
||||
}
|
||||
|
||||
static never_inline auto& access_static_function(const char* module, u32 fnid)
|
||||
{
|
||||
return access().at(module)->functions[fnid];
|
||||
}
|
||||
|
||||
static never_inline auto& access_static_variable(const char* module, u32 vnid)
|
||||
{
|
||||
return access().at(module)->variables[vnid];
|
||||
}
|
||||
|
||||
public:
|
||||
static never_inline const arm_static_module* get_module(const std::string& name)
|
||||
{
|
||||
const auto& map = access();
|
||||
const auto found = map.find(name);
|
||||
return found != map.end() ? found->second : nullptr;
|
||||
}
|
||||
|
||||
template<typename T, T Func>
|
||||
static void register_static_function(const char* module, const char* name, arm_function_t func, u32 fnid, u32 flags)
|
||||
{
|
||||
auto& info = access_static_function(module, fnid);
|
||||
|
||||
info.name = name;
|
||||
info.index = arm_function_manager::register_function<T, Func>(func);
|
||||
info.flags = flags;
|
||||
}
|
||||
|
||||
template<typename T, T* Var>
|
||||
static void register_static_variable(const char* module, const char* name, u32 vnid, void(*init)())
|
||||
{
|
||||
static_assert(std::is_same<u32, typename T::addr_type>::value, "Static variable registration: vm::gvar<T> expected");
|
||||
|
||||
auto& info = access_static_variable(module, vnid);
|
||||
|
||||
info.name = name;
|
||||
info.var = reinterpret_cast<vm::gvar<void>*>(Var);
|
||||
info.init = init ? init : [] {};
|
||||
info.size = SIZE_32(typename T::type);
|
||||
info.align = ALIGN_32(typename T::type);
|
||||
}
|
||||
|
||||
static const arm_static_module SceAppMgr;
|
||||
static const arm_static_module SceAppUtil;
|
||||
static const arm_static_module SceAudio;
|
||||
static const arm_static_module SceAudiodec;
|
||||
static const arm_static_module SceAudioenc;
|
||||
static const arm_static_module SceAudioIn;
|
||||
static const arm_static_module SceCamera;
|
||||
static const arm_static_module SceCodecEngine;
|
||||
static const arm_static_module SceCommonDialog;
|
||||
static const arm_static_module SceCpu;
|
||||
static const arm_static_module SceCtrl;
|
||||
static const arm_static_module SceDbg;
|
||||
static const arm_static_module SceDebugLed;
|
||||
static const arm_static_module SceDeci4p;
|
||||
static const arm_static_module SceDeflt;
|
||||
static const arm_static_module SceDipsw;
|
||||
static const arm_static_module SceDisplay;
|
||||
static const arm_static_module SceDisplayUser;
|
||||
static const arm_static_module SceFiber;
|
||||
static const arm_static_module SceFios;
|
||||
static const arm_static_module SceFpu;
|
||||
static const arm_static_module SceGxm;
|
||||
static const arm_static_module SceHttp;
|
||||
static const arm_static_module SceIme;
|
||||
static const arm_static_module SceIofilemgr;
|
||||
static const arm_static_module SceJpeg;
|
||||
static const arm_static_module SceJpegEnc;
|
||||
static const arm_static_module SceLibc;
|
||||
static const arm_static_module SceLibKernel;
|
||||
static const arm_static_module SceLibm;
|
||||
static const arm_static_module SceLibstdcxx;
|
||||
static const arm_static_module SceLibXml;
|
||||
static const arm_static_module SceLiveArea;
|
||||
static const arm_static_module SceLocation;
|
||||
static const arm_static_module SceMd5;
|
||||
static const arm_static_module SceModulemgr;
|
||||
static const arm_static_module SceMotion;
|
||||
static const arm_static_module SceMt19937;
|
||||
static const arm_static_module SceNet;
|
||||
static const arm_static_module SceNetCtl;
|
||||
static const arm_static_module SceNgs;
|
||||
static const arm_static_module SceNpBasic;
|
||||
static const arm_static_module SceNpCommon;
|
||||
static const arm_static_module SceNpManager;
|
||||
static const arm_static_module SceNpMatching;
|
||||
static const arm_static_module SceNpScore;
|
||||
static const arm_static_module SceNpUtility;
|
||||
static const arm_static_module ScePerf;
|
||||
static const arm_static_module ScePgf;
|
||||
static const arm_static_module ScePhotoExport;
|
||||
static const arm_static_module SceProcessmgr;
|
||||
static const arm_static_module SceRazorCapture;
|
||||
static const arm_static_module SceRtc;
|
||||
static const arm_static_module SceSas;
|
||||
static const arm_static_module SceScreenShot;
|
||||
static const arm_static_module SceSfmt;
|
||||
static const arm_static_module SceSha;
|
||||
static const arm_static_module SceSqlite;
|
||||
static const arm_static_module SceSsl;
|
||||
static const arm_static_module SceStdio;
|
||||
static const arm_static_module SceSulpha;
|
||||
static const arm_static_module SceSysmem;
|
||||
static const arm_static_module SceSysmodule;
|
||||
static const arm_static_module SceSystemGesture;
|
||||
static const arm_static_module SceThreadmgr;
|
||||
static const arm_static_module SceTouch;
|
||||
static const arm_static_module SceUlt;
|
||||
static const arm_static_module SceVideodec;
|
||||
static const arm_static_module SceVoice;
|
||||
static const arm_static_module SceVoiceQoS;
|
||||
};
|
||||
|
||||
#define REG_FNID(module, nid, func, ...) arm_module_manager::register_static_function<decltype(&func), &func>(#module, #func, BIND_FUNC(func), nid, {__VA_ARGS__})
|
||||
|
||||
#define REG_VNID(module, nid, var, ...) arm_module_manager::register_static_variable<decltype(var), &var>(#module, #var, nid, {__VA_ARGS__})
|
||||
|
||||
struct SceDateTime
|
||||
{
|
||||
le_t<u16> year;
|
||||
le_t<u16> month;
|
||||
le_t<u16> day;
|
||||
le_t<u16> hour;
|
||||
le_t<u16> minute;
|
||||
le_t<u16> second;
|
||||
le_t<u32> microsecond;
|
||||
};
|
||||
|
||||
struct SceFVector3
|
||||
{
|
||||
le_t<f32> x, y, z;
|
||||
};
|
||||
|
||||
struct SceFQuaternion
|
||||
{
|
||||
le_t<f32> x, y, z, w;
|
||||
};
|
||||
|
||||
union SceUMatrix4
|
||||
{
|
||||
struct
|
||||
{
|
||||
le_t<f32> f[4][4];
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
le_t<s32> i[4][4];
|
||||
};
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@ -1,25 +1,20 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/state.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
|
||||
#include "ARMv7Thread.h"
|
||||
#include "ARMv7Decoder.h"
|
||||
#include "ARMv7DisAsm.h"
|
||||
#include "ARMv7Opcodes.h"
|
||||
#include "ARMv7Interpreter.h"
|
||||
|
||||
void ARMv7Context::fast_call(u32 addr)
|
||||
{
|
||||
return static_cast<ARMv7Thread*>(this)->fast_call(addr);
|
||||
}
|
||||
namespace vm { using namespace psv; }
|
||||
|
||||
const arm_decoder<arm_interpreter> s_arm_interpreter;
|
||||
|
||||
#define TLS_MAX 128
|
||||
|
||||
u32 g_armv7_tls_start;
|
||||
|
||||
std::array<std::atomic<u32>, TLS_MAX> g_armv7_tls_owners;
|
||||
std::array<atomic_t<u32>, TLS_MAX> g_armv7_tls_owners;
|
||||
|
||||
void armv7_init_tls()
|
||||
{
|
||||
@ -48,8 +43,7 @@ u32 armv7_get_tls(u32 thread)
|
||||
|
||||
for (u32 i = 0; i < TLS_MAX; i++)
|
||||
{
|
||||
u32 old = 0;
|
||||
if (g_armv7_tls_owners[i].compare_exchange_strong(old, thread))
|
||||
if (g_armv7_tls_owners[i].compare_and_swap_test(0, thread))
|
||||
{
|
||||
const u32 addr = g_armv7_tls_start + i * Emu.GetTLSMemsz(); // get TLS address
|
||||
std::memcpy(vm::base(addr), vm::base(Emu.GetTLSAddr()), Emu.GetTLSFilesz()); // initialize from TLS image
|
||||
@ -70,57 +64,38 @@ void armv7_free_tls(u32 thread)
|
||||
|
||||
for (auto& v : g_armv7_tls_owners)
|
||||
{
|
||||
u32 old = thread;
|
||||
if (v.compare_exchange_strong(old, 0))
|
||||
if (v.compare_and_swap_test(thread, 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARMv7Thread::ARMv7Thread(const std::string& name)
|
||||
: CPUThread(CPU_THREAD_ARMv7, name)
|
||||
, ARMv7Context({})
|
||||
{
|
||||
}
|
||||
|
||||
ARMv7Thread::~ARMv7Thread()
|
||||
{
|
||||
close_stack();
|
||||
armv7_free_tls(m_id);
|
||||
}
|
||||
|
||||
std::string ARMv7Thread::get_name() const
|
||||
{
|
||||
return fmt::format("ARMv7 Thread[0x%x] (%s)[0x%08x]", m_id, CPUThread::get_name(), PC);
|
||||
return fmt::format("ARMv7[0x%x] Thread (%s)", id, name);
|
||||
}
|
||||
|
||||
void ARMv7Thread::dump_info() const
|
||||
std::string ARMv7Thread::dump() const
|
||||
{
|
||||
if (hle_func)
|
||||
std::string result = "Registers:\n=========\n";
|
||||
for(int i=0; i<15; ++i)
|
||||
{
|
||||
const auto func = get_psv_func_by_nid(hle_func);
|
||||
|
||||
LOG_SUCCESS(HLE, "Last function: %s (0x%x)", func ? func->name : "?????????", hle_func);
|
||||
result += fmt::format("r%u\t= 0x%08x\n", i, GPR[i]);
|
||||
}
|
||||
|
||||
CPUThread::dump_info();
|
||||
result += fmt::format("APSR\t= 0x%08x [N: %d, Z: %d, C: %d, V: %d, Q: %d]\n",
|
||||
APSR.APSR,
|
||||
u32{ APSR.N },
|
||||
u32{ APSR.Z },
|
||||
u32{ APSR.C },
|
||||
u32{ APSR.V },
|
||||
u32{ APSR.Q });
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void ARMv7Thread::init_regs()
|
||||
{
|
||||
memset(GPR, 0, sizeof(GPR));
|
||||
APSR.APSR = 0;
|
||||
IPSR.IPSR = 0;
|
||||
ISET = PC & 1 ? Thumb : ARM; // select instruction set
|
||||
PC = PC & ~1; // and fix PC
|
||||
ITSTATE.IT = 0;
|
||||
SP = stack_addr + stack_size;
|
||||
TLS = armv7_get_tls(m_id);
|
||||
debug = DF_DISASM | DF_PRINT;
|
||||
}
|
||||
|
||||
void ARMv7Thread::init_stack()
|
||||
void ARMv7Thread::cpu_init()
|
||||
{
|
||||
if (!stack_addr)
|
||||
{
|
||||
@ -136,60 +111,15 @@ void ARMv7Thread::init_stack()
|
||||
throw EXCEPTION("Out of stack memory");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ARMv7Thread::close_stack()
|
||||
{
|
||||
if (stack_addr)
|
||||
{
|
||||
vm::dealloc_verbose_nothrow(stack_addr, vm::main);
|
||||
stack_addr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
std::string ARMv7Thread::RegsToString() const
|
||||
{
|
||||
std::string result = "Registers:\n=========\n";
|
||||
for(int i=0; i<15; ++i)
|
||||
{
|
||||
result += fmt::format("%s\t= 0x%08x\n", g_arm_reg_name[i], GPR[i]);
|
||||
}
|
||||
|
||||
result += fmt::format("APSR\t= 0x%08x [N: %d, Z: %d, C: %d, V: %d, Q: %d]\n",
|
||||
APSR.APSR,
|
||||
u32{ APSR.N },
|
||||
u32{ APSR.Z },
|
||||
u32{ APSR.C },
|
||||
u32{ APSR.V },
|
||||
u32{ APSR.Q });
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string ARMv7Thread::ReadRegString(const std::string& reg) const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
bool ARMv7Thread::WriteRegString(const std::string& reg, std::string value)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void ARMv7Thread::do_run()
|
||||
{
|
||||
m_dec.reset();
|
||||
|
||||
switch((int)rpcs3::state.config.core.ppu_decoder.value())
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
m_dec.reset(new ARMv7Decoder(*this));
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR(ARMv7, "Invalid CPU decoder mode: %d", (int)rpcs3::state.config.core.ppu_decoder.value());
|
||||
Emu.Pause();
|
||||
}
|
||||
memset(GPR, 0, sizeof(GPR));
|
||||
APSR.APSR = 0;
|
||||
IPSR.IPSR = 0;
|
||||
ISET = PC & 1 ? Thumb : ARM; // select instruction set
|
||||
PC = PC & ~1; // and fix PC
|
||||
ITSTATE.IT = 0;
|
||||
SP = stack_addr + stack_size;
|
||||
TLS = armv7_get_tls(id);
|
||||
}
|
||||
|
||||
void ARMv7Thread::cpu_task()
|
||||
@ -201,10 +131,54 @@ void ARMv7Thread::cpu_task()
|
||||
return custom_task(*this);
|
||||
}
|
||||
|
||||
while (!m_state || !check_status())
|
||||
_log::g_tls_make_prefix = [](const auto&, auto, const auto&)
|
||||
{
|
||||
// decode instruction using specified decoder
|
||||
PC += m_dec->DecodeMemory(PC);
|
||||
const auto cpu = static_cast<ARMv7Thread*>(get_current_cpu_thread());
|
||||
|
||||
return fmt::format("%s [0x%08x]", cpu->get_name(), cpu->PC);
|
||||
};
|
||||
|
||||
while (!state.load() || !check_status())
|
||||
{
|
||||
if (ISET == Thumb)
|
||||
{
|
||||
const u16 op16 = vm::read16(PC);
|
||||
const u32 cond = ITSTATE.advance();
|
||||
|
||||
if (const auto func16 = s_arm_interpreter.decode_thumb(op16))
|
||||
{
|
||||
func16(*this, op16, cond);
|
||||
PC += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
const u32 op32 = (op16 << 16) | vm::read16(PC + 2);
|
||||
|
||||
s_arm_interpreter.decode_thumb(op32)(*this, op32, cond);
|
||||
PC += 4;
|
||||
}
|
||||
}
|
||||
else if (ISET == ARM)
|
||||
{
|
||||
const u32 op = vm::read32(PC);
|
||||
|
||||
s_arm_interpreter.decode_arm(op)(*this, op, op >> 28);
|
||||
PC += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw fmt::exception("Invalid instruction set" HERE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARMv7Thread::~ARMv7Thread()
|
||||
{
|
||||
armv7_free_tls(id);
|
||||
|
||||
if (stack_addr)
|
||||
{
|
||||
vm::dealloc_verbose_nothrow(stack_addr, vm::main);
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,11 +202,13 @@ void ARMv7Thread::fast_call(u32 addr)
|
||||
{
|
||||
cpu_task();
|
||||
}
|
||||
catch (CPUThreadReturn)
|
||||
catch (cpu_state _s)
|
||||
{
|
||||
state += _s;
|
||||
if (_s != cpu_state::ret) throw;
|
||||
}
|
||||
|
||||
m_state &= ~CPU_STATE_RETURN;
|
||||
state -= cpu_state::ret;
|
||||
|
||||
PC = old_PC;
|
||||
|
||||
@ -244,67 +220,3 @@ void ARMv7Thread::fast_call(u32 addr)
|
||||
LR = old_LR;
|
||||
custom_task = std::move(old_task);
|
||||
}
|
||||
|
||||
void ARMv7Thread::fast_stop()
|
||||
{
|
||||
m_state |= CPU_STATE_RETURN;
|
||||
}
|
||||
|
||||
armv7_thread::armv7_thread(u32 entry, const std::string& name, u32 stack_size, s32 prio)
|
||||
{
|
||||
std::shared_ptr<ARMv7Thread> armv7 = idm::make_ptr<ARMv7Thread>(name);
|
||||
|
||||
armv7->PC = entry;
|
||||
armv7->stack_size = stack_size;
|
||||
armv7->prio = prio;
|
||||
|
||||
thread = std::move(armv7);
|
||||
|
||||
argc = 0;
|
||||
}
|
||||
|
||||
cpu_thread& armv7_thread::args(std::initializer_list<std::string> values)
|
||||
{
|
||||
assert(argc == 0);
|
||||
|
||||
if (!values.size())
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::vector<char> argv_data;
|
||||
u32 argv_size = 0;
|
||||
|
||||
for (auto& arg : values)
|
||||
{
|
||||
const u32 arg_size = arg.size(); // get arg size
|
||||
|
||||
for (char c : arg)
|
||||
{
|
||||
argv_data.push_back(c); // append characters
|
||||
}
|
||||
|
||||
argv_data.push_back('\0'); // append null terminator
|
||||
|
||||
argv_size += arg_size + 1;
|
||||
argc++;
|
||||
}
|
||||
|
||||
argv = vm::alloc(argv_size, vm::main); // allocate arg list
|
||||
std::memcpy(vm::base(argv), argv_data.data(), argv_size); // copy arg list
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
cpu_thread& armv7_thread::run()
|
||||
{
|
||||
auto& armv7 = static_cast<ARMv7Thread&>(*thread);
|
||||
|
||||
armv7.run();
|
||||
|
||||
// set arguments
|
||||
armv7.GPR[0] = argc;
|
||||
armv7.GPR[1] = argv;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
@ -1,44 +1,271 @@
|
||||
#pragma once
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
#include "ARMv7Context.h"
|
||||
|
||||
class ARMv7Thread final : public CPUThread, public ARMv7Context
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
#include "Emu/Memory/vm.h"
|
||||
|
||||
enum ARMv7InstructionSet
|
||||
{
|
||||
ARM,
|
||||
Thumb,
|
||||
Jazelle,
|
||||
ThumbEE
|
||||
};
|
||||
|
||||
class ARMv7Thread final : public cpu_thread
|
||||
{
|
||||
public:
|
||||
std::function<void(ARMv7Thread&)> custom_task;
|
||||
|
||||
public:
|
||||
ARMv7Thread(const std::string& name);
|
||||
virtual ~ARMv7Thread() override;
|
||||
|
||||
virtual std::string get_name() const override;
|
||||
virtual void dump_info() const override;
|
||||
virtual u32 get_pc() const override { return PC; }
|
||||
virtual u32 get_offset() const override { return 0; }
|
||||
virtual void do_run() override;
|
||||
virtual std::string dump() const override;
|
||||
virtual void cpu_init() override;
|
||||
virtual void cpu_task() override;
|
||||
|
||||
virtual void init_regs() override;
|
||||
virtual void init_stack() override;
|
||||
virtual void close_stack() override;
|
||||
u32 get_stack_arg(u32 pos);
|
||||
ARMv7Thread(const std::string& name)
|
||||
: cpu_thread(cpu_type::arm, name)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~ARMv7Thread() override;
|
||||
|
||||
union
|
||||
{
|
||||
u32 GPR[15];
|
||||
|
||||
struct
|
||||
{
|
||||
u32 pad[13];
|
||||
|
||||
union
|
||||
{
|
||||
u32 SP;
|
||||
|
||||
struct { u16 SP_main, SP_process; };
|
||||
};
|
||||
|
||||
u32 LR;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u32 reserved0 : 16;
|
||||
u32 GE : 4;
|
||||
u32 reserved1 : 4;
|
||||
u32 dummy : 3;
|
||||
u32 Q : 1; // Set to 1 if an SSAT or USAT instruction changes (saturates) the input value for the signed or unsigned range of the result
|
||||
u32 V : 1; // Overflow condition code flag
|
||||
u32 C : 1; // Carry condition code flag
|
||||
u32 Z : 1; // Zero condition code flag
|
||||
u32 N : 1; // Negative condition code flag
|
||||
};
|
||||
|
||||
u32 APSR;
|
||||
|
||||
} APSR;
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
u64 GPR_D[8];
|
||||
};
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u32 dummy : 24;
|
||||
u32 exception : 8;
|
||||
};
|
||||
|
||||
u32 IPSR;
|
||||
|
||||
} IPSR;
|
||||
|
||||
ARMv7InstructionSet ISET;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u8 shift_state : 5;
|
||||
u8 cond_base : 3;
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
u8 check_state : 4;
|
||||
u8 condition : 4;
|
||||
};
|
||||
|
||||
u8 IT;
|
||||
|
||||
u32 advance()
|
||||
{
|
||||
// 0xf is "always true" and indicates that this instruction was not in IT block.
|
||||
// 0xe is "always true" too and represents the AL condition of IT block.
|
||||
// This makes a significant difference in some instructions.
|
||||
const u32 res = check_state ? condition : 0xf;
|
||||
|
||||
shift_state <<= 1;
|
||||
if (!check_state)
|
||||
{
|
||||
IT = 0; // clear
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return check_state != 0;
|
||||
}
|
||||
|
||||
} ITSTATE;
|
||||
|
||||
u32 TLS = 0;
|
||||
|
||||
struct perf_counter
|
||||
{
|
||||
u32 event;
|
||||
u32 value;
|
||||
};
|
||||
|
||||
std::array<perf_counter, 6> counters{};
|
||||
|
||||
u32 PC = 0;
|
||||
s32 prio = 0;
|
||||
u32 stack_addr = 0;
|
||||
u32 stack_size = 0;
|
||||
|
||||
std::function<void(ARMv7Thread&)> custom_task;
|
||||
|
||||
const char* last_function = nullptr;
|
||||
|
||||
void write_pc(u32 value, u32 size)
|
||||
{
|
||||
ISET = value & 1 ? Thumb : ARM;
|
||||
PC = (value & ~1) - size;
|
||||
}
|
||||
|
||||
u32 read_pc()
|
||||
{
|
||||
return ISET == ARM ? PC + 8 : PC + 4;
|
||||
}
|
||||
|
||||
u32 get_stack_arg(u32 pos)
|
||||
{
|
||||
return vm::psv::read32(SP + sizeof(u32) * (pos - 5));
|
||||
}
|
||||
|
||||
void write_gpr(u32 n, u32 value, u32 size)
|
||||
{
|
||||
Expects(n < 16);
|
||||
|
||||
if (n < 15)
|
||||
{
|
||||
GPR[n] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
write_pc(value, size);
|
||||
}
|
||||
}
|
||||
|
||||
u32 read_gpr(u32 n)
|
||||
{
|
||||
Expects(n < 16);
|
||||
|
||||
if (n < 15)
|
||||
{
|
||||
return GPR[n];
|
||||
}
|
||||
|
||||
return read_pc();
|
||||
}
|
||||
|
||||
// function for processing va_args in printf-like functions
|
||||
u32 get_next_gpr_arg(u32& g_count)
|
||||
{
|
||||
if (g_count < 4)
|
||||
{
|
||||
return GPR[g_count++];
|
||||
}
|
||||
else
|
||||
{
|
||||
return get_stack_arg(g_count++);
|
||||
}
|
||||
}
|
||||
|
||||
void fast_call(u32 addr);
|
||||
void fast_stop();
|
||||
|
||||
virtual std::string RegsToString() const override;
|
||||
virtual std::string ReadRegString(const std::string& reg) const override;
|
||||
virtual bool WriteRegString(const std::string& reg, std::string value) override;
|
||||
};
|
||||
|
||||
class armv7_thread : cpu_thread
|
||||
template<typename T, typename = void>
|
||||
struct arm_gpr_cast_impl
|
||||
{
|
||||
u32 argv;
|
||||
u32 argc;
|
||||
|
||||
public:
|
||||
armv7_thread(u32 entry, const std::string& name, u32 stack_size, s32 prio);
|
||||
|
||||
cpu_thread& args(std::initializer_list<std::string> values) override;
|
||||
|
||||
cpu_thread& run() override;
|
||||
static_assert(!sizeof(T), "Invalid type for arm_gpr_cast<>");
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct arm_gpr_cast_impl<T, std::enable_if_t<std::is_integral<T>::value || std::is_enum<T>::value>>
|
||||
{
|
||||
static_assert(sizeof(T) <= 4, "Too big integral type for arm_gpr_cast<>()");
|
||||
static_assert(std::is_same<const T, const bool>::value == false, "bool type is deprecated in arm_gpr_cast<>(), use b8 instead");
|
||||
|
||||
static inline u32 to(const T& value)
|
||||
{
|
||||
return static_cast<u32>(value);
|
||||
}
|
||||
|
||||
static inline T from(const u32 reg)
|
||||
{
|
||||
return static_cast<T>(reg);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct arm_gpr_cast_impl<b8, void>
|
||||
{
|
||||
static inline u32 to(const b8& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
static inline b8 from(const u32 reg)
|
||||
{
|
||||
return reg != 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, typename AT>
|
||||
struct arm_gpr_cast_impl<vm::_ptr_base<T, AT>, void>
|
||||
{
|
||||
static inline u32 to(const vm::_ptr_base<T, AT>& value)
|
||||
{
|
||||
return arm_gpr_cast_impl<AT>::to(value.addr());
|
||||
}
|
||||
|
||||
static inline vm::_ptr_base<T, AT> from(const u32 reg)
|
||||
{
|
||||
return{ arm_gpr_cast_impl<AT>::from(reg), vm::addr };
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, typename AT>
|
||||
struct arm_gpr_cast_impl<vm::_ref_base<T, AT>, void>
|
||||
{
|
||||
static inline u32 to(const vm::_ref_base<T, AT>& value)
|
||||
{
|
||||
return arm_gpr_cast_impl<AT>::to(value.addr());
|
||||
}
|
||||
|
||||
static inline vm::_ref_base<T, AT> from(const u32 reg)
|
||||
{
|
||||
return{ arm_gpr_cast_impl<AT>::from(reg), vm::addr };
|
||||
}
|
||||
};
|
||||
|
||||
template<typename To = u32, typename From>
|
||||
inline To arm_gpr_cast(const From& value)
|
||||
{
|
||||
return arm_gpr_cast_impl<To>::from(arm_gpr_cast_impl<From>::to(value));
|
||||
}
|
||||
|
350
rpcs3/Emu/ARMv7/ErrorCodes.h
Normal file
350
rpcs3/Emu/ARMv7/ErrorCodes.h
Normal file
@ -0,0 +1,350 @@
|
||||
#pragma once
|
||||
|
||||
#define ERROR_CODE(code) static_cast<s32>(code)
|
||||
|
||||
enum SceOk : s32
|
||||
{
|
||||
SCE_OK = 0,
|
||||
};
|
||||
|
||||
enum SceError : s32
|
||||
{
|
||||
SCE_ERROR_ERRNO_EPERM = ERROR_CODE(0x80010001),
|
||||
SCE_ERROR_ERRNO_ENOENT = ERROR_CODE(0x80010002),
|
||||
SCE_ERROR_ERRNO_ESRCH = ERROR_CODE(0x80010003),
|
||||
SCE_ERROR_ERRNO_EINTR = ERROR_CODE(0x80010004),
|
||||
SCE_ERROR_ERRNO_EIO = ERROR_CODE(0x80010005),
|
||||
SCE_ERROR_ERRNO_ENXIO = ERROR_CODE(0x80010006),
|
||||
SCE_ERROR_ERRNO_E2BIG = ERROR_CODE(0x80010007),
|
||||
SCE_ERROR_ERRNO_ENOEXEC = ERROR_CODE(0x80010008),
|
||||
SCE_ERROR_ERRNO_EBADF = ERROR_CODE(0x80010009),
|
||||
SCE_ERROR_ERRNO_ECHILD = ERROR_CODE(0x8001000A),
|
||||
SCE_ERROR_ERRNO_EAGAIN = ERROR_CODE(0x8001000B),
|
||||
SCE_ERROR_ERRNO_ENOMEM = ERROR_CODE(0x8001000C),
|
||||
SCE_ERROR_ERRNO_EACCES = ERROR_CODE(0x8001000D),
|
||||
SCE_ERROR_ERRNO_EFAULT = ERROR_CODE(0x8001000E),
|
||||
SCE_ERROR_ERRNO_ENOTBLK = ERROR_CODE(0x8001000F),
|
||||
SCE_ERROR_ERRNO_EBUSY = ERROR_CODE(0x80010010),
|
||||
SCE_ERROR_ERRNO_EEXIST = ERROR_CODE(0x80010011),
|
||||
SCE_ERROR_ERRNO_EXDEV = ERROR_CODE(0x80010012),
|
||||
SCE_ERROR_ERRNO_ENODEV = ERROR_CODE(0x80010013),
|
||||
SCE_ERROR_ERRNO_ENOTDIR = ERROR_CODE(0x80010014),
|
||||
SCE_ERROR_ERRNO_EISDIR = ERROR_CODE(0x80010015),
|
||||
SCE_ERROR_ERRNO_EINVAL = ERROR_CODE(0x80010016),
|
||||
SCE_ERROR_ERRNO_ENFILE = ERROR_CODE(0x80010017),
|
||||
SCE_ERROR_ERRNO_EMFILE = ERROR_CODE(0x80010018),
|
||||
SCE_ERROR_ERRNO_ENOTTY = ERROR_CODE(0x80010019),
|
||||
SCE_ERROR_ERRNO_ETXTBSY = ERROR_CODE(0x8001001A),
|
||||
SCE_ERROR_ERRNO_EFBIG = ERROR_CODE(0x8001001B),
|
||||
SCE_ERROR_ERRNO_ENOSPC = ERROR_CODE(0x8001001C),
|
||||
SCE_ERROR_ERRNO_ESPIPE = ERROR_CODE(0x8001001D),
|
||||
SCE_ERROR_ERRNO_EROFS = ERROR_CODE(0x8001001E),
|
||||
SCE_ERROR_ERRNO_EMLINK = ERROR_CODE(0x8001001F),
|
||||
SCE_ERROR_ERRNO_EPIPE = ERROR_CODE(0x80010020),
|
||||
SCE_ERROR_ERRNO_EDOM = ERROR_CODE(0x80010021),
|
||||
SCE_ERROR_ERRNO_ERANGE = ERROR_CODE(0x80010022),
|
||||
SCE_ERROR_ERRNO_ENOMSG = ERROR_CODE(0x80010023),
|
||||
SCE_ERROR_ERRNO_EIDRM = ERROR_CODE(0x80010024),
|
||||
SCE_ERROR_ERRNO_ECHRNG = ERROR_CODE(0x80010025),
|
||||
SCE_ERROR_ERRNO_EL2NSYNC = ERROR_CODE(0x80010026),
|
||||
SCE_ERROR_ERRNO_EL3HLT = ERROR_CODE(0x80010027),
|
||||
SCE_ERROR_ERRNO_EL3RST = ERROR_CODE(0x80010028),
|
||||
SCE_ERROR_ERRNO_ELNRNG = ERROR_CODE(0x80010029),
|
||||
SCE_ERROR_ERRNO_EUNATCH = ERROR_CODE(0x8001002A),
|
||||
SCE_ERROR_ERRNO_ENOCSI = ERROR_CODE(0x8001002B),
|
||||
SCE_ERROR_ERRNO_EL2HLT = ERROR_CODE(0x8001002C),
|
||||
SCE_ERROR_ERRNO_EDEADLK = ERROR_CODE(0x8001002D),
|
||||
SCE_ERROR_ERRNO_ENOLCK = ERROR_CODE(0x8001002E),
|
||||
SCE_ERROR_ERRNO_EFORMAT = ERROR_CODE(0x8001002F),
|
||||
SCE_ERROR_ERRNO_EUNSUP = ERROR_CODE(0x80010030),
|
||||
SCE_ERROR_ERRNO_EBADE = ERROR_CODE(0x80010032),
|
||||
SCE_ERROR_ERRNO_EBADR = ERROR_CODE(0x80010033),
|
||||
SCE_ERROR_ERRNO_EXFULL = ERROR_CODE(0x80010034),
|
||||
SCE_ERROR_ERRNO_ENOANO = ERROR_CODE(0x80010035),
|
||||
SCE_ERROR_ERRNO_EBADRQC = ERROR_CODE(0x80010036),
|
||||
SCE_ERROR_ERRNO_EBADSLT = ERROR_CODE(0x80010037),
|
||||
SCE_ERROR_ERRNO_EDEADLOCK = ERROR_CODE(0x80010038),
|
||||
SCE_ERROR_ERRNO_EBFONT = ERROR_CODE(0x80010039),
|
||||
SCE_ERROR_ERRNO_ENOSTR = ERROR_CODE(0x8001003C),
|
||||
SCE_ERROR_ERRNO_ENODATA = ERROR_CODE(0x8001003D),
|
||||
SCE_ERROR_ERRNO_ETIME = ERROR_CODE(0x8001003E),
|
||||
SCE_ERROR_ERRNO_ENOSR = ERROR_CODE(0x8001003F),
|
||||
SCE_ERROR_ERRNO_ENONET = ERROR_CODE(0x80010040),
|
||||
SCE_ERROR_ERRNO_ENOPKG = ERROR_CODE(0x80010041),
|
||||
SCE_ERROR_ERRNO_EREMOTE = ERROR_CODE(0x80010042),
|
||||
SCE_ERROR_ERRNO_ENOLINK = ERROR_CODE(0x80010043),
|
||||
SCE_ERROR_ERRNO_EADV = ERROR_CODE(0x80010044),
|
||||
SCE_ERROR_ERRNO_ESRMNT = ERROR_CODE(0x80010045),
|
||||
SCE_ERROR_ERRNO_ECOMM = ERROR_CODE(0x80010046),
|
||||
SCE_ERROR_ERRNO_EPROTO = ERROR_CODE(0x80010047),
|
||||
SCE_ERROR_ERRNO_EMULTIHOP = ERROR_CODE(0x8001004A),
|
||||
SCE_ERROR_ERRNO_ELBIN = ERROR_CODE(0x8001004B),
|
||||
SCE_ERROR_ERRNO_EDOTDOT = ERROR_CODE(0x8001004C),
|
||||
SCE_ERROR_ERRNO_EBADMSG = ERROR_CODE(0x8001004D),
|
||||
SCE_ERROR_ERRNO_EFTYPE = ERROR_CODE(0x8001004F),
|
||||
SCE_ERROR_ERRNO_ENOTUNIQ = ERROR_CODE(0x80010050),
|
||||
SCE_ERROR_ERRNO_EBADFD = ERROR_CODE(0x80010051),
|
||||
SCE_ERROR_ERRNO_EREMCHG = ERROR_CODE(0x80010052),
|
||||
SCE_ERROR_ERRNO_ELIBACC = ERROR_CODE(0x80010053),
|
||||
SCE_ERROR_ERRNO_ELIBBAD = ERROR_CODE(0x80010054),
|
||||
SCE_ERROR_ERRNO_ELIBSCN = ERROR_CODE(0x80010055),
|
||||
SCE_ERROR_ERRNO_ELIBMAX = ERROR_CODE(0x80010056),
|
||||
SCE_ERROR_ERRNO_ELIBEXEC = ERROR_CODE(0x80010057),
|
||||
SCE_ERROR_ERRNO_ENOSYS = ERROR_CODE(0x80010058),
|
||||
SCE_ERROR_ERRNO_ENMFILE = ERROR_CODE(0x80010059),
|
||||
SCE_ERROR_ERRNO_ENOTEMPTY = ERROR_CODE(0x8001005A),
|
||||
SCE_ERROR_ERRNO_ENAMETOOLONG = ERROR_CODE(0x8001005B),
|
||||
SCE_ERROR_ERRNO_ELOOP = ERROR_CODE(0x8001005C),
|
||||
SCE_ERROR_ERRNO_EOPNOTSUPP = ERROR_CODE(0x8001005F),
|
||||
SCE_ERROR_ERRNO_EPFNOSUPPORT = ERROR_CODE(0x80010060),
|
||||
SCE_ERROR_ERRNO_ECONNRESET = ERROR_CODE(0x80010068),
|
||||
SCE_ERROR_ERRNO_ENOBUFS = ERROR_CODE(0x80010069),
|
||||
SCE_ERROR_ERRNO_EAFNOSUPPORT = ERROR_CODE(0x8001006A),
|
||||
SCE_ERROR_ERRNO_EPROTOTYPE = ERROR_CODE(0x8001006B),
|
||||
SCE_ERROR_ERRNO_ENOTSOCK = ERROR_CODE(0x8001006C),
|
||||
SCE_ERROR_ERRNO_ENOPROTOOPT = ERROR_CODE(0x8001006D),
|
||||
SCE_ERROR_ERRNO_ESHUTDOWN = ERROR_CODE(0x8001006E),
|
||||
SCE_ERROR_ERRNO_ECONNREFUSED = ERROR_CODE(0x8001006F),
|
||||
SCE_ERROR_ERRNO_EADDRINUSE = ERROR_CODE(0x80010070),
|
||||
SCE_ERROR_ERRNO_ECONNABORTED = ERROR_CODE(0x80010071),
|
||||
SCE_ERROR_ERRNO_ENETUNREACH = ERROR_CODE(0x80010072),
|
||||
SCE_ERROR_ERRNO_ENETDOWN = ERROR_CODE(0x80010073),
|
||||
SCE_ERROR_ERRNO_ETIMEDOUT = ERROR_CODE(0x80010074),
|
||||
SCE_ERROR_ERRNO_EHOSTDOWN = ERROR_CODE(0x80010075),
|
||||
SCE_ERROR_ERRNO_EHOSTUNREACH = ERROR_CODE(0x80010076),
|
||||
SCE_ERROR_ERRNO_EINPROGRESS = ERROR_CODE(0x80010077),
|
||||
SCE_ERROR_ERRNO_EALREADY = ERROR_CODE(0x80010078),
|
||||
SCE_ERROR_ERRNO_EDESTADDRREQ = ERROR_CODE(0x80010079),
|
||||
SCE_ERROR_ERRNO_EMSGSIZE = ERROR_CODE(0x8001007A),
|
||||
SCE_ERROR_ERRNO_EPROTONOSUPPORT = ERROR_CODE(0x8001007B),
|
||||
SCE_ERROR_ERRNO_ESOCKTNOSUPPORT = ERROR_CODE(0x8001007C),
|
||||
SCE_ERROR_ERRNO_EADDRNOTAVAIL = ERROR_CODE(0x8001007D),
|
||||
SCE_ERROR_ERRNO_ENETRESET = ERROR_CODE(0x8001007E),
|
||||
SCE_ERROR_ERRNO_EISCONN = ERROR_CODE(0x8001007F),
|
||||
SCE_ERROR_ERRNO_ENOTCONN = ERROR_CODE(0x80010080),
|
||||
SCE_ERROR_ERRNO_ETOOMANYREFS = ERROR_CODE(0x80010081),
|
||||
SCE_ERROR_ERRNO_EPROCLIM = ERROR_CODE(0x80010082),
|
||||
SCE_ERROR_ERRNO_EUSERS = ERROR_CODE(0x80010083),
|
||||
SCE_ERROR_ERRNO_EDQUOT = ERROR_CODE(0x80010084),
|
||||
SCE_ERROR_ERRNO_ESTALE = ERROR_CODE(0x80010085),
|
||||
SCE_ERROR_ERRNO_ENOTSUP = ERROR_CODE(0x80010086),
|
||||
SCE_ERROR_ERRNO_ENOMEDIUM = ERROR_CODE(0x80010087),
|
||||
SCE_ERROR_ERRNO_ENOSHARE = ERROR_CODE(0x80010088),
|
||||
SCE_ERROR_ERRNO_ECASECLASH = ERROR_CODE(0x80010089),
|
||||
SCE_ERROR_ERRNO_EILSEQ = ERROR_CODE(0x8001008A),
|
||||
SCE_ERROR_ERRNO_EOVERFLOW = ERROR_CODE(0x8001008B),
|
||||
SCE_ERROR_ERRNO_ECANCELED = ERROR_CODE(0x8001008C),
|
||||
SCE_ERROR_ERRNO_ENOTRECOVERABLE = ERROR_CODE(0x8001008D),
|
||||
SCE_ERROR_ERRNO_EOWNERDEAD = ERROR_CODE(0x8001008E),
|
||||
};
|
||||
|
||||
// Special return type signaling on errors
|
||||
struct arm_error_code
|
||||
{
|
||||
s32 value;
|
||||
|
||||
// Print error message, error code is returned
|
||||
static s32 report(s32 error, const char* text);
|
||||
|
||||
// Must be specialized for specific tag type T
|
||||
template<typename T>
|
||||
static const char* print(T code)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
s32 error_check(T code)
|
||||
{
|
||||
if (const auto text = print(code))
|
||||
{
|
||||
return report(code, text);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
arm_error_code() = default;
|
||||
|
||||
// General error check
|
||||
template<typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
|
||||
arm_error_code(T value)
|
||||
: value(error_check(value))
|
||||
{
|
||||
}
|
||||
|
||||
// Force error reporting with a message specified
|
||||
arm_error_code(s32 value, const char* text)
|
||||
: value(report(value, text))
|
||||
{
|
||||
}
|
||||
|
||||
// Silence any error
|
||||
constexpr arm_error_code(s32 value, const std::nothrow_t&)
|
||||
: value(value)
|
||||
{
|
||||
}
|
||||
|
||||
// Conversion
|
||||
constexpr operator s32() const
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
// Helper macro for silencing possible error checks on returning arm_error_code values
|
||||
#define NOT_AN_ERROR(value) { static_cast<s32>(value), std::nothrow }
|
||||
|
||||
template<typename T, typename>
|
||||
struct arm_gpr_cast_impl;
|
||||
|
||||
template<>
|
||||
struct arm_gpr_cast_impl<arm_error_code, void>
|
||||
{
|
||||
static inline u32 to(const arm_error_code& code)
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
static inline arm_error_code from(const u32 reg)
|
||||
{
|
||||
return NOT_AN_ERROR(reg);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
inline const char* arm_error_code::print(SceError error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
STR_CASE(SCE_ERROR_ERRNO_EPERM);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOENT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ESRCH);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EINTR);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EIO);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENXIO);
|
||||
STR_CASE(SCE_ERROR_ERRNO_E2BIG);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOEXEC);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EBADF);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ECHILD);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EAGAIN);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOMEM);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EACCES);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EFAULT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOTBLK);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EBUSY);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EEXIST);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EXDEV);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENODEV);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOTDIR);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EISDIR);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EINVAL);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENFILE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EMFILE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOTTY);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ETXTBSY);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EFBIG);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOSPC);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ESPIPE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EROFS);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EMLINK);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EPIPE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EDOM);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ERANGE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOMSG);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EIDRM);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ECHRNG);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EL2NSYNC);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EL3HLT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EL3RST);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ELNRNG);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EUNATCH);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOCSI);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EL2HLT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EDEADLK);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOLCK);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EFORMAT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EUNSUP);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EBADE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EBADR);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EXFULL);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOANO);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EBADRQC);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EBADSLT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EDEADLOCK);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EBFONT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOSTR);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENODATA);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ETIME);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOSR);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENONET);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOPKG);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EREMOTE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOLINK);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EADV);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ESRMNT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ECOMM);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EPROTO);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EMULTIHOP);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ELBIN);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EDOTDOT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EBADMSG);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EFTYPE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOTUNIQ);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EBADFD);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EREMCHG);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ELIBACC);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ELIBBAD);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ELIBSCN);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ELIBMAX);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ELIBEXEC);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOSYS);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENMFILE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOTEMPTY);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENAMETOOLONG);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ELOOP);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EOPNOTSUPP);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EPFNOSUPPORT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ECONNRESET);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOBUFS);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EAFNOSUPPORT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EPROTOTYPE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOTSOCK);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOPROTOOPT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ESHUTDOWN);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ECONNREFUSED);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EADDRINUSE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ECONNABORTED);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENETUNREACH);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENETDOWN);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ETIMEDOUT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EHOSTDOWN);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EHOSTUNREACH);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EINPROGRESS);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EALREADY);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EDESTADDRREQ);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EMSGSIZE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EPROTONOSUPPORT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ESOCKTNOSUPPORT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EADDRNOTAVAIL);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENETRESET);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EISCONN);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOTCONN);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ETOOMANYREFS);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EPROCLIM);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EUSERS);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EDQUOT);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ESTALE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOTSUP);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOMEDIUM);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOSHARE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ECASECLASH);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EILSEQ);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EOVERFLOW);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ECANCELED);
|
||||
STR_CASE(SCE_ERROR_ERRNO_ENOTRECOVERABLE);
|
||||
STR_CASE(SCE_ERROR_ERRNO_EOWNERDEAD);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceAppMgr.h"
|
||||
|
||||
LOG_CHANNEL(sceAppMgr);
|
||||
|
||||
s32 sceAppMgrReceiveEventNum(vm::ptr<s32> eventNum)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -25,15 +27,10 @@ s32 sceAppMgrReleaseBgmPort()
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceAppMgr, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceAppMgrUser, nid, name)
|
||||
|
||||
psv_log_base sceAppMgr("SceAppMgr", []()
|
||||
DECLARE(arm_module_manager::SceAppMgr)("SceAppMgrUser", []()
|
||||
{
|
||||
sceAppMgr.on_load = nullptr;
|
||||
sceAppMgr.on_unload = nullptr;
|
||||
sceAppMgr.on_stop = nullptr;
|
||||
sceAppMgr.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x47E5DD7D, sceAppMgrReceiveEventNum);
|
||||
REG_FUNC(0xCFAD5A3A, sceAppMgrReceiveEvent);
|
||||
REG_FUNC(0xF3D65520, sceAppMgrAcquireBgmPort);
|
||||
|
@ -6,5 +6,3 @@ struct SceAppMgrEvent
|
||||
le_t<s32> appId;
|
||||
char param[56];
|
||||
};
|
||||
|
||||
extern psv_log_base sceAppMgr;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceAppUtil.h"
|
||||
|
||||
LOG_CHANNEL(sceAppUtil);
|
||||
|
||||
s32 sceAppUtilInit(vm::cptr<SceAppUtilInitParam> initParam, vm::ptr<SceAppUtilBootParam> bootParam)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -70,15 +72,10 @@ s32 sceAppUtilLoadSafeMemory(vm::ptr<void> buf, u32 bufSize, s64 offset)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceAppUtil, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceAppUtil, nid, name)
|
||||
|
||||
psv_log_base sceAppUtil("SceAppUtil", []()
|
||||
DECLARE(arm_module_manager::SceAppUtil)("SceAppUtil", []()
|
||||
{
|
||||
sceAppUtil.on_load = nullptr;
|
||||
sceAppUtil.on_unload = nullptr;
|
||||
sceAppUtil.on_stop = nullptr;
|
||||
sceAppUtil.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xDAFFE671, sceAppUtilInit);
|
||||
REG_FUNC(0xB220B00B, sceAppUtilShutdown);
|
||||
REG_FUNC(0x7E8FE96A, sceAppUtilSaveDataSlotCreate);
|
||||
|
@ -65,5 +65,3 @@ struct SceAppUtilSaveDataFileSlot
|
||||
vm::lptr<SceAppUtilSaveDataSlotParam> slotParam;
|
||||
char reserved[32];
|
||||
};
|
||||
|
||||
extern psv_log_base sceAppUtil;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceAudio.h"
|
||||
|
||||
LOG_CHANNEL(sceAudio);
|
||||
|
||||
s32 sceAudioOutOpenPort(s32 portType, s32 len, s32 freq, s32 param)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -45,15 +47,10 @@ s32 sceAudioOutGetAdopt(s32 portType)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceAudio, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceAudio, nid, name)
|
||||
|
||||
psv_log_base sceAudio("SceAudio", []()
|
||||
DECLARE(arm_module_manager::SceAudio)("SceAudio", []()
|
||||
{
|
||||
sceAudio.on_load = nullptr;
|
||||
sceAudio.on_unload = nullptr;
|
||||
sceAudio.on_stop = nullptr;
|
||||
sceAudio.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x5BC341E4, sceAudioOutOpenPort);
|
||||
REG_FUNC(0x69E2E6B5, sceAudioOutReleasePort);
|
||||
REG_FUNC(0x02DB3F5F, sceAudioOutOutput);
|
||||
|
@ -1,3 +1 @@
|
||||
#pragma once
|
||||
|
||||
extern psv_log_base sceAudio;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceAudioIn.h"
|
||||
|
||||
LOG_CHANNEL(sceAudioIn);
|
||||
|
||||
s32 sceAudioInOpenPort(s32 portType, s32 grain, s32 freq, s32 param)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -20,15 +22,10 @@ s32 sceAudioInInput(s32 port, vm::ptr<void> destPtr)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceAudioIn, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceAudioIn, nid, name)
|
||||
|
||||
psv_log_base sceAudioIn("SceAudioIn", []()
|
||||
DECLARE(arm_module_manager::SceAudioIn)("SceAudioIn", []()
|
||||
{
|
||||
sceAudioIn.on_load = nullptr;
|
||||
sceAudioIn.on_unload = nullptr;
|
||||
sceAudioIn.on_stop = nullptr;
|
||||
sceAudioIn.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x638ADD2D, sceAudioInInput);
|
||||
REG_FUNC(0x39B50DC1, sceAudioInOpenPort);
|
||||
REG_FUNC(0x3A61B8C4, sceAudioInReleasePort);
|
||||
|
@ -1,3 +1 @@
|
||||
#pragma once
|
||||
|
||||
extern psv_log_base sceAudioIn;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceAudiodec.h"
|
||||
|
||||
LOG_CHANNEL(sceAudiodec);
|
||||
|
||||
s32 sceAudiodecInitLibrary(u32 codecType, vm::ptr<SceAudiodecInitParam> pInitParam)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -40,15 +42,10 @@ s32 sceAudiodecGetInternalError(vm::ptr<SceAudiodecCtrl> pCtrl, vm::ptr<s32> pIn
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceAudiodec, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceAudiodecUser, nid, name)
|
||||
|
||||
psv_log_base sceAudiodec("SceAudiodec", []()
|
||||
DECLARE(arm_module_manager::SceAudiodec)("SceAudiodecUser", []()
|
||||
{
|
||||
sceAudiodec.on_load = nullptr;
|
||||
sceAudiodec.on_unload = nullptr;
|
||||
sceAudiodec.on_stop = nullptr;
|
||||
sceAudiodec.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x445C2CEF, sceAudiodecInitLibrary);
|
||||
REG_FUNC(0x45719B9D, sceAudiodecTermLibrary);
|
||||
REG_FUNC(0x4DFD3AAA, sceAudiodecCreateDecoder);
|
||||
|
@ -79,5 +79,3 @@ struct SceAudiodecCtrl
|
||||
le_t<u32> wordLength;
|
||||
vm::lptr<SceAudiodecInfo> pInfo;
|
||||
};
|
||||
|
||||
extern psv_log_base sceAudiodec;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceAudioenc.h"
|
||||
|
||||
LOG_CHANNEL(sceAudioenc);
|
||||
|
||||
s32 sceAudioencInitLibrary(u32 codecType, vm::ptr<SceAudioencInitParam> pInitParam)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -45,15 +47,10 @@ s32 sceAudioencGetInternalError(vm::ptr<SceAudioencCtrl> pCtrl, vm::ptr<s32> pIn
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceAudioenc, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceAudioencUser, nid, name)
|
||||
|
||||
psv_log_base sceAudioenc("SceAudioenc", []()
|
||||
DECLARE(arm_module_manager::SceAudioenc)("SceAudioencUser", []()
|
||||
{
|
||||
sceAudioenc.on_load = nullptr;
|
||||
sceAudioenc.on_unload = nullptr;
|
||||
sceAudioenc.on_stop = nullptr;
|
||||
sceAudioenc.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x76EE4DC6, sceAudioencInitLibrary);
|
||||
REG_FUNC(0xAB32D022, sceAudioencTermLibrary);
|
||||
REG_FUNC(0x64C04AE8, sceAudioencCreateEncoder);
|
||||
|
@ -55,5 +55,3 @@ struct SceAudioencCtrl
|
||||
vm::lptr<SceAudioencInfo> pInfo;
|
||||
vm::lptr<SceAudioencOptInfo> pOptInfo;
|
||||
};
|
||||
|
||||
extern psv_log_base sceAudioenc;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceCamera.h"
|
||||
|
||||
LOG_CHANNEL(sceCamera);
|
||||
|
||||
s32 sceCameraOpen(s32 devnum, vm::ptr<SceCameraInfo> pInfo)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -210,15 +212,10 @@ void sceCameraUseCacheMemoryForTrial(s32 isCache)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceCamera, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceCamera, nid, name)
|
||||
|
||||
psv_log_base sceCamera("SceCamera", []()
|
||||
DECLARE(arm_module_manager::SceCamera)("SceCamera", []()
|
||||
{
|
||||
sceCamera.on_load = nullptr;
|
||||
sceCamera.on_unload = nullptr;
|
||||
sceCamera.on_stop = nullptr;
|
||||
sceCamera.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xA462F801, sceCameraOpen);
|
||||
REG_FUNC(0xCD6E1CFC, sceCameraClose);
|
||||
REG_FUNC(0xA8FEAE35, sceCameraStart);
|
||||
|
@ -36,5 +36,3 @@ struct SceCameraRead
|
||||
vm::lptr<void> pvUBase;
|
||||
vm::lptr<void> pvVBase;
|
||||
};
|
||||
|
||||
extern psv_log_base sceCamera;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceCodecEngine.h"
|
||||
|
||||
LOG_CHANNEL(sceCodecEngine);
|
||||
|
||||
s32 sceCodecEnginePmonStart()
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -25,15 +27,10 @@ s32 sceCodecEnginePmonReset()
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceCodecEngine, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceCodecEngine, nid, name)
|
||||
|
||||
psv_log_base sceCodecEngine("SceCodecEngine", []()
|
||||
DECLARE(arm_module_manager::SceCodecEngine)("SceCodecEngine", []()
|
||||
{
|
||||
sceCodecEngine.on_load = nullptr;
|
||||
sceCodecEngine.on_unload = nullptr;
|
||||
sceCodecEngine.on_stop = nullptr;
|
||||
sceCodecEngine.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x3E718890, sceCodecEnginePmonStart);
|
||||
REG_FUNC(0x268B1EF5, sceCodecEnginePmonStop);
|
||||
REG_FUNC(0x859E4A68, sceCodecEnginePmonGetProcessorLoad);
|
||||
|
@ -5,5 +5,3 @@ struct SceCodecEnginePmonProcessorLoad
|
||||
le_t<u32> size;
|
||||
le_t<u32> average;
|
||||
};
|
||||
|
||||
extern psv_log_base sceCodecEngine;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceCommonDialog.h"
|
||||
|
||||
LOG_CHANNEL(sceCommonDialog);
|
||||
|
||||
s32 sceCommonDialogUpdate(vm::cptr<SceCommonDialogUpdateParam> updateParam)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -205,15 +207,10 @@ s32 scePhotoReviewDialogAbort()
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceCommonDialog, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceCommonDialog, nid, name)
|
||||
|
||||
psv_log_base sceCommonDialog("SceCommonDialog", []()
|
||||
DECLARE(arm_module_manager::SceCommonDialog)("SceCommonDialog", []()
|
||||
{
|
||||
sceCommonDialog.on_load = nullptr;
|
||||
sceCommonDialog.on_unload = nullptr;
|
||||
sceCommonDialog.on_stop = nullptr;
|
||||
sceCommonDialog.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x90530F2F, sceCommonDialogUpdate);
|
||||
REG_FUNC(0x755FF270, sceMsgDialogInit);
|
||||
REG_FUNC(0x4107019E, sceMsgDialogGetStatus);
|
||||
|
@ -298,5 +298,3 @@ struct ScePhotoReviewDialogResult
|
||||
le_t<s32> result;
|
||||
char reserved[32];
|
||||
};
|
||||
|
||||
extern psv_log_base sceCommonDialog;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceCtrl.h"
|
||||
|
||||
LOG_CHANNEL(sceCtrl);
|
||||
|
||||
s32 sceCtrlSetSamplingMode(u32 uiMode)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -45,15 +47,10 @@ s32 sceCtrlClearRapidFire(s32 port, s32 idx)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceCtrl, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceCtrl, nid, name)
|
||||
|
||||
psv_log_base sceCtrl("SceCtrl", []()
|
||||
DECLARE(arm_module_manager::SceCtrl)("SceCtrl", []()
|
||||
{
|
||||
sceCtrl.on_load = nullptr;
|
||||
sceCtrl.on_unload = nullptr;
|
||||
sceCtrl.on_stop = nullptr;
|
||||
sceCtrl.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xA497B150, sceCtrlSetSamplingMode);
|
||||
REG_FUNC(0xEC752AAF, sceCtrlGetSamplingMode);
|
||||
REG_FUNC(0xA9C3CED6, sceCtrlPeekBufferPositive);
|
||||
|
@ -20,5 +20,3 @@ struct SceCtrlRapidFireRule
|
||||
le_t<u32> uiMake;
|
||||
le_t<u32> uiBreak;
|
||||
};
|
||||
|
||||
extern psv_log_base sceCtrl;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceDbg.h"
|
||||
|
||||
LOG_CHANNEL(sceDbg);
|
||||
|
||||
s32 sceDbgSetMinimumLogLevel(s32 minimumLogLevel)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -14,26 +16,21 @@ s32 sceDbgSetBreakOnErrorState(SceDbgBreakOnErrorState state)
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
s32 sceDbgAssertionHandler(vm::cptr<char> pFile, s32 line, b8 stop, vm::cptr<char> pComponent, vm::cptr<char> pMessage, armv7_va_args_t va_args)
|
||||
s32 sceDbgAssertionHandler(vm::cptr<char> pFile, s32 line, b8 stop, vm::cptr<char> pComponent, vm::cptr<char> pMessage, arm_va_args_t va_args)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
s32 sceDbgLoggingHandler(vm::cptr<char> pFile, s32 line, s32 severity, vm::cptr<char> pComponent, vm::cptr<char> pMessage, armv7_va_args_t va_args)
|
||||
s32 sceDbgLoggingHandler(vm::cptr<char> pFile, s32 line, s32 severity, vm::cptr<char> pComponent, vm::cptr<char> pMessage, arm_va_args_t va_args)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceDbg, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceDbg, nid, name)
|
||||
|
||||
psv_log_base sceDbg("SceDbg", []()
|
||||
DECLARE(arm_module_manager::SceDbg)("SceDbg", []()
|
||||
{
|
||||
sceDbg.on_load = nullptr;
|
||||
sceDbg.on_unload = nullptr;
|
||||
sceDbg.on_stop = nullptr;
|
||||
sceDbg.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x941622FA, sceDbgSetMinimumLogLevel);
|
||||
REG_FUNC(0x1AF3678B, sceDbgAssertionHandler);
|
||||
REG_FUNC(0x6605AB19, sceDbgLoggingHandler);
|
||||
|
@ -5,5 +5,3 @@ enum SceDbgBreakOnErrorState : s32
|
||||
SCE_DBG_DISABLE_BREAK_ON_ERROR = 0,
|
||||
SCE_DBG_ENABLE_BREAK_ON_ERROR
|
||||
};
|
||||
|
||||
extern psv_log_base sceDbg;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceDeci4p.h"
|
||||
|
||||
LOG_CHANNEL(sceDeci4p);
|
||||
|
||||
s32 sceKernelDeci4pOpen(vm::cptr<char> protoname, u32 protonum, u32 bufsize)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -30,15 +32,10 @@ s32 sceKernelDeci4pRegisterCallback(s32 socketid, s32 cbid)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceDeci4p, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceDeci4pUserp, nid, name)
|
||||
|
||||
psv_log_base sceDeci4p("SceDeci4pUserp", []()
|
||||
DECLARE(arm_module_manager::SceDeci4p)("SceDeci4pUserp", []()
|
||||
{
|
||||
sceDeci4p.on_load = nullptr;
|
||||
sceDeci4p.on_unload = nullptr;
|
||||
sceDeci4p.on_stop = nullptr;
|
||||
sceDeci4p.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x28578FE8, sceKernelDeci4pOpen);
|
||||
REG_FUNC(0x63B0C50F, sceKernelDeci4pClose);
|
||||
REG_FUNC(0x971E1C66, sceKernelDeci4pRead);
|
||||
|
@ -1,5 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
using SceKernelDeci4pCallback = s32(s32 notifyId, s32 notifyCount, s32 notifyArg, vm::ptr<void> pCommon);
|
||||
|
||||
extern psv_log_base sceDeci4p;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceDeflt.h"
|
||||
|
||||
LOG_CHANNEL(sceDeflt);
|
||||
|
||||
s32 sceGzipIsValid(vm::cptr<void> pSrcGzip)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -70,15 +72,10 @@ s32 sceZipGetInfo(vm::cptr<void> pSrc, vm::cpptr<void> ppvExtra, vm::ptr<u32> pu
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceDeflt, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceDeflt, nid, name)
|
||||
|
||||
psv_log_base sceDeflt("SceDeflt", []()
|
||||
DECLARE(arm_module_manager::SceDeflt)("SceDeflt", []()
|
||||
{
|
||||
sceDeflt.on_load = nullptr;
|
||||
sceDeflt.on_unload = nullptr;
|
||||
sceDeflt.on_stop = nullptr;
|
||||
sceDeflt.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xCD83A464, sceZlibAdler32);
|
||||
REG_FUNC(0x110D5050, sceDeflateDecompress);
|
||||
REG_FUNC(0xE3CB51A3, sceGzipDecompress);
|
||||
|
@ -1,3 +1 @@
|
||||
#pragma once
|
||||
|
||||
extern psv_log_base sceDeflt;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceDisplay.h"
|
||||
|
||||
LOG_CHANNEL(sceDisplay);
|
||||
|
||||
s32 sceDisplayGetRefreshRate(vm::ptr<float> pFps)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -75,20 +77,16 @@ s32 sceDisplayUnregisterVblankStartCallback(s32 uid)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceDisplay, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceDisplay, nid, name)
|
||||
|
||||
psv_log_base sceDisplay("SceDisplay", []()
|
||||
DECLARE(arm_module_manager::SceDisplayUser)("SceDisplayUser", []()
|
||||
{
|
||||
sceDisplay.on_load = nullptr;
|
||||
sceDisplay.on_unload = nullptr;
|
||||
sceDisplay.on_stop = nullptr;
|
||||
sceDisplay.on_error = nullptr;
|
||||
REG_FNID(SceDisplayUser, 0x7A410B64, sceDisplaySetFrameBuf);
|
||||
REG_FNID(SceDisplayUser, 0x42AE6BBC, sceDisplayGetFrameBuf);
|
||||
});
|
||||
|
||||
// SceDisplayUser
|
||||
REG_FUNC(0x7A410B64, sceDisplaySetFrameBuf);
|
||||
REG_FUNC(0x42AE6BBC, sceDisplayGetFrameBuf);
|
||||
|
||||
// SceDisplay
|
||||
DECLARE(arm_module_manager::SceDisplay)("SceDisplay", []()
|
||||
{
|
||||
REG_FUNC(0xA08CA60D, sceDisplayGetRefreshRate);
|
||||
REG_FUNC(0xB6FDE0BA, sceDisplayGetVcount);
|
||||
REG_FUNC(0x5795E898, sceDisplayWaitVblankStart);
|
||||
|
@ -9,5 +9,3 @@ struct SceDisplayFrameBuf
|
||||
le_t<u32> width;
|
||||
le_t<u32> height;
|
||||
};
|
||||
|
||||
extern psv_log_base sceDisplay;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceFiber.h"
|
||||
|
||||
LOG_CHANNEL(sceFiber);
|
||||
|
||||
s32 _sceFiberInitializeImpl(vm::ptr<SceFiber> fiber, vm::cptr<char> name, vm::ptr<SceFiberEntry> entry, u32 argOnInitialize, vm::ptr<void> addrContext, u32 sizeContext, vm::cptr<SceFiberOptParam> optParam, u32 buildVersion)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -45,15 +47,10 @@ s32 sceFiberGetInfo(vm::ptr<SceFiber> fiber, vm::ptr<SceFiberInfo> fiberInfo)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceFiber, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceFiber, nid, name)
|
||||
|
||||
psv_log_base sceFiber("SceFiber", []()
|
||||
DECLARE(arm_module_manager::SceFiber)("SceFiber", []()
|
||||
{
|
||||
sceFiber.on_load = nullptr;
|
||||
sceFiber.on_unload = nullptr;
|
||||
sceFiber.on_stop = nullptr;
|
||||
sceFiber.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xF24A298C, _sceFiberInitializeImpl);
|
||||
//REG_FUNC(0xC6A3F9BB, _sceFiberInitializeWithInternalOptionImpl);
|
||||
//REG_FUNC(0x7D0C7DDB, _sceFiberAttachContextAndRun);
|
||||
|
@ -27,5 +27,3 @@ struct alignas(8) SceFiberInfo
|
||||
};
|
||||
|
||||
CHECK_SIZE_ALIGN(SceFiberInfo, 128, 8);
|
||||
|
||||
extern psv_log_base sceFiber;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceFios.h"
|
||||
|
||||
LOG_CHANNEL(sceFios);
|
||||
|
||||
s32 sceFiosInitialize(vm::cptr<SceFiosParams> pParameters)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -119,7 +121,7 @@ s32 sceFiosPathncmp(vm::cptr<char> pA, vm::cptr<char> pB, u32 n)
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
s32 sceFiosPrintf(vm::cptr<char> pFormat, armv7_va_args_t va_args)
|
||||
s32 sceFiosPrintf(vm::cptr<char> pFormat, arm_va_args_t va_args)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
@ -684,15 +686,10 @@ void sceFiosIOFilterPsarcDearchiver()
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceFios, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceFios2, nid, name)
|
||||
|
||||
psv_log_base sceFios("SceFios2", []()
|
||||
DECLARE(arm_module_manager::SceFios)("SceFios2", []()
|
||||
{
|
||||
sceFios.on_load = nullptr;
|
||||
sceFios.on_unload = nullptr;
|
||||
sceFios.on_stop = nullptr;
|
||||
sceFios.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x15857180, sceFiosArchiveGetMountBufferSize);
|
||||
REG_FUNC(0xDF3352FC, sceFiosArchiveGetMountBufferSizeSync);
|
||||
//REG_FUNC(0x92E76BBD, sceFiosArchiveMount);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
using SceFiosOpCallback = s32(vm::ptr<void> pContext, s32 op, u8 event, s32 err);
|
||||
using SceFiosVprintfCallback = s32(vm::cptr<char> fmt, armv7_va_args_t ap /* va_list */);
|
||||
using SceFiosVprintfCallback = s32(vm::cptr<char> fmt, arm_va_args_t ap /* va_list */);
|
||||
using SceFiosMemcpyCallback = vm::ptr<void>(vm::ptr<void> dst, vm::cptr<void> src, u32 len);
|
||||
|
||||
enum SceFiosWhence : s32
|
||||
@ -109,5 +109,3 @@ struct SceFiosPsarcDearchiverContext
|
||||
vm::lptr<void> pWorkBuffer;
|
||||
le_t<s32> reserved[4];
|
||||
};
|
||||
|
||||
extern psv_log_base sceFios;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceFpu.h"
|
||||
|
||||
LOG_CHANNEL(sceFpu);
|
||||
|
||||
float sceFpuSinf(float x)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -76,15 +78,10 @@ float sceFpuPowf(float x, float y)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceFpu, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceFpu, nid, name)
|
||||
|
||||
psv_log_base sceFpu("SceFpu", []()
|
||||
DECLARE(arm_module_manager::SceFpu)("SceFpu", []()
|
||||
{
|
||||
sceFpu.on_load = nullptr;
|
||||
sceFpu.on_unload = nullptr;
|
||||
sceFpu.on_stop = nullptr;
|
||||
sceFpu.on_error = nullptr;
|
||||
|
||||
//REG_FUNC(0x33E1AC14, sceFpuSinf);
|
||||
//REG_FUNC(0xDB66BA89, sceFpuCosf);
|
||||
//REG_FUNC(0x6FBDA1C9, sceFpuTanf);
|
||||
|
@ -1,3 +1 @@
|
||||
#pragma once
|
||||
|
||||
extern psv_log_base sceFpu;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceGxm.h"
|
||||
|
||||
LOG_CHANNEL(sceGxm);
|
||||
|
||||
s32 sceGxmInitialize(vm::cptr<SceGxmInitializeParams> params)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -1067,15 +1069,10 @@ s32 sceGxmSetUniformDataF(vm::ptr<void> uniformBuffer, vm::cptr<SceGxmProgramPar
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceGxm, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceGxm, nid, name)
|
||||
|
||||
psv_log_base sceGxm("SceGxm", []()
|
||||
DECLARE(arm_module_manager::SceGxm)("SceGxm", []()
|
||||
{
|
||||
sceGxm.on_load = nullptr;
|
||||
sceGxm.on_unload = nullptr;
|
||||
sceGxm.on_stop = nullptr;
|
||||
sceGxm.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xB0F1E4EC, sceGxmInitialize);
|
||||
REG_FUNC(0xB627DE66, sceGxmTerminate);
|
||||
//REG_FUNC(0x48C134AB, sceGxmBug9255RaisePrimitiveSplitThresholdEs2);
|
||||
@ -1145,6 +1142,8 @@ psv_log_base sceGxm("SceGxm", []()
|
||||
REG_FUNC(0x6679BEF0, sceGxmTextureInitLinearStrided);
|
||||
REG_FUNC(0xD572D547, sceGxmTextureInitSwizzled);
|
||||
REG_FUNC(0xE6F0DB27, sceGxmTextureInitTiled);
|
||||
//REG_FUNC(0x5DBFBA2C, sceGxmTextureInitSwizzledArbitrary);
|
||||
//REG_FUNC(0xE3DF5E3B, sceGxmTextureInitCubeArbitrary);
|
||||
REG_FUNC(0xE719CBD4, sceGxmTextureSetAnisoMode);
|
||||
REG_FUNC(0x855814C4, sceGxmTextureSetData);
|
||||
REG_FUNC(0xFC943596, sceGxmTextureSetFormat);
|
||||
@ -1186,11 +1185,14 @@ psv_log_base sceGxm("SceGxm", []()
|
||||
REG_FUNC(0x8FF68274, sceGxmPrecomputedVertexStateSetAllTextures);
|
||||
REG_FUNC(0x0389861D, sceGxmPrecomputedVertexStateSetAllUniformBuffers);
|
||||
REG_FUNC(0x1F856E5D, sceGxmGetRenderTargetMemSizes);
|
||||
//REG_FUNC(0xB291C959, sceGxmGetRenderTargetMemSize);
|
||||
REG_FUNC(0xD56CD7B1, sceGxmCreateRenderTarget);
|
||||
REG_FUNC(0x207AF96B, sceGxmCreateRenderTarget); // !!!
|
||||
REG_FUNC(0x0B94C50A, sceGxmDestroyRenderTarget);
|
||||
REG_FUNC(0xD0EDAB4C, sceGxmRenderTargetGetHostMem);
|
||||
REG_FUNC(0x49553737, sceGxmRenderTargetGetDriverMemBlock);
|
||||
REG_FUNC(0xDBA33160, sceGxmBeginScene);
|
||||
REG_FUNC(0x8734FF4E, sceGxmBeginScene); // !!!
|
||||
REG_FUNC(0xE84CE5B4, sceGxmCreateContext);
|
||||
REG_FUNC(0xEDDC5FB2, sceGxmDestroyContext);
|
||||
REG_FUNC(0xBC059AFC, sceGxmDraw);
|
||||
@ -1199,6 +1201,7 @@ psv_log_base sceGxm("SceGxm", []()
|
||||
REG_FUNC(0xFE300E2F, sceGxmEndScene);
|
||||
REG_FUNC(0x0733D8AE, sceGxmFinish);
|
||||
REG_FUNC(0x51FE0899, sceGxmMidSceneFlush);
|
||||
REG_FUNC(0x2B5C0444, sceGxmMidSceneFlush); // !!!
|
||||
REG_FUNC(0x4FA073A6, sceGxmPopUserMarker);
|
||||
REG_FUNC(0x3276C475, sceGxmPushUserMarker);
|
||||
REG_FUNC(0x7B1FABB6, sceGxmReserveFragmentDefaultUniformBuffer);
|
||||
|
@ -1238,5 +1238,3 @@ struct SceGxmRenderTargetParams
|
||||
le_t<u32> hostMemSize;
|
||||
le_t<s32> driverMemBlock;
|
||||
};
|
||||
|
||||
extern psv_log_base sceGxm;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceHttp.h"
|
||||
|
||||
LOG_CHANNEL(sceHttp);
|
||||
|
||||
s32 sceHttpInit(u32 poolSize)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -280,15 +282,10 @@ s32 sceHttpsFreeCaList(vm::ptr<SceHttpsCaList> caList)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceHttp, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceHttp, nid, name)
|
||||
|
||||
psv_log_base sceHttp("SceHttp", []()
|
||||
DECLARE(arm_module_manager::SceHttp)("SceHttp", []()
|
||||
{
|
||||
sceHttp.on_load = nullptr;
|
||||
sceHttp.on_unload = nullptr;
|
||||
sceHttp.on_stop = nullptr;
|
||||
sceHttp.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x214926D9, sceHttpInit);
|
||||
REG_FUNC(0xC9076666, sceHttpTerm);
|
||||
REG_FUNC(0xF98CDFA9, sceHttpGetMemoryPoolStats);
|
||||
|
@ -70,5 +70,3 @@ struct SceHttpsCaList
|
||||
};
|
||||
|
||||
using SceHttpsCallback = s32(u32 verifyEsrr, vm::cptr<vm::ptr<SceSslCert>> sslCert, s32 certNum, vm::ptr<void> userArg);
|
||||
|
||||
extern psv_log_base sceHttp;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceIme.h"
|
||||
|
||||
LOG_CHANNEL(sceIme);
|
||||
|
||||
s32 sceImeOpen(vm::ptr<SceImeParam> param)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -30,15 +32,10 @@ s32 sceImeClose()
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceIme, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceIme, nid, name)
|
||||
|
||||
psv_log_base sceIme("SceIme", []()
|
||||
DECLARE(arm_module_manager::SceIme)("SceIme", []()
|
||||
{
|
||||
sceIme.on_load = nullptr;
|
||||
sceIme.on_unload = nullptr;
|
||||
sceIme.on_stop = nullptr;
|
||||
sceIme.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x0E050613, sceImeOpen);
|
||||
REG_FUNC(0x71D6898A, sceImeUpdate);
|
||||
REG_FUNC(0x889A8421, sceImeClose);
|
||||
|
@ -66,5 +66,3 @@ struct SceImeParam
|
||||
le_t<u32> reserved0;
|
||||
le_t<u32> reserved1;
|
||||
};
|
||||
|
||||
extern psv_log_base sceIme;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceJpeg.h"
|
||||
|
||||
LOG_CHANNEL(sceJpeg);
|
||||
|
||||
s32 sceJpegInitMJpeg(s32 maxSplitDecoder)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -77,15 +79,10 @@ s32 sceJpegSplitDecodeMJpeg(vm::ptr<SceJpegSplitDecodeCtrl> pCtrl)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceJpeg, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceJpegUser, nid, name)
|
||||
|
||||
psv_log_base sceJpeg("SceJpeg", []()
|
||||
DECLARE(arm_module_manager::SceJpeg)("SceJpegUser", []()
|
||||
{
|
||||
sceJpeg.on_load = nullptr;
|
||||
sceJpeg.on_unload = nullptr;
|
||||
sceJpeg.on_stop = nullptr;
|
||||
sceJpeg.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xB030773B, sceJpegInitMJpeg);
|
||||
REG_FUNC(0x62842598, sceJpegFinishMJpeg);
|
||||
REG_FUNC(0x6215B095, sceJpegDecodeMJpeg);
|
||||
|
@ -34,5 +34,3 @@ struct SceJpegSplitDecodeCtrl
|
||||
|
||||
le_t<u32> internalData[3];
|
||||
};
|
||||
|
||||
extern psv_log_base sceJpeg;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceJpegEnc.h"
|
||||
|
||||
LOG_CHANNEL(sceJpegEnc);
|
||||
|
||||
s32 sceJpegEncoderGetContextSize()
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -73,15 +75,10 @@ s32 sceJpegEncoderCsc(
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceJpegEnc, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceJpegEncUser, nid, name)
|
||||
|
||||
psv_log_base sceJpegEnc("SceJpegEnc", []()
|
||||
DECLARE(arm_module_manager::SceJpegEnc)("SceJpegEncUser", []()
|
||||
{
|
||||
sceJpegEnc.on_load = nullptr;
|
||||
sceJpegEnc.on_unload = nullptr;
|
||||
sceJpegEnc.on_stop = nullptr;
|
||||
sceJpegEnc.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x2B55844D, sceJpegEncoderGetContextSize);
|
||||
REG_FUNC(0x88DA92B4, sceJpegEncoderInit);
|
||||
REG_FUNC(0xC60DE94C, sceJpegEncoderEncode);
|
||||
|
@ -1,5 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
using SceJpegEncoderContext = vm::ptr<void>;
|
||||
|
||||
extern psv_log_base sceJpegEnc;
|
||||
|
@ -1,14 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/PSVObjectList.h"
|
||||
|
||||
#include "Emu/SysCalls/Callback.h"
|
||||
#include "Emu/ARMv7/ARMv7Thread.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceLibKernel.h"
|
||||
|
||||
LOG_CHANNEL(sceLibKernel);
|
||||
|
||||
extern u64 get_system_time();
|
||||
|
||||
s32 sceKernelAllocMemBlock(vm::cptr<char> name, s32 type, u32 vsize, vm::ptr<SceKernelAllocMemBlockOpt> pOpt)
|
||||
@ -31,22 +29,22 @@ s32 sceKernelGetMemBlockInfoByAddr(vm::ptr<void> vbase, vm::ptr<SceKernelMemBloc
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
s32 sceKernelCreateThread(vm::cptr<char> pName, vm::ptr<SceKernelThreadEntry> entry, s32 initPriority, u32 stackSize, u32 attr, s32 cpuAffinityMask, vm::cptr<SceKernelThreadOptParam> pOptParam)
|
||||
arm_error_code sceKernelCreateThread(vm::cptr<char> pName, vm::ptr<SceKernelThreadEntry> entry, s32 initPriority, u32 stackSize, u32 attr, s32 cpuAffinityMask, vm::cptr<SceKernelThreadOptParam> pOptParam)
|
||||
{
|
||||
sceLibKernel.warning("sceKernelCreateThread(pName=*0x%x, entry=*0x%x, initPriority=%d, stackSize=0x%x, attr=0x%x, cpuAffinityMask=0x%x, pOptParam=*0x%x)",
|
||||
pName, entry, initPriority, stackSize, attr, cpuAffinityMask, pOptParam);
|
||||
|
||||
auto armv7 = idm::make_ptr<ARMv7Thread>(pName.get_ptr());
|
||||
const auto thread = idm::make_ptr<ARMv7Thread>(pName.get_ptr());
|
||||
|
||||
armv7->PC = entry.addr();
|
||||
armv7->prio = initPriority;
|
||||
armv7->stack_size = stackSize;
|
||||
armv7->run();
|
||||
thread->PC = entry.addr();
|
||||
thread->prio = initPriority;
|
||||
thread->stack_size = stackSize;
|
||||
thread->cpu_init();
|
||||
|
||||
return armv7->get_id();
|
||||
return NOT_AN_ERROR(thread->id);
|
||||
}
|
||||
|
||||
s32 sceKernelStartThread(s32 threadId, u32 argSize, vm::cptr<void> pArgBlock)
|
||||
arm_error_code sceKernelStartThread(s32 threadId, u32 argSize, vm::cptr<void> pArgBlock)
|
||||
{
|
||||
sceLibKernel.warning("sceKernelStartThread(threadId=0x%x, argSize=0x%x, pArgBlock=*0x%x)", threadId, argSize, pArgBlock);
|
||||
|
||||
@ -72,21 +70,22 @@ s32 sceKernelStartThread(s32 threadId, u32 argSize, vm::cptr<void> pArgBlock)
|
||||
thread->GPR[0] = argSize;
|
||||
thread->GPR[1] = pos;
|
||||
|
||||
thread->exec();
|
||||
thread->state -= cpu_state::stop;
|
||||
thread->safe_notify();
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 sceKernelExitThread(ARMv7Thread& context, s32 exitStatus)
|
||||
arm_error_code sceKernelExitThread(ARMv7Thread& cpu, s32 exitStatus)
|
||||
{
|
||||
sceLibKernel.warning("sceKernelExitThread(exitStatus=0x%x)", exitStatus);
|
||||
|
||||
// exit status is stored in r0
|
||||
context.exit();
|
||||
// Exit status is stored in r0
|
||||
cpu.state += cpu_state::exit;
|
||||
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 sceKernelDeleteThread(s32 threadId)
|
||||
arm_error_code sceKernelDeleteThread(s32 threadId)
|
||||
{
|
||||
sceLibKernel.warning("sceKernelDeleteThread(threadId=0x%x)", threadId);
|
||||
|
||||
@ -108,15 +107,14 @@ s32 sceKernelDeleteThread(s32 threadId)
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 sceKernelExitDeleteThread(ARMv7Thread& context, s32 exitStatus)
|
||||
arm_error_code sceKernelExitDeleteThread(ARMv7Thread& cpu, s32 exitStatus)
|
||||
{
|
||||
sceLibKernel.warning("sceKernelExitDeleteThread(exitStatus=0x%x)", exitStatus);
|
||||
|
||||
// exit status is stored in r0
|
||||
context.stop();
|
||||
//cpu.state += cpu_state::stop;
|
||||
|
||||
// current thread should be deleted
|
||||
idm::remove<ARMv7Thread>(context.get_id());
|
||||
// Delete current thread; exit status is stored in r0
|
||||
idm::remove<ARMv7Thread>(cpu.id);
|
||||
|
||||
return SCE_OK;
|
||||
}
|
||||
@ -149,11 +147,11 @@ s32 sceKernelGetThreadCurrentPriority()
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
u32 sceKernelGetThreadId(ARMv7Thread& context)
|
||||
u32 sceKernelGetThreadId(ARMv7Thread& cpu)
|
||||
{
|
||||
sceLibKernel.trace("sceKernelGetThreadId()");
|
||||
|
||||
return context.get_id();
|
||||
return cpu.id;
|
||||
}
|
||||
|
||||
s32 sceKernelChangeCurrentThreadAttr(u32 clearAttr, u32 setAttr)
|
||||
@ -205,24 +203,17 @@ s32 sceKernelGetSystemInfo(vm::ptr<SceKernelSystemInfo> pInfo)
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
s32 sceKernelGetThreadmgrUIDClass(s32 uid)
|
||||
arm_error_code sceKernelGetThreadmgrUIDClass(s32 uid)
|
||||
{
|
||||
sceLibKernel.error("sceKernelGetThreadmgrUIDClass(uid=0x%x)", uid);
|
||||
|
||||
const auto type = idm::get_type(uid);
|
||||
|
||||
if (!type)
|
||||
{
|
||||
return SCE_KERNEL_ERROR_INVALID_UID;
|
||||
}
|
||||
|
||||
if (*type == typeid(ARMv7Thread)) return SCE_KERNEL_THREADMGR_UID_CLASS_THREAD;
|
||||
if (*type == typeid(psv_semaphore_t)) return SCE_KERNEL_THREADMGR_UID_CLASS_SEMA;
|
||||
if (*type == typeid(psv_event_flag_t)) return SCE_KERNEL_THREADMGR_UID_CLASS_EVENT_FLAG;
|
||||
if (*type == typeid(psv_mutex_t)) return SCE_KERNEL_THREADMGR_UID_CLASS_MUTEX;
|
||||
if (*type == typeid(psv_cond_t)) return SCE_KERNEL_THREADMGR_UID_CLASS_COND;
|
||||
if (idm::check<ARMv7Thread>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_THREAD;
|
||||
if (idm::check<psv_semaphore_t>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_SEMA;
|
||||
if (idm::check<psv_event_flag_t>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_EVENT_FLAG;
|
||||
if (idm::check<psv_mutex_t>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_MUTEX;
|
||||
if (idm::check<psv_cond_t>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_COND;
|
||||
|
||||
throw EXCEPTION("Unknown UID class (type='%s')", type->name());
|
||||
return SCE_KERNEL_ERROR_INVALID_UID;
|
||||
}
|
||||
|
||||
s32 sceKernelChangeThreadVfpException(s32 clearMask, s32 setMask)
|
||||
@ -253,7 +244,7 @@ s32 sceKernelDelayThreadCB(u32 usec)
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
s32 sceKernelWaitThreadEnd(s32 threadId, vm::ptr<s32> pExitStatus, vm::ptr<u32> pTimeout)
|
||||
arm_error_code sceKernelWaitThreadEnd(s32 threadId, vm::ptr<s32> pExitStatus, vm::ptr<u32> pTimeout)
|
||||
{
|
||||
sceLibKernel.warning("sceKernelWaitThreadEnd(threadId=0x%x, pExitStatus=*0x%x, pTimeout=*0x%x)", threadId, pExitStatus, pTimeout);
|
||||
|
||||
@ -268,7 +259,7 @@ s32 sceKernelWaitThreadEnd(s32 threadId, vm::ptr<s32> pExitStatus, vm::ptr<u32>
|
||||
{
|
||||
}
|
||||
|
||||
while (thread->is_alive())
|
||||
while (!(thread->state & cpu_state::exit))
|
||||
{
|
||||
CHECK_EMU_STATUS;
|
||||
|
||||
@ -381,14 +372,14 @@ s32 sceKernelWaitMultipleEventsCB(vm::ptr<SceKernelWaitEvent> pWaitEventList, s3
|
||||
|
||||
// Event flag functions
|
||||
|
||||
s32 sceKernelCreateEventFlag(vm::cptr<char> pName, u32 attr, u32 initPattern, vm::cptr<SceKernelEventFlagOptParam> pOptParam)
|
||||
arm_error_code sceKernelCreateEventFlag(vm::cptr<char> pName, u32 attr, u32 initPattern, vm::cptr<SceKernelEventFlagOptParam> pOptParam)
|
||||
{
|
||||
sceLibKernel.error("sceKernelCreateEventFlag(pName=*0x%x, attr=0x%x, initPattern=0x%x, pOptParam=*0x%x)", pName, attr, initPattern, pOptParam);
|
||||
|
||||
return idm::make<psv_event_flag_t>(pName.get_ptr(), attr, initPattern);
|
||||
return NOT_AN_ERROR(idm::make<psv_event_flag_t>(pName.get_ptr(), attr, initPattern));
|
||||
}
|
||||
|
||||
s32 sceKernelDeleteEventFlag(s32 evfId)
|
||||
arm_error_code sceKernelDeleteEventFlag(s32 evfId)
|
||||
{
|
||||
sceLibKernel.error("sceKernelDeleteEventFlag(evfId=0x%x)", evfId);
|
||||
|
||||
@ -408,7 +399,7 @@ s32 sceKernelDeleteEventFlag(s32 evfId)
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 sceKernelOpenEventFlag(vm::cptr<char> pName)
|
||||
arm_error_code sceKernelOpenEventFlag(vm::cptr<char> pName)
|
||||
{
|
||||
sceLibKernel.error("sceKernelOpenEventFlag(pName=*0x%x)", pName);
|
||||
|
||||
@ -419,14 +410,14 @@ s32 sceKernelOpenEventFlag(vm::cptr<char> pName)
|
||||
|
||||
if (evf->name == pName.get_ptr() && evf->ref.atomic_op(ipc_ref_try_inc))
|
||||
{
|
||||
return idm::import(evf);
|
||||
return NOT_AN_ERROR(idm::import_existing(evf));
|
||||
}
|
||||
}
|
||||
|
||||
return SCE_KERNEL_ERROR_UID_CANNOT_FIND_BY_NAME;
|
||||
}
|
||||
|
||||
s32 sceKernelCloseEventFlag(s32 evfId)
|
||||
arm_error_code sceKernelCloseEventFlag(s32 evfId)
|
||||
{
|
||||
sceLibKernel.error("sceKernelCloseEventFlag(evfId=0x%x)", evfId);
|
||||
|
||||
@ -446,7 +437,7 @@ s32 sceKernelCloseEventFlag(s32 evfId)
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 sceKernelWaitEventFlag(ARMv7Thread& context, s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat, vm::ptr<u32> pTimeout)
|
||||
arm_error_code sceKernelWaitEventFlag(ARMv7Thread& cpu, s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat, vm::ptr<u32> pTimeout)
|
||||
{
|
||||
sceLibKernel.error("sceKernelWaitEventFlag(evfId=0x%x, bitPattern=0x%x, waitMode=0x%x, pResultPat=*0x%x, pTimeout=*0x%x)", evfId, bitPattern, waitMode, pResultPat, pTimeout);
|
||||
|
||||
@ -462,7 +453,7 @@ s32 sceKernelWaitEventFlag(ARMv7Thread& context, s32 evfId, u32 bitPattern, u32
|
||||
|
||||
std::unique_lock<std::mutex> lock(evf->mutex);
|
||||
|
||||
const u32 result = evf->pattern.atomic_op(event_flag_try_poll, bitPattern, waitMode);
|
||||
const u32 result = evf->pattern.fetch_op(event_flag_try_poll, bitPattern, waitMode);
|
||||
|
||||
if (event_flag_test(result, bitPattern, waitMode))
|
||||
{
|
||||
@ -472,13 +463,13 @@ s32 sceKernelWaitEventFlag(ARMv7Thread& context, s32 evfId, u32 bitPattern, u32
|
||||
}
|
||||
|
||||
// fixup register values for external use
|
||||
context.GPR[1] = bitPattern;
|
||||
context.GPR[2] = waitMode;
|
||||
cpu.GPR[1] = bitPattern;
|
||||
cpu.GPR[2] = waitMode;
|
||||
|
||||
// add waiter; attributes are ignored in current implementation
|
||||
sleep_queue_entry_t waiter(context, evf->sq);
|
||||
sleep_entry<cpu_thread> waiter(evf->sq, cpu);
|
||||
|
||||
while (!context.unsignal())
|
||||
while (!cpu.state.test_and_reset(cpu_state::signal))
|
||||
{
|
||||
CHECK_EMU_STATUS;
|
||||
|
||||
@ -488,33 +479,33 @@ s32 sceKernelWaitEventFlag(ARMv7Thread& context, s32 evfId, u32 bitPattern, u32
|
||||
|
||||
if (passed >= timeout)
|
||||
{
|
||||
context.GPR[0] = SCE_KERNEL_ERROR_WAIT_TIMEOUT;
|
||||
context.GPR[1] = evf->pattern;
|
||||
cpu.GPR[0] = SCE_KERNEL_ERROR_WAIT_TIMEOUT;
|
||||
cpu.GPR[1] = evf->pattern;
|
||||
break;
|
||||
}
|
||||
|
||||
context.cv.wait_for(lock, std::chrono::microseconds(timeout - passed));
|
||||
cpu.cv.wait_for(lock, std::chrono::microseconds(timeout - passed));
|
||||
}
|
||||
else
|
||||
{
|
||||
context.cv.wait(lock);
|
||||
cpu.cv.wait(lock);
|
||||
}
|
||||
}
|
||||
|
||||
if (pResultPat) *pResultPat = context.GPR[1];
|
||||
if (pResultPat) *pResultPat = cpu.GPR[1];
|
||||
if (pTimeout) *pTimeout = static_cast<u32>(std::max<s64>(0, timeout - (get_system_time() - start_time)));
|
||||
|
||||
return context.GPR[0];
|
||||
return NOT_AN_ERROR(cpu.GPR[0]);
|
||||
}
|
||||
|
||||
s32 sceKernelWaitEventFlagCB(ARMv7Thread& context, s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat, vm::ptr<u32> pTimeout)
|
||||
arm_error_code sceKernelWaitEventFlagCB(ARMv7Thread& cpu, s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat, vm::ptr<u32> pTimeout)
|
||||
{
|
||||
sceLibKernel.todo("sceKernelWaitEventFlagCB(evfId=0x%x, bitPattern=0x%x, waitMode=0x%x, pResultPat=*0x%x, pTimeout=*0x%x)", evfId, bitPattern, waitMode, pResultPat, pTimeout);
|
||||
|
||||
return sceKernelWaitEventFlag(context, evfId, bitPattern, waitMode, pResultPat, pTimeout);
|
||||
return sceKernelWaitEventFlag(cpu, evfId, bitPattern, waitMode, pResultPat, pTimeout);
|
||||
}
|
||||
|
||||
s32 sceKernelPollEventFlag(s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat)
|
||||
arm_error_code sceKernelPollEventFlag(s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat)
|
||||
{
|
||||
sceLibKernel.error("sceKernelPollEventFlag(evfId=0x%x, bitPattern=0x%x, waitMode=0x%x, pResultPat=*0x%x)", evfId, bitPattern, waitMode, pResultPat);
|
||||
|
||||
@ -527,7 +518,7 @@ s32 sceKernelPollEventFlag(s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32>
|
||||
|
||||
std::lock_guard<std::mutex> lock(evf->mutex);
|
||||
|
||||
const u32 result = evf->pattern.atomic_op(event_flag_try_poll, bitPattern, waitMode);
|
||||
const u32 result = evf->pattern.fetch_op(event_flag_try_poll, bitPattern, waitMode);
|
||||
|
||||
if (!event_flag_test(result, bitPattern, waitMode))
|
||||
{
|
||||
@ -539,7 +530,7 @@ s32 sceKernelPollEventFlag(s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32>
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 sceKernelSetEventFlag(s32 evfId, u32 bitPattern)
|
||||
arm_error_code sceKernelSetEventFlag(s32 evfId, u32 bitPattern)
|
||||
{
|
||||
sceLibKernel.error("sceKernelSetEventFlag(evfId=0x%x, bitPattern=0x%x)", evfId, bitPattern);
|
||||
|
||||
@ -554,24 +545,25 @@ s32 sceKernelSetEventFlag(s32 evfId, u32 bitPattern)
|
||||
|
||||
evf->pattern |= bitPattern;
|
||||
|
||||
auto pred = [&](sleep_queue_t::value_type& thread) -> bool
|
||||
auto pred = [&](cpu_thread* thread) -> bool
|
||||
{
|
||||
auto& context = static_cast<ARMv7Thread&>(*thread);
|
||||
auto& cpu = static_cast<ARMv7Thread&>(*thread);
|
||||
|
||||
// load pattern and mode from registers
|
||||
const u32 pattern = context.GPR[1];
|
||||
const u32 mode = context.GPR[2];
|
||||
const u32 pattern = cpu.GPR[1];
|
||||
const u32 mode = cpu.GPR[2];
|
||||
|
||||
// check specific pattern
|
||||
const u32 result = evf->pattern.atomic_op(event_flag_try_poll, pattern, mode);
|
||||
const u32 result = evf->pattern.fetch_op(event_flag_try_poll, pattern, mode);
|
||||
|
||||
if (event_flag_test(result, pattern, mode))
|
||||
{
|
||||
// save pattern
|
||||
context.GPR[0] = SCE_OK;
|
||||
context.GPR[1] = result;
|
||||
cpu.GPR[0] = SCE_OK;
|
||||
cpu.GPR[1] = result;
|
||||
|
||||
context.signal();
|
||||
thread->state += cpu_state::signal;
|
||||
thread->cv.notify_one();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -584,7 +576,7 @@ s32 sceKernelSetEventFlag(s32 evfId, u32 bitPattern)
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 sceKernelClearEventFlag(s32 evfId, u32 bitPattern)
|
||||
arm_error_code sceKernelClearEventFlag(s32 evfId, u32 bitPattern)
|
||||
{
|
||||
sceLibKernel.error("sceKernelClearEventFlag(evfId=0x%x, bitPattern=0x%x)", evfId, bitPattern);
|
||||
|
||||
@ -602,7 +594,7 @@ s32 sceKernelClearEventFlag(s32 evfId, u32 bitPattern)
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 sceKernelCancelEventFlag(s32 evfId, u32 setPattern, vm::ptr<s32> pNumWaitThreads)
|
||||
arm_error_code sceKernelCancelEventFlag(s32 evfId, u32 setPattern, vm::ptr<s32> pNumWaitThreads)
|
||||
{
|
||||
sceLibKernel.error("sceKernelCancelEventFlag(evfId=0x%x, setPattern=0x%x, pNumWaitThreads=*0x%x)", evfId, setPattern, pNumWaitThreads);
|
||||
|
||||
@ -619,7 +611,8 @@ s32 sceKernelCancelEventFlag(s32 evfId, u32 setPattern, vm::ptr<s32> pNumWaitThr
|
||||
{
|
||||
static_cast<ARMv7Thread&>(*thread).GPR[0] = SCE_KERNEL_ERROR_WAIT_CANCEL;
|
||||
static_cast<ARMv7Thread&>(*thread).GPR[1] = setPattern;
|
||||
thread->signal();
|
||||
thread->state += cpu_state::signal;
|
||||
thread->cv.notify_one();
|
||||
}
|
||||
|
||||
*pNumWaitThreads = static_cast<u32>(evf->sq.size());
|
||||
@ -630,7 +623,7 @@ s32 sceKernelCancelEventFlag(s32 evfId, u32 setPattern, vm::ptr<s32> pNumWaitThr
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 sceKernelGetEventFlagInfo(s32 evfId, vm::ptr<SceKernelEventFlagInfo> pInfo)
|
||||
arm_error_code sceKernelGetEventFlagInfo(s32 evfId, vm::ptr<SceKernelEventFlagInfo> pInfo)
|
||||
{
|
||||
sceLibKernel.error("sceKernelGetEventFlagInfo(evfId=0x%x, pInfo=*0x%x)", evfId, pInfo);
|
||||
|
||||
@ -658,14 +651,14 @@ s32 sceKernelGetEventFlagInfo(s32 evfId, vm::ptr<SceKernelEventFlagInfo> pInfo)
|
||||
|
||||
// Semaphore functions
|
||||
|
||||
s32 sceKernelCreateSema(vm::cptr<char> pName, u32 attr, s32 initCount, s32 maxCount, vm::cptr<SceKernelSemaOptParam> pOptParam)
|
||||
arm_error_code sceKernelCreateSema(vm::cptr<char> pName, u32 attr, s32 initCount, s32 maxCount, vm::cptr<SceKernelSemaOptParam> pOptParam)
|
||||
{
|
||||
sceLibKernel.error("sceKernelCreateSema(pName=*0x%x, attr=0x%x, initCount=%d, maxCount=%d, pOptParam=*0x%x)", pName, attr, initCount, maxCount, pOptParam);
|
||||
|
||||
return idm::make<psv_semaphore_t>(pName.get_ptr(), attr, initCount, maxCount);
|
||||
return NOT_AN_ERROR(idm::make<psv_semaphore_t>(pName.get_ptr(), attr, initCount, maxCount));
|
||||
}
|
||||
|
||||
s32 sceKernelDeleteSema(s32 semaId)
|
||||
arm_error_code sceKernelDeleteSema(s32 semaId)
|
||||
{
|
||||
sceLibKernel.error("sceKernelDeleteSema(semaId=0x%x)", semaId);
|
||||
|
||||
@ -691,7 +684,7 @@ s32 sceKernelCloseSema(s32 semaId)
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
s32 sceKernelWaitSema(s32 semaId, s32 needCount, vm::ptr<u32> pTimeout)
|
||||
arm_error_code sceKernelWaitSema(s32 semaId, s32 needCount, vm::ptr<u32> pTimeout)
|
||||
{
|
||||
sceLibKernel.error("sceKernelWaitSema(semaId=0x%x, needCount=%d, pTimeout=*0x%x)", semaId, needCount, pTimeout);
|
||||
|
||||
@ -734,14 +727,14 @@ s32 sceKernelGetSemaInfo(s32 semaId, vm::ptr<SceKernelSemaInfo> pInfo)
|
||||
|
||||
// Mutex functions
|
||||
|
||||
s32 sceKernelCreateMutex(vm::cptr<char> pName, u32 attr, s32 initCount, vm::cptr<SceKernelMutexOptParam> pOptParam)
|
||||
arm_error_code sceKernelCreateMutex(vm::cptr<char> pName, u32 attr, s32 initCount, vm::cptr<SceKernelMutexOptParam> pOptParam)
|
||||
{
|
||||
sceLibKernel.error("sceKernelCreateMutex(pName=*0x%x, attr=0x%x, initCount=%d, pOptParam=*0x%x)", pName, attr, initCount, pOptParam);
|
||||
|
||||
return idm::make<psv_mutex_t>(pName.get_ptr(), attr, initCount);
|
||||
return NOT_AN_ERROR(idm::make<psv_mutex_t>(pName.get_ptr(), attr, initCount));
|
||||
}
|
||||
|
||||
s32 sceKernelDeleteMutex(s32 mutexId)
|
||||
arm_error_code sceKernelDeleteMutex(s32 mutexId)
|
||||
{
|
||||
sceLibKernel.error("sceKernelDeleteMutex(mutexId=0x%x)", mutexId);
|
||||
|
||||
@ -841,7 +834,7 @@ s32 sceKernelGetLwMutexInfoById(s32 lwMutexId, vm::ptr<SceKernelLwMutexInfo> pIn
|
||||
|
||||
// Condition variable functions
|
||||
|
||||
s32 sceKernelCreateCond(vm::cptr<char> pName, u32 attr, s32 mutexId, vm::cptr<SceKernelCondOptParam> pOptParam)
|
||||
arm_error_code sceKernelCreateCond(vm::cptr<char> pName, u32 attr, s32 mutexId, vm::cptr<SceKernelCondOptParam> pOptParam)
|
||||
{
|
||||
sceLibKernel.error("sceKernelCreateCond(pName=*0x%x, attr=0x%x, mutexId=0x%x, pOptParam=*0x%x)", pName, attr, mutexId, pOptParam);
|
||||
|
||||
@ -852,10 +845,10 @@ s32 sceKernelCreateCond(vm::cptr<char> pName, u32 attr, s32 mutexId, vm::cptr<Sc
|
||||
return SCE_KERNEL_ERROR_INVALID_UID;
|
||||
}
|
||||
|
||||
return idm::make<psv_cond_t>(pName.get_ptr(), attr, mutex);
|
||||
return NOT_AN_ERROR(idm::make<psv_cond_t>(pName.get_ptr(), attr, mutex));
|
||||
}
|
||||
|
||||
s32 sceKernelDeleteCond(s32 condId)
|
||||
arm_error_code sceKernelDeleteCond(s32 condId)
|
||||
{
|
||||
sceLibKernel.error("sceKernelDeleteCond(condId=0x%x)", condId);
|
||||
|
||||
@ -1227,15 +1220,10 @@ s32 sceIoGetstat(vm::cptr<char> name, vm::ptr<SceIoStat> buf)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLibKernel, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceLibKernel, nid, name)
|
||||
|
||||
psv_log_base sceLibKernel("sceLibKernel", []()
|
||||
DECLARE(arm_module_manager::SceLibKernel)("SceLibKernel", []()
|
||||
{
|
||||
sceLibKernel.on_load = nullptr;
|
||||
sceLibKernel.on_unload = nullptr;
|
||||
sceLibKernel.on_stop = nullptr;
|
||||
//sceLibKernel.on_error = nullptr; // keep default error handler
|
||||
|
||||
// REG_FUNC(???, sceKernelGetEventInfo);
|
||||
|
||||
//REG_FUNC(0x023EAA62, sceKernelPuts);
|
||||
@ -1544,62 +1532,91 @@ psv_log_base sceLibKernel("sceLibKernel", []()
|
||||
//REG_FUNC(0x963F4A99, sceSblACMgrIsGameProgram);
|
||||
//REG_FUNC(0x261E2C34, sceKernelGetOpenPsId);
|
||||
|
||||
/* SceModulemgr */
|
||||
//REG_FUNC(0x36585DAF, sceKernelGetModuleInfo);
|
||||
//REG_FUNC(0x2EF2581F, sceKernelGetModuleList);
|
||||
//REG_FUNC(0xF5798C7C, sceKernelGetModuleIdByAddr);
|
||||
|
||||
/* SceProcessmgr */
|
||||
//REG_FUNC(0xCD248267, sceKernelGetCurrentProcess);
|
||||
//REG_FUNC(0x2252890C, sceKernelPowerTick);
|
||||
//REG_FUNC(0x9E45DA09, sceKernelLibcClock);
|
||||
//REG_FUNC(0x0039BE45, sceKernelLibcTime);
|
||||
//REG_FUNC(0x4B879059, sceKernelLibcGettimeofday);
|
||||
//REG_FUNC(0xC1727F59, sceKernelGetStdin);
|
||||
//REG_FUNC(0xE5AA625C, sceKernelGetStdout);
|
||||
//REG_FUNC(0xFA5E3ADA, sceKernelGetStderr);
|
||||
//REG_FUNC(0xE6E9FCA3, sceKernelGetRemoteProcessTime);
|
||||
//REG_FUNC(0xD37A8437, sceKernelGetProcessTime);
|
||||
//REG_FUNC(0xF5D0D4C6, sceKernelGetProcessTimeLow);
|
||||
//REG_FUNC(0x89DA0967, sceKernelGetProcessTimeWide);
|
||||
//REG_FUNC(0x2BE3E066, sceKernelGetProcessParam);
|
||||
|
||||
/* SceStdio */
|
||||
//REG_FUNC(0x54237407, sceKernelStdin);
|
||||
//REG_FUNC(0x9033E9BD, sceKernelStdout);
|
||||
//REG_FUNC(0x35EE7CF5, sceKernelStderr);
|
||||
|
||||
/* SceSysmem */
|
||||
REG_FUNC(0xB9D5EBDE, sceKernelAllocMemBlock);
|
||||
REG_FUNC(0xA91E15EE, sceKernelFreeMemBlock);
|
||||
REG_FUNC(0xB8EF5818, sceKernelGetMemBlockBase);
|
||||
//REG_FUNC(0x3B29E0F5, sceKernelRemapMemBlock);
|
||||
//REG_FUNC(0xA33B99D1, sceKernelFindMemBlockByAddr);
|
||||
REG_FUNC(0x4010AD65, sceKernelGetMemBlockInfoByAddr);
|
||||
|
||||
/* SceCpu */
|
||||
//REG_FUNC(0x2704CFEE, sceKernelCpuId);
|
||||
|
||||
/* SceDipsw */
|
||||
//REG_FUNC(0x1C783FB2, sceKernelCheckDipsw);
|
||||
//REG_FUNC(0x817053D4, sceKernelSetDipsw);
|
||||
//REG_FUNC(0x800EDCC1, sceKernelClearDipsw);
|
||||
|
||||
/* SceThreadmgr */
|
||||
REG_FUNC(0x0C8A38E1, sceKernelExitThread);
|
||||
REG_FUNC(0x1D17DECF, sceKernelExitDeleteThread);
|
||||
REG_FUNC(0x4B675D05, sceKernelDelayThread);
|
||||
REG_FUNC(0x9C0180E1, sceKernelDelayThreadCB);
|
||||
//REG_FUNC(0x001173F8, sceKernelChangeActiveCpuMask);
|
||||
REG_FUNC(0x01414F0B, sceKernelGetThreadCurrentPriority);
|
||||
REG_FUNC(0x751C9B7A, sceKernelChangeCurrentThreadAttr);
|
||||
REG_FUNC(0xD9BD74EB, sceKernelCheckWaitableStatus);
|
||||
REG_FUNC(0x9DCB4B7A, sceKernelGetProcessId);
|
||||
REG_FUNC(0xE53E41F6, sceKernelCheckCallback);
|
||||
REG_FUNC(0xF4EE4FA9, sceKernelGetSystemTimeWide);
|
||||
REG_FUNC(0x47F6DE49, sceKernelGetSystemTimeLow);
|
||||
//REG_FUNC(0xC0FAF6A3, sceKernelCreateThreadForUser);
|
||||
|
||||
/* SceDebugLed */
|
||||
//REG_FUNC(0x78E702D3, sceKernelSetGPO);
|
||||
//REG_FUNC(0x4C4672BF, sceKernelGetProcessTime); // !!!
|
||||
});
|
||||
|
||||
DECLARE(arm_module_manager::SceIofilemgr)("SceIofilemgr", []()
|
||||
{
|
||||
REG_FNID(SceIofilemgr, 0x34EFD876, sceIoWrite); // !!!
|
||||
REG_FNID(SceIofilemgr, 0xC70B8886, sceIoClose); // !!!
|
||||
REG_FNID(SceIofilemgr, 0xFDB32293, sceIoRead); // !!!
|
||||
});
|
||||
|
||||
DECLARE(arm_module_manager::SceModulemgr)("SceModulemgr", []()
|
||||
{
|
||||
//REG_FNID(SceModulemgr, 0x36585DAF, sceKernelGetModuleInfo);
|
||||
//REG_FNID(SceModulemgr, 0x2EF2581F, sceKernelGetModuleList);
|
||||
//REG_FNID(SceModulemgr, 0xF5798C7C, sceKernelGetModuleIdByAddr);
|
||||
});
|
||||
|
||||
DECLARE(arm_module_manager::SceProcessmgr)("SceProcessmgr", []()
|
||||
{
|
||||
//REG_FNID(SceProcessmgr, 0xCD248267, sceKernelGetCurrentProcess);
|
||||
//REG_FNID(SceProcessmgr, 0x2252890C, sceKernelPowerTick);
|
||||
//REG_FNID(SceProcessmgr, 0x9E45DA09, sceKernelLibcClock);
|
||||
//REG_FNID(SceProcessmgr, 0x0039BE45, sceKernelLibcTime);
|
||||
//REG_FNID(SceProcessmgr, 0x4B879059, sceKernelLibcGettimeofday);
|
||||
//REG_FNID(SceProcessmgr, 0xC1727F59, sceKernelGetStdin);
|
||||
//REG_FNID(SceProcessmgr, 0xE5AA625C, sceKernelGetStdout);
|
||||
//REG_FNID(SceProcessmgr, 0xFA5E3ADA, sceKernelGetStderr);
|
||||
//REG_FNID(SceProcessmgr, 0xE6E9FCA3, sceKernelGetRemoteProcessTime);
|
||||
//REG_FNID(SceProcessmgr, 0xD37A8437, sceKernelGetProcessTime);
|
||||
//REG_FNID(SceProcessmgr, 0xF5D0D4C6, sceKernelGetProcessTimeLow);
|
||||
//REG_FNID(SceProcessmgr, 0x89DA0967, sceKernelGetProcessTimeWide);
|
||||
//REG_FNID(SceProcessmgr, 0x2BE3E066, sceKernelGetProcessParam);
|
||||
});
|
||||
|
||||
DECLARE(arm_module_manager::SceStdio)("SceStdio", []()
|
||||
{
|
||||
//REG_FNID(SceStdio, 0x54237407, sceKernelStdin);
|
||||
//REG_FNID(SceStdio, 0x9033E9BD, sceKernelStdout);
|
||||
//REG_FNID(SceStdio, 0x35EE7CF5, sceKernelStderr);
|
||||
});
|
||||
|
||||
DECLARE(arm_module_manager::SceSysmem)("SceSysmem", []()
|
||||
{
|
||||
REG_FNID(SceSysmem, 0xB9D5EBDE, sceKernelAllocMemBlock);
|
||||
REG_FNID(SceSysmem, 0xA91E15EE, sceKernelFreeMemBlock);
|
||||
REG_FNID(SceSysmem, 0xB8EF5818, sceKernelGetMemBlockBase);
|
||||
//REG_FNID(SceSysmem, 0x3B29E0F5, sceKernelRemapMemBlock);
|
||||
//REG_FNID(SceSysmem, 0xA33B99D1, sceKernelFindMemBlockByAddr);
|
||||
REG_FNID(SceSysmem, 0x4010AD65, sceKernelGetMemBlockInfoByAddr);
|
||||
});
|
||||
|
||||
DECLARE(arm_module_manager::SceCpu)("SceCpu", []()
|
||||
{
|
||||
//REG_FNID(SceCpu, 0x2704CFEE, sceKernelCpuId);
|
||||
});
|
||||
|
||||
DECLARE(arm_module_manager::SceDipsw)("SceDipsw", []()
|
||||
{
|
||||
//REG_FNID(SceDipsw, 0x1C783FB2, sceKernelCheckDipsw);
|
||||
//REG_FNID(SceDipsw, 0x817053D4, sceKernelSetDipsw);
|
||||
//REG_FNID(SceDipsw, 0x800EDCC1, sceKernelClearDipsw);
|
||||
});
|
||||
|
||||
DECLARE(arm_module_manager::SceThreadmgr)("SceThreadmgr", []()
|
||||
{
|
||||
REG_FNID(SceThreadmgr, 0x0C8A38E1, sceKernelExitThread);
|
||||
REG_FNID(SceThreadmgr, 0x1D17DECF, sceKernelExitDeleteThread);
|
||||
REG_FNID(SceThreadmgr, 0x4B675D05, sceKernelDelayThread);
|
||||
REG_FNID(SceThreadmgr, 0x9C0180E1, sceKernelDelayThreadCB);
|
||||
REG_FNID(SceThreadmgr, 0x1BBDE3D9, sceKernelDeleteThread); // !!!
|
||||
//REG_FNID(SceThreadmgr, 0x001173F8, sceKernelChangeActiveCpuMask);
|
||||
REG_FNID(SceThreadmgr, 0x01414F0B, sceKernelGetThreadCurrentPriority);
|
||||
REG_FNID(SceThreadmgr, 0x751C9B7A, sceKernelChangeCurrentThreadAttr);
|
||||
REG_FNID(SceThreadmgr, 0xD9BD74EB, sceKernelCheckWaitableStatus);
|
||||
REG_FNID(SceThreadmgr, 0x9DCB4B7A, sceKernelGetProcessId);
|
||||
REG_FNID(SceThreadmgr, 0xB19CF7E9, sceKernelCreateCallback); // !!!
|
||||
REG_FNID(SceThreadmgr, 0xD469676B, sceKernelDeleteCallback); // !!!
|
||||
REG_FNID(SceThreadmgr, 0xE53E41F6, sceKernelCheckCallback);
|
||||
REG_FNID(SceThreadmgr, 0xF4EE4FA9, sceKernelGetSystemTimeWide);
|
||||
REG_FNID(SceThreadmgr, 0x47F6DE49, sceKernelGetSystemTimeLow);
|
||||
//REG_FNID(SceThreadmgr, 0xC0FAF6A3, sceKernelCreateThreadForUser);
|
||||
REG_FNID(SceThreadmgr, 0xF1AE5654, sceKernelGetThreadCpuAffinityMask); // !!!
|
||||
});
|
||||
|
||||
DECLARE(arm_module_manager::SceDebugLed)("SceDebugLed", []()
|
||||
{
|
||||
//REG_FNID(SceDebugLed, 0x78E702D3, sceKernelSetGPO);
|
||||
});
|
||||
|
@ -1,258 +1,540 @@
|
||||
#pragma once
|
||||
|
||||
#include "Utilities/SleepQueue.h"
|
||||
#include "Emu/ARMv7/ErrorCodes.h"
|
||||
|
||||
// Error Codes
|
||||
|
||||
enum
|
||||
enum SceLibKernelError : s32
|
||||
{
|
||||
SCE_KERNEL_ERROR_ERROR = 0x80020001,
|
||||
SCE_KERNEL_ERROR_NOT_IMPLEMENTED = 0x80020002,
|
||||
SCE_KERNEL_ERROR_INVALID_ARGUMENT = 0x80020003,
|
||||
SCE_KERNEL_ERROR_INVALID_ARGUMENT_SIZE = 0x80020004,
|
||||
SCE_KERNEL_ERROR_INVALID_FLAGS = 0x80020005,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_SIZE = 0x80020006,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_ADDR = 0x80020007,
|
||||
SCE_KERNEL_ERROR_UNSUP = 0x80020008,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MODE = 0x80020009,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_ALIGNMENT = 0x8002000A,
|
||||
SCE_KERNEL_ERROR_NOSYS = 0x8002000B,
|
||||
SCE_KERNEL_ERROR_DEBUG_ERROR = 0x80021000,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_DIPSW_NUMBER = 0x80021001,
|
||||
SCE_KERNEL_ERROR_CPU_ERROR = 0x80022000,
|
||||
SCE_KERNEL_ERROR_MMU_ILLEGAL_L1_TYPE = 0x80022001,
|
||||
SCE_KERNEL_ERROR_MMU_L2_INDEX_OVERFLOW = 0x80022002,
|
||||
SCE_KERNEL_ERROR_MMU_L2_SIZE_OVERFLOW = 0x80022003,
|
||||
SCE_KERNEL_ERROR_INVALID_CPU_AFFINITY = 0x80022004,
|
||||
SCE_KERNEL_ERROR_INVALID_MEMORY_ACCESS = 0x80022005,
|
||||
SCE_KERNEL_ERROR_INVALID_MEMORY_ACCESS_PERMISSION = 0x80022006,
|
||||
SCE_KERNEL_ERROR_VA2PA_FAULT = 0x80022007,
|
||||
SCE_KERNEL_ERROR_VA2PA_MAPPED = 0x80022008,
|
||||
SCE_KERNEL_ERROR_VALIDATION_CHECK_FAILED = 0x80022009,
|
||||
SCE_KERNEL_ERROR_SYSMEM_ERROR = 0x80024000,
|
||||
SCE_KERNEL_ERROR_INVALID_PROCESS_CONTEXT = 0x80024001,
|
||||
SCE_KERNEL_ERROR_UID_NAME_TOO_LONG = 0x80024002,
|
||||
SCE_KERNEL_ERROR_VARANGE_IS_NOT_PHYSICAL_CONTINUOUS = 0x80024003,
|
||||
SCE_KERNEL_ERROR_PHYADDR_ERROR = 0x80024100,
|
||||
SCE_KERNEL_ERROR_NO_PHYADDR = 0x80024101,
|
||||
SCE_KERNEL_ERROR_PHYADDR_USED = 0x80024102,
|
||||
SCE_KERNEL_ERROR_PHYADDR_NOT_USED = 0x80024103,
|
||||
SCE_KERNEL_ERROR_NO_IOADDR = 0x80024104,
|
||||
SCE_KERNEL_ERROR_PHYMEM_ERROR = 0x80024300,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_PHYPAGE_STATUS = 0x80024301,
|
||||
SCE_KERNEL_ERROR_NO_FREE_PHYSICAL_PAGE = 0x80024302,
|
||||
SCE_KERNEL_ERROR_NO_FREE_PHYSICAL_PAGE_UNIT = 0x80024303,
|
||||
SCE_KERNEL_ERROR_PHYMEMPART_NOT_EMPTY = 0x80024304,
|
||||
SCE_KERNEL_ERROR_NO_PHYMEMPART_LPDDR2 = 0x80024305,
|
||||
SCE_KERNEL_ERROR_NO_PHYMEMPART_CDRAM = 0x80024306,
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_ERROR = 0x80024400,
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_ILLEGAL_SIZE = 0x80024401,
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_ILLEGAL_INDEX = 0x80024402,
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_INDEX_OVERFLOW = 0x80024403,
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_NO_CHUNK = 0x80024404,
|
||||
SCE_KERNEL_ERROR_UID_ERROR = 0x80024500,
|
||||
SCE_KERNEL_ERROR_INVALID_UID = 0x80024501,
|
||||
SCE_KERNEL_ERROR_SYSMEM_UID_INVALID_ARGUMENT = 0x80024502,
|
||||
SCE_KERNEL_ERROR_SYSMEM_INVALID_UID_RANGE = 0x80024503,
|
||||
SCE_KERNEL_ERROR_SYSMEM_NO_VALID_UID = 0x80024504,
|
||||
SCE_KERNEL_ERROR_SYSMEM_CANNOT_ALLOCATE_UIDENTRY = 0x80024505,
|
||||
SCE_KERNEL_ERROR_NOT_PROCESS_UID = 0x80024506,
|
||||
SCE_KERNEL_ERROR_NOT_KERNEL_UID = 0x80024507,
|
||||
SCE_KERNEL_ERROR_INVALID_UID_CLASS = 0x80024508,
|
||||
SCE_KERNEL_ERROR_INVALID_UID_SUBCLASS = 0x80024509,
|
||||
SCE_KERNEL_ERROR_UID_CANNOT_FIND_BY_NAME = 0x8002450A,
|
||||
SCE_KERNEL_ERROR_VIRPAGE_ERROR = 0x80024600,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_VIRPAGE_TYPE = 0x80024601,
|
||||
SCE_KERNEL_ERROR_BLOCK_ERROR = 0x80024700,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_BLOCK_ID = 0x80024701,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_BLOCK_TYPE = 0x80024702,
|
||||
SCE_KERNEL_ERROR_BLOCK_IN_USE = 0x80024703,
|
||||
SCE_KERNEL_ERROR_PARTITION_ERROR = 0x80024800,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_PARTITION_ID = 0x80024801,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_PARTITION_INDEX = 0x80024802,
|
||||
SCE_KERNEL_ERROR_NO_L2PAGETABLE = 0x80024803,
|
||||
SCE_KERNEL_ERROR_HEAPLIB_ERROR = 0x80024900,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_HEAP_ID = 0x80024901,
|
||||
SCE_KERNEL_ERROR_OUT_OF_RANG = 0x80024902,
|
||||
SCE_KERNEL_ERROR_HEAPLIB_NOMEM = 0x80024903,
|
||||
SCE_KERNEL_ERROR_SYSMEM_ADDRESS_SPACE_ERROR = 0x80024A00,
|
||||
SCE_KERNEL_ERROR_INVALID_ADDRESS_SPACE_ID = 0x80024A01,
|
||||
SCE_KERNEL_ERROR_INVALID_PARTITION_INDEX = 0x80024A02,
|
||||
SCE_KERNEL_ERROR_ADDRESS_SPACE_CANNOT_FIND_PARTITION_BY_ADDR = 0x80024A03,
|
||||
SCE_KERNEL_ERROR_SYSMEM_MEMBLOCK_ERROR = 0x80024B00,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_TYPE = 0x80024B01,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_REMAP_TYPE = 0x80024B02,
|
||||
SCE_KERNEL_ERROR_NOT_PHY_CONT_MEMBLOCK = 0x80024B03,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_CODE = 0x80024B04,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_SIZE = 0x80024B05,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_USERMAP_SIZE = 0x80024B06,
|
||||
SCE_KERNEL_ERROR_MEMBLOCK_TYPE_FOR_KERNEL_PROCESS = 0x80024B07,
|
||||
SCE_KERNEL_ERROR_PROCESS_CANNOT_REMAP_MEMBLOCK = 0x80024B08,
|
||||
SCE_KERNEL_ERROR_SYSMEM_PHYMEMLOW_ERROR = 0x80024C00,
|
||||
SCE_KERNEL_ERROR_CANNOT_ALLOC_PHYMEMLOW = 0x80024C01,
|
||||
SCE_KERNEL_ERROR_UNKNOWN_PHYMEMLOW_TYPE = 0x80024C02,
|
||||
SCE_KERNEL_ERROR_SYSMEM_BITHEAP_ERROR = 0x80024D00,
|
||||
SCE_KERNEL_ERROR_CANNOT_ALLOC_BITHEAP = 0x80024D01,
|
||||
SCE_KERNEL_ERROR_LOADCORE_ERROR = 0x80025000,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_ELF_HEADER = 0x80025001,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_SELF_HEADER = 0x80025002,
|
||||
SCE_KERNEL_ERROR_EXCPMGR_ERROR = 0x80027000,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_EXCPCODE = 0x80027001,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_EXCPHANDLER = 0x80027002,
|
||||
SCE_KERNEL_ERROR_NOTFOUND_EXCPHANDLER = 0x80027003,
|
||||
SCE_KERNEL_ERROR_CANNOT_RELEASE_EXCPHANDLER = 0x80027004,
|
||||
SCE_KERNEL_ERROR_INTRMGR_ERROR = 0x80027100,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_CONTEXT = 0x80027101,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRCODE = 0x80027102,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRPARAM = 0x80027103,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRPRIORITY = 0x80027104,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_TARGET_CPU = 0x80027105,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRFILTER = 0x80027106,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRTYPE = 0x80027107,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_HANDLER = 0x80027108,
|
||||
SCE_KERNEL_ERROR_FOUND_HANDLER = 0x80027109,
|
||||
SCE_KERNEL_ERROR_NOTFOUND_HANDLER = 0x8002710A,
|
||||
SCE_KERNEL_ERROR_NO_MEMORY = 0x8002710B,
|
||||
SCE_KERNEL_ERROR_DMACMGR_ERROR = 0x80027200,
|
||||
SCE_KERNEL_ERROR_ALREADY_QUEUED = 0x80027201,
|
||||
SCE_KERNEL_ERROR_NOT_QUEUED = 0x80027202,
|
||||
SCE_KERNEL_ERROR_NOT_SETUP = 0x80027203,
|
||||
SCE_KERNEL_ERROR_ON_TRANSFERRING = 0x80027204,
|
||||
SCE_KERNEL_ERROR_NOT_INITIALIZED = 0x80027205,
|
||||
SCE_KERNEL_ERROR_TRANSFERRED = 0x80027206,
|
||||
SCE_KERNEL_ERROR_NOT_UNDER_CONTROL = 0x80027207,
|
||||
SCE_KERNEL_ERROR_SYSTIMER_ERROR = 0x80027300,
|
||||
SCE_KERNEL_ERROR_NO_FREE_TIMER = 0x80027301,
|
||||
SCE_KERNEL_ERROR_TIMER_NOT_ALLOCATED = 0x80027302,
|
||||
SCE_KERNEL_ERROR_TIMER_COUNTING = 0x80027303,
|
||||
SCE_KERNEL_ERROR_TIMER_STOPPED = 0x80027304,
|
||||
SCE_KERNEL_ERROR_THREADMGR_ERROR = 0x80028000,
|
||||
SCE_KERNEL_ERROR_DORMANT = 0x80028001,
|
||||
SCE_KERNEL_ERROR_NOT_DORMANT = 0x80028002,
|
||||
SCE_KERNEL_ERROR_UNKNOWN_THID = 0x80028003,
|
||||
SCE_KERNEL_ERROR_CAN_NOT_WAIT = 0x80028004,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_THID = 0x80028005,
|
||||
SCE_KERNEL_ERROR_THREAD_TERMINATED = 0x80028006,
|
||||
SCE_KERNEL_ERROR_DELETED = 0x80028007,
|
||||
SCE_KERNEL_ERROR_WAIT_TIMEOUT = 0x80028008,
|
||||
SCE_KERNEL_ERROR_NOTIFY_CALLBACK = 0x80028009,
|
||||
SCE_KERNEL_ERROR_WAIT_DELETE = 0x8002800A,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_ATTR = 0x8002800B,
|
||||
SCE_KERNEL_ERROR_EVF_MULTI = 0x8002800C,
|
||||
SCE_KERNEL_ERROR_WAIT_CANCEL = 0x8002800D,
|
||||
SCE_KERNEL_ERROR_EVF_COND = 0x8002800E,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_COUNT = 0x8002800F,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_PRIORITY = 0x80028010,
|
||||
SCE_KERNEL_ERROR_MUTEX_RECURSIVE = 0x80028011,
|
||||
SCE_KERNEL_ERROR_MUTEX_LOCK_OVF = 0x80028012,
|
||||
SCE_KERNEL_ERROR_MUTEX_NOT_OWNED = 0x80028013,
|
||||
SCE_KERNEL_ERROR_MUTEX_UNLOCK_UDF = 0x80028014,
|
||||
SCE_KERNEL_ERROR_MUTEX_FAILED_TO_OWN = 0x80028015,
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_RECURSIVE = 0x80028016,
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_LOCK_OVF = 0x80028017,
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_FAILED_TO_OWN = 0x80028018,
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_NOT_OWNED = 0x80028019,
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_OWNED = 0x8002801A,
|
||||
SCE_KERNEL_ERROR_ALARM_CAN_NOT_CANCEL = 0x8002801B,
|
||||
SCE_KERNEL_ERROR_INVALID_OBJECT_TYPE = 0x8002801C,
|
||||
SCE_KERNEL_ERROR_KERNEL_TLS_FULL = 0x8002801D,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_KERNEL_TLS_INDEX = 0x8002801E,
|
||||
SCE_KERNEL_ERROR_KERNEL_TLS_BUSY = 0x8002801F,
|
||||
SCE_KERNEL_ERROR_DIFFERENT_UID_CLASS = 0x80028020,
|
||||
SCE_KERNEL_ERROR_UNKNOWN_UID = 0x80028021,
|
||||
SCE_KERNEL_ERROR_SEMA_ZERO = 0x80028022,
|
||||
SCE_KERNEL_ERROR_SEMA_OVF = 0x80028023,
|
||||
SCE_KERNEL_ERROR_PMON_NOT_THREAD_MODE = 0x80028024,
|
||||
SCE_KERNEL_ERROR_PMON_NOT_CPU_MODE = 0x80028025,
|
||||
SCE_KERNEL_ERROR_ALREADY_REGISTERED = 0x80028026,
|
||||
SCE_KERNEL_ERROR_INVALID_THREAD_ID = 0x80028027,
|
||||
SCE_KERNEL_ERROR_ALREADY_DEBUG_SUSPENDED = 0x80028028,
|
||||
SCE_KERNEL_ERROR_NOT_DEBUG_SUSPENDED = 0x80028029,
|
||||
SCE_KERNEL_ERROR_CAN_NOT_USE_VFP = 0x8002802A,
|
||||
SCE_KERNEL_ERROR_RUNNING = 0x8002802B,
|
||||
SCE_KERNEL_ERROR_EVENT_COND = 0x8002802C,
|
||||
SCE_KERNEL_ERROR_MSG_PIPE_FULL = 0x8002802D,
|
||||
SCE_KERNEL_ERROR_MSG_PIPE_EMPTY = 0x8002802E,
|
||||
SCE_KERNEL_ERROR_ALREADY_SENT = 0x8002802F,
|
||||
SCE_KERNEL_ERROR_CAN_NOT_SUSPEND = 0x80028030,
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_ALREADY_INITIALIZED = 0x80028031,
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_NOT_INITIALIZED = 0x80028032,
|
||||
SCE_KERNEL_ERROR_THREAD_STOPPED = 0x80028033,
|
||||
SCE_KERNEL_ERROR_THREAD_SUSPENDED = 0x80028034,
|
||||
SCE_KERNEL_ERROR_NOT_SUSPENDED = 0x80028035,
|
||||
SCE_KERNEL_ERROR_WAIT_DELETE_MUTEX = 0x80028036,
|
||||
SCE_KERNEL_ERROR_WAIT_CANCEL_MUTEX = 0x80028037,
|
||||
SCE_KERNEL_ERROR_WAIT_DELETE_COND = 0x80028038,
|
||||
SCE_KERNEL_ERROR_WAIT_CANCEL_COND = 0x80028039,
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_NOT_OWNED = 0x8002803A,
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_LOCK_OVF = 0x8002803B,
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_UNLOCK_UDF = 0x8002803C,
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_RECURSIVE = 0x8002803D,
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_FAILED_TO_OWN = 0x8002803E,
|
||||
SCE_KERNEL_ERROR_WAIT_DELETE_LW_MUTEX = 0x8002803F,
|
||||
SCE_KERNEL_ERROR_ILLEGAL_STACK_SIZE = 0x80028040,
|
||||
SCE_KERNEL_ERROR_RW_LOCK_RECURSIVE = 0x80028041,
|
||||
SCE_KERNEL_ERROR_RW_LOCK_LOCK_OVF = 0x80028042,
|
||||
SCE_KERNEL_ERROR_RW_LOCK_NOT_OWNED = 0x80028043,
|
||||
SCE_KERNEL_ERROR_RW_LOCK_UNLOCK_UDF = 0x80028044,
|
||||
SCE_KERNEL_ERROR_RW_LOCK_FAILED_TO_LOCK = 0x80028045,
|
||||
SCE_KERNEL_ERROR_RW_LOCK_FAILED_TO_UNLOCK = 0x80028046,
|
||||
|
||||
SCE_KERNEL_ERROR_PROCESSMGR_ERROR = 0x80029000,
|
||||
SCE_KERNEL_ERROR_INVALID_PID = 0x80029001,
|
||||
SCE_KERNEL_ERROR_INVALID_PROCESS_TYPE = 0x80029002,
|
||||
SCE_KERNEL_ERROR_PLS_FULL = 0x80029003,
|
||||
SCE_KERNEL_ERROR_INVALID_PROCESS_STATUS = 0x80029004,
|
||||
SCE_KERNEL_ERROR_INVALID_BUDGET_ID = 0x80029005,
|
||||
SCE_KERNEL_ERROR_INVALID_BUDGET_SIZE = 0x80029006,
|
||||
SCE_KERNEL_ERROR_CP14_DISABLED = 0x80029007,
|
||||
SCE_KERNEL_ERROR_EXCEEDED_MAX_PROCESSES = 0x80029008,
|
||||
SCE_KERNEL_ERROR_PROCESS_REMAINING = 0x80029009,
|
||||
SCE_KERNEL_ERROR_IOFILEMGR_ERROR = 0x8002A000,
|
||||
SCE_KERNEL_ERROR_IO_NAME_TOO_LONG = 0x8002A001,
|
||||
SCE_KERNEL_ERROR_IO_REG_DEV = 0x8002A002,
|
||||
SCE_KERNEL_ERROR_IO_ALIAS_USED = 0x8002A003,
|
||||
SCE_KERNEL_ERROR_IO_DEL_DEV = 0x8002A004,
|
||||
SCE_KERNEL_ERROR_IO_WOULD_BLOCK = 0x8002A005,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_START_FAILED = 0x8002D000,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_STOP_FAIL = 0x8002D001,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_IN_USE = 0x8002D002,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_LIB = 0x8002D003,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_SYSCALL_REG = 0x8002D004,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOMEM_LIB = 0x8002D005,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOMEM_STUB = 0x8002D006,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOMEM_SELF = 0x8002D007,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOMEM = 0x8002D008,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_LIB = 0x8002D009,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_STUB = 0x8002D00A,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_FUNC_NID = 0x8002D00B,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_VAR_NID = 0x8002D00C,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_TYPE = 0x8002D00D,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_MOD_ENTRY = 0x8002D00E,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_PROC_PARAM = 0x8002D00F,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_MODOBJ = 0x8002D010,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_MOD = 0x8002D011,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_PROCESS = 0x8002D012,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_OLD_LIB = 0x8002D013,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_STARTED = 0x8002D014,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOT_STARTED = 0x8002D015,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOT_STOPPED = 0x8002D016,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_PROCESS_UID = 0x8002D017,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_CANNOT_EXPORT_LIB_TO_SHARED = 0x8002D018,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_REL_INFO = 0x8002D019,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_REF_INFO = 0x8002D01A,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_ELINK = 0x8002D01B,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOENT = 0x8002D01C,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_BUSY = 0x8002D01D,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOEXEC = 0x8002D01E,
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NAMETOOLONG = 0x8002D01F,
|
||||
SCE_KERNEL_ERROR_LIBRARYDB_NOENT = 0x8002D080,
|
||||
SCE_KERNEL_ERROR_LIBRARYDB_NO_LIB = 0x8002D081,
|
||||
SCE_KERNEL_ERROR_LIBRARYDB_NO_MOD = 0x8002D082,
|
||||
SCE_KERNEL_ERROR_AUTHFAIL = 0x8002F000,
|
||||
SCE_KERNEL_ERROR_NO_AUTH = 0x8002F001,
|
||||
SCE_KERNEL_ERROR_ERROR = ERROR_CODE(0x80020001),
|
||||
SCE_KERNEL_ERROR_NOT_IMPLEMENTED = ERROR_CODE(0x80020002),
|
||||
SCE_KERNEL_ERROR_INVALID_ARGUMENT = ERROR_CODE(0x80020003),
|
||||
SCE_KERNEL_ERROR_INVALID_ARGUMENT_SIZE = ERROR_CODE(0x80020004),
|
||||
SCE_KERNEL_ERROR_INVALID_FLAGS = ERROR_CODE(0x80020005),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_SIZE = ERROR_CODE(0x80020006),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_ADDR = ERROR_CODE(0x80020007),
|
||||
SCE_KERNEL_ERROR_UNSUP = ERROR_CODE(0x80020008),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MODE = ERROR_CODE(0x80020009),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_ALIGNMENT = ERROR_CODE(0x8002000A),
|
||||
SCE_KERNEL_ERROR_NOSYS = ERROR_CODE(0x8002000B),
|
||||
SCE_KERNEL_ERROR_DEBUG_ERROR = ERROR_CODE(0x80021000),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_DIPSW_NUMBER = ERROR_CODE(0x80021001),
|
||||
SCE_KERNEL_ERROR_CPU_ERROR = ERROR_CODE(0x80022000),
|
||||
SCE_KERNEL_ERROR_MMU_ILLEGAL_L1_TYPE = ERROR_CODE(0x80022001),
|
||||
SCE_KERNEL_ERROR_MMU_L2_INDEX_OVERFLOW = ERROR_CODE(0x80022002),
|
||||
SCE_KERNEL_ERROR_MMU_L2_SIZE_OVERFLOW = ERROR_CODE(0x80022003),
|
||||
SCE_KERNEL_ERROR_INVALID_CPU_AFFINITY = ERROR_CODE(0x80022004),
|
||||
SCE_KERNEL_ERROR_INVALID_MEMORY_ACCESS = ERROR_CODE(0x80022005),
|
||||
SCE_KERNEL_ERROR_INVALID_MEMORY_ACCESS_PERMISSION = ERROR_CODE(0x80022006),
|
||||
SCE_KERNEL_ERROR_VA2PA_FAULT = ERROR_CODE(0x80022007),
|
||||
SCE_KERNEL_ERROR_VA2PA_MAPPED = ERROR_CODE(0x80022008),
|
||||
SCE_KERNEL_ERROR_VALIDATION_CHECK_FAILED = ERROR_CODE(0x80022009),
|
||||
SCE_KERNEL_ERROR_SYSMEM_ERROR = ERROR_CODE(0x80024000),
|
||||
SCE_KERNEL_ERROR_INVALID_PROCESS_CONTEXT = ERROR_CODE(0x80024001),
|
||||
SCE_KERNEL_ERROR_UID_NAME_TOO_LONG = ERROR_CODE(0x80024002),
|
||||
SCE_KERNEL_ERROR_VARANGE_IS_NOT_PHYSICAL_CONTINUOUS = ERROR_CODE(0x80024003),
|
||||
SCE_KERNEL_ERROR_PHYADDR_ERROR = ERROR_CODE(0x80024100),
|
||||
SCE_KERNEL_ERROR_NO_PHYADDR = ERROR_CODE(0x80024101),
|
||||
SCE_KERNEL_ERROR_PHYADDR_USED = ERROR_CODE(0x80024102),
|
||||
SCE_KERNEL_ERROR_PHYADDR_NOT_USED = ERROR_CODE(0x80024103),
|
||||
SCE_KERNEL_ERROR_NO_IOADDR = ERROR_CODE(0x80024104),
|
||||
SCE_KERNEL_ERROR_PHYMEM_ERROR = ERROR_CODE(0x80024300),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_PHYPAGE_STATUS = ERROR_CODE(0x80024301),
|
||||
SCE_KERNEL_ERROR_NO_FREE_PHYSICAL_PAGE = ERROR_CODE(0x80024302),
|
||||
SCE_KERNEL_ERROR_NO_FREE_PHYSICAL_PAGE_UNIT = ERROR_CODE(0x80024303),
|
||||
SCE_KERNEL_ERROR_PHYMEMPART_NOT_EMPTY = ERROR_CODE(0x80024304),
|
||||
SCE_KERNEL_ERROR_NO_PHYMEMPART_LPDDR2 = ERROR_CODE(0x80024305),
|
||||
SCE_KERNEL_ERROR_NO_PHYMEMPART_CDRAM = ERROR_CODE(0x80024306),
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_ERROR = ERROR_CODE(0x80024400),
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_ILLEGAL_SIZE = ERROR_CODE(0x80024401),
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_ILLEGAL_INDEX = ERROR_CODE(0x80024402),
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_INDEX_OVERFLOW = ERROR_CODE(0x80024403),
|
||||
SCE_KERNEL_ERROR_FIXEDHEAP_NO_CHUNK = ERROR_CODE(0x80024404),
|
||||
SCE_KERNEL_ERROR_UID_ERROR = ERROR_CODE(0x80024500),
|
||||
SCE_KERNEL_ERROR_INVALID_UID = ERROR_CODE(0x80024501),
|
||||
SCE_KERNEL_ERROR_SYSMEM_UID_INVALID_ARGUMENT = ERROR_CODE(0x80024502),
|
||||
SCE_KERNEL_ERROR_SYSMEM_INVALID_UID_RANGE = ERROR_CODE(0x80024503),
|
||||
SCE_KERNEL_ERROR_SYSMEM_NO_VALID_UID = ERROR_CODE(0x80024504),
|
||||
SCE_KERNEL_ERROR_SYSMEM_CANNOT_ALLOCATE_UIDENTRY = ERROR_CODE(0x80024505),
|
||||
SCE_KERNEL_ERROR_NOT_PROCESS_UID = ERROR_CODE(0x80024506),
|
||||
SCE_KERNEL_ERROR_NOT_KERNEL_UID = ERROR_CODE(0x80024507),
|
||||
SCE_KERNEL_ERROR_INVALID_UID_CLASS = ERROR_CODE(0x80024508),
|
||||
SCE_KERNEL_ERROR_INVALID_UID_SUBCLASS = ERROR_CODE(0x80024509),
|
||||
SCE_KERNEL_ERROR_UID_CANNOT_FIND_BY_NAME = ERROR_CODE(0x8002450A),
|
||||
SCE_KERNEL_ERROR_VIRPAGE_ERROR = ERROR_CODE(0x80024600),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_VIRPAGE_TYPE = ERROR_CODE(0x80024601),
|
||||
SCE_KERNEL_ERROR_BLOCK_ERROR = ERROR_CODE(0x80024700),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_BLOCK_ID = ERROR_CODE(0x80024701),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_BLOCK_TYPE = ERROR_CODE(0x80024702),
|
||||
SCE_KERNEL_ERROR_BLOCK_IN_USE = ERROR_CODE(0x80024703),
|
||||
SCE_KERNEL_ERROR_PARTITION_ERROR = ERROR_CODE(0x80024800),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_PARTITION_ID = ERROR_CODE(0x80024801),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_PARTITION_INDEX = ERROR_CODE(0x80024802),
|
||||
SCE_KERNEL_ERROR_NO_L2PAGETABLE = ERROR_CODE(0x80024803),
|
||||
SCE_KERNEL_ERROR_HEAPLIB_ERROR = ERROR_CODE(0x80024900),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_HEAP_ID = ERROR_CODE(0x80024901),
|
||||
SCE_KERNEL_ERROR_OUT_OF_RANG = ERROR_CODE(0x80024902),
|
||||
SCE_KERNEL_ERROR_HEAPLIB_NOMEM = ERROR_CODE(0x80024903),
|
||||
SCE_KERNEL_ERROR_SYSMEM_ADDRESS_SPACE_ERROR = ERROR_CODE(0x80024A00),
|
||||
SCE_KERNEL_ERROR_INVALID_ADDRESS_SPACE_ID = ERROR_CODE(0x80024A01),
|
||||
SCE_KERNEL_ERROR_INVALID_PARTITION_INDEX = ERROR_CODE(0x80024A02),
|
||||
SCE_KERNEL_ERROR_ADDRESS_SPACE_CANNOT_FIND_PARTITION_BY_ADDR = ERROR_CODE(0x80024A03),
|
||||
SCE_KERNEL_ERROR_SYSMEM_MEMBLOCK_ERROR = ERROR_CODE(0x80024B00),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_TYPE = ERROR_CODE(0x80024B01),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_REMAP_TYPE = ERROR_CODE(0x80024B02),
|
||||
SCE_KERNEL_ERROR_NOT_PHY_CONT_MEMBLOCK = ERROR_CODE(0x80024B03),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_CODE = ERROR_CODE(0x80024B04),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_SIZE = ERROR_CODE(0x80024B05),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_USERMAP_SIZE = ERROR_CODE(0x80024B06),
|
||||
SCE_KERNEL_ERROR_MEMBLOCK_TYPE_FOR_KERNEL_PROCESS = ERROR_CODE(0x80024B07),
|
||||
SCE_KERNEL_ERROR_PROCESS_CANNOT_REMAP_MEMBLOCK = ERROR_CODE(0x80024B08),
|
||||
SCE_KERNEL_ERROR_SYSMEM_PHYMEMLOW_ERROR = ERROR_CODE(0x80024C00),
|
||||
SCE_KERNEL_ERROR_CANNOT_ALLOC_PHYMEMLOW = ERROR_CODE(0x80024C01),
|
||||
SCE_KERNEL_ERROR_UNKNOWN_PHYMEMLOW_TYPE = ERROR_CODE(0x80024C02),
|
||||
SCE_KERNEL_ERROR_SYSMEM_BITHEAP_ERROR = ERROR_CODE(0x80024D00),
|
||||
SCE_KERNEL_ERROR_CANNOT_ALLOC_BITHEAP = ERROR_CODE(0x80024D01),
|
||||
SCE_KERNEL_ERROR_LOADCORE_ERROR = ERROR_CODE(0x80025000),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_ELF_HEADER = ERROR_CODE(0x80025001),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_SELF_HEADER = ERROR_CODE(0x80025002),
|
||||
};
|
||||
|
||||
enum SceLibKernelError0 : s32
|
||||
{
|
||||
SCE_KERNEL_ERROR_EXCPMGR_ERROR = ERROR_CODE(0x80027000),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_EXCPCODE = ERROR_CODE(0x80027001),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_EXCPHANDLER = ERROR_CODE(0x80027002),
|
||||
SCE_KERNEL_ERROR_NOTFOUND_EXCPHANDLER = ERROR_CODE(0x80027003),
|
||||
SCE_KERNEL_ERROR_CANNOT_RELEASE_EXCPHANDLER = ERROR_CODE(0x80027004),
|
||||
SCE_KERNEL_ERROR_INTRMGR_ERROR = ERROR_CODE(0x80027100),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_CONTEXT = ERROR_CODE(0x80027101),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRCODE = ERROR_CODE(0x80027102),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRPARAM = ERROR_CODE(0x80027103),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRPRIORITY = ERROR_CODE(0x80027104),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_TARGET_CPU = ERROR_CODE(0x80027105),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRFILTER = ERROR_CODE(0x80027106),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_INTRTYPE = ERROR_CODE(0x80027107),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_HANDLER = ERROR_CODE(0x80027108),
|
||||
SCE_KERNEL_ERROR_FOUND_HANDLER = ERROR_CODE(0x80027109),
|
||||
SCE_KERNEL_ERROR_NOTFOUND_HANDLER = ERROR_CODE(0x8002710A),
|
||||
SCE_KERNEL_ERROR_NO_MEMORY = ERROR_CODE(0x8002710B),
|
||||
SCE_KERNEL_ERROR_DMACMGR_ERROR = ERROR_CODE(0x80027200),
|
||||
SCE_KERNEL_ERROR_ALREADY_QUEUED = ERROR_CODE(0x80027201),
|
||||
SCE_KERNEL_ERROR_NOT_QUEUED = ERROR_CODE(0x80027202),
|
||||
SCE_KERNEL_ERROR_NOT_SETUP = ERROR_CODE(0x80027203),
|
||||
SCE_KERNEL_ERROR_ON_TRANSFERRING = ERROR_CODE(0x80027204),
|
||||
SCE_KERNEL_ERROR_NOT_INITIALIZED = ERROR_CODE(0x80027205),
|
||||
SCE_KERNEL_ERROR_TRANSFERRED = ERROR_CODE(0x80027206),
|
||||
SCE_KERNEL_ERROR_NOT_UNDER_CONTROL = ERROR_CODE(0x80027207),
|
||||
SCE_KERNEL_ERROR_SYSTIMER_ERROR = ERROR_CODE(0x80027300),
|
||||
SCE_KERNEL_ERROR_NO_FREE_TIMER = ERROR_CODE(0x80027301),
|
||||
SCE_KERNEL_ERROR_TIMER_NOT_ALLOCATED = ERROR_CODE(0x80027302),
|
||||
SCE_KERNEL_ERROR_TIMER_COUNTING = ERROR_CODE(0x80027303),
|
||||
SCE_KERNEL_ERROR_TIMER_STOPPED = ERROR_CODE(0x80027304),
|
||||
SCE_KERNEL_ERROR_THREADMGR_ERROR = ERROR_CODE(0x80028000),
|
||||
SCE_KERNEL_ERROR_DORMANT = ERROR_CODE(0x80028001),
|
||||
SCE_KERNEL_ERROR_NOT_DORMANT = ERROR_CODE(0x80028002),
|
||||
SCE_KERNEL_ERROR_UNKNOWN_THID = ERROR_CODE(0x80028003),
|
||||
SCE_KERNEL_ERROR_CAN_NOT_WAIT = ERROR_CODE(0x80028004),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_THID = ERROR_CODE(0x80028005),
|
||||
SCE_KERNEL_ERROR_THREAD_TERMINATED = ERROR_CODE(0x80028006),
|
||||
SCE_KERNEL_ERROR_DELETED = ERROR_CODE(0x80028007),
|
||||
SCE_KERNEL_ERROR_WAIT_TIMEOUT = ERROR_CODE(0x80028008),
|
||||
SCE_KERNEL_ERROR_NOTIFY_CALLBACK = ERROR_CODE(0x80028009),
|
||||
SCE_KERNEL_ERROR_WAIT_DELETE = ERROR_CODE(0x8002800A),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_ATTR = ERROR_CODE(0x8002800B),
|
||||
SCE_KERNEL_ERROR_EVF_MULTI = ERROR_CODE(0x8002800C),
|
||||
SCE_KERNEL_ERROR_WAIT_CANCEL = ERROR_CODE(0x8002800D),
|
||||
SCE_KERNEL_ERROR_EVF_COND = ERROR_CODE(0x8002800E),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_COUNT = ERROR_CODE(0x8002800F),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_PRIORITY = ERROR_CODE(0x80028010),
|
||||
SCE_KERNEL_ERROR_MUTEX_RECURSIVE = ERROR_CODE(0x80028011),
|
||||
SCE_KERNEL_ERROR_MUTEX_LOCK_OVF = ERROR_CODE(0x80028012),
|
||||
SCE_KERNEL_ERROR_MUTEX_NOT_OWNED = ERROR_CODE(0x80028013),
|
||||
SCE_KERNEL_ERROR_MUTEX_UNLOCK_UDF = ERROR_CODE(0x80028014),
|
||||
SCE_KERNEL_ERROR_MUTEX_FAILED_TO_OWN = ERROR_CODE(0x80028015),
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_RECURSIVE = ERROR_CODE(0x80028016),
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_LOCK_OVF = ERROR_CODE(0x80028017),
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_FAILED_TO_OWN = ERROR_CODE(0x80028018),
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_NOT_OWNED = ERROR_CODE(0x80028019),
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_OWNED = ERROR_CODE(0x8002801A),
|
||||
SCE_KERNEL_ERROR_ALARM_CAN_NOT_CANCEL = ERROR_CODE(0x8002801B),
|
||||
SCE_KERNEL_ERROR_INVALID_OBJECT_TYPE = ERROR_CODE(0x8002801C),
|
||||
SCE_KERNEL_ERROR_KERNEL_TLS_FULL = ERROR_CODE(0x8002801D),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_KERNEL_TLS_INDEX = ERROR_CODE(0x8002801E),
|
||||
SCE_KERNEL_ERROR_KERNEL_TLS_BUSY = ERROR_CODE(0x8002801F),
|
||||
SCE_KERNEL_ERROR_DIFFERENT_UID_CLASS = ERROR_CODE(0x80028020),
|
||||
SCE_KERNEL_ERROR_UNKNOWN_UID = ERROR_CODE(0x80028021),
|
||||
SCE_KERNEL_ERROR_SEMA_ZERO = ERROR_CODE(0x80028022),
|
||||
SCE_KERNEL_ERROR_SEMA_OVF = ERROR_CODE(0x80028023),
|
||||
SCE_KERNEL_ERROR_PMON_NOT_THREAD_MODE = ERROR_CODE(0x80028024),
|
||||
SCE_KERNEL_ERROR_PMON_NOT_CPU_MODE = ERROR_CODE(0x80028025),
|
||||
SCE_KERNEL_ERROR_ALREADY_REGISTERED = ERROR_CODE(0x80028026),
|
||||
SCE_KERNEL_ERROR_INVALID_THREAD_ID = ERROR_CODE(0x80028027),
|
||||
SCE_KERNEL_ERROR_ALREADY_DEBUG_SUSPENDED = ERROR_CODE(0x80028028),
|
||||
SCE_KERNEL_ERROR_NOT_DEBUG_SUSPENDED = ERROR_CODE(0x80028029),
|
||||
SCE_KERNEL_ERROR_CAN_NOT_USE_VFP = ERROR_CODE(0x8002802A),
|
||||
SCE_KERNEL_ERROR_RUNNING = ERROR_CODE(0x8002802B),
|
||||
SCE_KERNEL_ERROR_EVENT_COND = ERROR_CODE(0x8002802C),
|
||||
SCE_KERNEL_ERROR_MSG_PIPE_FULL = ERROR_CODE(0x8002802D),
|
||||
SCE_KERNEL_ERROR_MSG_PIPE_EMPTY = ERROR_CODE(0x8002802E),
|
||||
SCE_KERNEL_ERROR_ALREADY_SENT = ERROR_CODE(0x8002802F),
|
||||
SCE_KERNEL_ERROR_CAN_NOT_SUSPEND = ERROR_CODE(0x80028030),
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_ALREADY_INITIALIZED = ERROR_CODE(0x80028031),
|
||||
SCE_KERNEL_ERROR_FAST_MUTEX_NOT_INITIALIZED = ERROR_CODE(0x80028032),
|
||||
SCE_KERNEL_ERROR_THREAD_STOPPED = ERROR_CODE(0x80028033),
|
||||
SCE_KERNEL_ERROR_THREAD_SUSPENDED = ERROR_CODE(0x80028034),
|
||||
SCE_KERNEL_ERROR_NOT_SUSPENDED = ERROR_CODE(0x80028035),
|
||||
SCE_KERNEL_ERROR_WAIT_DELETE_MUTEX = ERROR_CODE(0x80028036),
|
||||
SCE_KERNEL_ERROR_WAIT_CANCEL_MUTEX = ERROR_CODE(0x80028037),
|
||||
SCE_KERNEL_ERROR_WAIT_DELETE_COND = ERROR_CODE(0x80028038),
|
||||
SCE_KERNEL_ERROR_WAIT_CANCEL_COND = ERROR_CODE(0x80028039),
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_NOT_OWNED = ERROR_CODE(0x8002803A),
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_LOCK_OVF = ERROR_CODE(0x8002803B),
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_UNLOCK_UDF = ERROR_CODE(0x8002803C),
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_RECURSIVE = ERROR_CODE(0x8002803D),
|
||||
SCE_KERNEL_ERROR_LW_MUTEX_FAILED_TO_OWN = ERROR_CODE(0x8002803E),
|
||||
SCE_KERNEL_ERROR_WAIT_DELETE_LW_MUTEX = ERROR_CODE(0x8002803F),
|
||||
SCE_KERNEL_ERROR_ILLEGAL_STACK_SIZE = ERROR_CODE(0x80028040),
|
||||
SCE_KERNEL_ERROR_RW_LOCK_RECURSIVE = ERROR_CODE(0x80028041),
|
||||
SCE_KERNEL_ERROR_RW_LOCK_LOCK_OVF = ERROR_CODE(0x80028042),
|
||||
SCE_KERNEL_ERROR_RW_LOCK_NOT_OWNED = ERROR_CODE(0x80028043),
|
||||
SCE_KERNEL_ERROR_RW_LOCK_UNLOCK_UDF = ERROR_CODE(0x80028044),
|
||||
SCE_KERNEL_ERROR_RW_LOCK_FAILED_TO_LOCK = ERROR_CODE(0x80028045),
|
||||
SCE_KERNEL_ERROR_RW_LOCK_FAILED_TO_UNLOCK = ERROR_CODE(0x80028046),
|
||||
};
|
||||
|
||||
enum SceLibKernelError1 : s32
|
||||
{
|
||||
SCE_KERNEL_ERROR_PROCESSMGR_ERROR = ERROR_CODE(0x80029000),
|
||||
SCE_KERNEL_ERROR_INVALID_PID = ERROR_CODE(0x80029001),
|
||||
SCE_KERNEL_ERROR_INVALID_PROCESS_TYPE = ERROR_CODE(0x80029002),
|
||||
SCE_KERNEL_ERROR_PLS_FULL = ERROR_CODE(0x80029003),
|
||||
SCE_KERNEL_ERROR_INVALID_PROCESS_STATUS = ERROR_CODE(0x80029004),
|
||||
SCE_KERNEL_ERROR_INVALID_BUDGET_ID = ERROR_CODE(0x80029005),
|
||||
SCE_KERNEL_ERROR_INVALID_BUDGET_SIZE = ERROR_CODE(0x80029006),
|
||||
SCE_KERNEL_ERROR_CP14_DISABLED = ERROR_CODE(0x80029007),
|
||||
SCE_KERNEL_ERROR_EXCEEDED_MAX_PROCESSES = ERROR_CODE(0x80029008),
|
||||
SCE_KERNEL_ERROR_PROCESS_REMAINING = ERROR_CODE(0x80029009),
|
||||
SCE_KERNEL_ERROR_IOFILEMGR_ERROR = ERROR_CODE(0x8002A000),
|
||||
SCE_KERNEL_ERROR_IO_NAME_TOO_LONG = ERROR_CODE(0x8002A001),
|
||||
SCE_KERNEL_ERROR_IO_REG_DEV = ERROR_CODE(0x8002A002),
|
||||
SCE_KERNEL_ERROR_IO_ALIAS_USED = ERROR_CODE(0x8002A003),
|
||||
SCE_KERNEL_ERROR_IO_DEL_DEV = ERROR_CODE(0x8002A004),
|
||||
SCE_KERNEL_ERROR_IO_WOULD_BLOCK = ERROR_CODE(0x8002A005),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_START_FAILED = ERROR_CODE(0x8002D000),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_STOP_FAIL = ERROR_CODE(0x8002D001),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_IN_USE = ERROR_CODE(0x8002D002),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_LIB = ERROR_CODE(0x8002D003),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_SYSCALL_REG = ERROR_CODE(0x8002D004),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOMEM_LIB = ERROR_CODE(0x8002D005),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOMEM_STUB = ERROR_CODE(0x8002D006),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOMEM_SELF = ERROR_CODE(0x8002D007),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOMEM = ERROR_CODE(0x8002D008),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_LIB = ERROR_CODE(0x8002D009),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_STUB = ERROR_CODE(0x8002D00A),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_FUNC_NID = ERROR_CODE(0x8002D00B),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_VAR_NID = ERROR_CODE(0x8002D00C),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_TYPE = ERROR_CODE(0x8002D00D),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_MOD_ENTRY = ERROR_CODE(0x8002D00E),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_PROC_PARAM = ERROR_CODE(0x8002D00F),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_MODOBJ = ERROR_CODE(0x8002D010),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_MOD = ERROR_CODE(0x8002D011),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NO_PROCESS = ERROR_CODE(0x8002D012),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_OLD_LIB = ERROR_CODE(0x8002D013),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_STARTED = ERROR_CODE(0x8002D014),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOT_STARTED = ERROR_CODE(0x8002D015),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOT_STOPPED = ERROR_CODE(0x8002D016),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_PROCESS_UID = ERROR_CODE(0x8002D017),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_CANNOT_EXPORT_LIB_TO_SHARED = ERROR_CODE(0x8002D018),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_REL_INFO = ERROR_CODE(0x8002D019),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_INVALID_REF_INFO = ERROR_CODE(0x8002D01A),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_ELINK = ERROR_CODE(0x8002D01B),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOENT = ERROR_CODE(0x8002D01C),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_BUSY = ERROR_CODE(0x8002D01D),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NOEXEC = ERROR_CODE(0x8002D01E),
|
||||
SCE_KERNEL_ERROR_MODULEMGR_NAMETOOLONG = ERROR_CODE(0x8002D01F),
|
||||
SCE_KERNEL_ERROR_LIBRARYDB_NOENT = ERROR_CODE(0x8002D080),
|
||||
SCE_KERNEL_ERROR_LIBRARYDB_NO_LIB = ERROR_CODE(0x8002D081),
|
||||
SCE_KERNEL_ERROR_LIBRARYDB_NO_MOD = ERROR_CODE(0x8002D082),
|
||||
SCE_KERNEL_ERROR_AUTHFAIL = ERROR_CODE(0x8002F000),
|
||||
SCE_KERNEL_ERROR_NO_AUTH = ERROR_CODE(0x8002F001),
|
||||
};
|
||||
|
||||
template<>
|
||||
inline const char* arm_error_code::print(SceLibKernelError error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
STR_CASE(SCE_KERNEL_ERROR_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_IMPLEMENTED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_ARGUMENT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_ARGUMENT_SIZE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_FLAGS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_SIZE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_ADDR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_UNSUP);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_MODE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_ALIGNMENT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOSYS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_DEBUG_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_DIPSW_NUMBER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_CPU_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MMU_ILLEGAL_L1_TYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MMU_L2_INDEX_OVERFLOW);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MMU_L2_SIZE_OVERFLOW);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_CPU_AFFINITY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_MEMORY_ACCESS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_MEMORY_ACCESS_PERMISSION);
|
||||
STR_CASE(SCE_KERNEL_ERROR_VA2PA_FAULT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_VA2PA_MAPPED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_VALIDATION_CHECK_FAILED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSMEM_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_PROCESS_CONTEXT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_UID_NAME_TOO_LONG);
|
||||
STR_CASE(SCE_KERNEL_ERROR_VARANGE_IS_NOT_PHYSICAL_CONTINUOUS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PHYADDR_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_PHYADDR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PHYADDR_USED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PHYADDR_NOT_USED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_IOADDR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PHYMEM_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_PHYPAGE_STATUS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_FREE_PHYSICAL_PAGE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_FREE_PHYSICAL_PAGE_UNIT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PHYMEMPART_NOT_EMPTY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_PHYMEMPART_LPDDR2);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_PHYMEMPART_CDRAM);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FIXEDHEAP_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FIXEDHEAP_ILLEGAL_SIZE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FIXEDHEAP_ILLEGAL_INDEX);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FIXEDHEAP_INDEX_OVERFLOW);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FIXEDHEAP_NO_CHUNK);
|
||||
STR_CASE(SCE_KERNEL_ERROR_UID_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_UID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSMEM_UID_INVALID_ARGUMENT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSMEM_INVALID_UID_RANGE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSMEM_NO_VALID_UID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSMEM_CANNOT_ALLOCATE_UIDENTRY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_PROCESS_UID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_KERNEL_UID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_UID_CLASS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_UID_SUBCLASS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_UID_CANNOT_FIND_BY_NAME);
|
||||
STR_CASE(SCE_KERNEL_ERROR_VIRPAGE_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_VIRPAGE_TYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_BLOCK_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_BLOCK_ID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_BLOCK_TYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_BLOCK_IN_USE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PARTITION_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_PARTITION_ID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_PARTITION_INDEX);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_L2PAGETABLE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_HEAPLIB_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_HEAP_ID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_OUT_OF_RANG);
|
||||
STR_CASE(SCE_KERNEL_ERROR_HEAPLIB_NOMEM);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSMEM_ADDRESS_SPACE_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_ADDRESS_SPACE_ID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_PARTITION_INDEX);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ADDRESS_SPACE_CANNOT_FIND_PARTITION_BY_ADDR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSMEM_MEMBLOCK_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_TYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_REMAP_TYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_PHY_CONT_MEMBLOCK);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_CODE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK_SIZE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_USERMAP_SIZE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MEMBLOCK_TYPE_FOR_KERNEL_PROCESS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PROCESS_CANNOT_REMAP_MEMBLOCK);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSMEM_PHYMEMLOW_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_CANNOT_ALLOC_PHYMEMLOW);
|
||||
STR_CASE(SCE_KERNEL_ERROR_UNKNOWN_PHYMEMLOW_TYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSMEM_BITHEAP_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_CANNOT_ALLOC_BITHEAP);
|
||||
STR_CASE(SCE_KERNEL_ERROR_LOADCORE_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_ELF_HEADER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_SELF_HEADER);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<>
|
||||
inline const char* arm_error_code::print(SceLibKernelError0 error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
STR_CASE(SCE_KERNEL_ERROR_EXCPMGR_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_EXCPCODE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_EXCPHANDLER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOTFOUND_EXCPHANDLER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_CANNOT_RELEASE_EXCPHANDLER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INTRMGR_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_CONTEXT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_INTRCODE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_INTRPARAM);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_INTRPRIORITY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_TARGET_CPU);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_INTRFILTER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_INTRTYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_HANDLER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FOUND_HANDLER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOTFOUND_HANDLER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_MEMORY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_DMACMGR_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ALREADY_QUEUED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_QUEUED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_SETUP);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ON_TRANSFERRING);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_INITIALIZED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_TRANSFERRED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_UNDER_CONTROL);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SYSTIMER_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_FREE_TIMER);
|
||||
STR_CASE(SCE_KERNEL_ERROR_TIMER_NOT_ALLOCATED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_TIMER_COUNTING);
|
||||
STR_CASE(SCE_KERNEL_ERROR_TIMER_STOPPED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_THREADMGR_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_DORMANT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_DORMANT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_UNKNOWN_THID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_CAN_NOT_WAIT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_THID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_THREAD_TERMINATED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_DELETED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_WAIT_TIMEOUT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOTIFY_CALLBACK);
|
||||
STR_CASE(SCE_KERNEL_ERROR_WAIT_DELETE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_ATTR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_EVF_MULTI);
|
||||
STR_CASE(SCE_KERNEL_ERROR_WAIT_CANCEL);
|
||||
STR_CASE(SCE_KERNEL_ERROR_EVF_COND);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_COUNT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_PRIORITY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MUTEX_RECURSIVE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MUTEX_LOCK_OVF);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MUTEX_NOT_OWNED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MUTEX_UNLOCK_UDF);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MUTEX_FAILED_TO_OWN);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FAST_MUTEX_RECURSIVE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FAST_MUTEX_LOCK_OVF);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FAST_MUTEX_FAILED_TO_OWN);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FAST_MUTEX_NOT_OWNED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FAST_MUTEX_OWNED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ALARM_CAN_NOT_CANCEL);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_OBJECT_TYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_KERNEL_TLS_FULL);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_KERNEL_TLS_INDEX);
|
||||
STR_CASE(SCE_KERNEL_ERROR_KERNEL_TLS_BUSY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_DIFFERENT_UID_CLASS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_UNKNOWN_UID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SEMA_ZERO);
|
||||
STR_CASE(SCE_KERNEL_ERROR_SEMA_OVF);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PMON_NOT_THREAD_MODE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PMON_NOT_CPU_MODE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ALREADY_REGISTERED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_THREAD_ID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ALREADY_DEBUG_SUSPENDED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_DEBUG_SUSPENDED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_CAN_NOT_USE_VFP);
|
||||
STR_CASE(SCE_KERNEL_ERROR_RUNNING);
|
||||
STR_CASE(SCE_KERNEL_ERROR_EVENT_COND);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MSG_PIPE_FULL);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MSG_PIPE_EMPTY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ALREADY_SENT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_CAN_NOT_SUSPEND);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FAST_MUTEX_ALREADY_INITIALIZED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_FAST_MUTEX_NOT_INITIALIZED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_THREAD_STOPPED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_THREAD_SUSPENDED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NOT_SUSPENDED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_WAIT_DELETE_MUTEX);
|
||||
STR_CASE(SCE_KERNEL_ERROR_WAIT_CANCEL_MUTEX);
|
||||
STR_CASE(SCE_KERNEL_ERROR_WAIT_DELETE_COND);
|
||||
STR_CASE(SCE_KERNEL_ERROR_WAIT_CANCEL_COND);
|
||||
STR_CASE(SCE_KERNEL_ERROR_LW_MUTEX_NOT_OWNED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_LW_MUTEX_LOCK_OVF);
|
||||
STR_CASE(SCE_KERNEL_ERROR_LW_MUTEX_UNLOCK_UDF);
|
||||
STR_CASE(SCE_KERNEL_ERROR_LW_MUTEX_RECURSIVE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_LW_MUTEX_FAILED_TO_OWN);
|
||||
STR_CASE(SCE_KERNEL_ERROR_WAIT_DELETE_LW_MUTEX);
|
||||
STR_CASE(SCE_KERNEL_ERROR_ILLEGAL_STACK_SIZE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_RW_LOCK_RECURSIVE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_RW_LOCK_LOCK_OVF);
|
||||
STR_CASE(SCE_KERNEL_ERROR_RW_LOCK_NOT_OWNED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_RW_LOCK_UNLOCK_UDF);
|
||||
STR_CASE(SCE_KERNEL_ERROR_RW_LOCK_FAILED_TO_LOCK);
|
||||
STR_CASE(SCE_KERNEL_ERROR_RW_LOCK_FAILED_TO_UNLOCK);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<>
|
||||
inline const char* arm_error_code::print(SceLibKernelError1 error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
STR_CASE(SCE_KERNEL_ERROR_PROCESSMGR_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_PID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_PROCESS_TYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PLS_FULL);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_PROCESS_STATUS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_BUDGET_ID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_INVALID_BUDGET_SIZE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_CP14_DISABLED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_EXCEEDED_MAX_PROCESSES);
|
||||
STR_CASE(SCE_KERNEL_ERROR_PROCESS_REMAINING);
|
||||
STR_CASE(SCE_KERNEL_ERROR_IOFILEMGR_ERROR);
|
||||
STR_CASE(SCE_KERNEL_ERROR_IO_NAME_TOO_LONG);
|
||||
STR_CASE(SCE_KERNEL_ERROR_IO_REG_DEV);
|
||||
STR_CASE(SCE_KERNEL_ERROR_IO_ALIAS_USED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_IO_DEL_DEV);
|
||||
STR_CASE(SCE_KERNEL_ERROR_IO_WOULD_BLOCK);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_START_FAILED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_STOP_FAIL);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_IN_USE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NO_LIB);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_SYSCALL_REG);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NOMEM_LIB);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NOMEM_STUB);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NOMEM_SELF);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NOMEM);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_INVALID_LIB);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_INVALID_STUB);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NO_FUNC_NID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NO_VAR_NID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_INVALID_TYPE);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NO_MOD_ENTRY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_INVALID_PROC_PARAM);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NO_MODOBJ);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NO_MOD);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NO_PROCESS);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_OLD_LIB);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_STARTED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NOT_STARTED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NOT_STOPPED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_INVALID_PROCESS_UID);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_CANNOT_EXPORT_LIB_TO_SHARED);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_INVALID_REL_INFO);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_INVALID_REF_INFO);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_ELINK);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NOENT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_BUSY);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NOEXEC);
|
||||
STR_CASE(SCE_KERNEL_ERROR_MODULEMGR_NAMETOOLONG);
|
||||
STR_CASE(SCE_KERNEL_ERROR_LIBRARYDB_NOENT);
|
||||
STR_CASE(SCE_KERNEL_ERROR_LIBRARYDB_NO_LIB);
|
||||
STR_CASE(SCE_KERNEL_ERROR_LIBRARYDB_NO_MOD);
|
||||
STR_CASE(SCE_KERNEL_ERROR_AUTHFAIL);
|
||||
STR_CASE(SCE_KERNEL_ERROR_NO_AUTH);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
enum psv_object_class_t : u32
|
||||
{
|
||||
SCE_KERNEL_UID_CLASS_PROCESS = 0,
|
||||
@ -458,7 +740,7 @@ struct psv_event_flag_t
|
||||
|
||||
std::mutex mutex;
|
||||
|
||||
sleep_queue_t sq;
|
||||
sleep_queue<cpu_thread> sq;
|
||||
|
||||
psv_event_flag_t(const char* name, u32 attr, u32 pattern)
|
||||
: name(name)
|
||||
@ -479,7 +761,8 @@ struct psv_event_flag_t
|
||||
{
|
||||
static_cast<ARMv7Thread&>(*thread).GPR[0] = SCE_KERNEL_ERROR_WAIT_DELETE;
|
||||
static_cast<ARMv7Thread&>(*thread).GPR[1] = pattern;
|
||||
thread->signal();
|
||||
thread->state += cpu_state::signal;
|
||||
thread->cv.notify_one();
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -741,8 +1024,6 @@ struct SceIoDirent
|
||||
};
|
||||
|
||||
// Module
|
||||
extern psv_log_base sceLibKernel;
|
||||
|
||||
// Aux
|
||||
|
||||
inline bool ipc_ref_try_dec(u32& ref)
|
||||
|
@ -1,18 +1,15 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceXml.h"
|
||||
#include "sceLibXml.h"
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceXml, #name, name)
|
||||
LOG_CHANNEL(sceLibXml);
|
||||
|
||||
psv_log_base sceXml("SceXml", []()
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceLibXml, nid, name)
|
||||
|
||||
DECLARE(arm_module_manager::SceLibXml)("SceLibXml", []()
|
||||
{
|
||||
sceXml.on_load = nullptr;
|
||||
sceXml.on_unload = nullptr;
|
||||
sceXml.on_stop = nullptr;
|
||||
sceXml.on_error = nullptr;
|
||||
|
||||
//REG_FUNC(0x57400A1A, _ZN3sce3Xml10SimpleDataC1EPKcj);
|
||||
//REG_FUNC(0x7E582075, _ZN3sce3Xml10SimpleDataC1Ev);
|
||||
//REG_FUNC(0x4CF0656B, _ZN3sce3Xml10SimpleDataC2EPKcj);
|
1
rpcs3/Emu/ARMv7/Modules/sceLibXml.h
Normal file
1
rpcs3/Emu/ARMv7/Modules/sceLibXml.h
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
@ -1,18 +1,21 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
#include "Emu/ARMv7/ARMv7Thread.h"
|
||||
#include "Emu/ARMv7/ARMv7Callback.h"
|
||||
|
||||
#include "sceLibc.h"
|
||||
|
||||
LOG_CHANNEL(sceLibc);
|
||||
|
||||
// TODO
|
||||
vm::ptr<void> g_dso;
|
||||
|
||||
std::vector<std::function<void(ARMv7Thread&)>> g_atexit;
|
||||
|
||||
std::mutex g_atexit_mutex;
|
||||
|
||||
std::string armv7_fmt(ARMv7Context& context, vm::cptr<char> fmt, u32 g_count, u32 f_count, u32 v_count)
|
||||
std::string arm_fmt(ARMv7Thread& cpu, vm::cptr<char> fmt, u32 g_count)
|
||||
{
|
||||
std::string result;
|
||||
|
||||
@ -40,7 +43,7 @@ std::string armv7_fmt(ARMv7Context& context, vm::cptr<char> fmt, u32 g_count, u3
|
||||
if (*fmt == '*')
|
||||
{
|
||||
fmt++;
|
||||
return context.get_next_gpr_arg(g_count, f_count, v_count);
|
||||
return cpu.get_next_gpr_arg(g_count);
|
||||
}
|
||||
|
||||
while (*fmt - '0' < 10)
|
||||
@ -64,7 +67,7 @@ std::string armv7_fmt(ARMv7Context& context, vm::cptr<char> fmt, u32 g_count, u3
|
||||
if (*++fmt == '*')
|
||||
{
|
||||
fmt++;
|
||||
return context.get_next_gpr_arg(g_count, f_count, v_count);
|
||||
return cpu.get_next_gpr_arg(g_count);
|
||||
}
|
||||
|
||||
while (*fmt - '0' < 10)
|
||||
@ -88,7 +91,7 @@ std::string armv7_fmt(ARMv7Context& context, vm::cptr<char> fmt, u32 g_count, u3
|
||||
case 'i':
|
||||
{
|
||||
// signed decimal
|
||||
const s64 value = context.get_next_gpr_arg(g_count, f_count, v_count);
|
||||
const s64 value = cpu.get_next_gpr_arg(g_count);
|
||||
|
||||
if (plus_sign || minus_sign || space_sign || number_sign || zero_padding || width || prec) break;
|
||||
|
||||
@ -99,7 +102,7 @@ std::string armv7_fmt(ARMv7Context& context, vm::cptr<char> fmt, u32 g_count, u3
|
||||
case 'X':
|
||||
{
|
||||
// hexadecimal
|
||||
const u64 value = context.get_next_gpr_arg(g_count, f_count, v_count);
|
||||
const u64 value = cpu.get_next_gpr_arg(g_count);
|
||||
|
||||
if (plus_sign || minus_sign || space_sign || prec) break;
|
||||
|
||||
@ -108,7 +111,7 @@ std::string armv7_fmt(ARMv7Context& context, vm::cptr<char> fmt, u32 g_count, u3
|
||||
result += cf == 'x' ? "0x" : "0X";
|
||||
}
|
||||
|
||||
const std::string& hex = cf == 'x' ? fmt::to_hex(value) : fmt::toupper(fmt::to_hex(value));
|
||||
const std::string& hex = cf == 'x' ? fmt::to_hex(value) : fmt::to_upper(fmt::to_hex(value));
|
||||
|
||||
if (hex.length() >= width)
|
||||
{
|
||||
@ -127,7 +130,7 @@ std::string armv7_fmt(ARMv7Context& context, vm::cptr<char> fmt, u32 g_count, u3
|
||||
case 's':
|
||||
{
|
||||
// string
|
||||
const vm::cptr<char> string{ context.get_next_gpr_arg(g_count, f_count, v_count), vm::addr };
|
||||
const vm::cptr<char> string{ cpu.get_next_gpr_arg(g_count), vm::addr };
|
||||
|
||||
if (plus_sign || minus_sign || space_sign || number_sign || zero_padding || width || prec) break;
|
||||
|
||||
@ -154,9 +157,9 @@ namespace sce_libc_func
|
||||
|
||||
std::lock_guard<std::mutex> lock(g_atexit_mutex);
|
||||
|
||||
g_atexit.insert(g_atexit.begin(), [func, arg, dso](ARMv7Thread& context)
|
||||
g_atexit.insert(g_atexit.begin(), [func, arg, dso](ARMv7Thread& cpu)
|
||||
{
|
||||
func(context, arg);
|
||||
func(cpu, arg);
|
||||
});
|
||||
}
|
||||
|
||||
@ -166,13 +169,13 @@ namespace sce_libc_func
|
||||
|
||||
std::lock_guard<std::mutex> lock(g_atexit_mutex);
|
||||
|
||||
g_atexit.insert(g_atexit.begin(), [func, arg, dso](ARMv7Thread& context)
|
||||
g_atexit.insert(g_atexit.begin(), [func, arg, dso](ARMv7Thread& cpu)
|
||||
{
|
||||
func(context, arg);
|
||||
func(cpu, arg);
|
||||
});
|
||||
}
|
||||
|
||||
void exit(ARMv7Thread& context)
|
||||
void exit(ARMv7Thread& cpu)
|
||||
{
|
||||
sceLibc.warning("exit()");
|
||||
|
||||
@ -182,7 +185,7 @@ namespace sce_libc_func
|
||||
|
||||
for (auto& func : decltype(g_atexit)(std::move(g_atexit)))
|
||||
{
|
||||
func(context);
|
||||
func(cpu);
|
||||
}
|
||||
|
||||
sceLibc.success("Process finished");
|
||||
@ -196,27 +199,27 @@ namespace sce_libc_func
|
||||
{
|
||||
CHECK_EMU_STATUS;
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
}
|
||||
|
||||
void printf(ARMv7Thread& context, vm::cptr<char> fmt, armv7_va_args_t va_args)
|
||||
void printf(ARMv7Thread& cpu, vm::cptr<char> fmt, arm_va_args_t va_args)
|
||||
{
|
||||
sceLibc.warning("printf(fmt=*0x%x)", fmt);
|
||||
sceLibc.trace("*** *fmt = '%s'", fmt.get_ptr());
|
||||
|
||||
const std::string& result = armv7_fmt(context, fmt, va_args.g_count, va_args.f_count, va_args.v_count);
|
||||
const std::string& result = arm_fmt(cpu, fmt, va_args.count);
|
||||
sceLibc.trace("*** -> '%s'", result);
|
||||
|
||||
_log::g_tty_file.log(result);
|
||||
}
|
||||
|
||||
void sprintf(ARMv7Thread& context, vm::ptr<char> str, vm::cptr<char> fmt, armv7_va_args_t va_args)
|
||||
void sprintf(ARMv7Thread& cpu, vm::ptr<char> str, vm::cptr<char> fmt, arm_va_args_t va_args)
|
||||
{
|
||||
sceLibc.warning("sprintf(str=*0x%x, fmt=*0x%x)", str, fmt);
|
||||
sceLibc.trace("*** *fmt = '%s'", fmt.get_ptr());
|
||||
|
||||
const std::string& result = armv7_fmt(context, fmt, va_args.g_count, va_args.f_count, va_args.v_count);
|
||||
const std::string& result = arm_fmt(cpu, fmt, va_args.count);
|
||||
sceLibc.trace("*** -> '%s'", result);
|
||||
|
||||
::memcpy(str.get_ptr(), result.c_str(), result.size() + 1);
|
||||
@ -225,8 +228,9 @@ namespace sce_libc_func
|
||||
void __cxa_set_dso_handle_main(vm::ptr<void> dso)
|
||||
{
|
||||
sceLibc.warning("__cxa_set_dso_handle_main(dso=*0x%x)", dso);
|
||||
|
||||
|
||||
g_dso = dso;
|
||||
g_atexit.clear();
|
||||
}
|
||||
|
||||
void memcpy(vm::ptr<void> dst, vm::cptr<void> src, u32 size)
|
||||
@ -252,18 +256,10 @@ namespace sce_libc_func
|
||||
}
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLibc, #name, sce_libc_func::name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceLibc, nid, sce_libc_func::name)
|
||||
|
||||
psv_log_base sceLibc("SceLibc", []()
|
||||
DECLARE(arm_module_manager::SceLibc)("SceLibc", []()
|
||||
{
|
||||
g_dso = vm::null;
|
||||
g_atexit.clear();
|
||||
|
||||
sceLibc.on_load = nullptr;
|
||||
sceLibc.on_unload = nullptr;
|
||||
sceLibc.on_stop = nullptr;
|
||||
sceLibc.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xE4531F85, _Assert);
|
||||
//REG_FUNC(0xE71C5CDE, _Stoul);
|
||||
//REG_FUNC(0x7A5CA6A3, _Stoulx);
|
||||
|
@ -1,5 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
using atexit_func_t = void(vm::ptr<void>);
|
||||
|
||||
extern psv_log_base sceLibc;
|
||||
|
@ -1,23 +1,20 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceLibm.h"
|
||||
|
||||
LOG_CHANNEL(sceLibm);
|
||||
|
||||
namespace sce_libm_func
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLibm, #name, sce_libm_func::name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceLibm, nid, sce_libm_func::name)
|
||||
|
||||
psv_log_base sceLibm("SceLibm", []()
|
||||
DECLARE(arm_module_manager::SceLibm)("SceLibm", []()
|
||||
{
|
||||
sceLibm.on_load = nullptr;
|
||||
sceLibm.on_unload = nullptr;
|
||||
sceLibm.on_stop = nullptr;
|
||||
sceLibm.on_error = nullptr;
|
||||
|
||||
//REG_FUNC(0xC73FE76D, _Exp);
|
||||
//REG_FUNC(0xFF4EAE04, _FExp);
|
||||
//REG_FUNC(0xB363D7D4, _LExp);
|
||||
|
@ -1,3 +1 @@
|
||||
#pragma once
|
||||
|
||||
extern psv_log_base sceLibm;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceLibstdcxx.h"
|
||||
|
||||
LOG_CHANNEL(sceLibstdcxx);
|
||||
|
||||
namespace sce_libstdcxx_func
|
||||
{
|
||||
void __aeabi_unwind_cpp_pr0()
|
||||
@ -22,16 +24,12 @@ namespace sce_libstdcxx_func
|
||||
}
|
||||
}
|
||||
|
||||
// Attention: find and set correct original mangled name in third parameter, for example: REG_FUNC(0xAE71DC3, operator_new_nothrow, "_ZnwjRKSt9nothrow_t");
|
||||
#define REG_FUNC(nid, name, orig_name) reg_psv_func(nid, &sceLibstdcxx, orig_name, sce_libstdcxx_func::name)
|
||||
// TODO: find and set correct original mangled name. Currently ignored.
|
||||
// Example of correct usage: REG_FUNC(0xAE71DC3, operator_new_nothrow, "_ZnwjRKSt9nothrow_t");
|
||||
#define REG_FUNC(nid, name, orig_name) REG_FNID(SceLibstdcxx, nid, sce_libstdcxx_func::name)
|
||||
|
||||
psv_log_base sceLibstdcxx("SceLibstdcxx", []()
|
||||
DECLARE(arm_module_manager::SceLibstdcxx)("SceLibstdcxx", []()
|
||||
{
|
||||
sceLibstdcxx.on_load = nullptr;
|
||||
sceLibstdcxx.on_unload = nullptr;
|
||||
sceLibstdcxx.on_stop = nullptr;
|
||||
sceLibstdcxx.on_error = nullptr;
|
||||
|
||||
//REG_FUNC(0x52B0C625, std::bad_typeid::what() const);
|
||||
//REG_FUNC(0x64D7D074, std::bad_typeid::_Doraise() const);
|
||||
//REG_FUNC(0x15FB88E2, std::logic_error::what() const);
|
||||
|
@ -1,3 +1 @@
|
||||
#pragma once
|
||||
|
||||
extern psv_log_base sceLibstdcxx;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceLiveArea.h"
|
||||
|
||||
LOG_CHANNEL(sceLiveArea);
|
||||
|
||||
s32 sceLiveAreaResourceReplaceAll(vm::cptr<char> dirpath)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -14,15 +16,10 @@ s32 sceLiveAreaResourceGetStatus()
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLiveArea, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceLiveArea, nid, name)
|
||||
|
||||
psv_log_base sceLiveArea("SceLiveArea", []()
|
||||
DECLARE(arm_module_manager::SceLiveArea)("SceLiveArea", []()
|
||||
{
|
||||
sceLiveArea.on_load = nullptr;
|
||||
sceLiveArea.on_unload = nullptr;
|
||||
sceLiveArea.on_stop = nullptr;
|
||||
sceLiveArea.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xA4B506F9, sceLiveAreaResourceReplaceAll);
|
||||
REG_FUNC(0x54A395FB, sceLiveAreaResourceGetStatus);
|
||||
});
|
||||
|
@ -1,3 +1 @@
|
||||
#pragma once
|
||||
|
||||
extern psv_log_base sceLiveArea;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceLocation.h"
|
||||
|
||||
LOG_CHANNEL(sceLocation);
|
||||
|
||||
s32 sceLocationOpen(vm::ptr<u8> handle, SceLocationLocationMethod lmethod, SceLocationHeadingMethod hmethod)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -90,15 +92,10 @@ s32 sceLocationSetGpsEmulationFile(vm::ptr<char> filename)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLocation, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceLibLocation, nid, name)
|
||||
|
||||
psv_log_base sceLocation("SceLibLocation", []()
|
||||
DECLARE(arm_module_manager::SceLocation)("SceLibLocation", []()
|
||||
{
|
||||
sceLocation.on_load = nullptr;
|
||||
sceLocation.on_unload = nullptr;
|
||||
sceLocation.on_stop = nullptr;
|
||||
sceLocation.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xDD271661, sceLocationOpen);
|
||||
REG_FUNC(0x14FE76E8, sceLocationClose);
|
||||
REG_FUNC(0xB1F55065, sceLocationReopen);
|
||||
|
@ -79,5 +79,3 @@ struct SceLocationPermissionInfo
|
||||
SceLocationPermissionStatus mainstatus;
|
||||
SceLocationPermissionApplicationStatus applicationstatus;
|
||||
};
|
||||
|
||||
extern psv_log_base sceLocation;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceMd5.h"
|
||||
|
||||
LOG_CHANNEL(sceMd5);
|
||||
|
||||
s32 sceMd5Digest(vm::cptr<void> plain, u32 len, vm::ptr<u8> digest)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -24,15 +26,10 @@ s32 sceMd5BlockResult(vm::ptr<SceMd5Context> pContext, vm::ptr<u8> digest)
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceMd5, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceMd5, nid, name)
|
||||
|
||||
psv_log_base sceMd5("SceMd5", []()
|
||||
DECLARE(arm_module_manager::SceMd5)("SceMd5", []()
|
||||
{
|
||||
sceMd5.on_load = nullptr;
|
||||
sceMd5.on_unload = nullptr;
|
||||
sceMd5.on_stop = nullptr;
|
||||
sceMd5.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xB845BCCB, sceMd5Digest);
|
||||
REG_FUNC(0x4D6436F9, sceMd5BlockInit);
|
||||
REG_FUNC(0x094A4902, sceMd5BlockUpdate);
|
||||
|
@ -10,5 +10,3 @@ struct SceMd5Context
|
||||
u8 buf[64];
|
||||
u8 result[64];
|
||||
};
|
||||
|
||||
extern psv_log_base sceMd5;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceMotion.h"
|
||||
|
||||
LOG_CHANNEL(sceMotion);
|
||||
|
||||
s32 sceMotionGetState(vm::ptr<SceMotionState> motionState)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -84,15 +86,10 @@ s32 sceMotionStopSampling()
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceMotion, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceMotion, nid, name)
|
||||
|
||||
psv_log_base sceMotion("SceMotion", []()
|
||||
DECLARE(arm_module_manager::SceMotion)("SceMotion", []()
|
||||
{
|
||||
sceMotion.on_load = nullptr;
|
||||
sceMotion.on_unload = nullptr;
|
||||
sceMotion.on_stop = nullptr;
|
||||
sceMotion.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xBDB32767, sceMotionGetState);
|
||||
REG_FUNC(0x47D679EA, sceMotionGetSensorState);
|
||||
REG_FUNC(0xC1652201, sceMotionGetTiltCorrection);
|
||||
|
@ -26,5 +26,3 @@ struct SceMotionSensorState
|
||||
le_t<u64> hostTimestamp;
|
||||
u8 reserve3[8];
|
||||
};
|
||||
|
||||
extern psv_log_base sceMotion;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceMt19937.h"
|
||||
|
||||
LOG_CHANNEL(sceMt19937);
|
||||
|
||||
s32 sceMt19937Init(vm::ptr<SceMt19937Context> pCtx, u32 seed)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -15,15 +17,10 @@ u32 sceMt19937UInt(vm::ptr<SceMt19937Context> pCtx)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceMt19937, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceMt19937, nid, name)
|
||||
|
||||
psv_log_base sceMt19937("SceMt19937", []()
|
||||
DECLARE(arm_module_manager::SceMt19937)("SceMt19937", []()
|
||||
{
|
||||
sceMt19937.on_load = nullptr;
|
||||
sceMt19937.on_unload = nullptr;
|
||||
sceMt19937.on_stop = nullptr;
|
||||
sceMt19937.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xEE5BA27C, sceMt19937Init);
|
||||
REG_FUNC(0x29E43BB5, sceMt19937UInt);
|
||||
});
|
||||
|
@ -5,5 +5,3 @@ struct SceMt19937Context
|
||||
le_t<u32> count;
|
||||
le_t<u32> state[624];
|
||||
};
|
||||
|
||||
extern psv_log_base sceMt19937;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceNet.h"
|
||||
|
||||
LOG_CHANNEL(sceNet);
|
||||
|
||||
s32 sceNetSetDnsInfo(vm::ptr<SceNetDnsInfo> info, s32 flags)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -295,15 +297,10 @@ s32 sceNetGetStatisticsInfo(vm::ptr<SceNetStatisticsInfo> info, s32 flags)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceNet, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceNet, nid, name)
|
||||
|
||||
psv_log_base sceNet("SceNet", []()
|
||||
DECLARE(arm_module_manager::SceNet)("SceNet", []()
|
||||
{
|
||||
sceNet.on_load = nullptr;
|
||||
sceNet.on_unload = nullptr;
|
||||
sceNet.on_stop = nullptr;
|
||||
sceNet.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xD62EF218, sceNetSetDnsInfo);
|
||||
REG_FUNC(0xFEC1166D, sceNetClearDnsCache);
|
||||
REG_FUNC(0xAFF9FA4D, sceNetDumpCreate);
|
||||
|
@ -178,5 +178,3 @@ struct SceNetStatisticsInfo
|
||||
le_t<s32> libnet_mem_free_size;
|
||||
le_t<s32> libnet_mem_free_min;
|
||||
};
|
||||
|
||||
extern psv_log_base sceNet;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceNetCtl.h"
|
||||
|
||||
LOG_CHANNEL(sceNetCtl);
|
||||
|
||||
s32 sceNetCtlInit()
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -84,15 +86,10 @@ s32 sceNetCtlAdhocGetInAddr(vm::ptr<SceNetInAddr> inaddr)
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceNetCtl, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceNetCtl, nid, name)
|
||||
|
||||
psv_log_base sceNetCtl("SceNetCtl", []()
|
||||
DECLARE(arm_module_manager::SceNetCtl)("SceNetCtl", []()
|
||||
{
|
||||
sceNetCtl.on_load = nullptr;
|
||||
sceNetCtl.on_unload = nullptr;
|
||||
sceNetCtl.on_stop = nullptr;
|
||||
sceNetCtl.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x495CA1DB, sceNetCtlInit);
|
||||
REG_FUNC(0xCD188648, sceNetCtlTerm);
|
||||
REG_FUNC(0xDFFC3ED4, sceNetCtlCheckCallback);
|
||||
|
@ -43,5 +43,3 @@ struct SceNetCtlAdhocPeerInfo
|
||||
};
|
||||
|
||||
using SceNetCtlCallback = void(s32 event_type, vm::ptr<void> arg);
|
||||
|
||||
extern psv_log_base sceNetCtl;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceNgs.h"
|
||||
|
||||
LOG_CHANNEL(sceNgs);
|
||||
|
||||
s32 sceNgsSystemGetRequiredMemorySize(vm::cptr<SceNgsSystemInitParams> pSynthParams, vm::ptr<u32> pnSize)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -320,15 +322,10 @@ s32 sceSulphaNgsTrace(vm::cptr<char> message)
|
||||
}
|
||||
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceNgs, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceNgs, nid, name)
|
||||
|
||||
psv_log_base sceNgs("SceNgs", []()
|
||||
DECLARE(arm_module_manager::SceNgs)("SceNgs", []()
|
||||
{
|
||||
sceNgs.on_load = nullptr;
|
||||
sceNgs.on_unload = nullptr;
|
||||
sceNgs.on_stop = nullptr;
|
||||
sceNgs.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x6CE8B36F, sceNgsSystemGetRequiredMemorySize);
|
||||
REG_FUNC(0xED14CF4A, sceNgsSystemInit);
|
||||
REG_FUNC(0x684F080C, sceNgsSystemUpdate);
|
||||
|
@ -102,5 +102,3 @@ struct SceSulphaNgsConfig
|
||||
le_t<u32> maxNamedObjects;
|
||||
le_t<u32> maxTraceBufferBytes;
|
||||
};
|
||||
|
||||
extern psv_log_base sceNgs;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceNpBasic.h"
|
||||
|
||||
LOG_CHANNEL(sceNpBasic);
|
||||
|
||||
s32 sceNpBasicInit(vm::ptr<void> opt)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -94,15 +96,10 @@ s32 sceNpBasicGetPlaySessionLog(SceNpBasicPlaySessionLogType type, u32 index, vm
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceNpBasic, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceNpBasic, nid, name)
|
||||
|
||||
psv_log_base sceNpBasic("SceNpBasic", []()
|
||||
DECLARE(arm_module_manager::SceNpBasic)("SceNpBasic", []()
|
||||
{
|
||||
sceNpBasic.on_load = nullptr;
|
||||
sceNpBasic.on_unload = nullptr;
|
||||
sceNpBasic.on_stop = nullptr;
|
||||
sceNpBasic.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xEFB91A99, sceNpBasicInit);
|
||||
REG_FUNC(0x389BCB3B, sceNpBasicTerm);
|
||||
REG_FUNC(0x26E6E048, sceNpBasicRegisterHandler);
|
||||
|
@ -113,5 +113,3 @@ enum SceNpBasicPlaySessionLogType : s32
|
||||
SCE_NP_BASIC_PLAY_SESSION_LOG_TYPE_BY_NP_COMM_ID = 1,
|
||||
SCE_NP_BASIC_PLAY_SESSION_LOG_TYPE_MAX = 2
|
||||
};
|
||||
|
||||
extern psv_log_base sceNpBasic;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceNpCommon.h"
|
||||
|
||||
LOG_CHANNEL(sceNpCommon);
|
||||
|
||||
s32 sceNpAuthInit()
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -59,15 +61,10 @@ s32 sceNpCmpNpIdInOrder(vm::cptr<SceNpId> npid1, vm::cptr<SceNpId> npid2, vm::pt
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceNpCommon, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceNpCommon, nid, name)
|
||||
|
||||
psv_log_base sceNpCommon("SceNpCommon", []()
|
||||
DECLARE(arm_module_manager::SceNpCommon)("SceNpCommon", []()
|
||||
{
|
||||
sceNpCommon.on_load = nullptr;
|
||||
sceNpCommon.on_unload = nullptr;
|
||||
sceNpCommon.on_stop = nullptr;
|
||||
sceNpCommon.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x441D8B4E, sceNpAuthInit);
|
||||
REG_FUNC(0x6093B689, sceNpAuthTerm);
|
||||
REG_FUNC(0xED42079F, sceNpAuthCreateStartRequest);
|
||||
|
@ -147,5 +147,3 @@ struct SceNpEntitlement
|
||||
le_t<u32> consumedCount;
|
||||
char padding[4];
|
||||
};
|
||||
|
||||
extern psv_log_base sceNpCommon;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceNpManager.h"
|
||||
|
||||
LOG_CHANNEL(sceNpManager);
|
||||
|
||||
s32 sceNpInit(vm::cptr<SceNpCommunicationConfig> commConf, vm::ptr<SceNpOptParam> opt)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -54,15 +56,10 @@ s32 sceNpManagerGetChatRestrictionFlag(vm::ptr<s32> isRestricted)
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceNpManager, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceNpManager, nid, name)
|
||||
|
||||
psv_log_base sceNpManager("SceNpManager", []()
|
||||
DECLARE(arm_module_manager::SceNpManager)("SceNpManager", []()
|
||||
{
|
||||
sceNpManager.on_load = nullptr;
|
||||
sceNpManager.on_unload = nullptr;
|
||||
sceNpManager.on_stop = nullptr;
|
||||
sceNpManager.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x04D9F484, sceNpInit);
|
||||
REG_FUNC(0x19E40AE1, sceNpTerm);
|
||||
REG_FUNC(0x3C94B4B4, sceNpManagerGetNpId);
|
||||
|
@ -8,5 +8,3 @@ struct SceNpOptParam
|
||||
};
|
||||
|
||||
using SceNpServiceStateCallback = void(SceNpServiceState state, vm::ptr<void> userdata);
|
||||
|
||||
extern psv_log_base sceNpManager;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceNpMatching.h"
|
||||
|
||||
LOG_CHANNEL(sceNpMatching);
|
||||
|
||||
// Functions
|
||||
|
||||
s32 sceNpMatching2Init(u32 poolSize, s32 threadPriority, s32 cpuAffinityMask, u32 threadStackSize)
|
||||
@ -224,15 +226,10 @@ s32 sceNpMatching2SignalingGetPeerNetInfoResult(
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceNpMatching, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceNpMatching2, nid, name)
|
||||
|
||||
psv_log_base sceNpMatching("SceNpMatching2", []()
|
||||
DECLARE(arm_module_manager::SceNpMatching)("SceNpMatching2", []()
|
||||
{
|
||||
sceNpMatching.on_load = nullptr;
|
||||
sceNpMatching.on_unload = nullptr;
|
||||
sceNpMatching.on_stop = nullptr;
|
||||
sceNpMatching.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0xEBB1FE74, sceNpMatching2Init);
|
||||
REG_FUNC(0x0124641C, sceNpMatching2Term);
|
||||
REG_FUNC(0xADF578E1, sceNpMatching2CreateContext);
|
||||
|
@ -985,5 +985,3 @@ struct SceNpMatching2SignalingNetInfo
|
||||
SceNetInAddr mappedAddr;
|
||||
le_t<s32> natStatus;
|
||||
};
|
||||
|
||||
extern psv_log_base sceNpMatching;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceNpScore.h"
|
||||
|
||||
LOG_CHANNEL(sceNpScore);
|
||||
|
||||
s32 sceNpScoreInit(s32 threadPriority, s32 cpuAffinityMask, vm::ptr<void> option)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -276,15 +278,10 @@ s32 sceNpScoreSanitizeCommentAsync(s32 reqId, vm::cptr<char> comment, vm::ptr<ch
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceNpScore, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceNpScore, nid, name)
|
||||
|
||||
psv_log_base sceNpScore("SceNpScore", []()
|
||||
DECLARE(arm_module_manager::SceNpScore)("SceNpScore", []()
|
||||
{
|
||||
sceNpScore.on_load = nullptr;
|
||||
sceNpScore.on_unload = nullptr;
|
||||
sceNpScore.on_stop = nullptr;
|
||||
sceNpScore.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x0433069F, sceNpScoreInit);
|
||||
REG_FUNC(0x2050F98F, sceNpScoreTerm);
|
||||
REG_FUNC(0x5685F225, sceNpScoreCreateTitleCtx);
|
||||
|
@ -51,5 +51,3 @@ struct SceNpScoreNpIdPcId
|
||||
le_t<s32> pcId;
|
||||
u8 pad[4];
|
||||
};
|
||||
|
||||
extern psv_log_base sceNpScore;
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "sceNpUtility.h"
|
||||
|
||||
LOG_CHANNEL(sceNpUtility);
|
||||
|
||||
s32 sceNpLookupInit(s32 usesAsync, s32 threadPriority, s32 cpuAffinityMask, vm::ptr<void> option)
|
||||
{
|
||||
throw EXCEPTION("");
|
||||
@ -126,15 +128,10 @@ s32 sceNpBandwidthTestAbort()
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &sceNpUtility, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(SceNpUtility, nid, name)
|
||||
|
||||
psv_log_base sceNpUtility("SceNpUtility", []()
|
||||
DECLARE(arm_module_manager::SceNpUtility)("SceNpUtility", []()
|
||||
{
|
||||
sceNpUtility.on_load = nullptr;
|
||||
sceNpUtility.on_unload = nullptr;
|
||||
sceNpUtility.on_stop = nullptr;
|
||||
sceNpUtility.on_error = nullptr;
|
||||
|
||||
REG_FUNC(0x9246A673, sceNpLookupInit);
|
||||
REG_FUNC(0x0158B61B, sceNpLookupTerm);
|
||||
REG_FUNC(0x5110E17E, sceNpLookupCreateTitleCtx);
|
||||
|
@ -9,5 +9,3 @@ struct SceNpBandwidthTestResult
|
||||
le_t<s32> result;
|
||||
char padding[4];
|
||||
};
|
||||
|
||||
extern psv_log_base sceNpUtility;
|
||||
|
@ -1,33 +1,29 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/ARMv7/PSVFuncList.h"
|
||||
#include "Emu/ARMv7/ARMv7Module.h"
|
||||
|
||||
#include "scePerf.h"
|
||||
|
||||
LOG_CHANNEL(scePerf);
|
||||
|
||||
extern u64 get_system_time();
|
||||
|
||||
s32 scePerfArmPmonReset(ARMv7Thread& context, s32 threadId)
|
||||
arm_error_code scePerfArmPmonReset(ARMv7Thread& cpu, s32 threadId)
|
||||
{
|
||||
scePerf.warning("scePerfArmPmonReset(threadId=0x%x)", threadId);
|
||||
|
||||
if (threadId != SCE_PERF_ARM_PMON_THREAD_ID_SELF)
|
||||
{
|
||||
throw EXCEPTION("Unexpected thread");
|
||||
}
|
||||
ASSERT(threadId == SCE_PERF_ARM_PMON_THREAD_ID_SELF);
|
||||
|
||||
context.counters = {};
|
||||
cpu.counters = {};
|
||||
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 scePerfArmPmonSelectEvent(ARMv7Thread& context, s32 threadId, u32 counter, u8 eventCode)
|
||||
arm_error_code scePerfArmPmonSelectEvent(ARMv7Thread& cpu, s32 threadId, u32 counter, u8 eventCode)
|
||||
{
|
||||
scePerf.warning("scePerfArmPmonSelectEvent(threadId=0x%x, counter=0x%x, eventCode=0x%x)", threadId, counter, eventCode);
|
||||
|
||||
if (threadId != SCE_PERF_ARM_PMON_THREAD_ID_SELF)
|
||||
{
|
||||
throw EXCEPTION("Unexpected thread");
|
||||
}
|
||||
ASSERT(threadId == SCE_PERF_ARM_PMON_THREAD_ID_SELF);
|
||||
|
||||
if (counter >= 6)
|
||||
{
|
||||
@ -66,44 +62,35 @@ s32 scePerfArmPmonSelectEvent(ARMv7Thread& context, s32 threadId, u32 counter, u
|
||||
}
|
||||
}
|
||||
|
||||
context.counters[counter].event = eventCode;
|
||||
context.counters[counter].value = value;
|
||||
cpu.counters[counter].event = eventCode;
|
||||
cpu.counters[counter].value = value;
|
||||
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 scePerfArmPmonStart(ARMv7Thread& context, s32 threadId)
|
||||
arm_error_code scePerfArmPmonStart(ARMv7Thread& cpu, s32 threadId)
|
||||
{
|
||||
scePerf.warning("scePerfArmPmonStart(threadId=0x%x)", threadId);
|
||||
|
||||
if (threadId != SCE_PERF_ARM_PMON_THREAD_ID_SELF)
|
||||
{
|
||||
throw EXCEPTION("Unexpected thread");
|
||||
}
|
||||
ASSERT(threadId == SCE_PERF_ARM_PMON_THREAD_ID_SELF);
|
||||
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 scePerfArmPmonStop(ARMv7Thread& context, s32 threadId)
|
||||
arm_error_code scePerfArmPmonStop(ARMv7Thread& cpu, s32 threadId)
|
||||
{
|
||||
scePerf.warning("scePerfArmPmonStop(threadId=0x%x)");
|
||||
|
||||
if (threadId != SCE_PERF_ARM_PMON_THREAD_ID_SELF)
|
||||
{
|
||||
throw EXCEPTION("Unexpected thread");
|
||||
}
|
||||
ASSERT(threadId == SCE_PERF_ARM_PMON_THREAD_ID_SELF);
|
||||
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 scePerfArmPmonGetCounterValue(ARMv7Thread& context, s32 threadId, u32 counter, vm::ptr<u32> pValue)
|
||||
arm_error_code scePerfArmPmonGetCounterValue(ARMv7Thread& cpu, s32 threadId, u32 counter, vm::ptr<u32> pValue)
|
||||
{
|
||||
scePerf.warning("scePerfArmPmonGetCounterValue(threadId=0x%x, counter=%d, pValue=*0x%x)", threadId, counter, pValue);
|
||||
|
||||
if (threadId != SCE_PERF_ARM_PMON_THREAD_ID_SELF)
|
||||
{
|
||||
throw EXCEPTION("Unexpected thread");
|
||||
}
|
||||
ASSERT(threadId == SCE_PERF_ARM_PMON_THREAD_ID_SELF);
|
||||
|
||||
if (counter >= 6 && counter != SCE_PERF_ARM_PMON_CYCLE_COUNTER)
|
||||
{
|
||||
@ -112,7 +99,7 @@ s32 scePerfArmPmonGetCounterValue(ARMv7Thread& context, s32 threadId, u32 counte
|
||||
|
||||
if (counter < 6)
|
||||
{
|
||||
*pValue = context.counters[counter].value;
|
||||
*pValue = cpu.counters[counter].value;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -122,7 +109,7 @@ s32 scePerfArmPmonGetCounterValue(ARMv7Thread& context, s32 threadId, u32 counte
|
||||
return SCE_OK;
|
||||
}
|
||||
|
||||
s32 scePerfArmPmonSoftwareIncrement(ARMv7Thread& context, u32 mask)
|
||||
arm_error_code scePerfArmPmonSoftwareIncrement(ARMv7Thread& cpu, u32 mask)
|
||||
{
|
||||
scePerf.warning("scePerfArmPmonSoftwareIncrement(mask=0x%x)", mask);
|
||||
|
||||
@ -135,7 +122,7 @@ s32 scePerfArmPmonSoftwareIncrement(ARMv7Thread& context, u32 mask)
|
||||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
context.counters[i].value++;
|
||||
cpu.counters[i].value++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,15 +163,10 @@ s32 sceRazorCpuSync()
|
||||
throw EXCEPTION("");
|
||||
}
|
||||
|
||||
#define REG_FUNC(nid, name) reg_psv_func(nid, &scePerf, #name, name)
|
||||
#define REG_FUNC(nid, name) REG_FNID(ScePerf, nid, name)
|
||||
|
||||
psv_log_base scePerf("ScePerf", []()
|
||||
DECLARE(arm_module_manager::ScePerf)("ScePerf", []()
|
||||
{
|
||||
scePerf.on_load = nullptr;
|
||||
scePerf.on_unload = nullptr;
|
||||
scePerf.on_stop = nullptr;
|
||||
//scePerf.on_error = nullptr; // keep default error handler
|
||||
|
||||
REG_FUNC(0x35151735, scePerfArmPmonReset);
|
||||
REG_FUNC(0x63CBEA8B, scePerfArmPmonSelectEvent);
|
||||
REG_FUNC(0xC9D969D5, scePerfArmPmonStart);
|
||||
|
@ -1,11 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
#include "Emu/ARMv7/ErrorCodes.h"
|
||||
|
||||
enum ScePerfError : s32
|
||||
{
|
||||
// Error Codes
|
||||
SCE_PERF_ERROR_INVALID_ARGUMENT = 0x80580000,
|
||||
SCE_PERF_ERROR_INVALID_ARGUMENT = ERROR_CODE(0x80580000),
|
||||
};
|
||||
|
||||
template<>
|
||||
inline const char* arm_error_code::print(ScePerfError error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
STR_CASE(SCE_PERF_ERROR_INVALID_ARGUMENT);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
enum : s32
|
||||
{
|
||||
// Thread IDs
|
||||
@ -89,5 +102,3 @@ enum : u8
|
||||
SCE_PERF_ARM_PMON_PLE_FIFO_OVERFLOW = 0xA4,
|
||||
SCE_PERF_ARM_PMON_PLE_REQ_PROGRAMMED = 0xA5,
|
||||
};
|
||||
|
||||
extern psv_log_base scePerf;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user