20 #include "SyscallManager.h" 21 #include "pedigree/kernel/LockGuard.h" 22 #include "pedigree/kernel/compiler.h" 23 #include "pedigree/kernel/processor/Processor.h" 40 if (
UNLIKELY(pHandler != 0 && m_pHandler[Service] != 0))
42 if (
UNLIKELY(pHandler == 0 && m_pHandler[Service] == 0))
45 m_pHandler[Service] = pHandler;
52 size_t serviceNumber = syscallState.getSyscallService();
54 if (
UNLIKELY(serviceNumber >= serviceEnd))
63 pHandler = m_Instance.m_pHandler[serviceNumber];
68 syscallState.setSyscallReturnValue(pHandler->
syscall(syscallState));
69 syscallState.setSyscallErrno(
75 NOTICE(
"Unwind state exit, in interrupt handler");
86 Service_t service, uintptr_t
function, uintptr_t p1, uintptr_t p2,
87 uintptr_t p3, uintptr_t p4, uintptr_t p5)
103 for (
size_t i = 0; i < serviceEnd; i++)
static EXPORTED_PUBLIC SyscallManager & instance()
static HostedSyscallManager & instance()
static void initialiseProcessor() INITIALISATION_ONLY
static HostedSyscallManager m_Instance
virtual uintptr_t syscall(SyscallState &State)=0
virtual bool registerSyscallHandler(Service_t Service, SyscallHandler *pHandler)
static ProcessorInformation & information()
HostedSyscallManager() INITIALISATION_ONLY
virtual ~HostedSyscallManager()
SyscallHandler * m_pHandler[serviceEnd]
uintptr_t syscall(Service_t service, uintptr_t function, uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4, uintptr_t p5)