1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-21 18:22:33 +01:00

error_code implemented

Reports based on formatting system
ppu_error_code removed
arm_error_code removed
This commit is contained in:
Nekotekina 2016-08-16 18:46:24 +03:00
parent 1c33c012ad
commit ad174eb12c
35 changed files with 984 additions and 1023 deletions

View File

@ -39,7 +39,7 @@ struct fmt_unveil
// This overload resolution takes the precedence
static inline u64_wrapper get(T&& arg)
{
return {std::move(arg)};
return u64_wrapper{std::move(arg)};
}
};

View File

@ -818,7 +818,10 @@ static_assert(sizeof(cmd64) == 8 && std::is_pod<cmd64>::value, "Incorrect cmd64
template <typename T, T Value, typename T1 = void, typename... Ts>
struct multicast : multicast<T, Value, Ts...>
{
constexpr multicast() = default;
constexpr multicast()
: multicast<T, Value, Ts...>()
{
}
// Implicit conversion to desired type
constexpr operator T1() const
@ -868,14 +871,59 @@ public:
}
};
enum class not_an_error_t : s32
// Error code type (return type), implements error reporting
struct error_code
{
// Use fixed s32 type for now (could be template argument)
s32 value;
error_code() = default;
// Must be implemented
static s32 error_report(const fmt_type_info* sup, u64 arg);
// Helper type (TODO: use scoped enum when error code is widely used)
enum not_an_error : s32
{
__not_an_error // SFINAE marker
};
// __not_an_error tester
template<typename ET, typename = void>
struct is_error : std::integral_constant<bool, std::is_enum<ET>::value || std::is_integral<ET>::value>
{
};
template<typename ET>
struct is_error<ET, void_t<decltype(ET::__not_an_error)>> : std::false_type
{
};
// Not an error constructor
template<typename ET, typename = decltype(ET::__not_an_error)>
error_code(const ET& value, int = 0)
: value(static_cast<s32>(value))
{
}
// Error constructor
template<typename ET, typename = std::enable_if_t<is_error<ET>::value>>
error_code(const ET& value)
: value(error_report(fmt::get_type_info<fmt_unveil_t<ET>>(), fmt_unveil<ET>::get(value)))
{
}
operator s32() const
{
return value;
}
};
// Helper function for error_code
template <typename T>
FORCE_INLINE not_an_error_t not_an_error(const T& value)
constexpr FORCE_INLINE error_code::not_an_error not_an_error(const T& value)
{
return static_cast<not_an_error_t>(static_cast<s32>(value));
return static_cast<error_code::not_an_error>(static_cast<s32>(value));
}
template <typename T, typename ID>

View File

@ -1,10 +1,18 @@
#pragma once
enum CellOk : s32
struct CellOk
{
CELL_OK = 0,
enum : s32
{
__not_an_error,
CELL_OK = 0
};
};
// Temporary workaround
constexpr auto CELL_OK = CellOk::CELL_OK;
enum CellError : u32
{
CELL_EAGAIN = 0x80010001, // The resource is temporarily unavailable
@ -66,142 +74,3 @@ enum CellError : u32
CELL_ENOTMOUNTED = 0x8001003A,
CELL_ENOTSDATA = 0x8001003B,
};
// Special return type signaling on errors
struct ppu_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;
}
ppu_error_code() = default;
// General error check
template<typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
ppu_error_code(T value)
: value(error_check(value))
{
}
// Force error reporting with a message specified
ppu_error_code(s32 value, const char* text)
: value(report(value, text))
{
}
// Silence any error
constexpr ppu_error_code(not_an_error_t value)
: value(static_cast<s32>(value))
{
}
// Conversion
constexpr operator s32() const
{
return value;
}
};
template<typename T, typename>
struct ppu_gpr_cast_impl;
template<>
struct ppu_gpr_cast_impl<ppu_error_code, void>
{
static inline u64 to(const ppu_error_code& code)
{
return code;
}
static inline ppu_error_code from(const u64 reg)
{
return not_an_error(reg);
}
};
template<>
inline const char* ppu_error_code::print(CellError error)
{
switch (error)
{
STR_CASE(CELL_EAGAIN);
STR_CASE(CELL_EINVAL);
STR_CASE(CELL_ENOSYS);
STR_CASE(CELL_ENOMEM);
STR_CASE(CELL_ESRCH);
STR_CASE(CELL_ENOENT);
STR_CASE(CELL_ENOEXEC);
STR_CASE(CELL_EDEADLK);
STR_CASE(CELL_EPERM);
STR_CASE(CELL_EBUSY);
STR_CASE(CELL_ETIMEDOUT);
STR_CASE(CELL_EABORT);
STR_CASE(CELL_EFAULT);
STR_CASE(CELL_ESTAT);
STR_CASE(CELL_EALIGN);
STR_CASE(CELL_EKRESOURCE);
STR_CASE(CELL_EISDIR);
STR_CASE(CELL_ECANCELED);
STR_CASE(CELL_EEXIST);
STR_CASE(CELL_EISCONN);
STR_CASE(CELL_ENOTCONN);
STR_CASE(CELL_EAUTHFAIL);
STR_CASE(CELL_ENOTMSELF);
STR_CASE(CELL_ESYSVER);
STR_CASE(CELL_EAUTHFATAL);
STR_CASE(CELL_EDOM);
STR_CASE(CELL_ERANGE);
STR_CASE(CELL_EILSEQ);
STR_CASE(CELL_EFPOS);
STR_CASE(CELL_EINTR);
STR_CASE(CELL_EFBIG);
STR_CASE(CELL_EMLINK);
STR_CASE(CELL_ENFILE);
STR_CASE(CELL_ENOSPC);
STR_CASE(CELL_ENOTTY);
STR_CASE(CELL_EPIPE);
STR_CASE(CELL_EROFS);
STR_CASE(CELL_ESPIPE);
STR_CASE(CELL_E2BIG);
STR_CASE(CELL_EACCES);
STR_CASE(CELL_EBADF);
STR_CASE(CELL_EIO);
STR_CASE(CELL_EMFILE);
STR_CASE(CELL_ENODEV);
STR_CASE(CELL_ENOTDIR);
STR_CASE(CELL_ENXIO);
STR_CASE(CELL_EXDEV);
STR_CASE(CELL_EBADMSG);
STR_CASE(CELL_EINPROGRESS);
STR_CASE(CELL_EMSGSIZE);
STR_CASE(CELL_ENAMETOOLONG);
STR_CASE(CELL_ENOLCK);
STR_CASE(CELL_ENOTEMPTY);
STR_CASE(CELL_ENOTSUP);
STR_CASE(CELL_EFSSPECIFIC);
STR_CASE(CELL_EOVERFLOW);
STR_CASE(CELL_ENOTMOUNTED);
STR_CASE(CELL_ENOTSDATA);
}
return nullptr;
}

View File

@ -262,7 +262,7 @@ s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr<CellFsDirectoryEntry> entries, u32
return CELL_OK;
}
ppu_error_code cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size, vm::ptr<u64> nread)
error_code cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size, vm::ptr<u64> nread)
{
cellFs.trace("cellFsReadWithOffset(fd=%d, offset=0x%llx, buf=*0x%x, buffer_size=0x%llx, nread=*0x%x)", fd, offset, buf, buffer_size, nread);
@ -291,7 +291,7 @@ ppu_error_code cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 b
return not_an_error(rc ? rc : arg->out_code.value());
}
ppu_error_code cellFsWriteWithOffset(u32 fd, u64 offset, vm::cptr<void> buf, u64 data_size, vm::ptr<u64> nwrite)
error_code cellFsWriteWithOffset(u32 fd, u64 offset, vm::cptr<void> buf, u64 data_size, vm::ptr<u64> nwrite)
{
cellFs.trace("cellFsWriteWithOffset(fd=%d, offset=0x%llx, buf=*0x%x, data_size=0x%llx, nwrite=*0x%x)", fd, offset, buf, data_size, nwrite);

View File

@ -14,6 +14,55 @@
logs::channel cellGame("cellGame", logs::level::notice);
template<>
void fmt_class_string<CellGameError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto error)
{
switch (error)
{
STR_CASE(CELL_GAME_ERROR_NOTFOUND);
STR_CASE(CELL_GAME_ERROR_BROKEN);
STR_CASE(CELL_GAME_ERROR_INTERNAL);
STR_CASE(CELL_GAME_ERROR_PARAM);
STR_CASE(CELL_GAME_ERROR_NOAPP);
STR_CASE(CELL_GAME_ERROR_ACCESS_ERROR);
STR_CASE(CELL_GAME_ERROR_NOSPACE);
STR_CASE(CELL_GAME_ERROR_NOTSUPPORTED);
STR_CASE(CELL_GAME_ERROR_FAILURE);
STR_CASE(CELL_GAME_ERROR_BUSY);
STR_CASE(CELL_GAME_ERROR_IN_SHUTDOWN);
STR_CASE(CELL_GAME_ERROR_INVALID_ID);
STR_CASE(CELL_GAME_ERROR_EXIST);
STR_CASE(CELL_GAME_ERROR_NOTPATCH);
STR_CASE(CELL_GAME_ERROR_INVALID_THEME_FILE);
STR_CASE(CELL_GAME_ERROR_BOOTPATH);
}
return unknown;
});
}
template<>
void fmt_class_string<CellGameDataError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto error)
{
switch (error)
{
STR_CASE(CELL_GAMEDATA_ERROR_CBRESULT);
STR_CASE(CELL_GAMEDATA_ERROR_ACCESS_ERROR);
STR_CASE(CELL_GAMEDATA_ERROR_INTERNAL);
STR_CASE(CELL_GAMEDATA_ERROR_PARAM);
STR_CASE(CELL_GAMEDATA_ERROR_NOSPACE);
STR_CASE(CELL_GAMEDATA_ERROR_BROKEN);
STR_CASE(CELL_GAMEDATA_ERROR_FAILURE);
}
return unknown;
});
}
// Normal content directory (if is_temporary is not involved):
// contentInfo = dir
// usrdir = dir + "/USRDIR"
@ -153,7 +202,7 @@ s32 cellGameDataExitBroken()
}
ppu_error_code cellGameBootCheck(vm::ptr<u32> type, vm::ptr<u32> attributes, vm::ptr<CellGameContentSize> size, vm::ptr<char[CELL_GAME_DIRNAME_SIZE]> dirName)
error_code cellGameBootCheck(vm::ptr<u32> type, vm::ptr<u32> attributes, vm::ptr<CellGameContentSize> size, vm::ptr<char[CELL_GAME_DIRNAME_SIZE]> dirName)
{
cellGame.warning("cellGameBootCheck(type=*0x%x, attributes=*0x%x, size=*0x%x, dirName=*0x%x)", type, attributes, size, dirName);
@ -214,10 +263,10 @@ ppu_error_code cellGameBootCheck(vm::ptr<u32> type, vm::ptr<u32> attributes, vm:
cellGame.error("cellGameBootCheck(): Unknown CATEGORY: %s", category);
}
return CELL_GAME_RET_OK;
return CELL_OK;
}
ppu_error_code cellGamePatchCheck(vm::ptr<CellGameContentSize> size, vm::ptr<void> reserved)
error_code cellGamePatchCheck(vm::ptr<CellGameContentSize> size, vm::ptr<void> reserved)
{
cellGame.warning("cellGamePatchCheck(size=*0x%x, reserved=*0x%x)", size, reserved);
@ -246,7 +295,7 @@ ppu_error_code cellGamePatchCheck(vm::ptr<CellGameContentSize> size, vm::ptr<voi
return CELL_OK;
}
ppu_error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellGameContentSize> size)
error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellGameContentSize> size)
{
cellGame.warning("cellGameDataCheck(type=%d, dirName=%s, size=*0x%x)", type, dirName, size);
@ -271,7 +320,7 @@ ppu_error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellG
if (!fs::is_dir(vfs::get(dir)))
{
cellGame.warning("cellGameDataCheck(): '%s' directory not found", dir);
return CELL_GAME_RET_NONE;
return not_an_error(CELL_GAME_RET_NONE);
}
if (!fxm::make<content_permission>(std::move(dir), psf::load_object(fs::file(vfs::get(dir + "/PARAM.SFO"))), false))
@ -279,10 +328,10 @@ ppu_error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellG
return CELL_GAME_ERROR_BUSY;
}
return CELL_GAME_RET_OK;
return CELL_OK;
}
ppu_error_code cellGameContentPermit(vm::ptr<char[CELL_GAME_PATH_MAX]> contentInfoPath, vm::ptr<char[CELL_GAME_PATH_MAX]> usrdirPath)
error_code cellGameContentPermit(vm::ptr<char[CELL_GAME_PATH_MAX]> contentInfoPath, vm::ptr<char[CELL_GAME_PATH_MAX]> usrdirPath)
{
cellGame.warning("cellGameContentPermit(contentInfoPath=*0x%x, usrdirPath=*0x%x)", contentInfoPath, usrdirPath);
@ -330,7 +379,7 @@ ppu_error_code cellGameContentPermit(vm::ptr<char[CELL_GAME_PATH_MAX]> contentIn
return CELL_OK;
}
ppu_error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char> dirName, u32 errDialog, vm::ptr<CellGameDataStatCallback> funcStat, u32 container)
error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char> dirName, u32 errDialog, vm::ptr<CellGameDataStatCallback> funcStat, u32 container)
{
cellGame.error("cellGameDataCheckCreate2(version=0x%x, dirName=%s, errDialog=0x%x, funcStat=*0x%x, container=%d)", version, dirName, errDialog, funcStat, container);
@ -347,7 +396,7 @@ ppu_error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<c
{
cellGame.todo("cellGameDataCheckCreate2(): should create directory %s", dir);
// TODO: create data
return CELL_GAMEDATA_RET_OK;
return CELL_OK;
}
vm::var<CellGameDataCBResult> cbResult;
@ -394,7 +443,7 @@ ppu_error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<c
cellGame.warning("cellGameDataCheckCreate2(): callback returned CELL_GAMEDATA_CBRESULT_OK_CANCEL");
case CELL_GAMEDATA_CBRESULT_OK:
return CELL_GAMEDATA_RET_OK;
return CELL_OK;
case CELL_GAMEDATA_CBRESULT_ERR_NOSPACE: // TODO: process errors, error message and needSizeKB result
cellGame.error("cellGameDataCheckCreate2(): callback returned CELL_GAMEDATA_CBRESULT_ERR_NOSPACE");
@ -426,7 +475,7 @@ s32 cellGameDataCheckCreate(ppu_thread& ppu, u32 version, vm::cptr<char> dirName
return cellGameDataCheckCreate2(ppu, version, dirName, errDialog, funcStat, container);
}
ppu_error_code cellGameCreateGameData(vm::ptr<CellGameSetInitParams> init, vm::ptr<char[CELL_GAME_PATH_MAX]> tmp_contentInfoPath, vm::ptr<char[CELL_GAME_PATH_MAX]> tmp_usrdirPath)
error_code cellGameCreateGameData(vm::ptr<CellGameSetInitParams> init, vm::ptr<char[CELL_GAME_PATH_MAX]> tmp_contentInfoPath, vm::ptr<char[CELL_GAME_PATH_MAX]> tmp_usrdirPath)
{
cellGame.error("cellGameCreateGameData(init=*0x%x, tmp_contentInfoPath=*0x%x, tmp_usrdirPath=*0x%x)", init, tmp_contentInfoPath, tmp_usrdirPath);
@ -476,7 +525,7 @@ s32 cellGameDeleteGameData()
return CELL_OK;
}
ppu_error_code cellGameGetParamInt(s32 id, vm::ptr<s32> value)
error_code cellGameGetParamInt(s32 id, vm::ptr<s32> value)
{
cellGame.warning("cellGameGetParamInt(id=%d, value=*0x%x)", id, value);
@ -539,7 +588,7 @@ static const char* get_param_string_key(s32 id)
return nullptr;
}
ppu_error_code cellGameGetParamString(s32 id, vm::ptr<char> buf, u32 bufsize)
error_code cellGameGetParamString(s32 id, vm::ptr<char> buf, u32 bufsize)
{
cellGame.warning("cellGameGetParamString(id=%d, buf=*0x%x, bufsize=%d)", id, buf, bufsize);
@ -565,7 +614,7 @@ ppu_error_code cellGameGetParamString(s32 id, vm::ptr<char> buf, u32 bufsize)
return CELL_OK;
}
ppu_error_code cellGameSetParamString(s32 id, vm::cptr<char> buf)
error_code cellGameSetParamString(s32 id, vm::cptr<char> buf)
{
cellGame.warning("cellGameSetParamString(id=%d, buf=*0x%x)", id, buf);
@ -616,7 +665,7 @@ s32 cellGameGetLocalWebContentPath()
return CELL_OK;
}
ppu_error_code cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, vm::cptr<char> dirName)
error_code cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, vm::cptr<char> dirName)
{
cellGame.warning("cellGameContentErrorDialog(type=%d, errNeedSizeKB=%d, dirName=%s)", type, errNeedSizeKB, dirName);

View File

@ -32,31 +32,16 @@ enum CellGameError : u32
CELL_GAME_ERROR_BOOTPATH = 0x8002cb50,
};
template<>
inline const char* ppu_error_code::print(CellGameError error)
enum CellGameDataError : u32
{
switch (error)
{
STR_CASE(CELL_GAME_ERROR_NOTFOUND);
STR_CASE(CELL_GAME_ERROR_BROKEN);
STR_CASE(CELL_GAME_ERROR_INTERNAL);
STR_CASE(CELL_GAME_ERROR_PARAM);
STR_CASE(CELL_GAME_ERROR_NOAPP);
STR_CASE(CELL_GAME_ERROR_ACCESS_ERROR);
STR_CASE(CELL_GAME_ERROR_NOSPACE);
STR_CASE(CELL_GAME_ERROR_NOTSUPPORTED);
STR_CASE(CELL_GAME_ERROR_FAILURE);
STR_CASE(CELL_GAME_ERROR_BUSY);
STR_CASE(CELL_GAME_ERROR_IN_SHUTDOWN);
STR_CASE(CELL_GAME_ERROR_INVALID_ID);
STR_CASE(CELL_GAME_ERROR_EXIST);
STR_CASE(CELL_GAME_ERROR_NOTPATCH);
STR_CASE(CELL_GAME_ERROR_INVALID_THEME_FILE);
STR_CASE(CELL_GAME_ERROR_BOOTPATH);
}
return nullptr;
}
CELL_GAMEDATA_ERROR_CBRESULT = 0x8002b601,
CELL_GAMEDATA_ERROR_ACCESS_ERROR = 0x8002b602,
CELL_GAMEDATA_ERROR_INTERNAL = 0x8002b603,
CELL_GAMEDATA_ERROR_PARAM = 0x8002b604,
CELL_GAMEDATA_ERROR_NOSPACE = 0x8002b605,
CELL_GAMEDATA_ERROR_BROKEN = 0x8002b606,
CELL_GAMEDATA_ERROR_FAILURE = 0x8002b607,
};
// Definitions
enum
@ -174,16 +159,6 @@ enum // old consts
CELL_GAMEDATA_RET_OK = 0,
CELL_GAMEDATA_RET_CANCEL = 1,
CELL_GAMEDATA_ERROR_CBRESULT = 0x8002b601,
CELL_GAMEDATA_ERROR_ACCESS_ERROR = 0x8002b602,
CELL_GAMEDATA_ERROR_INTERNAL = 0x8002b603,
CELL_GAMEDATA_ERROR_PARAM = 0x8002b604,
CELL_GAMEDATA_ERROR_NOSPACE = 0x8002b605,
CELL_GAMEDATA_ERROR_BROKEN = 0x8002b606,
CELL_GAMEDATA_ERROR_FAILURE = 0x8002b607,
CELL_GAMEDATA_ATTR_NORMAL = 0,
CELL_GAMEDATA_VERSION_CURRENT = 0,

