diff --git a/src/sim/syscall_desc.hh b/src/sim/syscall_desc.hh index 4f1aa1877c..b8d993b333 100644 --- a/src/sim/syscall_desc.hh +++ b/src/sim/syscall_desc.hh @@ -76,6 +76,12 @@ class SyscallDesc { std::string name() { return _name; } + /** + * For use within the system call executor if new threads are created and + * need something returned into them. + */ + virtual void returnInto(ThreadContext *tc, const SyscallReturn &ret) = 0; + protected: using Executor = std::function; @@ -162,6 +168,12 @@ class SyscallDescABI : public SyscallDesc SyscallDescABI(const char *name) : SyscallDescABI(name, ABIExecutor<>(unimplementedFunc)) {} + + void + returnInto(ThreadContext *tc, const SyscallReturn &ret) override + { + GuestABI::Result::store(tc, ret); + } }; #endif // __SIM_SYSCALL_DESC_HH__