From 1fbae601ad75ffb91c68224868fa6bf4553dc341 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 30 Nov 2023 23:29:18 -0800 Subject: [PATCH] caller.py: implement write syscall --- src/openpower/decoder/isa/caller.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index ae6ade01..205ae888 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -1166,6 +1166,13 @@ class SyscallEmulator(openpower.syscalls.Dispatcher): self.__isacaller.halted = True raise ExitSyscallCalled(status) + def sys_write(self, fd, buf, count, *rest): + buf = self.__isacaller.mem.get_ctypes(buf, count, is_write=False) + try: + return os.write(fd, buf) + except OSError as e: + return -e.errno + class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop): # decoder2 - an instance of power_decoder2 -- 2.30.2