summaryrefslogtreecommitdiffstats
path: root/libc/tools
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-10-16 14:27:59 -0700
committerElliott Hughes <enh@google.com>2013-10-16 14:27:59 -0700
commit103ccde8fe2f2c8abde914a8ba736b2e9cb8d20b (patch)
treeb89dd26c065ca696293d554a7998a6593ed8f73b /libc/tools
parent1f29c2f51097b68110bc2766a7c1560d6a8831d0 (diff)
downloadbionic-103ccde8fe2f2c8abde914a8ba736b2e9cb8d20b.zip
bionic-103ccde8fe2f2c8abde914a8ba736b2e9cb8d20b.tar.gz
bionic-103ccde8fe2f2c8abde914a8ba736b2e9cb8d20b.tar.bz2
Sort the syscalls.mk files, give all generated files the same header.
No non-comment changes to the .S files. Change-Id: Iafcfd004c3ea92b64268f80ab16df615b97cefac
Diffstat (limited to 'libc/tools')
-rwxr-xr-xlibc/tools/gensyscalls.py23
1 files changed, 17 insertions, 6 deletions
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 <asm/unistd.h>
#include <linux/err.h>
#include <machine/asm.h>
@@ -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 <asm/unistd.h>
.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()