aboutsummaryrefslogtreecommitdiffstats
path: root/csource
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2015-12-24 14:40:46 +0100
committerDmitry Vyukov <dvyukov@google.com>2015-12-24 19:13:08 +0100
commitaf4e0c0b7a9556fd09c544bb2d8431764118b373 (patch)
treea10f6e5ec5b8b2ea7e59977857a1329f4ed5abbb /csource
parent4961230857a28aa346c62266ae633861c3c17290 (diff)
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.
Diffstat (limited to 'csource')
-rw-r--r--csource/csource.go5
1 files changed, 2 insertions, 3 deletions
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")