diff options
| -rw-r--r-- | arch/x86/syscalls/Makefile | 9 | ||||
| -rw-r--r-- | scripts/xen-hypercalls.sh | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/syscalls/Makefile b/arch/x86/syscalls/Makefile index 3323c2745248..a55abb9f6c5e 100644 --- a/arch/x86/syscalls/Makefile +++ b/arch/x86/syscalls/Makefile | |||
| @@ -19,6 +19,9 @@ quiet_cmd_syshdr = SYSHDR $@ | |||
| 19 | quiet_cmd_systbl = SYSTBL $@ | 19 | quiet_cmd_systbl = SYSTBL $@ |
| 20 | cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@ | 20 | cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@ |
| 21 | 21 | ||
| 22 | quiet_cmd_hypercalls = HYPERCALLS $@ | ||
| 23 | cmd_hypercalls = $(CONFIG_SHELL) '$<' $@ $(filter-out $<,$^) | ||
| 24 | |||
| 22 | syshdr_abi_unistd_32 := i386 | 25 | syshdr_abi_unistd_32 := i386 |
| 23 | $(uapi)/unistd_32.h: $(syscall32) $(syshdr) | 26 | $(uapi)/unistd_32.h: $(syscall32) $(syshdr) |
| 24 | $(call if_changed,syshdr) | 27 | $(call if_changed,syshdr) |
| @@ -47,10 +50,16 @@ $(out)/syscalls_32.h: $(syscall32) $(systbl) | |||
| 47 | $(out)/syscalls_64.h: $(syscall64) $(systbl) | 50 | $(out)/syscalls_64.h: $(syscall64) $(systbl) |
| 48 | $(call if_changed,systbl) | 51 | $(call if_changed,systbl) |
| 49 | 52 | ||
| 53 | $(out)/xen-hypercalls.h: $(srctree)/scripts/xen-hypercalls.sh | ||
| 54 | $(call if_changed,hypercalls) | ||
| 55 | |||
| 56 | $(out)/xen-hypercalls.h: $(srctree)/include/xen/interface/xen*.h | ||
| 57 | |||
| 50 | uapisyshdr-y += unistd_32.h unistd_64.h unistd_x32.h | 58 | uapisyshdr-y += unistd_32.h unistd_64.h unistd_x32.h |
| 51 | syshdr-y += syscalls_32.h | 59 | syshdr-y += syscalls_32.h |
| 52 | syshdr-$(CONFIG_X86_64) += unistd_32_ia32.h unistd_64_x32.h | 60 | syshdr-$(CONFIG_X86_64) += unistd_32_ia32.h unistd_64_x32.h |
| 53 | syshdr-$(CONFIG_X86_64) += syscalls_64.h | 61 | syshdr-$(CONFIG_X86_64) += syscalls_64.h |
| 62 | syshdr-$(CONFIG_XEN) += xen-hypercalls.h | ||
| 54 | 63 | ||
| 55 | targets += $(uapisyshdr-y) $(syshdr-y) | 64 | targets += $(uapisyshdr-y) $(syshdr-y) |
| 56 | 65 | ||
diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh new file mode 100644 index 000000000000..676d9226814f --- /dev/null +++ b/scripts/xen-hypercalls.sh | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | out="$1" | ||
| 3 | shift | ||
| 4 | in="$@" | ||
| 5 | |||
| 6 | for i in $in; do | ||
| 7 | eval $CPP $LINUXINCLUDE -dD -imacros "$i" -x c /dev/null | ||
| 8 | done | \ | ||
| 9 | awk '$1 == "#define" && $2 ~ /__HYPERVISOR_[a-z][a-z_0-9]*/ { v[$3] = $2 } | ||
| 10 | END { print "/* auto-generated by scripts/xen-hypercall.sh */" | ||
| 11 | for (i in v) if (!(v[i] in v)) | ||
| 12 | print "HYPERCALL("substr(v[i], 14)")"}' | sort -u >$out | ||
