ppu_initialize_syscalls draft

This commit is contained in:
Nekotekina 2017-05-09 18:17:55 +03:00
parent 3a5efe9809
commit 8209e6c1e3
2 changed files with 11 additions and 1 deletions

View File

@ -142,6 +142,7 @@ cfg::set_entry g_cfg_load_libs(cfg::root.core, "Load libraries");
extern cfg::map_entry<ppu_decoder_type> g_cfg_ppu_decoder;
extern void ppu_initialize_syscalls();
extern std::string ppu_get_function_name(const std::string& module, u32 fnid);
extern std::string ppu_get_variable_name(const std::string& module, u32 vnid);
extern void ppu_register_range(u32 addr, u32 size);
@ -234,6 +235,8 @@ struct ppu_linkage_info
// Initialize static modules.
static void ppu_initialize_modules(const std::shared_ptr<ppu_linkage_info>& link)
{
ppu_initialize_syscalls();
const std::initializer_list<const ppu_static_module*> registered
{
&ppu_module_manager::cellAdec,

View File

@ -62,12 +62,14 @@ extern std::string ppu_get_syscall_name(u64 code);
static constexpr ppu_function_t null_func = nullptr;
std::array<ppu_function_t, 1024> g_ppu_syscall_table{};
// UNS = Unused
// ROOT = Root
// DBG = Debug
// PM = Product Mode
// AuthID = Authentication ID
std::array<ppu_function_t, 1024> g_ppu_syscall_table
const std::array<ppu_function_t, 1024> s_ppu_syscall_table
{
null_func,
BIND_FUNC(sys_process_getpid), //1 (0x001)
@ -986,6 +988,11 @@ void fmt_class_string<CellError>::format(std::string& out, u64 arg)
});
}
extern void ppu_initialize_syscalls()
{
g_ppu_syscall_table = s_ppu_syscall_table;
}
extern void ppu_execute_syscall(ppu_thread& ppu, u64 code)
{
if (code < g_ppu_syscall_table.size())