View File

@ -3196,7 +3196,7 @@ s32 cellSpursEventFlagGetTasksetAddress(vm::ptr<CellSpursEventFlag> eventFlag, v
return CELL_OK;
}
static inline s32 SyncErrorToSpursError(const ppu_error_code& res)
static inline s32 SyncErrorToSpursError(const error_code& res)
{
return res.value < 0 ? 0x80410900 | (res.value & 0xff) : res.value;
}

View File

@ -12,6 +12,38 @@
logs::channel cellSync("cellSync", logs::level::notice);
template<>
void fmt_class_string<CellSyncError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto error)
{
switch (error)
{
STR_CASE(CELL_SYNC_ERROR_AGAIN);
STR_CASE(CELL_SYNC_ERROR_INVAL);
STR_CASE(CELL_SYNC_ERROR_NOSYS);
STR_CASE(CELL_SYNC_ERROR_NOMEM);
STR_CASE(CELL_SYNC_ERROR_SRCH);
STR_CASE(CELL_SYNC_ERROR_NOENT);
STR_CASE(CELL_SYNC_ERROR_NOEXEC);
STR_CASE(CELL_SYNC_ERROR_DEADLK);
STR_CASE(CELL_SYNC_ERROR_PERM);
STR_CASE(CELL_SYNC_ERROR_BUSY);
STR_CASE(CELL_SYNC_ERROR_ABORT);
STR_CASE(CELL_SYNC_ERROR_FAULT);
STR_CASE(CELL_SYNC_ERROR_CHILD);
STR_CASE(CELL_SYNC_ERROR_STAT);
STR_CASE(CELL_SYNC_ERROR_ALIGN);
STR_CASE(CELL_SYNC_ERROR_NULL_POINTER);
STR_CASE(CELL_SYNC_ERROR_NOT_SUPPORTED_THREAD);
STR_CASE(CELL_SYNC_ERROR_NO_NOTIFIER);
STR_CASE(CELL_SYNC_ERROR_NO_SPU_CONTEXT_STORAGE);
}
return unknown;
});
}
namespace _sync
{
static inline be_t<u16> mutex_acquire(mutex& ctrl)
@ -30,7 +62,7 @@ namespace _sync
}
}
ppu_error_code cellSyncMutexInitialize(vm::ptr<CellSyncMutex> mutex)
error_code cellSyncMutexInitialize(vm::ptr<CellSyncMutex> mutex)
{
cellSync.trace("cellSyncMutexInitialize(mutex=*0x%x)", mutex);
@ -49,7 +81,7 @@ ppu_error_code cellSyncMutexInitialize(vm::ptr<CellSyncMutex> mutex)
return CELL_OK;
}
ppu_error_code cellSyncMutexLock(vm::ptr<CellSyncMutex> mutex)
error_code cellSyncMutexLock(vm::ptr<CellSyncMutex> mutex)
{
cellSync.trace("cellSyncMutexLock(mutex=*0x%x)", mutex);
@ -74,7 +106,7 @@ ppu_error_code cellSyncMutexLock(vm::ptr<CellSyncMutex> mutex)
return CELL_OK;
}
ppu_error_code cellSyncMutexTryLock(vm::ptr<CellSyncMutex> mutex)
error_code cellSyncMutexTryLock(vm::ptr<CellSyncMutex> mutex)
{
cellSync.trace("cellSyncMutexTryLock(mutex=*0x%x)", mutex);
@ -96,7 +128,7 @@ ppu_error_code cellSyncMutexTryLock(vm::ptr<CellSyncMutex> mutex)
return CELL_OK;
}
ppu_error_code cellSyncMutexUnlock(vm::ptr<CellSyncMutex> mutex)
error_code cellSyncMutexUnlock(vm::ptr<CellSyncMutex> mutex)
{
cellSync.trace("cellSyncMutexUnlock(mutex=*0x%x)", mutex);
@ -117,7 +149,7 @@ ppu_error_code cellSyncMutexUnlock(vm::ptr<CellSyncMutex> mutex)
return CELL_OK;
}
ppu_error_code cellSyncBarrierInitialize(vm::ptr<CellSyncBarrier> barrier, u16 total_count)
error_code cellSyncBarrierInitialize(vm::ptr<CellSyncBarrier> barrier, u16 total_count)
{
cellSync.trace("cellSyncBarrierInitialize(barrier=*0x%x, total_count=%d)", barrier, total_count);
@ -142,7 +174,7 @@ ppu_error_code cellSyncBarrierInitialize(vm::ptr<CellSyncBarrier> barrier, u16 t
return CELL_OK;
}
ppu_error_code cellSyncBarrierNotify(vm::ptr<CellSyncBarrier> barrier)
error_code cellSyncBarrierNotify(vm::ptr<CellSyncBarrier> barrier)
{
cellSync.trace("cellSyncBarrierNotify(barrier=*0x%x)", barrier);
@ -163,7 +195,7 @@ ppu_error_code cellSyncBarrierNotify(vm::ptr<CellSyncBarrier> barrier)
return CELL_OK;
}
ppu_error_code cellSyncBarrierTryNotify(vm::ptr<CellSyncBarrier> barrier)
error_code cellSyncBarrierTryNotify(vm::ptr<CellSyncBarrier> barrier)
{
cellSync.trace("cellSyncBarrierTryNotify(barrier=*0x%x)", barrier);
@ -189,7 +221,7 @@ ppu_error_code cellSyncBarrierTryNotify(vm::ptr<CellSyncBarrier> barrier)
return CELL_OK;
}
ppu_error_code cellSyncBarrierWait(vm::ptr<CellSyncBarrier> barrier)
error_code cellSyncBarrierWait(vm::ptr<CellSyncBarrier> barrier)
{
cellSync.trace("cellSyncBarrierWait(barrier=*0x%x)", barrier);
@ -212,7 +244,7 @@ ppu_error_code cellSyncBarrierWait(vm::ptr<CellSyncBarrier> barrier)
return CELL_OK;
}
ppu_error_code cellSyncBarrierTryWait(vm::ptr<CellSyncBarrier> barrier)
error_code cellSyncBarrierTryWait(vm::ptr<CellSyncBarrier> barrier)
{
cellSync.trace("cellSyncBarrierTryWait(barrier=*0x%x)", barrier);
@ -238,7 +270,7 @@ ppu_error_code cellSyncBarrierTryWait(vm::ptr<CellSyncBarrier> barrier)
return CELL_OK;
}
ppu_error_code cellSyncRwmInitialize(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer, u32 buffer_size)
error_code cellSyncRwmInitialize(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer, u32 buffer_size)
{
cellSync.trace("cellSyncRwmInitialize(rwm=*0x%x, buffer=*0x%x, buffer_size=0x%x)", rwm, buffer, buffer_size);
@ -267,7 +299,7 @@ ppu_error_code cellSyncRwmInitialize(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buf
return CELL_OK;
}
ppu_error_code cellSyncRwmRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer)
error_code cellSyncRwmRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer)
{
cellSync.trace("cellSyncRwmRead(rwm=*0x%x, buffer=*0x%x)", rwm, buffer);
@ -298,7 +330,7 @@ ppu_error_code cellSyncRwmRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer)
return CELL_OK;
}
ppu_error_code cellSyncRwmTryRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer)
error_code cellSyncRwmTryRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer)
{
cellSync.trace("cellSyncRwmTryRead(rwm=*0x%x, buffer=*0x%x)", rwm, buffer);
@ -332,7 +364,7 @@ ppu_error_code cellSyncRwmTryRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer
return CELL_OK;
}
ppu_error_code cellSyncRwmWrite(vm::ptr<CellSyncRwm> rwm, vm::cptr<void> buffer)
error_code cellSyncRwmWrite(vm::ptr<CellSyncRwm> rwm, vm::cptr<void> buffer)
{
cellSync.trace("cellSyncRwmWrite(rwm=*0x%x, buffer=*0x%x)", rwm, buffer);
@ -363,7 +395,7 @@ ppu_error_code cellSyncRwmWrite(vm::ptr<CellSyncRwm> rwm, vm::cptr<void> buffer)
return CELL_OK;
}
ppu_error_code cellSyncRwmTryWrite(vm::ptr<CellSyncRwm> rwm, vm::cptr<void> buffer)
error_code cellSyncRwmTryWrite(vm::ptr<CellSyncRwm> rwm, vm::cptr<void> buffer)
{
cellSync.trace("cellSyncRwmTryWrite(rwm=*0x%x, buffer=*0x%x)", rwm, buffer);
@ -394,7 +426,7 @@ ppu_error_code cellSyncRwmTryWrite(vm::ptr<CellSyncRwm> rwm, vm::cptr<void> buff
return CELL_OK;
}
ppu_error_code cellSyncQueueInitialize(vm::ptr<CellSyncQueue> queue, vm::ptr<u8> buffer, u32 size, u32 depth)
error_code cellSyncQueueInitialize(vm::ptr<CellSyncQueue> queue, vm::ptr<u8> buffer, u32 size, u32 depth)
{
cellSync.trace("cellSyncQueueInitialize(queue=*0x%x, buffer=*0x%x, size=0x%x, depth=0x%x)", queue, buffer, size, depth);
@ -429,7 +461,7 @@ ppu_error_code cellSyncQueueInitialize(vm::ptr<CellSyncQueue> queue, vm::ptr<u8>
return CELL_OK;
}
ppu_error_code cellSyncQueuePush(vm::ptr<CellSyncQueue> queue, vm::cptr<void> buffer)
error_code cellSyncQueuePush(vm::ptr<CellSyncQueue> queue, vm::cptr<void> buffer)
{
cellSync.trace("cellSyncQueuePush(queue=*0x%x, buffer=*0x%x)", queue, buffer);
@ -460,7 +492,7 @@ ppu_error_code cellSyncQueuePush(vm::ptr<CellSyncQueue> queue, vm::cptr<void> bu
return CELL_OK;
}
ppu_error_code cellSyncQueueTryPush(vm::ptr<CellSyncQueue> queue, vm::cptr<void> buffer)
error_code cellSyncQueueTryPush(vm::ptr<CellSyncQueue> queue, vm::cptr<void> buffer)
{
cellSync.trace("cellSyncQueueTryPush(queue=*0x%x, buffer=*0x%x)", queue, buffer);
@ -494,7 +526,7 @@ ppu_error_code cellSyncQueueTryPush(vm::ptr<CellSyncQueue> queue, vm::cptr<void>
return CELL_OK;
}
ppu_error_code cellSyncQueuePop(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buffer)
error_code cellSyncQueuePop(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buffer)
{
cellSync.trace("cellSyncQueuePop(queue=*0x%x, buffer=*0x%x)", queue, buffer);
@ -525,7 +557,7 @@ ppu_error_code cellSyncQueuePop(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buff
return CELL_OK;
}
ppu_error_code cellSyncQueueTryPop(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buffer)
error_code cellSyncQueueTryPop(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buffer)
{
cellSync.trace("cellSyncQueueTryPop(queue=*0x%x, buffer=*0x%x)", queue, buffer);
@ -559,7 +591,7 @@ ppu_error_code cellSyncQueueTryPop(vm::ptr<CellSyncQueue> queue, vm::ptr<void> b
return CELL_OK;
}
ppu_error_code cellSyncQueuePeek(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buffer)
error_code cellSyncQueuePeek(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buffer)
{
cellSync.trace("cellSyncQueuePeek(queue=*0x%x, buffer=*0x%x)", queue, buffer);
@ -590,7 +622,7 @@ ppu_error_code cellSyncQueuePeek(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buf
return CELL_OK;
}
ppu_error_code cellSyncQueueTryPeek(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buffer)
error_code cellSyncQueueTryPeek(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buffer)
{
cellSync.trace("cellSyncQueueTryPeek(queue=*0x%x, buffer=*0x%x)", queue, buffer);
@ -624,7 +656,7 @@ ppu_error_code cellSyncQueueTryPeek(vm::ptr<CellSyncQueue> queue, vm::ptr<void>
return CELL_OK;
}
ppu_error_code cellSyncQueueSize(vm::ptr<CellSyncQueue> queue)
error_code cellSyncQueueSize(vm::ptr<CellSyncQueue> queue)
{
cellSync.trace("cellSyncQueueSize(queue=*0x%x)", queue);
@ -643,7 +675,7 @@ ppu_error_code cellSyncQueueSize(vm::ptr<CellSyncQueue> queue)
return not_an_error(queue->ctrl.load().count & 0xffffff);
}
ppu_error_code cellSyncQueueClear(vm::ptr<CellSyncQueue> queue)
error_code cellSyncQueueClear(vm::ptr<CellSyncQueue> queue)
{
cellSync.trace("cellSyncQueueClear(queue=*0x%x)", queue);
@ -711,7 +743,7 @@ void syncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cptr<void> buffer
queue->m_eq_id = 0;
}
ppu_error_code cellSyncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cptr<void> buffer, u32 size, u32 depth, u32 direction, vm::ptr<void> eaSignal)
error_code cellSyncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cptr<void> buffer, u32 size, u32 depth, u32 direction, vm::ptr<void> eaSignal)
{
cellSync.warning("cellSyncLFQueueInitialize(queue=*0x%x, buffer=*0x%x, size=0x%x, depth=0x%x, direction=%d, eaSignal=*0x%x)", queue, buffer, size, depth, direction, eaSignal);
@ -820,7 +852,7 @@ ppu_error_code cellSyncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cpt
return CELL_OK;
}
ppu_error_code _cellSyncLFQueueGetPushPointer(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<s32> pointer, u32 isBlocking, u32 useEventQueue)
error_code _cellSyncLFQueueGetPushPointer(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<s32> pointer, u32 isBlocking, u32 useEventQueue)
{
cellSync.warning("_cellSyncLFQueueGetPushPointer(queue=*0x%x, pointer=*0x%x, isBlocking=%d, useEventQueue=%d)", queue, pointer, isBlocking, useEventQueue);
@ -913,7 +945,7 @@ ppu_error_code _cellSyncLFQueueGetPushPointer(ppu_thread& ppu, vm::ptr<CellSyncL
}
}
ppu_error_code _cellSyncLFQueueGetPushPointer2(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<s32> pointer, u32 isBlocking, u32 useEventQueue)
error_code _cellSyncLFQueueGetPushPointer2(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<s32> pointer, u32 isBlocking, u32 useEventQueue)
{
// arguments copied from _cellSyncLFQueueGetPushPointer
cellSync.todo("_cellSyncLFQueueGetPushPointer2(queue=*0x%x, pointer=*0x%x, isBlocking=%d, useEventQueue=%d)", queue, pointer, isBlocking, useEventQueue);
@ -921,7 +953,7 @@ ppu_error_code _cellSyncLFQueueGetPushPointer2(ppu_thread& ppu, vm::ptr<CellSync
fmt::throw_exception("Unimplemented" HERE);
}
ppu_error_code _cellSyncLFQueueCompletePushPointer(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, s32 pointer, vm::ptr<s32(u32 addr, u32 arg)> fpSendSignal)
error_code _cellSyncLFQueueCompletePushPointer(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, s32 pointer, vm::ptr<s32(u32 addr, u32 arg)> fpSendSignal)
{
cellSync.warning("_cellSyncLFQueueCompletePushPointer(queue=*0x%x, pointer=%d, fpSendSignal=*0x%x)", queue, pointer, fpSendSignal);
@ -1053,7 +1085,7 @@ ppu_error_code _cellSyncLFQueueCompletePushPointer(ppu_thread& ppu, vm::ptr<Cell
}
}
ppu_error_code _cellSyncLFQueueCompletePushPointer2(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, s32 pointer, vm::ptr<s32(u32 addr, u32 arg)> fpSendSignal)
error_code _cellSyncLFQueueCompletePushPointer2(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, s32 pointer, vm::ptr<s32(u32 addr, u32 arg)> fpSendSignal)
{
// arguments copied from _cellSyncLFQueueCompletePushPointer
cellSync.todo("_cellSyncLFQueueCompletePushPointer2(queue=*0x%x, pointer=%d, fpSendSignal=*0x%x)", queue, pointer, fpSendSignal);
@ -1061,7 +1093,7 @@ ppu_error_code _cellSyncLFQueueCompletePushPointer2(ppu_thread& ppu, vm::ptr<Cel
fmt::throw_exception("Unimplemented" HERE);
}
ppu_error_code _cellSyncLFQueuePushBody(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::cptr<void> buffer, u32 isBlocking)
error_code _cellSyncLFQueuePushBody(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::cptr<void> buffer, u32 isBlocking)
{
// cellSyncLFQueuePush has 1 in isBlocking param, cellSyncLFQueueTryPush has 0
cellSync.warning("_cellSyncLFQueuePushBody(queue=*0x%x, buffer=*0x%x, isBlocking=%d)", queue, buffer, isBlocking);
@ -1119,7 +1151,7 @@ ppu_error_code _cellSyncLFQueuePushBody(ppu_thread& ppu, vm::ptr<CellSyncLFQueue
}
}
ppu_error_code _cellSyncLFQueueGetPopPointer(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<s32> pointer, u32 isBlocking, u32 arg4, u32 useEventQueue)
error_code _cellSyncLFQueueGetPopPointer(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<s32> pointer, u32 isBlocking, u32 arg4, u32 useEventQueue)
{
cellSync.warning("_cellSyncLFQueueGetPopPointer(queue=*0x%x, pointer=*0x%x, isBlocking=%d, arg4=%d, useEventQueue=%d)", queue, pointer, isBlocking, arg4, useEventQueue);
@ -1212,7 +1244,7 @@ ppu_error_code _cellSyncLFQueueGetPopPointer(ppu_thread& ppu, vm::ptr<CellSyncLF
}
}
ppu_error_code _cellSyncLFQueueGetPopPointer2(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<s32> pointer, u32 isBlocking, u32 useEventQueue)
error_code _cellSyncLFQueueGetPopPointer2(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<s32> pointer, u32 isBlocking, u32 useEventQueue)
{
// arguments copied from _cellSyncLFQueueGetPopPointer
cellSync.todo("_cellSyncLFQueueGetPopPointer2(queue=*0x%x, pointer=*0x%x, isBlocking=%d, useEventQueue=%d)", queue, pointer, isBlocking, useEventQueue);
@ -1220,7 +1252,7 @@ ppu_error_code _cellSyncLFQueueGetPopPointer2(ppu_thread& ppu, vm::ptr<CellSyncL
fmt::throw_exception("Unimplemented" HERE);
}
ppu_error_code _cellSyncLFQueueCompletePopPointer(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, s32 pointer, vm::ptr<s32(u32 addr, u32 arg)> fpSendSignal, u32 noQueueFull)
error_code _cellSyncLFQueueCompletePopPointer(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, s32 pointer, vm::ptr<s32(u32 addr, u32 arg)> fpSendSignal, u32 noQueueFull)
{
// arguments copied from _cellSyncLFQueueCompletePushPointer + unknown argument (noQueueFull taken from LFQueue2CompletePopPointer)
cellSync.warning("_cellSyncLFQueueCompletePopPointer(queue=*0x%x, pointer=%d, fpSendSignal=*0x%x, noQueueFull=%d)", queue, pointer, fpSendSignal, noQueueFull);
@ -1352,7 +1384,7 @@ ppu_error_code _cellSyncLFQueueCompletePopPointer(ppu_thread& ppu, vm::ptr<CellS
}
}
ppu_error_code _cellSyncLFQueueCompletePopPointer2(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, s32 pointer, vm::ptr<s32(u32 addr, u32 arg)> fpSendSignal, u32 noQueueFull)
error_code _cellSyncLFQueueCompletePopPointer2(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, s32 pointer, vm::ptr<s32(u32 addr, u32 arg)> fpSendSignal, u32 noQueueFull)
{
// arguments copied from _cellSyncLFQueueCompletePopPointer
cellSync.todo("_cellSyncLFQueueCompletePopPointer2(queue=*0x%x, pointer=%d, fpSendSignal=*0x%x, noQueueFull=%d)", queue, pointer, fpSendSignal, noQueueFull);
@ -1360,7 +1392,7 @@ ppu_error_code _cellSyncLFQueueCompletePopPointer2(ppu_thread& ppu, vm::ptr<Cell
fmt::throw_exception("Unimplemented" HERE);
}
ppu_error_code _cellSyncLFQueuePopBody(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<void> buffer, u32 isBlocking)
error_code _cellSyncLFQueuePopBody(ppu_thread& ppu, vm::ptr<CellSyncLFQueue> queue, vm::ptr<void> buffer, u32 isBlocking)
{
// cellSyncLFQueuePop has 1 in isBlocking param, cellSyncLFQueueTryPop has 0
cellSync.warning("_cellSyncLFQueuePopBody(queue=*0x%x, buffer=*0x%x, isBlocking=%d)", queue, buffer, isBlocking);
@ -1418,7 +1450,7 @@ ppu_error_code _cellSyncLFQueuePopBody(ppu_thread& ppu, vm::ptr<CellSyncLFQueue>
}
}
ppu_error_code cellSyncLFQueueClear(vm::ptr<CellSyncLFQueue> queue)
error_code cellSyncLFQueueClear(vm::ptr<CellSyncLFQueue> queue)
{
cellSync.warning("cellSyncLFQueueClear(queue=*0x%x)", queue);
@ -1469,7 +1501,7 @@ ppu_error_code cellSyncLFQueueClear(vm::ptr<CellSyncLFQueue> queue)
return CELL_OK;
}
ppu_error_code cellSyncLFQueueSize(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u32> size)
error_code cellSyncLFQueueSize(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u32> size)
{
cellSync.warning("cellSyncLFQueueSize(queue=*0x%x, size=*0x%x)", queue, size);
@ -1506,7 +1538,7 @@ ppu_error_code cellSyncLFQueueSize(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u32>
}
}
ppu_error_code cellSyncLFQueueDepth(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u32> depth)
error_code cellSyncLFQueueDepth(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u32> depth)
{
cellSync.trace("cellSyncLFQueueDepth(queue=*0x%x, depth=*0x%x)", queue, depth);
@ -1525,7 +1557,7 @@ ppu_error_code cellSyncLFQueueDepth(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u32>
return CELL_OK;
}
ppu_error_code _cellSyncLFQueueGetSignalAddress(vm::cptr<CellSyncLFQueue> queue, vm::pptr<void> ppSignal)
error_code _cellSyncLFQueueGetSignalAddress(vm::cptr<CellSyncLFQueue> queue, vm::pptr<void> ppSignal)
{
cellSync.trace("_cellSyncLFQueueGetSignalAddress(queue=*0x%x, ppSignal=**0x%x)", queue, ppSignal);
@ -1544,7 +1576,7 @@ ppu_error_code _cellSyncLFQueueGetSignalAddress(vm::cptr<CellSyncLFQueue> queue,
return CELL_OK;
}
ppu_error_code cellSyncLFQueueGetDirection(vm::cptr<CellSyncLFQueue> queue, vm::ptr<u32> direction)
error_code cellSyncLFQueueGetDirection(vm::cptr<CellSyncLFQueue> queue, vm::ptr<u32> direction)
{
cellSync.trace("cellSyncLFQueueGetDirection(queue=*0x%x, direction=*0x%x)", queue, direction);
@ -1563,7 +1595,7 @@ ppu_error_code cellSyncLFQueueGetDirection(vm::cptr<CellSyncLFQueue> queue, vm::
return CELL_OK;
}
ppu_error_code cellSyncLFQueueGetEntrySize(vm::cptr<CellSyncLFQueue> queue, vm::ptr<u32> entry_size)
error_code cellSyncLFQueueGetEntrySize(vm::cptr<CellSyncLFQueue> queue, vm::ptr<u32> entry_size)
{
cellSync.trace("cellSyncLFQueueGetEntrySize(queue=*0x%x, entry_size=*0x%x)", queue, entry_size);
@ -1582,14 +1614,14 @@ ppu_error_code cellSyncLFQueueGetEntrySize(vm::cptr<CellSyncLFQueue> queue, vm::
return CELL_OK;
}
ppu_error_code _cellSyncLFQueueAttachLv2EventQueue(vm::ptr<u32> spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
error_code _cellSyncLFQueueAttachLv2EventQueue(vm::ptr<u32> spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
{
cellSync.todo("_cellSyncLFQueueAttachLv2EventQueue(spus=*0x%x, num=%d, queue=*0x%x)", spus, num, queue);
fmt::throw_exception("Unimplemented" HERE);
}
ppu_error_code _cellSyncLFQueueDetachLv2EventQueue(vm::ptr<u32> spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
error_code _cellSyncLFQueueDetachLv2EventQueue(vm::ptr<u32> spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
{
cellSync.todo("_cellSyncLFQueueDetachLv2EventQueue(spus=*0x%x, num=%d, queue=*0x%x)", spus, num, queue);

View File

@ -34,47 +34,6 @@ enum CellSyncError1 : u32
CELL_SYNC_ERROR_UNKNOWNKEY = 0x80410113,
};
template<>
inline const char* ppu_error_code::print(CellSyncError error)
{
switch (error)
{
STR_CASE(CELL_SYNC_ERROR_AGAIN);
STR_CASE(CELL_SYNC_ERROR_INVAL);
STR_CASE(CELL_SYNC_ERROR_NOSYS);
STR_CASE(CELL_SYNC_ERROR_NOMEM);
STR_CASE(CELL_SYNC_ERROR_SRCH);
STR_CASE(CELL_SYNC_ERROR_NOENT);
STR_CASE(CELL_SYNC_ERROR_NOEXEC);
STR_CASE(CELL_SYNC_ERROR_DEADLK);
STR_CASE(CELL_SYNC_ERROR_PERM);
STR_CASE(CELL_SYNC_ERROR_BUSY);
STR_CASE(CELL_SYNC_ERROR_ABORT);
STR_CASE(CELL_SYNC_ERROR_FAULT);
STR_CASE(CELL_SYNC_ERROR_CHILD);
STR_CASE(CELL_SYNC_ERROR_STAT);
STR_CASE(CELL_SYNC_ERROR_ALIGN);
STR_CASE(CELL_SYNC_ERROR_NULL_POINTER);
STR_CASE(CELL_SYNC_ERROR_NOT_SUPPORTED_THREAD);
STR_CASE(CELL_SYNC_ERROR_NO_NOTIFIER);
STR_CASE(CELL_SYNC_ERROR_NO_SPU_CONTEXT_STORAGE);
}
return nullptr;
}
template<>
inline const char* ppu_error_code::print(CellSyncError1 error)
{
switch (error)
{
STR_CASE(CELL_SYNC_ERROR_SHOTAGE);
STR_CASE(CELL_SYNC_ERROR_UNKNOWNKEY);
}
return nullptr;
}
namespace _sync
{
struct alignas(4) mutex // CellSyncMutex control variable
@ -381,4 +340,4 @@ struct alignas(128) CellSyncLFQueue
CHECK_SIZE_ALIGN(CellSyncLFQueue, 128, 128);
// Prototypes
ppu_error_code cellSyncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cptr<void> buffer, u32 size, u32 depth, u32 direction, vm::ptr<void> eaSignal);
error_code cellSyncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cptr<void> buffer, u32 size, u32 depth, u32 direction, vm::ptr<void> eaSignal);

View File

@ -8,6 +8,23 @@
logs::channel cellUserInfo("cellUserInfo", logs::level::notice);
template<>
void fmt_class_string<CellUserInfoError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto error)
{
switch (error)
{
STR_CASE(CELL_USERINFO_ERROR_BUSY);
STR_CASE(CELL_USERINFO_ERROR_INTERNAL);
STR_CASE(CELL_USERINFO_ERROR_PARAM);
STR_CASE(CELL_USERINFO_ERROR_NOUSER);
}
return unknown;
});
}
s32 cellUserInfoGetStat(u32 id, vm::ptr<CellUserInfoUserStat> stat)
{
cellUserInfo.warning("cellUserInfoGetStat(id=%d, stat=*0x%x)", id, stat);
@ -63,7 +80,7 @@ s32 cellUserInfoEnableOverlay()
return CELL_OK;
}
ppu_error_code cellUserInfoGetList(vm::ptr<u32> listNum, vm::ptr<CellUserInfoUserList> listBuf, vm::ptr<u32> currentUserId)
error_code cellUserInfoGetList(vm::ptr<u32> listNum, vm::ptr<CellUserInfoUserList> listBuf, vm::ptr<u32> currentUserId)
{
cellUserInfo.todo("cellUserInfoGetList(listNum=*0x%x, listBuf=*0x%x, currentUserId=*0x%x)", listNum, listBuf, currentUserId);

View File

@ -3,30 +3,21 @@
namespace vm { using namespace ps3; }
// Return Codes
enum CellUserInfoError : u32
enum
{
CELL_USERINFO_RET_OK = 0,
CELL_USERINFO_RET_CANCEL = 1,
};
// Error Codes
enum CellUserInfoError : u32
{
CELL_USERINFO_ERROR_BUSY = 0x8002c301,
CELL_USERINFO_ERROR_INTERNAL = 0x8002c302,
CELL_USERINFO_ERROR_PARAM = 0x8002c303,
CELL_USERINFO_ERROR_NOUSER = 0x8002c304,
};
template<>
inline const char* ppu_error_code::print(CellUserInfoError error)
{
switch (error)
{
STR_CASE(CELL_USERINFO_ERROR_BUSY);
STR_CASE(CELL_USERINFO_ERROR_INTERNAL);
STR_CASE(CELL_USERINFO_ERROR_PARAM);
STR_CASE(CELL_USERINFO_ERROR_NOUSER);
}
return nullptr;
}
// Enums
enum CellUserInfoParamSize
{

View File

@ -37,7 +37,29 @@ const extern std::unordered_map<u8, std::pair<int, int>> g_video_out_resolution_
{ CELL_VIDEO_OUT_RESOLUTION_960x1080, { 960, 1080 } },
};
ppu_error_code cellVideoOutGetState(u32 videoOut, u32 deviceIndex, vm::ptr<CellVideoOutState> state)
template<>
void fmt_class_string<CellVideoOutError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto error)
{
switch (error)
{
STR_CASE(CELL_VIDEO_OUT_ERROR_NOT_IMPLEMENTED);
STR_CASE(CELL_VIDEO_OUT_ERROR_ILLEGAL_CONFIGURATION);
STR_CASE(CELL_VIDEO_OUT_ERROR_ILLEGAL_PARAMETER);
STR_CASE(CELL_VIDEO_OUT_ERROR_PARAMETER_OUT_OF_RANGE);
STR_CASE(CELL_VIDEO_OUT_ERROR_DEVICE_NOT_FOUND);
STR_CASE(CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT);
STR_CASE(CELL_VIDEO_OUT_ERROR_UNSUPPORTED_DISPLAY_MODE);
STR_CASE(CELL_VIDEO_OUT_ERROR_CONDITION_BUSY);
STR_CASE(CELL_VIDEO_OUT_ERROR_VALUE_IS_NOT_SET);
}
return unknown;
});
}
error_code cellVideoOutGetState(u32 videoOut, u32 deviceIndex, vm::ptr<CellVideoOutState> state)
{
cellSysutil.trace("cellVideoOutGetState(videoOut=%d, deviceIndex=%d, state=*0x%x)", videoOut, deviceIndex, state);
@ -63,7 +85,7 @@ ppu_error_code cellVideoOutGetState(u32 videoOut, u32 deviceIndex, vm::ptr<CellV
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
ppu_error_code cellVideoOutGetResolution(u32 resolutionId, vm::ptr<CellVideoOutResolution> resolution)
error_code cellVideoOutGetResolution(u32 resolutionId, vm::ptr<CellVideoOutResolution> resolution)
{
cellSysutil.trace("cellVideoOutGetResolution(resolutionId=0x%x, resolution=*0x%x)", resolutionId, resolution);
@ -104,7 +126,7 @@ ppu_error_code cellVideoOutGetResolution(u32 resolutionId, vm::ptr<CellVideoOutR
return CELL_OK;
}
ppu_error_code cellVideoOutConfigure(u32 videoOut, vm::ptr<CellVideoOutConfiguration> config, vm::ptr<CellVideoOutOption> option, u32 waitForEvent)
error_code cellVideoOutConfigure(u32 videoOut, vm::ptr<CellVideoOutConfiguration> config, vm::ptr<CellVideoOutOption> option, u32 waitForEvent)
{
cellSysutil.warning("cellVideoOutConfigure(videoOut=%d, config=*0x%x, option=*0x%x, waitForEvent=%d)", videoOut, config, option, waitForEvent);
@ -121,7 +143,7 @@ ppu_error_code cellVideoOutConfigure(u32 videoOut, vm::ptr<CellVideoOutConfigura
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
ppu_error_code cellVideoOutGetConfiguration(u32 videoOut, vm::ptr<CellVideoOutConfiguration> config, vm::ptr<CellVideoOutOption> option)
error_code cellVideoOutGetConfiguration(u32 videoOut, vm::ptr<CellVideoOutConfiguration> config, vm::ptr<CellVideoOutOption> option)
{
cellSysutil.warning("cellVideoOutGetConfiguration(videoOut=%d, config=*0x%x, option=*0x%x)", videoOut, config, option);
@ -146,7 +168,7 @@ ppu_error_code cellVideoOutGetConfiguration(u32 videoOut, vm::ptr<CellVideoOutCo
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
ppu_error_code cellVideoOutGetDeviceInfo(u32 videoOut, u32 deviceIndex, vm::ptr<CellVideoOutDeviceInfo> info)
error_code cellVideoOutGetDeviceInfo(u32 videoOut, u32 deviceIndex, vm::ptr<CellVideoOutDeviceInfo> info)
{
cellSysutil.warning("cellVideoOutGetDeviceInfo(videoOut=%d, deviceIndex=%d, info=*0x%x)", videoOut, deviceIndex, info);
@ -177,7 +199,7 @@ ppu_error_code cellVideoOutGetDeviceInfo(u32 videoOut, u32 deviceIndex, vm::ptr<
return CELL_OK;
}
ppu_error_code cellVideoOutGetNumberOfDevice(u32 videoOut)
error_code cellVideoOutGetNumberOfDevice(u32 videoOut)
{
cellSysutil.warning("cellVideoOutGetNumberOfDevice(videoOut=%d)", videoOut);
@ -190,7 +212,7 @@ ppu_error_code cellVideoOutGetNumberOfDevice(u32 videoOut)
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
ppu_error_code cellVideoOutGetResolutionAvailability(u32 videoOut, u32 resolutionId, u32 aspect, u32 option)
error_code cellVideoOutGetResolutionAvailability(u32 videoOut, u32 resolutionId, u32 aspect, u32 option)
{
cellSysutil.warning("cellVideoOutGetResolutionAvailability(videoOut=%d, resolutionId=0x%x, aspect=%d, option=%d)", videoOut, resolutionId, aspect, option);

View File

@ -18,25 +18,6 @@ enum CellVideoOutError : u32
CELL_VIDEO_OUT_ERROR_VALUE_IS_NOT_SET = 0x8002b228,
};
template<>
inline const char* ppu_error_code::print(CellVideoOutError error)
{
switch (error)
{
STR_CASE(CELL_VIDEO_OUT_ERROR_NOT_IMPLEMENTED);
STR_CASE(CELL_VIDEO_OUT_ERROR_ILLEGAL_CONFIGURATION);
STR_CASE(CELL_VIDEO_OUT_ERROR_ILLEGAL_PARAMETER);
STR_CASE(CELL_VIDEO_OUT_ERROR_PARAMETER_OUT_OF_RANGE);
STR_CASE(CELL_VIDEO_OUT_ERROR_DEVICE_NOT_FOUND);
STR_CASE(CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT);
STR_CASE(CELL_VIDEO_OUT_ERROR_UNSUPPORTED_DISPLAY_MODE);
STR_CASE(CELL_VIDEO_OUT_ERROR_CONDITION_BUSY);
STR_CASE(CELL_VIDEO_OUT_ERROR_VALUE_IS_NOT_SET);
}
return nullptr;
}
enum CellVideoOut : s32
{
CELL_VIDEO_OUT_PRIMARY = 0,

View File

@ -199,7 +199,7 @@ namespace sys_net
if (name && result != SYS_NET_EWOULDBLOCK)
{
ppu_error_code::report(result, name);
libnet.error("Socket error %s", name);
}
return result;

View File

@ -2355,29 +2355,6 @@ extern std::string ppu_get_variable_name(const std::string& module, u32 vnid)
return fmt::format("0x%08X", vnid);
}
s32 ppu_error_code::report(s32 error, const char* text)
{
if (auto thread = get_current_cpu_thread())
{
if (thread->id >= ppu_thread::id_min)
{
if (auto func = static_cast<ppu_thread*>(thread)->last_function)
{
LOG_ERROR(PPU, "'%s' failed with 0x%08x : %s", func, error, text);
}
else
{
LOG_ERROR(PPU, "Unknown function failed with 0x%08x : %s", error, text);
}
return error;
}
}
LOG_ERROR(PPU, "Illegal call to ppu_error_code::report(0x%x, '%s')!");
return error;
}
std::vector<ppu_function_t>& ppu_function_manager::access()
{
static std::vector<ppu_function_t> list

View File

@ -192,6 +192,20 @@ struct ppu_gpr_cast_impl<b8, void>
}
};
template<>
struct ppu_gpr_cast_impl<error_code, void>
{
static inline u64 to(const error_code& code)
{
return code;
}
static inline error_code from(const u64 reg)
{
return not_an_error(reg);
}
};
template<typename T, typename AT>
struct ppu_gpr_cast_impl<vm::_ptr_base<T, AT>, void>
{

View File

@ -908,6 +908,77 @@ std::array<ppu_function_t, 1024> g_ppu_syscall_table
null_func, null_func, null_func, null_func, //1023 UNS
};
template<>
void fmt_class_string<CellError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto error)
{
switch (error)
{
STR_CASE(CELL_EAGAIN);
STR_CASE(CELL_EINVAL);
STR_CASE(CELL_ENOSYS);
STR_CASE(CELL_ENOMEM);
STR_CASE(CELL_ESRCH);
STR_CASE(CELL_ENOENT);
STR_CASE(CELL_ENOEXEC);
STR_CASE(CELL_EDEADLK);
STR_CASE(CELL_EPERM);
STR_CASE(CELL_EBUSY);
STR_CASE(CELL_ETIMEDOUT);
STR_CASE(CELL_EABORT);
STR_CASE(CELL_EFAULT);
STR_CASE(CELL_ESTAT);
STR_CASE(CELL_EALIGN);
STR_CASE(CELL_EKRESOURCE);
STR_CASE(CELL_EISDIR);
STR_CASE(CELL_ECANCELED);
STR_CASE(CELL_EEXIST);
STR_CASE(CELL_EISCONN);
STR_CASE(CELL_ENOTCONN);
STR_CASE(CELL_EAUTHFAIL);
STR_CASE(CELL_ENOTMSELF);
STR_CASE(CELL_ESYSVER);
STR_CASE(CELL_EAUTHFATAL);
STR_CASE(CELL_EDOM);
STR_CASE(CELL_ERANGE);
STR_CASE(CELL_EILSEQ);
STR_CASE(CELL_EFPOS);
STR_CASE(CELL_EINTR);
STR_CASE(CELL_EFBIG);
STR_CASE(CELL_EMLINK);
STR_CASE(CELL_ENFILE);
STR_CASE(CELL_ENOSPC);
STR_CASE(CELL_ENOTTY);
STR_CASE(CELL_EPIPE);
STR_CASE(CELL_EROFS);
STR_CASE(CELL_ESPIPE);
STR_CASE(CELL_E2BIG);
STR_CASE(CELL_EACCES);
STR_CASE(CELL_EBADF);
STR_CASE(CELL_EIO);
STR_CASE(CELL_EMFILE);
STR_CASE(CELL_ENODEV);
STR_CASE(CELL_ENOTDIR);
STR_CASE(CELL_ENXIO);
STR_CASE(CELL_EXDEV);
STR_CASE(CELL_EBADMSG);
STR_CASE(CELL_EINPROGRESS);
STR_CASE(CELL_EMSGSIZE);
STR_CASE(CELL_ENAMETOOLONG);
STR_CASE(CELL_ENOLCK);
STR_CASE(CELL_ENOTEMPTY);
STR_CASE(CELL_ENOTSUP);
STR_CASE(CELL_EFSSPECIFIC);
STR_CASE(CELL_EOVERFLOW);
STR_CASE(CELL_ENOTMOUNTED);
STR_CASE(CELL_ENOTSDATA);
}
return unknown;
});
}
extern void ppu_execute_syscall(ppu_thread& ppu, u64 code)
{
if (code < g_ppu_syscall_table.size())

View File

@ -45,14 +45,14 @@ u64 lv2_file::op_write(vm::ps3::cptr<void> buf, u64 size)
return file.write(local_buf.get(), size);
}
ppu_error_code sys_fs_test(u32 arg1, u32 arg2, vm::ptr<u32> arg3, u32 arg4, vm::ptr<char> arg5, u32 arg6)
error_code sys_fs_test(u32 arg1, u32 arg2, vm::ptr<u32> arg3, u32 arg4, vm::ptr<char> arg5, u32 arg6)
{
sys_fs.todo("sys_fs_test(arg1=0x%x, arg2=0x%x, arg3=*0x%x, arg4=0x%x, arg5=*0x%x, arg6=0x%x) -> CELL_OK", arg1, arg2, arg3, arg4, arg5, arg6);
return CELL_OK;
}
ppu_error_code sys_fs_open(vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, s32 mode, vm::cptr<void> arg, u64 size)
error_code sys_fs_open(vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, s32 mode, vm::cptr<void> arg, u64 size)
{
sys_fs.warning("sys_fs_open(path=%s, flags=%#o, fd=*0x%x, mode=%#o, arg=*0x%x, size=0x%llx)", path, flags, fd, mode, arg, size);
@ -156,7 +156,7 @@ ppu_error_code sys_fs_open(vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, s32
return CELL_OK;
}
ppu_error_code sys_fs_read(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread)
error_code sys_fs_read(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread)
{
sys_fs.trace("sys_fs_read(fd=%d, buf=*0x%x, nbytes=0x%llx, nread=*0x%x)", fd, buf, nbytes, nread);
@ -179,7 +179,7 @@ ppu_error_code sys_fs_read(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> n
return CELL_OK;
}
ppu_error_code sys_fs_write(u32 fd, vm::cptr<void> buf, u64 nbytes, vm::ptr<u64> nwrite)
error_code sys_fs_write(u32 fd, vm::cptr<void> buf, u64 nbytes, vm::ptr<u64> nwrite)
{
sys_fs.trace("sys_fs_write(fd=%d, buf=*0x%x, nbytes=0x%llx, nwrite=*0x%x)", fd, buf, nbytes, nwrite);
@ -199,7 +199,7 @@ ppu_error_code sys_fs_write(u32 fd, vm::cptr<void> buf, u64 nbytes, vm::ptr<u64>
return CELL_OK;
}
ppu_error_code sys_fs_close(u32 fd)
error_code sys_fs_close(u32 fd)
{
sys_fs.trace("sys_fs_close(fd=%d)", fd);
@ -217,7 +217,7 @@ ppu_error_code sys_fs_close(u32 fd)
return CELL_OK;
}
ppu_error_code sys_fs_opendir(vm::cptr<char> path, vm::ptr<u32> fd)
error_code sys_fs_opendir(vm::cptr<char> path, vm::ptr<u32> fd)
{
sys_fs.warning("sys_fs_opendir(path=%s, fd=*0x%x)", path, fd);
@ -258,7 +258,7 @@ ppu_error_code sys_fs_opendir(vm::cptr<char> path, vm::ptr<u32> fd)
return CELL_OK;
}
ppu_error_code sys_fs_readdir(u32 fd, vm::ptr<CellFsDirent> dir, vm::ptr<u64> nread)
error_code sys_fs_readdir(u32 fd, vm::ptr<CellFsDirent> dir, vm::ptr<u64> nread)
{
sys_fs.warning("sys_fs_readdir(fd=%d, dir=*0x%x, nread=*0x%x)", fd, dir, nread);
@ -286,7 +286,7 @@ ppu_error_code sys_fs_readdir(u32 fd, vm::ptr<CellFsDirent> dir, vm::ptr<u64> nr
return CELL_OK;
}
ppu_error_code sys_fs_closedir(u32 fd)
error_code sys_fs_closedir(u32 fd)
{
sys_fs.trace("sys_fs_closedir(fd=%d)", fd);
@ -302,7 +302,7 @@ ppu_error_code sys_fs_closedir(u32 fd)
return CELL_OK;
}
ppu_error_code sys_fs_stat(vm::cptr<char> path, vm::ptr<CellFsStat> sb)
error_code sys_fs_stat(vm::cptr<char> path, vm::ptr<CellFsStat> sb)
{
sys_fs.warning("sys_fs_stat(path=%s, sb=*0x%x)", path, sb);
@ -334,7 +334,7 @@ ppu_error_code sys_fs_stat(vm::cptr<char> path, vm::ptr<CellFsStat> sb)
return CELL_OK;
}
ppu_error_code sys_fs_fstat(u32 fd, vm::ptr<CellFsStat> sb)
error_code sys_fs_fstat(u32 fd, vm::ptr<CellFsStat> sb)
{
sys_fs.warning("sys_fs_fstat(fd=%d, sb=*0x%x)", fd, sb);
@ -361,7 +361,7 @@ ppu_error_code sys_fs_fstat(u32 fd, vm::ptr<CellFsStat> sb)
return CELL_OK;
}
ppu_error_code sys_fs_mkdir(vm::cptr<char> path, s32 mode)
error_code sys_fs_mkdir(vm::cptr<char> path, s32 mode)
{
sys_fs.warning("sys_fs_mkdir(path=%s, mode=%#o)", path, mode);
@ -381,7 +381,7 @@ ppu_error_code sys_fs_mkdir(vm::cptr<char> path, s32 mode)
return CELL_OK;
}
ppu_error_code sys_fs_rename(vm::cptr<char> from, vm::cptr<char> to)
error_code sys_fs_rename(vm::cptr<char> from, vm::cptr<char> to)
{
sys_fs.warning("sys_fs_rename(from=%s, to=%s)", from, to);
@ -394,7 +394,7 @@ ppu_error_code sys_fs_rename(vm::cptr<char> from, vm::cptr<char> to)
return CELL_OK;
}
ppu_error_code sys_fs_rmdir(vm::cptr<char> path)
error_code sys_fs_rmdir(vm::cptr<char> path)
{
sys_fs.warning("sys_fs_rmdir(path=%s)", path);
@ -413,7 +413,7 @@ ppu_error_code sys_fs_rmdir(vm::cptr<char> path)
return CELL_OK;
}
ppu_error_code sys_fs_unlink(vm::cptr<char> path)
error_code sys_fs_unlink(vm::cptr<char> path)
{
sys_fs.warning("sys_fs_unlink(path=%s)", path);
@ -432,7 +432,7 @@ ppu_error_code sys_fs_unlink(vm::cptr<char> path)
return CELL_OK;
}
ppu_error_code sys_fs_fcntl(u32 fd, u32 op, vm::ptr<void> _arg, u32 _size)
error_code sys_fs_fcntl(u32 fd, u32 op, vm::ptr<void> _arg, u32 _size)
{
sys_fs.trace("sys_fs_fcntl(fd=%d, op=0x%x, arg=*0x%x, size=0x%x)", fd, op, _arg, _size);
@ -489,7 +489,7 @@ ppu_error_code sys_fs_fcntl(u32 fd, u32 op, vm::ptr<void> _arg, u32 _size)
return CELL_OK;
}
ppu_error_code sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ptr<u64> pos)
error_code sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ptr<u64> pos)
{
sys_fs.trace("sys_fs_lseek(fd=%d, offset=0x%llx, whence=0x%x, pos=*0x%x)", fd, offset, whence, pos);
@ -513,7 +513,7 @@ ppu_error_code sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ptr<u64> pos)
return CELL_OK;
}
ppu_error_code sys_fs_fget_block_size(u32 fd, vm::ptr<u64> sector_size, vm::ptr<u64> block_size, vm::ptr<u64> arg4, vm::ptr<u64> arg5)
error_code sys_fs_fget_block_size(u32 fd, vm::ptr<u64> sector_size, vm::ptr<u64> block_size, vm::ptr<u64> arg4, vm::ptr<u64> arg5)
{
sys_fs.todo("sys_fs_fget_block_size(fd=%d, sector_size=*0x%x, block_size=*0x%x, arg4=*0x%x, arg5=*0x%x)", fd, sector_size, block_size, arg4, arg5);
@ -530,7 +530,7 @@ ppu_error_code sys_fs_fget_block_size(u32 fd, vm::ptr<u64> sector_size, vm::ptr<
return CELL_OK;
}
ppu_error_code sys_fs_get_block_size(vm::cptr<char> path, vm::ptr<u64> sector_size, vm::ptr<u64> block_size, vm::ptr<u64> arg4)
error_code sys_fs_get_block_size(vm::cptr<char> path, vm::ptr<u64> sector_size, vm::ptr<u64> block_size, vm::ptr<u64> arg4)
{
sys_fs.todo("sys_fs_get_block_size(path=%s, sector_size=*0x%x, block_size=*0x%x, arg4=*0x%x, arg5=*0x%x)", path, sector_size, block_size, arg4);
@ -540,7 +540,7 @@ ppu_error_code sys_fs_get_block_size(vm::cptr<char> path, vm::ptr<u64> sector_si
return CELL_OK;
}
ppu_error_code sys_fs_truncate(vm::cptr<char> path, u64 size)
error_code sys_fs_truncate(vm::cptr<char> path, u64 size)
{
sys_fs.warning("sys_fs_truncate(path=%s, size=0x%llx)", path, size);
@ -558,7 +558,7 @@ ppu_error_code sys_fs_truncate(vm::cptr<char> path, u64 size)
return CELL_OK;
}
ppu_error_code sys_fs_ftruncate(u32 fd, u64 size)
error_code sys_fs_ftruncate(u32 fd, u64 size)
{
sys_fs.warning("sys_fs_ftruncate(fd=%d, size=0x%llx)", fd, size);
@ -585,7 +585,7 @@ ppu_error_code sys_fs_ftruncate(u32 fd, u64 size)
return CELL_OK;
}
ppu_error_code sys_fs_chmod(vm::cptr<char> path, s32 mode)
error_code sys_fs_chmod(vm::cptr<char> path, s32 mode)
{
sys_fs.todo("sys_fs_chmod(path=%s, mode=%#o) -> CELL_OK", path, mode);

View File

@ -185,24 +185,24 @@ struct lv2_file_op_rw : lv2_file_op
CHECK_SIZE(lv2_file_op_rw, 0x38);
// SysCalls
ppu_error_code sys_fs_test(u32 arg1, u32 arg2, vm::ps3::ptr<u32> arg3, u32 arg4, vm::ps3::ptr<char> arg5, u32 arg6);
ppu_error_code sys_fs_open(vm::ps3::cptr<char> path, s32 flags, vm::ps3::ptr<u32> fd, s32 mode, vm::ps3::cptr<void> arg, u64 size);
ppu_error_code sys_fs_read(u32 fd, vm::ps3::ptr<void> buf, u64 nbytes, vm::ps3::ptr<u64> nread);
ppu_error_code sys_fs_write(u32 fd, vm::ps3::cptr<void> buf, u64 nbytes, vm::ps3::ptr<u64> nwrite);
ppu_error_code sys_fs_close(u32 fd);
ppu_error_code sys_fs_opendir(vm::ps3::cptr<char> path, vm::ps3::ptr<u32> fd);
ppu_error_code sys_fs_readdir(u32 fd, vm::ps3::ptr<CellFsDirent> dir, vm::ps3::ptr<u64> nread);
ppu_error_code sys_fs_closedir(u32 fd);
ppu_error_code sys_fs_stat(vm::ps3::cptr<char> path, vm::ps3::ptr<CellFsStat> sb);
ppu_error_code sys_fs_fstat(u32 fd, vm::ps3::ptr<CellFsStat> sb);
ppu_error_code sys_fs_mkdir(vm::ps3::cptr<char> path, s32 mode);
ppu_error_code sys_fs_rename(vm::ps3::cptr<char> from, vm::ps3::cptr<char> to);
ppu_error_code sys_fs_rmdir(vm::ps3::cptr<char> path);
ppu_error_code sys_fs_unlink(vm::ps3::cptr<char> path);
ppu_error_code sys_fs_fcntl(u32 fd, u32 op, vm::ps3::ptr<void> arg, u32 size);
ppu_error_code sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ps3::ptr<u64> pos);
ppu_error_code sys_fs_fget_block_size(u32 fd, vm::ps3::ptr<u64> sector_size, vm::ps3::ptr<u64> block_size, vm::ps3::ptr<u64> arg4, vm::ps3::ptr<u64> arg5);
ppu_error_code sys_fs_get_block_size(vm::ps3::cptr<char> path, vm::ps3::ptr<u64> sector_size, vm::ps3::ptr<u64> block_size, vm::ps3::ptr<u64> arg4);
ppu_error_code sys_fs_truncate(vm::ps3::cptr<char> path, u64 size);
ppu_error_code sys_fs_ftruncate(u32 fd, u64 size);
ppu_error_code sys_fs_chmod(vm::ps3::cptr<char> path, s32 mode);
error_code sys_fs_test(u32 arg1, u32 arg2, vm::ps3::ptr<u32> arg3, u32 arg4, vm::ps3::ptr<char> arg5, u32 arg6);
error_code sys_fs_open(vm::ps3::cptr<char> path, s32 flags, vm::ps3::ptr<u32> fd, s32 mode, vm::ps3::cptr<void> arg, u64 size);
error_code sys_fs_read(u32 fd, vm::ps3::ptr<void> buf, u64 nbytes, vm::ps3::ptr<u64> nread);
error_code sys_fs_write(u32 fd, vm::ps3::cptr<void> buf, u64 nbytes, vm::ps3::ptr<u64> nwrite);
error_code sys_fs_close(u32 fd);
error_code sys_fs_opendir(vm::ps3::cptr<char> path, vm::ps3::ptr<u32> fd);
error_code sys_fs_readdir(u32 fd, vm::ps3::ptr<CellFsDirent> dir, vm::ps3::ptr<u64> nread);
error_code sys_fs_closedir(u32 fd);
error_code sys_fs_stat(vm::ps3::cptr<char> path, vm::ps3::ptr<CellFsStat> sb);
error_code sys_fs_fstat(u32 fd, vm::ps3::ptr<CellFsStat> sb);
error_code sys_fs_mkdir(vm::ps3::cptr<char> path, s32 mode);
error_code sys_fs_rename(vm::ps3::cptr<char> from, vm::ps3::cptr<char> to);
error_code sys_fs_rmdir(vm::ps3::cptr<char> path);
error_code sys_fs_unlink(vm::ps3::cptr<char> path);
error_code sys_fs_fcntl(u32 fd, u32 op, vm::ps3::ptr<void> arg, u32 size);
error_code sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ps3::ptr<u64> pos);
error_code sys_fs_fget_block_size(u32 fd, vm::ps3::ptr<u64> sector_size, vm::ps3::ptr<u64> block_size, vm::ps3::ptr<u64> arg4, vm::ps3::ptr<u64> arg5);
error_code sys_fs_get_block_size(vm::ps3::cptr<char> path, vm::ps3::ptr<u64> sector_size, vm::ps3::ptr<u64> block_size, vm::ps3::ptr<u64> arg4);
error_code sys_fs_truncate(vm::ps3::cptr<char> path, u64 size);
error_code sys_fs_ftruncate(u32 fd, u64 size);
error_code sys_fs_chmod(vm::ps3::cptr<char> path, s32 mode);

View File

@ -5,7 +5,7 @@ namespace vm { using namespace ps3; }
logs::channel sys_memory("sys_memory", logs::level::notice);
ppu_error_code sys_memory_allocate(u32 size, u64 flags, vm::ptr<u32> alloc_addr)
error_code sys_memory_allocate(u32 size, u64 flags, vm::ptr<u32> alloc_addr)
{
sys_memory.warning("sys_memory_allocate(size=0x%x, flags=0x%llx, alloc_addr=*0x%x)", size, flags, alloc_addr);
@ -53,7 +53,7 @@ ppu_error_code sys_memory_allocate(u32 size, u64 flags, vm::ptr<u32> alloc_addr)
return CELL_OK;
}
ppu_error_code sys_memory_allocate_from_container(u32 size, u32 cid, u64 flags, vm::ptr<u32> alloc_addr)
error_code sys_memory_allocate_from_container(u32 size, u32 cid, u64 flags, vm::ptr<u32> alloc_addr)
{
sys_memory.warning("sys_memory_allocate_from_container(size=0x%x, cid=0x%x, flags=0x%llx, alloc_addr=*0x%x)", size, cid, flags, alloc_addr);
@ -86,7 +86,7 @@ ppu_error_code sys_memory_allocate_from_container(u32 size, u32 cid, u64 flags,
}
}
ppu_error_code result{};
error_code result{};
const auto ct = idm::get<lv2_memory_container>(cid, [&](u32, lv2_memory_container& ct)
{
@ -116,7 +116,7 @@ ppu_error_code sys_memory_allocate_from_container(u32 size, u32 cid, u64 flags,
return CELL_OK;
}
ppu_error_code sys_memory_free(u32 addr)
error_code sys_memory_free(u32 addr)
{
sys_memory.warning("sys_memory_free(addr=0x%x)", addr);
@ -145,7 +145,7 @@ ppu_error_code sys_memory_free(u32 addr)
return CELL_OK;
}
ppu_error_code sys_memory_get_page_attribute(u32 addr, vm::ptr<sys_page_attr_t> attr)
error_code sys_memory_get_page_attribute(u32 addr, vm::ptr<sys_page_attr_t> attr)
{
sys_memory.error("sys_memory_get_page_attribute(addr=0x%x, attr=*0x%x)", addr, attr);
@ -157,7 +157,7 @@ ppu_error_code sys_memory_get_page_attribute(u32 addr, vm::ptr<sys_page_attr_t>
return CELL_OK;
}
ppu_error_code sys_memory_get_user_memory_size(vm::ptr<sys_memory_info_t> mem_info)
error_code sys_memory_get_user_memory_size(vm::ptr<sys_memory_info_t> mem_info)
{
sys_memory.warning("sys_memory_get_user_memory_size(mem_info=*0x%x)", mem_info);
@ -176,7 +176,7 @@ ppu_error_code sys_memory_get_user_memory_size(vm::ptr<sys_memory_info_t> mem_in
return CELL_OK;
}
ppu_error_code sys_memory_container_create(vm::ptr<u32> cid, u32 size)
error_code sys_memory_container_create(vm::ptr<u32> cid, u32 size)
{
sys_memory.warning("sys_memory_container_create(cid=*0x%x, size=0x%x)", cid, size);
@ -202,11 +202,11 @@ ppu_error_code sys_memory_container_create(vm::ptr<u32> cid, u32 size)
return CELL_OK;
}
ppu_error_code sys_memory_container_destroy(u32 cid)
error_code sys_memory_container_destroy(u32 cid)
{
sys_memory.warning("sys_memory_container_destroy(cid=0x%x)", cid);
ppu_error_code result{};
error_code result{};
const auto ct = idm::withdraw<lv2_memory_container>(cid, [&](u32, lv2_memory_container& ct)
{
@ -236,7 +236,7 @@ ppu_error_code sys_memory_container_destroy(u32 cid)
return CELL_OK;
}
ppu_error_code sys_memory_container_get_size(vm::ptr<sys_memory_info_t> mem_info, u32 cid)
error_code sys_memory_container_get_size(vm::ptr<sys_memory_info_t> mem_info, u32 cid)
{
sys_memory.warning("sys_memory_container_get_size(mem_info=*0x%x, cid=0x%x)", mem_info, cid);

View File

@ -78,11 +78,11 @@ struct lv2_memory_container
};
// SysCalls
ppu_error_code sys_memory_allocate(u32 size, u64 flags, vm::ps3::ptr<u32> alloc_addr);
ppu_error_code sys_memory_allocate_from_container(u32 size, u32 cid, u64 flags, vm::ps3::ptr<u32> alloc_addr);
ppu_error_code sys_memory_free(u32 start_addr);
ppu_error_code sys_memory_get_page_attribute(u32 addr, vm::ps3::ptr<sys_page_attr_t> attr);
ppu_error_code sys_memory_get_user_memory_size(vm::ps3::ptr<sys_memory_info_t> mem_info);
ppu_error_code sys_memory_container_create(vm::ps3::ptr<u32> cid, u32 size);
ppu_error_code sys_memory_container_destroy(u32 cid);
ppu_error_code sys_memory_container_get_size(vm::ps3::ptr<sys_memory_info_t> mem_info, u32 cid);
error_code sys_memory_allocate(u32 size, u64 flags, vm::ps3::ptr<u32> alloc_addr);
error_code sys_memory_allocate_from_container(u32 size, u32 cid, u64 flags, vm::ps3::ptr<u32> alloc_addr);
error_code sys_memory_free(u32 start_addr);
error_code sys_memory_get_page_attribute(u32 addr, vm::ps3::ptr<sys_page_attr_t> attr);
error_code sys_memory_get_user_memory_size(vm::ps3::ptr<sys_memory_info_t> mem_info);
error_code sys_memory_container_create(vm::ps3::ptr<u32> cid, u32 size);
error_code sys_memory_container_destroy(u32 cid);
error_code sys_memory_container_get_size(vm::ps3::ptr<sys_memory_info_t> mem_info, u32 cid);

View File

@ -5,7 +5,7 @@ namespace vm { using namespace ps3; }
logs::channel sys_mmapper("sys_mmapper", logs::level::notice);
ppu_error_code sys_mmapper_allocate_address(u64 size, u64 flags, u64 alignment, vm::ptr<u32> alloc_addr)
error_code sys_mmapper_allocate_address(u64 size, u64 flags, u64 alignment, vm::ptr<u32> alloc_addr)
{
sys_mmapper.error("sys_mmapper_allocate_address(size=0x%llx, flags=0x%llx, alignment=0x%llx, alloc_addr=*0x%x)", size, flags, alignment, alloc_addr);
@ -49,7 +49,7 @@ ppu_error_code sys_mmapper_allocate_address(u64 size, u64 flags, u64 alignment,
return CELL_EALIGN;
}
ppu_error_code sys_mmapper_allocate_fixed_address()
error_code sys_mmapper_allocate_fixed_address()
{
sys_mmapper.error("sys_mmapper_allocate_fixed_address()");
@ -61,7 +61,7 @@ ppu_error_code sys_mmapper_allocate_fixed_address()
return CELL_OK;
}
ppu_error_code sys_mmapper_allocate_shared_memory(u64 unk, u32 size, u64 flags, vm::ptr<u32> mem_id)
error_code sys_mmapper_allocate_shared_memory(u64 unk, u32 size, u64 flags, vm::ptr<u32> mem_id)
{
sys_mmapper.warning("sys_mmapper_allocate_shared_memory(0x%llx, size=0x%x, flags=0x%llx, mem_id=*0x%x)", unk, size, flags, mem_id);
@ -108,7 +108,7 @@ ppu_error_code sys_mmapper_allocate_shared_memory(u64 unk, u32 size, u64 flags,
return CELL_OK;
}
ppu_error_code sys_mmapper_allocate_shared_memory_from_container(u64 unk, u32 size, u32 cid, u64 flags, vm::ptr<u32> mem_id)
error_code sys_mmapper_allocate_shared_memory_from_container(u64 unk, u32 size, u32 cid, u64 flags, vm::ptr<u32> mem_id)
{
sys_mmapper.error("sys_mmapper_allocate_shared_memory_from_container(0x%llx, size=0x%x, cid=0x%x, flags=0x%llx, mem_id=*0x%x)", unk, size, cid, flags, mem_id);
@ -141,7 +141,7 @@ ppu_error_code sys_mmapper_allocate_shared_memory_from_container(u64 unk, u32 si
}
}
ppu_error_code result{};
error_code result{};
const auto ct = idm::get<lv2_memory_container>(cid, [&](u32, lv2_memory_container& ct)
{
@ -171,14 +171,14 @@ ppu_error_code sys_mmapper_allocate_shared_memory_from_container(u64 unk, u32 si
return CELL_OK;
}
ppu_error_code sys_mmapper_change_address_access_right(u32 addr, u64 flags)
error_code sys_mmapper_change_address_access_right(u32 addr, u64 flags)
{
sys_mmapper.todo("sys_mmapper_change_address_access_right(addr=0x%x, flags=0x%llx)", addr, flags);
return CELL_OK;
}
ppu_error_code sys_mmapper_free_address(u32 addr)
error_code sys_mmapper_free_address(u32 addr)
{
sys_mmapper.error("sys_mmapper_free_address(addr=0x%x)", addr);
@ -198,11 +198,11 @@ ppu_error_code sys_mmapper_free_address(u32 addr)
return CELL_OK;
}
ppu_error_code sys_mmapper_free_shared_memory(u32 mem_id)
error_code sys_mmapper_free_shared_memory(u32 mem_id)
{
sys_mmapper.warning("sys_mmapper_free_shared_memory(mem_id=0x%x)", mem_id);
ppu_error_code result{};
error_code result{};
// Conditionally remove memory ID
const auto mem = idm::withdraw<lv2_memory>(mem_id, [&](u32, lv2_memory& mem)
@ -232,7 +232,7 @@ ppu_error_code sys_mmapper_free_shared_memory(u32 mem_id)
return CELL_OK;
}
ppu_error_code sys_mmapper_map_shared_memory(u32 addr, u32 mem_id, u64 flags)
error_code sys_mmapper_map_shared_memory(u32 addr, u32 mem_id, u64 flags)
{
sys_mmapper.error("sys_mmapper_map_shared_memory(addr=0x%x, mem_id=0x%x, flags=0x%llx)", addr, mem_id, flags);
@ -271,7 +271,7 @@ ppu_error_code sys_mmapper_map_shared_memory(u32 addr, u32 mem_id, u64 flags)
return CELL_OK;
}
ppu_error_code sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, vm::ptr<u32> alloc_addr)
error_code sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, vm::ptr<u32> alloc_addr)
{
sys_mmapper.error("sys_mmapper_search_and_map(start_addr=0x%x, mem_id=0x%x, flags=0x%llx, alloc_addr=*0x%x)", start_addr, mem_id, flags, alloc_addr);
@ -307,7 +307,7 @@ ppu_error_code sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags,
return CELL_OK;
}
ppu_error_code sys_mmapper_unmap_shared_memory(u32 addr, vm::ptr<u32> mem_id)
error_code sys_mmapper_unmap_shared_memory(u32 addr, vm::ptr<u32> mem_id)
{
sys_mmapper.error("sys_mmapper_unmap_shared_memory(addr=0x%x, mem_id=*0x%x)", addr, mem_id);
@ -338,7 +338,7 @@ ppu_error_code sys_mmapper_unmap_shared_memory(u32 addr, vm::ptr<u32> mem_id)
return CELL_OK;
}
ppu_error_code sys_mmapper_enable_page_fault_notification(u32 addr, u32 eq)
error_code sys_mmapper_enable_page_fault_notification(u32 addr, u32 eq)
{
sys_mmapper.todo("sys_mmapper_enable_page_fault_notification(addr=0x%x, eq=0x%x)", addr, eq);

View File

@ -21,14 +21,14 @@ struct lv2_memory
};
// SysCalls
ppu_error_code sys_mmapper_allocate_address(u64 size, u64 flags, u64 alignment, vm::ps3::ptr<u32> alloc_addr);
ppu_error_code sys_mmapper_allocate_fixed_address();
ppu_error_code sys_mmapper_allocate_shared_memory(u64 unk, u32 size, u64 flags, vm::ps3::ptr<u32> mem_id);
ppu_error_code sys_mmapper_allocate_shared_memory_from_container(u64 unk, u32 size, u32 cid, u64 flags, vm::ps3::ptr<u32> mem_id);
ppu_error_code sys_mmapper_change_address_access_right(u32 addr, u64 flags);
ppu_error_code sys_mmapper_free_address(u32 addr);
ppu_error_code sys_mmapper_free_shared_memory(u32 mem_id);
ppu_error_code sys_mmapper_map_shared_memory(u32 addr, u32 mem_id, u64 flags);
ppu_error_code sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, vm::ps3::ptr<u32> alloc_addr);
ppu_error_code sys_mmapper_unmap_shared_memory(u32 addr, vm::ps3::ptr<u32> mem_id);
ppu_error_code sys_mmapper_enable_page_fault_notification(u32 addr, u32 eq);
error_code sys_mmapper_allocate_address(u64 size, u64 flags, u64 alignment, vm::ps3::ptr<u32> alloc_addr);
error_code sys_mmapper_allocate_fixed_address();
error_code sys_mmapper_allocate_shared_memory(u64 unk, u32 size, u64 flags, vm::ps3::ptr<u32> mem_id);
error_code sys_mmapper_allocate_shared_memory_from_container(u64 unk, u32 size, u32 cid, u64 flags, vm::ps3::ptr<u32> mem_id);
error_code sys_mmapper_change_address_access_right(u32 addr, u64 flags);
error_code sys_mmapper_free_address(u32 addr);
error_code sys_mmapper_free_shared_memory(u32 mem_id);
error_code sys_mmapper_map_shared_memory(u32 addr, u32 mem_id, u64 flags);
error_code sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, vm::ps3::ptr<u32> alloc_addr);
error_code sys_mmapper_unmap_shared_memory(u32 addr, vm::ps3::ptr<u32> mem_id);
error_code sys_mmapper_enable_page_fault_notification(u32 addr, u32 eq);

View File

@ -7,7 +7,7 @@ logs::channel sys_tty("sys_tty", logs::level::notice);
extern fs::file g_tty;
ppu_error_code sys_tty_read(s32 ch, vm::ptr<char> buf, u32 len, vm::ptr<u32> preadlen)
error_code sys_tty_read(s32 ch, vm::ptr<char> buf, u32 len, vm::ptr<u32> preadlen)
{
sys_tty.fatal("sys_tty_read(ch=%d, buf=*0x%x, len=%d, preadlen=*0x%x)", ch, buf, len, preadlen);
@ -15,7 +15,7 @@ ppu_error_code sys_tty_read(s32 ch, vm::ptr<char> buf, u32 len, vm::ptr<u32> pre
fmt::throw_exception("Unimplemented" HERE);
}
ppu_error_code sys_tty_write(s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwritelen)
error_code sys_tty_write(s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwritelen)
{
sys_tty.notice("sys_tty_write(ch=%d, buf=*0x%x, len=%d, pwritelen=*0x%x)", ch, buf, len, pwritelen);

View File

@ -26,5 +26,5 @@ enum
};
// SysCalls
ppu_error_code sys_tty_read(s32 ch, vm::ps3::ptr<char> buf, u32 len, vm::ps3::ptr<u32> preadlen);
ppu_error_code sys_tty_write(s32 ch, vm::ps3::cptr<char> buf, u32 len, vm::ps3::ptr<u32> pwritelen);
error_code sys_tty_read(s32 ch, vm::ps3::ptr<char> buf, u32 len, vm::ps3::ptr<u32> preadlen);
error_code sys_tty_write(s32 ch, vm::ps3::cptr<char> buf, u32 len, vm::ps3::ptr<u32> pwritelen);

View File

@ -6,7 +6,7 @@ namespace vm { using namespace ps3; }
logs::channel sys_vm("sys_vm", logs::level::notice);
ppu_error_code sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, vm::ptr<u32> addr)
error_code sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, vm::ptr<u32> addr)
{
sys_vm.error("sys_vm_memory_map(vsize=0x%x, psize=0x%x, cid=0x%x, flags=0x%llx, policy=0x%llx, addr=*0x%x)", vsize, psize, cid, flag, policy, addr);
@ -38,7 +38,7 @@ ppu_error_code sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 po
return CELL_ENOMEM;
}
ppu_error_code sys_vm_unmap(u32 addr)
error_code sys_vm_unmap(u32 addr)
{
sys_vm.warning("sys_vm_unmap(addr=0x%x)", addr);
@ -50,70 +50,70 @@ ppu_error_code sys_vm_unmap(u32 addr)
return CELL_OK;
}
ppu_error_code sys_vm_append_memory(u32 addr, u32 size)
error_code sys_vm_append_memory(u32 addr, u32 size)
{
sys_vm.warning("sys_vm_append_memory(addr=0x%x, size=0x%x)", addr, size);
return CELL_OK;
}
ppu_error_code sys_vm_return_memory(u32 addr, u32 size)
error_code sys_vm_return_memory(u32 addr, u32 size)
{
sys_vm.warning("sys_vm_return_memory(addr=0x%x, size=0x%x)", addr, size);
return CELL_OK;
}
ppu_error_code sys_vm_lock(u32 addr, u32 size)
error_code sys_vm_lock(u32 addr, u32 size)
{
sys_vm.warning("sys_vm_lock(addr=0x%x, size=0x%x)", addr, size);
return CELL_OK;
}
ppu_error_code sys_vm_unlock(u32 addr, u32 size)
error_code sys_vm_unlock(u32 addr, u32 size)
{
sys_vm.warning("sys_vm_unlock(addr=0x%x, size=0x%x)", addr, size);
return CELL_OK;
}
ppu_error_code sys_vm_touch(u32 addr, u32 size)
error_code sys_vm_touch(u32 addr, u32 size)
{
sys_vm.warning("sys_vm_touch(addr=0x%x, size=0x%x)", addr, size);
return CELL_OK;
}
ppu_error_code sys_vm_flush(u32 addr, u32 size)
error_code sys_vm_flush(u32 addr, u32 size)
{
sys_vm.warning("sys_vm_flush(addr=0x%x, size=0x%x)", addr, size);
return CELL_OK;
}
ppu_error_code sys_vm_invalidate(u32 addr, u32 size)
error_code sys_vm_invalidate(u32 addr, u32 size)
{
sys_vm.todo("sys_vm_invalidate(addr=0x%x, size=0x%x)", addr, size);
return CELL_OK;
}
ppu_error_code sys_vm_store(u32 addr, u32 size)
error_code sys_vm_store(u32 addr, u32 size)
{
sys_vm.warning("sys_vm_store(addr=0x%x, size=0x%x)", addr, size);
return CELL_OK;
}
ppu_error_code sys_vm_sync(u32 addr, u32 size)
error_code sys_vm_sync(u32 addr, u32 size)
{
sys_vm.warning("sys_vm_sync(addr=0x%x, size=0x%x)", addr, size);
return CELL_OK;
}
ppu_error_code sys_vm_test(u32 addr, u32 size, vm::ptr<u64> result)
error_code sys_vm_test(u32 addr, u32 size, vm::ptr<u64> result)
{
sys_vm.warning("sys_vm_test(addr=0x%x, size=0x%x, result=*0x%x)", addr, size, result);
@ -122,7 +122,7 @@ ppu_error_code sys_vm_test(u32 addr, u32 size, vm::ptr<u64> result)
return CELL_OK;
}
ppu_error_code sys_vm_get_statistics(u32 addr, vm::ptr<sys_vm_statistics_t> stat)
error_code sys_vm_get_statistics(u32 addr, vm::ptr<sys_vm_statistics_t> stat)
{
sys_vm.warning("sys_vm_get_statistics(addr=0x%x, stat=*0x%x)", addr, stat);

View File

@ -26,16 +26,16 @@ struct sys_vm_statistics_t
};
// SysCalls
ppu_error_code sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, vm::ps3::ptr<u32> addr);
ppu_error_code sys_vm_unmap(u32 addr);
ppu_error_code sys_vm_append_memory(u32 addr, u32 size);
ppu_error_code sys_vm_return_memory(u32 addr, u32 size);
ppu_error_code sys_vm_lock(u32 addr, u32 size);
ppu_error_code sys_vm_unlock(u32 addr, u32 size);
ppu_error_code sys_vm_touch(u32 addr, u32 size);
ppu_error_code sys_vm_flush(u32 addr, u32 size);
ppu_error_code sys_vm_invalidate(u32 addr, u32 size);
ppu_error_code sys_vm_store(u32 addr, u32 size);
ppu_error_code sys_vm_sync(u32 addr, u32 size);
ppu_error_code sys_vm_test(u32 addr, u32 size, vm::ps3::ptr<u64> result);
ppu_error_code sys_vm_get_statistics(u32 addr, vm::ps3::ptr<sys_vm_statistics_t> stat);
error_code sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, vm::ps3::ptr<u32> addr);
error_code sys_vm_unmap(u32 addr);
error_code sys_vm_append_memory(u32 addr, u32 size);
error_code sys_vm_return_memory(u32 addr, u32 size);
error_code sys_vm_lock(u32 addr, u32 size);
error_code sys_vm_unlock(u32 addr, u32 size);
error_code sys_vm_touch(u32 addr, u32 size);
error_code sys_vm_flush(u32 addr, u32 size);
error_code sys_vm_invalidate(u32 addr, u32 size);
error_code sys_vm_store(u32 addr, u32 size);
error_code sys_vm_sync(u32 addr, u32 size);
error_code sys_vm_test(u32 addr, u32 size, vm::ps3::ptr<u64> result);
error_code sys_vm_get_statistics(u32 addr, vm::ps3::ptr<sys_vm_statistics_t> stat);

View File

@ -35,26 +35,6 @@ extern std::string arm_get_variable_name(const std::string& module, u32 vnid)
return fmt::format("0x%08X", vnid);
}
s32 arm_error_code::report(s32 error, const char* text)
{
if (auto thread = get_current_cpu_thread())
{
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 arm_report_error(0x%x, '%s')!");
return error;
}
std::vector<arm_function_t>& arm_function_manager::access()
{
static std::vector<arm_function_t> list

View File

@ -237,6 +237,20 @@ struct arm_gpr_cast_impl<b8, void>
}
};
template<>
struct arm_gpr_cast_impl<error_code, void>
{
static inline u32 to(const error_code& code)
{
return code;
}
static inline error_code from(const u32 reg)
{
return not_an_error(reg);
}
};
template<typename T, typename AT>
struct arm_gpr_cast_impl<vm::_ptr_base<T, AT>, void>
{

View File

@ -1,10 +1,18 @@
#pragma once
enum SceOk : s32
struct SceOk
{
SCE_OK = 0,
enum : s32
{
__not_an_error,
SCE_OK = 0
};
};
// Temporary workaround
constexpr auto SCE_OK = SceOk::SCE_OK;
enum SceError : u32
{
SCE_ERROR_ERRNO_EPERM = 0x80010001,
@ -135,211 +143,3 @@ enum SceError : u32
SCE_ERROR_ERRNO_ENOTRECOVERABLE = 0x8001008D,
SCE_ERROR_ERRNO_EOWNERDEAD = 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(not_an_error_t value)
: value(static_cast<s32>(value))
{
}
// Conversion
constexpr operator s32() const
{
return value;
}
};
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;
}

View File

@ -15,6 +15,403 @@ logs::channel sceLibKernel("sceLibKernel", logs::level::notice);
extern u64 get_system_time();
template<>
void fmt_class_string<SceError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto 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 unknown;
});
}
template<>
void fmt_class_string<SceLibKernelError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto 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);
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);
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 unknown;
});
}
arm_tls_manager::arm_tls_manager(u32 vaddr, u32 fsize, u32 vsize)
: vaddr(vaddr)
, fsize(fsize)
@ -88,7 +485,7 @@ s32 sceKernelGetMemBlockInfoByAddr(vm::ptr<void> vbase, vm::ptr<SceKernelMemBloc
fmt::throw_exception("Unimplemented" HERE);
}
arm_error_code sceKernelCreateThread(vm::cptr<char> pName, vm::ptr<SceKernelThreadEntry> entry, s32 initPriority, u32 stackSize, u32 attr, s32 cpuAffinityMask, vm::cptr<SceKernelThreadOptParam> pOptParam)
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=%s, entry=*0x%x, initPriority=%d, stackSize=0x%x, attr=0x%x, cpuAffinityMask=0x%x, pOptParam=*0x%x)",
pName, entry, initPriority, stackSize, attr, cpuAffinityMask, pOptParam);
@ -101,7 +498,7 @@ arm_error_code sceKernelCreateThread(vm::cptr<char> pName, vm::ptr<SceKernelThre
return not_an_error(thread->id);
}
arm_error_code sceKernelStartThread(s32 threadId, u32 argSize, vm::cptr<void> pArgBlock)
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);
@ -130,7 +527,7 @@ arm_error_code sceKernelStartThread(s32 threadId, u32 argSize, vm::cptr<void> pA
return SCE_OK;
}
arm_error_code sceKernelExitThread(ARMv7Thread& cpu, s32 exitStatus)
error_code sceKernelExitThread(ARMv7Thread& cpu, s32 exitStatus)
{
sceLibKernel.warning("sceKernelExitThread(exitStatus=0x%x)", exitStatus);
@ -140,7 +537,7 @@ arm_error_code sceKernelExitThread(ARMv7Thread& cpu, s32 exitStatus)
return SCE_OK;
}
arm_error_code sceKernelDeleteThread(s32 threadId)
error_code sceKernelDeleteThread(s32 threadId)
{
sceLibKernel.warning("sceKernelDeleteThread(threadId=0x%x)", threadId);
@ -163,7 +560,7 @@ arm_error_code sceKernelDeleteThread(s32 threadId)
return SCE_OK;
}
arm_error_code sceKernelExitDeleteThread(ARMv7Thread& cpu, s32 exitStatus)
error_code sceKernelExitDeleteThread(ARMv7Thread& cpu, s32 exitStatus)
{
sceLibKernel.warning("sceKernelExitDeleteThread(exitStatus=0x%x)", exitStatus);
@ -288,7 +685,7 @@ s32 sceKernelDelayThreadCB(u32 usec)
fmt::throw_exception("Unimplemented" HERE);
}
arm_error_code sceKernelWaitThreadEnd(s32 threadId, vm::ptr<s32> pExitStatus, vm::ptr<u32> pTimeout)
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);
@ -733,7 +1130,7 @@ private:
template<> DECLARE(psp2_event_flag::ipc::g_ipc) {};
arm_error_code sceKernelCreateEventFlag(vm::cptr<char> pName, u32 attr, u32 initPattern, vm::cptr<SceKernelEventFlagOptParam> pOptParam)
error_code sceKernelCreateEventFlag(vm::cptr<char> pName, u32 attr, u32 initPattern, vm::cptr<SceKernelEventFlagOptParam> pOptParam)
{
sceLibKernel.error("sceKernelCreateEventFlag(pName=%s, attr=0x%x, initPattern=0x%x, pOptParam=*0x%x)", pName, attr, initPattern, pOptParam);
@ -750,7 +1147,7 @@ arm_error_code sceKernelCreateEventFlag(vm::cptr<char> pName, u32 attr, u32 init
return not_an_error(idm::import_existing(evf));
}
arm_error_code sceKernelDeleteEventFlag(s32 evfId)
error_code sceKernelDeleteEventFlag(s32 evfId)
{
sceLibKernel.error("sceKernelDeleteEventFlag(evfId=0x%x)", evfId);
@ -776,7 +1173,7 @@ arm_error_code sceKernelDeleteEventFlag(s32 evfId)
return SCE_OK;
}
arm_error_code sceKernelOpenEventFlag(vm::cptr<char> pName)
error_code sceKernelOpenEventFlag(vm::cptr<char> pName)
{
sceLibKernel.error("sceKernelOpenEventFlag(pName=%s)", pName);
@ -791,7 +1188,7 @@ arm_error_code sceKernelOpenEventFlag(vm::cptr<char> pName)
return not_an_error(idm::import_existing(evf));
}
arm_error_code sceKernelCloseEventFlag(s32 evfId)
error_code sceKernelCloseEventFlag(s32 evfId)
{
sceLibKernel.error("sceKernelCloseEventFlag(evfId=0x%x)", evfId);
@ -811,7 +1208,7 @@ arm_error_code sceKernelCloseEventFlag(s32 evfId)
return SCE_OK;
}
arm_error_code sceKernelWaitEventFlag(ARMv7Thread& cpu, s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat, vm::ptr<u32> pTimeout)
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);
@ -884,14 +1281,14 @@ arm_error_code sceKernelWaitEventFlag(ARMv7Thread& cpu, s32 evfId, u32 bitPatter
return not_an_error(cpu.GPR[0]);
}
arm_error_code sceKernelWaitEventFlagCB(ARMv7Thread& cpu, s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat, vm::ptr<u32> pTimeout)
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(cpu, evfId, bitPattern, waitMode, pResultPat, pTimeout);
}
arm_error_code sceKernelPollEventFlag(ARMv7Thread& cpu, s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat)
error_code sceKernelPollEventFlag(ARMv7Thread& cpu, 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);
@ -934,7 +1331,7 @@ arm_error_code sceKernelPollEventFlag(ARMv7Thread& cpu, s32 evfId, u32 bitPatter
return not_an_error(SCE_KERNEL_ERROR_EVENT_COND);
}
arm_error_code sceKernelSetEventFlag(s32 evfId, u32 bitPattern)
error_code sceKernelSetEventFlag(s32 evfId, u32 bitPattern)
{
sceLibKernel.error("sceKernelSetEventFlag(evfId=0x%x, bitPattern=0x%x)", evfId, bitPattern);
@ -952,7 +1349,7 @@ arm_error_code sceKernelSetEventFlag(s32 evfId, u32 bitPattern)
return SCE_OK;
}
arm_error_code sceKernelClearEventFlag(s32 evfId, u32 bitPattern)
error_code sceKernelClearEventFlag(s32 evfId, u32 bitPattern)
{
sceLibKernel.error("sceKernelClearEventFlag(evfId=0x%x, bitPattern=0x%x)", evfId, bitPattern);
@ -970,7 +1367,7 @@ arm_error_code sceKernelClearEventFlag(s32 evfId, u32 bitPattern)
return SCE_OK;
}
arm_error_code sceKernelCancelEventFlag(ARMv7Thread& cpu, s32 evfId, u32 setPattern, vm::ptr<s32> pNumWaitThreads)
error_code sceKernelCancelEventFlag(ARMv7Thread& cpu, s32 evfId, u32 setPattern, vm::ptr<s32> pNumWaitThreads)
{
sceLibKernel.error("sceKernelCancelEventFlag(evfId=0x%x, setPattern=0x%x, pNumWaitThreads=*0x%x)", evfId, setPattern, pNumWaitThreads);
@ -988,7 +1385,7 @@ arm_error_code sceKernelCancelEventFlag(ARMv7Thread& cpu, s32 evfId, u32 setPatt
return SCE_OK;
}
arm_error_code sceKernelGetEventFlagInfo(s32 evfId, vm::ptr<SceKernelEventFlagInfo> pInfo)
error_code sceKernelGetEventFlagInfo(s32 evfId, vm::ptr<SceKernelEventFlagInfo> pInfo)
{
sceLibKernel.error("sceKernelGetEventFlagInfo(evfId=0x%x, pInfo=*0x%x)", evfId, pInfo);
@ -1017,14 +1414,14 @@ arm_error_code sceKernelGetEventFlagInfo(s32 evfId, vm::ptr<SceKernelEventFlagIn
// Semaphore functions
arm_error_code sceKernelCreateSema(vm::cptr<char> pName, u32 attr, s32 initCount, s32 maxCount, vm::cptr<SceKernelSemaOptParam> pOptParam)
error_code sceKernelCreateSema(vm::cptr<char> pName, u32 attr, s32 initCount, s32 maxCount, vm::cptr<SceKernelSemaOptParam> pOptParam)
{
sceLibKernel.error("sceKernelCreateSema(pName=%s, attr=0x%x, initCount=%d, maxCount=%d, pOptParam=*0x%x)", pName, attr, initCount, maxCount, pOptParam);
return not_an_error(idm::make<psp2_semaphore>(pName.get_ptr(), attr, initCount, maxCount));
}
arm_error_code sceKernelDeleteSema(s32 semaId)
error_code sceKernelDeleteSema(s32 semaId)
{
sceLibKernel.error("sceKernelDeleteSema(semaId=0x%x)", semaId);
@ -1050,7 +1447,7 @@ s32 sceKernelCloseSema(s32 semaId)
fmt::throw_exception("Unimplemented" HERE);
}
arm_error_code sceKernelWaitSema(s32 semaId, s32 needCount, vm::ptr<u32> pTimeout)
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);
@ -1093,14 +1490,14 @@ s32 sceKernelGetSemaInfo(s32 semaId, vm::ptr<SceKernelSemaInfo> pInfo)
// Mutex functions
arm_error_code sceKernelCreateMutex(vm::cptr<char> pName, u32 attr, s32 initCount, vm::cptr<SceKernelMutexOptParam> pOptParam)
error_code sceKernelCreateMutex(vm::cptr<char> pName, u32 attr, s32 initCount, vm::cptr<SceKernelMutexOptParam> pOptParam)
{
sceLibKernel.error("sceKernelCreateMutex(pName=%s, attr=0x%x, initCount=%d, pOptParam=*0x%x)", pName, attr, initCount, pOptParam);
return not_an_error(idm::make<psp2_mutex>(pName.get_ptr(), attr, initCount));
}
arm_error_code sceKernelDeleteMutex(s32 mutexId)
error_code sceKernelDeleteMutex(s32 mutexId)
{
sceLibKernel.error("sceKernelDeleteMutex(mutexId=0x%x)", mutexId);
@ -1200,7 +1597,7 @@ s32 sceKernelGetLwMutexInfoById(s32 lwMutexId, vm::ptr<SceKernelLwMutexInfo> pIn
// Condition variable functions
arm_error_code sceKernelCreateCond(vm::cptr<char> pName, u32 attr, s32 mutexId, vm::cptr<SceKernelCondOptParam> pOptParam)
error_code sceKernelCreateCond(vm::cptr<char> pName, u32 attr, s32 mutexId, vm::cptr<SceKernelCondOptParam> pOptParam)
{
sceLibKernel.error("sceKernelCreateCond(pName=%s, attr=0x%x, mutexId=0x%x, pOptParam=*0x%x)", pName, attr, mutexId, pOptParam);
@ -1214,7 +1611,7 @@ arm_error_code sceKernelCreateCond(vm::cptr<char> pName, u32 attr, s32 mutexId,
return not_an_error(idm::make<psp2_cond>(pName.get_ptr(), attr, mutex));
}
arm_error_code sceKernelDeleteCond(s32 condId)
error_code sceKernelDeleteCond(s32 condId)
{
sceLibKernel.error("sceKernelDeleteCond(condId=0x%x)", condId);
@ -1483,15 +1880,15 @@ s32 sceKernelGetRWLockInfo(s32 rwLockId, vm::ptr<SceKernelRWLockInfo> pInfo)
fmt::throw_exception("Unimplemented" HERE);
}
arm_error_code sceKernelGetThreadmgrUIDClass(s32 uid)
error_code sceKernelGetThreadmgrUIDClass(s32 uid)
{
sceLibKernel.error("sceKernelGetThreadmgrUIDClass(uid=0x%x)", uid);
if (idm::check<ARMv7Thread>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_THREAD;
if (idm::check<psp2_semaphore>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_SEMA;
if (idm::check<psp2_event_flag>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_EVENT_FLAG;
if (idm::check<psp2_mutex>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_MUTEX;
if (idm::check<psp2_cond>(uid)) return SCE_KERNEL_THREADMGR_UID_CLASS_COND;
if (idm::check<ARMv7Thread>(uid)) return not_an_error(SCE_KERNEL_THREADMGR_UID_CLASS_THREAD);
if (idm::check<psp2_semaphore>(uid)) return not_an_error(SCE_KERNEL_THREADMGR_UID_CLASS_SEMA);
if (idm::check<psp2_event_flag>(uid)) return not_an_error(SCE_KERNEL_THREADMGR_UID_CLASS_EVENT_FLAG);
if (idm::check<psp2_mutex>(uid)) return not_an_error(SCE_KERNEL_THREADMGR_UID_CLASS_MUTEX);
if (idm::check<psp2_cond>(uid)) return not_an_error(SCE_KERNEL_THREADMGR_UID_CLASS_COND);
return SCE_KERNEL_ERROR_INVALID_UID;
}

View File

@ -117,11 +117,6 @@ enum SceLibKernelError : u32
SCE_KERNEL_ERROR_LOADCORE_ERROR = 0x80025000,
SCE_KERNEL_ERROR_ILLEGAL_ELF_HEADER = 0x80025001,
SCE_KERNEL_ERROR_ILLEGAL_SELF_HEADER = 0x80025002,
};
// Error Codes
enum SceLibKernelError0 : u32
{
SCE_KERNEL_ERROR_EXCPMGR_ERROR = 0x80027000,
SCE_KERNEL_ERROR_ILLEGAL_EXCPCODE = 0x80027001,
SCE_KERNEL_ERROR_ILLEGAL_EXCPHANDLER = 0x80027002,
@ -223,11 +218,6 @@ enum SceLibKernelError0 : u32
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,
};
// Error Codes
enum SceLibKernelError1 : u32
{
SCE_KERNEL_ERROR_PROCESSMGR_ERROR = 0x80029000,
SCE_KERNEL_ERROR_INVALID_PID = 0x80029001,
SCE_KERNEL_ERROR_INVALID_PROCESS_TYPE = 0x80029002,
@ -283,280 +273,6 @@ enum SceLibKernelError1 : u32
SCE_KERNEL_ERROR_NO_AUTH = 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;
}
// PSP2 UID Class
enum : u32
{

View File

@ -8,7 +8,21 @@ logs::channel scePerf("scePerf", logs::level::notice);
extern u64 get_system_time();
arm_error_code scePerfArmPmonReset(ARMv7Thread& cpu, s32 threadId)
template<>
void fmt_class_string<ScePerfError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto error)
{
switch (error)
{
STR_CASE(SCE_PERF_ERROR_INVALID_ARGUMENT);
}
return unknown;
});
}
error_code scePerfArmPmonReset(ARMv7Thread& cpu, s32 threadId)
{
scePerf.warning("scePerfArmPmonReset(threadId=0x%x)", threadId);
@ -19,7 +33,7 @@ arm_error_code scePerfArmPmonReset(ARMv7Thread& cpu, s32 threadId)
return SCE_OK;
}
arm_error_code scePerfArmPmonSelectEvent(ARMv7Thread& cpu, s32 threadId, u32 counter, u8 eventCode)
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);
@ -68,7 +82,7 @@ arm_error_code scePerfArmPmonSelectEvent(ARMv7Thread& cpu, s32 threadId, u32 cou
return SCE_OK;
}
arm_error_code scePerfArmPmonStart(ARMv7Thread& cpu, s32 threadId)
error_code scePerfArmPmonStart(ARMv7Thread& cpu, s32 threadId)
{
scePerf.warning("scePerfArmPmonStart(threadId=0x%x)", threadId);
@ -77,7 +91,7 @@ arm_error_code scePerfArmPmonStart(ARMv7Thread& cpu, s32 threadId)
return SCE_OK;
}
arm_error_code scePerfArmPmonStop(ARMv7Thread& cpu, s32 threadId)
error_code scePerfArmPmonStop(ARMv7Thread& cpu, s32 threadId)
{
scePerf.warning("scePerfArmPmonStop(threadId=0x%x)");
@ -86,7 +100,7 @@ arm_error_code scePerfArmPmonStop(ARMv7Thread& cpu, s32 threadId)
return SCE_OK;
}
arm_error_code scePerfArmPmonGetCounterValue(ARMv7Thread& cpu, s32 threadId, u32 counter, vm::ptr<u32> pValue)
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);
@ -109,7 +123,7 @@ arm_error_code scePerfArmPmonGetCounterValue(ARMv7Thread& cpu, s32 threadId, u32
return SCE_OK;
}
arm_error_code scePerfArmPmonSoftwareIncrement(ARMv7Thread& cpu, u32 mask)
error_code scePerfArmPmonSoftwareIncrement(ARMv7Thread& cpu, u32 mask)
{
scePerf.warning("scePerfArmPmonSoftwareIncrement(mask=0x%x)", mask);

View File

@ -8,17 +8,6 @@ enum ScePerfError : u32
SCE_PERF_ERROR_INVALID_ARGUMENT = 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

View File

@ -475,4 +475,50 @@ void Emulator::Stop()
}
}
s32 error_code::error_report(const fmt_type_info* sup, u64 arg)
{
std::string out;
if (auto thread = get_current_cpu_thread())
{
if (g_system == system_type::ps3 && thread->id >= ppu_thread::id_min)
{
if (auto func = static_cast<ppu_thread*>(thread)->last_function)
{
out += "'";
out += func;
out += "'";
}
}
if (g_system == system_type::psv)
{
if (auto func = static_cast<ARMv7Thread*>(thread)->last_function)
{
out += "'";
out += func;
out += "'";
}
}
}
if (out.empty())
{
fmt::append(out, "Unknown function failed with 0x%08x", arg);
}
else
{
fmt::append(out, " failed with 0x%08x", arg);
}
if (sup)
{
fmt::raw_append(out, " : %s", sup, fmt_args_t<void>{arg});
}
LOG_ERROR(GENERAL, "%s", out);
return static_cast<s32>(arg);
}
Emulator Emu;