Lines Matching full:syscall
60 # ARM assembler templates for each syscall stub
99 # Arm64 assembler templates for each syscall stub
116 # MIPS assembler templates for each syscall stub
123 syscall
138 # MIPS64 assembler templates for each syscall stub
145 syscall
166 # x86 assembler templates for each syscall stub
201 # x86_64 assembler templates for each syscall stub
206 syscall
219 """Returns True iff a syscall parameter description corresponds
290 def add_footer(pointer_length, stub, syscall):
291 # Add any aliases for this syscall.
292 aliases = syscall["aliases"]
294 stub += "\nALIAS_SYMBOL(%s, %s)\n" % (alias, syscall["func"])
298 if (pointer_length == 64 and syscall["func"].startswith("__")) or syscall["func"].startswith("___"):
299 stub += '.hidden ' + syscall["func"] + '\n'
304 def arm_eabi_genstub(syscall):
305 num_regs = count_arm_param_registers(syscall["params"])
307 return arm_eabi_call_long % syscall
308 return arm_eabi_call_default % syscall
311 def arm64_genstub(syscall):
312 return arm64_call % syscall
315 def mips_genstub(syscall):
316 return mips_call % syscall
319 def mips64_genstub(syscall):
320 return mips64_call % syscall
323 def x86_genstub(syscall):
324 result = syscall_stub_header % syscall
326 numparams = count_generic_param_registers(syscall["params"])
345 result += x86_call % syscall
350 result += x86_return % syscall
354 def x86_genstub_socketcall(syscall):
356 # syscall (socket, bind, recv, etc)
360 result = syscall_stub_header % syscall
374 result += " mov $%d, %%ebx\n" % syscall["socketcall_id"]
380 # now do the syscall code itself
381 result += x86_call % syscall
388 result += x86_return % syscall
392 def x86_64_genstub(syscall):
393 result = syscall_stub_header % syscall
394 num_regs = count_generic_param_registers64(syscall["params"])
399 result += x86_64_call % syscall
412 """ parse a syscall spec line.
445 # now find if there is a socketcall_id for a dispatch-type syscall
496 E("invalid syscall architecture '%s' in '%s'" % (arch, line))
531 for syscall in self.syscalls:
532 syscall["__NR_name"] = make__NR_name(syscall["name"])
534 if syscall.has_key("arm"):
535 syscall["asm-arm"] = add_footer(32, arm_eabi_genstub(syscall), syscall)
537 if syscall.has_key("arm64"):
538 syscall["asm-arm64"] = add_footer(64, arm64_genstub(syscall), syscall)
540 if syscall.has_key("x86"):
541 if syscall["socketcall_id"] >= 0:
542 syscall["asm-x86"] = add_footer(32, x86_genstub_socketcall(syscall), syscall)
544 syscall["asm-x86"] = add_footer(32, x86_genstub(syscall), syscall)
545 elif syscall["socketcall_id"] >= 0:
549 if syscall.has_key("mips"):
550 syscall["asm-mips"] = add_footer(32, mips_genstub(syscall), syscall)
552 if syscall.has_key("mips64"):
553 syscall["asm-mips64"] = add_footer(64, mips64_genstub(syscall), syscall)
555 if syscall.has_key("x86_64"):
556 syscall["asm-x86_64"] = add_footer(64, x86_64_genstub(syscall), syscall)
567 for syscall in sorted(syscalls):
568 fp.write("#define SYS_%s %s\n" % (syscall, make__NR_name(syscall)))
572 # TODO: generate a separate file for each architecture, like glibc's bits/syscall.h.
597 # Write each syscall stub.
599 for syscall in self.syscalls:
601 if syscall.has_key("asm-%s" % arch):
602 filename = "arch-%s/syscalls/%s.S" % (arch, syscall["func"])
605 fp.write(syscall["asm-%s" % arch])