aboutsummaryrefslogtreecommitdiffstats
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
parent71c8a60fee3cd389849444d84fe95fa0d90f0d57 (diff)
sysgen: use __ppc64__ || __PPC64__ || __powerpc64__ to detect ppc
Different macros are defined by different compilers...
-rw-r--r--executor/syscalls.h6
-rw-r--r--sysgen/syscallnr.go12
2 files changed, 9 insertions, 9 deletions
diff --git a/executor/syscalls.h b/executor/syscalls.h
index 28817ea5a..dd9479c93 100644
--- a/executor/syscalls.h
+++ b/executor/syscalls.h
@@ -12,7 +12,7 @@ struct call_t {
};
-#ifdef __x86_64__
+#if defined(__x86_64__) || 0
call_t syscalls[] = {
{"open", 2},
{"open$dir", 2},
@@ -978,7 +978,7 @@ call_t syscalls[] = {
};
#endif
-#ifdef __aarch64__
+#if defined(__aarch64__) || 0
call_t syscalls[] = {
{"open", -1},
{"open$dir", -1},
@@ -1944,7 +1944,7 @@ call_t syscalls[] = {
};
#endif
-#ifdef __ppc64__
+#if defined(__ppc64__) || defined(__PPC64__) || defined(__powerpc64__) || 0
call_t syscalls[] = {
{"open", 5},
{"open$dir", 5},
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}}