From af4e0c0b7a9556fd09c544bb2d8431764118b373 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 24 Dec 2015 14:40:46 +0100 Subject: sysgen: pull in syscall numbers from kernel headers Syscall numbers for different architectures are now pulled in from kernel headers. This solves 2 problems: - we don't need to hardcode numbers for new syscalls (that don't present in typical distro headers) - we have correct number for different archs (previously hardcoded numbers were for x86_64) This also makes syscall numbers available for Go code, which can be useful. --- csource/csource.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'csource') diff --git a/csource/csource.go b/csource/csource.go index 01d2152d5..7a65f5b0d 100644 --- a/csource/csource.go +++ b/csource/csource.go @@ -37,13 +37,12 @@ func Write(p *prog.Prog, opts Options) []byte { handled := make(map[string]bool) for _, c := range p.Calls { name := c.Meta.CallName - nr, ok := prog.NewSyscalls[name] - if !ok || handled[name] { + if handled[name] { continue } handled[name] = true fmt.Fprintf(w, "#ifndef SYS_%v\n", name) - fmt.Fprintf(w, "#define SYS_%v %v\n", name, nr) + fmt.Fprintf(w, "#define SYS_%v %v\n", name, c.Meta.NR) fmt.Fprintf(w, "#endif\n") } fmt.Fprintf(w, "\n") -- cgit mrf-deployment