47 uintptr_t p3, uintptr_t p4, uintptr_t p5) {
48 if (function >= serviceEnd) {
49 ERROR(
"PedigreeCSyscallManager: invalid function called: " <<
Dec
50 <<
static_cast<int>(function));
57 uintptr_t p1 = state.getSyscallParameter(0);
58 uintptr_t p2 = state.getSyscallParameter(1);
59 uintptr_t p3 = state.getSyscallParameter(2);
64 switch (state.getSyscallNumber()) {
67 return pedigree_login(
static_cast<int>(p1));
68 case PEDIGREE_LOAD_KEYMAP:
69 return pedigree_load_keymap(
reinterpret_cast<uint32_t*
>(p1), p2);
70 case PEDIGREE_GET_MOUNT:
71 return pedigree_get_mount(
reinterpret_cast<char*
>(p1),
reinterpret_cast<char*
>(p2), p3);
75 case PEDIGREE_MODULE_LOAD:
76 pedigree_module_load(
reinterpret_cast<char*
>(p1));
78 case PEDIGREE_MODULE_UNLOAD: {
80 SYSCALL_ERROR(InvalidArgument);
86 String moduleName(
reinterpret_cast<const char*
>(p1));
87 if (moduleName.
compare(
"pedigree-c")) {
88 SYSCALL_ERROR(DeviceBusy);
92 if (!pedigree_module_unload(
const_cast<char*
>(moduleName.cstr()))) {
93 SYSCALL_ERROR(DeviceBusy);
98 case PEDIGREE_MODULE_IS_LOADED:
99 return pedigree_module_is_loaded(
reinterpret_cast<char*
>(p1));
100 case PEDIGREE_MODULE_GET_DEPENDING:
101 return pedigree_module_get_depending(
reinterpret_cast<char*
>(p1),
reinterpret_cast<char*
>(p2),
103 case PEDIGREE_INPUT_INHIBIT_EVENTS:
104 pedigree_input_inhibit_events(p1);
106 case PEDIGREE_EVENT_RETURN:
107 return pedigree_event_return();
108 case PEDIGREE_SYS_REQUEST_MEM:
109 return reinterpret_cast<uintptr_t
>(pedigree_sys_request_mem(p1));
110 case PEDIGREE_HALTFS:
114 ERROR(
"PedigreeCSyscallManager: invalid syscall received: " <<
Dec
115 << state.getSyscallNumber());
virtual uintptr_t syscall(Service_t service, uintptr_t function, uintptr_t p1=0, uintptr_t p2=0, uintptr_t p3=0, uintptr_t p4=0, uintptr_t p5=0)=0