From b3d426282cafabd414ded35742b932d508f06782 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 19 Sep 2023 20:13:21 +0300 Subject: [PATCH] syscalls: support identifiers iteration --- src/openpower/syscalls/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openpower/syscalls/__init__.py b/src/openpower/syscalls/__init__.py index 053e45f3..569655d2 100644 --- a/src/openpower/syscalls/__init__.py +++ b/src/openpower/syscalls/__init__.py @@ -54,6 +54,12 @@ class Dispatcher: return super().__init__() + def __iter__(self): + identifiers = sorted(map(int, filter(str.isnumeric, self.__guest))) + for identifier in identifiers: + entry = self.__guest[str(identifier)][1][0] + yield (identifier, entry) + def __getitem__(self, identifier): if not isinstance(identifier, int): raise ValueError(identifier) -- 2.30.2