Change-Id: I4cc14eba43fde75a7702fdc7ad07d3d949e9c092
This commit is contained in:
Jean-Baptiste Queru
2012-02-01 09:46:08 -08:00
399 changed files with 33 additions and 16293 deletions

View File

@@ -31,7 +31,7 @@ print "bionic_root is %s" % bionic_root
bionic_temp = "/tmp/bionic_gensyscalls/"
# all architectures, update as you see fit
all_archs = [ "arm", "x86", "sh" ]
all_archs = [ "arm", "x86" ]
def make_dir( path ):
if not os.path.exists(path):
@@ -183,63 +183,6 @@ thumb_call_long = thumb_header + """\
.fnend
"""
# SuperH assembler templates for each syscall stub
#
superh_header = """/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type %(fname)s, @function
.globl %(fname)s
.align 4
%(fname)s:
"""
superh_call_default = """
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(%(numargs)s + 0x10)
/* check return value */
cmp/pz r0
bt %(idname)s_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
%(idname)s_end:
rts
nop
.align 2
0: .long %(idname)s
1: .long __set_syscall_errno
"""
superh_5args_header = """
/* get ready for additonal arg */
mov.l @r15, r0
"""
superh_6args_header = """
/* get ready for additonal arg */
mov.l @r15, r0
mov.l @(4, r15), r1
"""
superh_7args_header = """
/* get ready for additonal arg */
mov.l @r15, r0
mov.l @(4, r15), r1
mov.l @(8, r15), r2
"""
def param_uses_64bits(param):
"""Returns True iff a syscall parameter description corresponds
to a 64-bit type."""
@@ -437,10 +380,6 @@ class State:
E("cid for dispatch syscalls is only supported for x86 in "
"'%s'" % syscall_name)
return
if t["id3"] >= 0:
num_regs = count_generic_param_registers(syscall_params)
t["asm-sh"] = self.superh_genstub(syscall_func,num_regs,"__NR_"+syscall_name)
def gen_NR_syscall(self,fp,name,id):
@@ -490,20 +429,6 @@ class State:
gen_syscalls[sc_name] = True
fp.write( "#endif\n" );
# all superh-specific syscalls
fp.write( "\n#if defined(__SH3__) || defined(__SH4__) \n" );
for sc in self.syscalls:
sc_id = sc["id"]
sc_id2 = sc["id2"]
sc_id3 = sc["id3"]
sc_name = sc["name"]
if sc_id2 != sc_id3 and sc_id3 >= 0:
self.gen_NR_syscall( fp, sc_name, sc_id3 )
else:
if sc_id != sc_id2 and sc_id2 >= 0:
self.gen_NR_syscall( fp, sc_name, sc_id2 )
fp.write( "#endif\n" );
fp.write( "\n#endif\n" )
fp.write( "\n#endif /* _BIONIC_LINUX_SYSCALLS_H_ */\n" );
fp.close()
@@ -520,7 +445,6 @@ class State:
arch_test = {
"arm": lambda x: x.has_key("asm-arm") or x.has_key("asm-thumb"),
"x86": lambda x: x.has_key("asm-x86"),
"sh": lambda x: x.has_key("asm-sh")
}
for sc in self.syscalls:
@@ -557,14 +481,6 @@ class State:
fp.close()
self.new_stubs.append( fname )
if sc.has_key("asm-sh"):
fname = "arch-sh/syscalls/%s.S" % sc["func"]
D2( ">>> generating "+fname )
fp = create_file( fname )
fp.write(sc["asm-sh"])
fp.close()
self.new_stubs.append( fname )
def regenerate(self):
D( "scanning for existing architecture-specific stub files" )