From 103ccde8fe2f2c8abde914a8ba736b2e9cb8d20b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 16 Oct 2013 14:27:59 -0700 Subject: Sort the syscalls.mk files, give all generated files the same header. No non-comment changes to the .S files. Change-Id: Iafcfd004c3ea92b64268f80ab16df615b97cefac --- libc/tools/gensyscalls.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'libc/tools') diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py index d31af9d..2334e35 100755 --- a/libc/tools/gensyscalls.py +++ b/libc/tools/gensyscalls.py @@ -4,7 +4,14 @@ # the header files listing all available system calls, and the # makefiles used to build all the stubs. -import sys, os.path, glob, re, commands, filecmp, shutil +import commands +import filecmp +import glob +import os.path +import re +import shutil +import stat +import sys from bionic_utils import * @@ -13,6 +20,8 @@ bionic_libc_root = os.environ["ANDROID_BUILD_TOP"] + "/bionic/libc/" # temp directory where we store all intermediate files bionic_temp = "/tmp/bionic_gensyscalls/" +warning = "Generated by gensyscalls.py. Do not edit." + DRY_RUN = False def make_dir(path): @@ -30,7 +39,8 @@ def create_file(relpath): return open(bionic_temp + relpath, "w") -syscall_stub_header = """/* autogenerated by gensyscalls.py */ +syscall_stub_header = "/* " + warning + " */\n" + \ +""" #include #include #include @@ -81,7 +91,8 @@ END(%(func)s) # MIPS assembler templates for each syscall stub # -mips_call = """/* autogenerated by gensyscalls.py */ +mips_call = "/* " + warning + " */\n" + \ +""" #include .text .globl %(func)s @@ -359,7 +370,7 @@ class State: glibc_syscalls_h_path = "include/sys/glibc-syscalls.h" D("generating " + glibc_syscalls_h_path) glibc_fp = create_file(glibc_syscalls_h_path) - glibc_fp.write("/* Auto-generated by gensyscalls.py; do not edit. */\n") + glibc_fp.write("/* %s */\n" % warning) glibc_fp.write("#ifndef _BIONIC_GLIBC_SYSCALLS_H_\n") glibc_fp.write("#define _BIONIC_GLIBC_SYSCALLS_H_\n") @@ -383,9 +394,9 @@ class State: path = "arch-%s/syscalls.mk" % arch D("generating " + path) fp = create_file(path) - fp.write("# Auto-generated by gensyscalls.py. Do not edit.\n") + fp.write("# %s\n" % warning) fp.write("syscall_src :=\n") - for syscall in self.syscalls: + for syscall in sorted(self.syscalls, key=lambda syscall: syscall["func"]): if syscall.has_key("asm-%s" % arch): fp.write("syscall_src += arch-%s/syscalls/%s.S\n" % (arch, syscall["func"])) fp.close() -- cgit v1.1