From: Jacob Lifshay Date: Fri, 1 Dec 2023 07:29:18 +0000 (-0800) Subject: caller.py: implement write syscall X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46b65d91b6d43be1bd4531616438f533d220b09e;p=openpower-isa.git caller.py: implement write syscall --- 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