aboutsummaryrefslogtreecommitdiffstats
path: root/sysgen
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-01-25 11:05:21 +0100
committerDmitry Vyukov <dvyukov@google.com>2016-01-25 11:06:30 +0100
commitb5f1cae8dd3f19faff3ff122020f98aa6f28916c (patch)
tree84838c1104d9ec573c158afeac9fe5dcc82aec92 /sysgen
parent71c8a60fee3cd389849444d84fe95fa0d90f0d57 (diff)
sysgen: use __ppc64__ || __PPC64__ || __powerpc64__ to detect ppc
Different macros are defined by different compilers...
Diffstat (limited to 'sysgen')
-rw-r--r--sysgen/syscallnr.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/sysgen/syscallnr.go b/sysgen/syscallnr.go
index 6fd6a4254..10017be35 100644
--- a/sysgen/syscallnr.go
+++ b/sysgen/syscallnr.go
@@ -12,16 +12,16 @@ import (
type Arch struct {
GOARCH string
- CARCH string
+ CARCH []string
KernelHeaderArch string
KernelInclude string
Numbers []int
}
var archs = []*Arch{
- {"amd64", "__x86_64__", "x86", "asm/unistd.h", nil},
- {"arm64", "__aarch64__", "arm64", "asm/unistd.h", nil},
- {"ppc64le", "__ppc64__", "powerpc", "asm/unistd.h", nil},
+ {"amd64", []string{"__x86_64__"}, "x86", "asm/unistd.h", nil},
+ {"arm64", []string{"__aarch64__"}, "arm64", "asm/unistd.h", nil},
+ {"ppc64le", []string{"__ppc64__", "__PPC64__", "__powerpc64__"}, "powerpc", "asm/unistd.h", nil},
}
var syzkalls = map[string]int{
@@ -95,7 +95,7 @@ type SyscallsData struct {
}
type ArchData struct {
- CARCH string
+ CARCH []string
Calls []SyscallData
}
@@ -130,7 +130,7 @@ struct call_t {
};
{{range $arch := $.Archs}}
-#ifdef {{$arch.CARCH}}
+#if {{range $cdef := $arch.CARCH}}defined({{$cdef}}) || {{end}}0
call_t syscalls[] = {
{{range $c := $arch.Calls}} {"{{$c.Name}}", {{$c.NR}}},
{{end}}