syscalls: introduce syscall arguments length
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 22 Sep 2023 18:30:22 +0000 (21:30 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 22 Dec 2023 19:26:20 +0000 (19:26 +0000)
src/openpower/syscalls/__init__.py

index d89ecdb98a26c4e8c16d433306cbe4c014761547..bf86718d5c380fddc8636eea466619235dd82273 100644 (file)
@@ -33,11 +33,14 @@ class Syscall:
     def host(self):
         return self.__host
 
+    def __len__(self):
+        return len(self.__parameters)
+
     def __repr__(self):
         return f"{self.__class__.__name__}({self.entry} {self.guest}=>{self.host})"
 
     def __call__(self, *arguments):
-        if len(arguments) != len(self.__parameters):
+        if len(arguments) < len(self):
             raise ValueError("conflict between arguments and parameters")
 
         for index in range(len(arguments)):