diff options
Diffstat (limited to 'src/sim/syscall_desc.hh')
-rw-r--r-- | src/sim/syscall_desc.hh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/sim/syscall_desc.hh b/src/sim/syscall_desc.hh index 0b226438a..8f6e33d89 100644 --- a/src/sim/syscall_desc.hh +++ b/src/sim/syscall_desc.hh @@ -46,13 +46,14 @@ #ifndef __SIM_SYSCALL_DESC_HH__ #define __SIM_SYSCALL_DESC_HH__ +#include <functional> #include <string> #include "base/types.hh" +#include "sim/syscall_return.hh" class Process; class SyscallDesc; -class SyscallReturn; class ThreadContext; SyscallReturn unimplementedFunc(SyscallDesc *desc, int num, @@ -66,15 +67,13 @@ SyscallReturn unimplementedFunc(SyscallDesc *desc, int num, */ class SyscallDesc { public: - /** Typedef the function pointer here to clean up code below */ - typedef SyscallReturn (*SyscallExecutor)(SyscallDesc*, int num, - ThreadContext*); + using SyscallExecutor = + std::function<SyscallReturn(SyscallDesc *, int num, ThreadContext *)>; SyscallDesc(const char *name, - SyscallExecutor sys_exec=unimplementedFunc, int flags=0) + SyscallExecutor sys_exec=unimplementedFunc, int flags=0) : _name(name), executor(sys_exec), _flags(flags), _warned(false) - { - } + {} /** Provide a mechanism to specify behavior for abnormal system calls */ enum Flags { |