MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / ExportCommonSyscallDefines

Function ExportCommonSyscallDefines

Scripts/GenerateSyscallNumbers.py:225–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223 print("};")
224
225def ExportCommonSyscallDefines():
226 global Definitions_Arm64
227 global SyscallDefinitions
228
229 print("enum FEX_Syscalls_Common {")
230 for Def in Definitions_Arm64:
231 # Check the dict to ensure the definitions exist everywhere
232 if not Def.Name in SyscallDefinitions:
233 continue
234
235 Defs = SyscallDefinitions[Def.Name]
236 if len(Defs) != NumArches:
237 continue
238
239 Number = Def.Number
240 Matches = True
241 for AllDef in Defs:
242 if AllDef.Number != Def.Number:
243 Matches = False
244
245 if not Matches:
246 continue
247
248 for AllDef in Defs:
249 if AllDef.EntryName == "<None>":
250 print(" // {} No entrypoint. -ENOSYS".format(AllDef.Arch))
251
252 print(" SYS_{} = {},".format(Def.Name, Def.Number))
253
254
255 # Find a max between all architectures
256 Maximums = []
257 for Defs in [Definitions_x64, Definitions_x86, Definitions_Arm64]:
258 Maximums.append(1 << (int(math.log(len(Defs), 2)) + 1))
259 print(" SYSCALL_MAX = {},".format(max(Maximums)))
260
261 print("};")
262
263
264def main():

Callers 1

mainFunction · 0.85

Calls 3

printFunction · 0.85
appendMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected