Skip to contentSkip to conversation

build: Rename as-insn-check to as-option-add

PATCH In review Andrew Cooper 3 participants 3 messages Feb 23, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 build: Rename as-insn-check to as-option-add

as-insn-check mutates the passed-in flags. Rename it to as-option-add, in line with cc-option-add, and update all callers.

---
CC: George Dunlap <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

v2:
* Choose as-option-add as the name

---
 Config.mk             |  8 ++++----
 xen/arch/x86/Rules.mk | 14 +++++++-------
 2 files changed, 11 insertions(+), 11 deletions(-)
Config.mk +4 -4
index c6f0df9..ab05286 100644
@@ -163,11 +163,11 @@ as-insn = $(if $(shell echo 'void _(void) { asm volatile ( $(2) ); }' \
                        | $(filter-out -M% %.d -include %/include/xen/config.h,$(1)) \
                               -c -x c -o /dev/null - 2>&1),$(4),$(3))
 
-# as-insn-check: Add an option to compilation flags, but only if insn is
+# as-option-add: Add an option to compilation flags, but only if insn is
 #                supported by assembler.
-# Usage: $(call as-insn-check,CFLAGS,CC,"nop",-DHAVE_GAS_NOP)
-as-insn-check = $(eval $(call as-insn-check-closure,$(1),$(2),$(3),$(4)))
-define as-insn-check-closure
+# Usage: $(call as-option-add,CFLAGS,CC,"insn",option-yes)
+as-option-add = $(eval $(call as-option-add-closure,$(1),$(2),$(3),$(4)))
+define as-option-add-closure
     ifeq ($$(call as-insn,$$($(2)) $$($(1)),$(3),y,n),y)
         $(1) += $(4)
     endif
xen/arch/x86/Rules.mk +7 -7
index 1dc5c37..4561713 100644
@@ -14,13 +14,13 @@ CFLAGS += -msoft-float
 
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
-$(call as-insn-check,CFLAGS,CC,"vmcall",-DHAVE_GAS_VMX)
-$(call as-insn-check,CFLAGS,CC,"crc32 %eax$$(comma)%eax",-DHAVE_GAS_SSE4_2)
-$(call as-insn-check,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_GAS_EPT)
-$(call as-insn-check,CFLAGS,CC,"rdrand %eax",-DHAVE_GAS_RDRAND)
-$(call as-insn-check,CFLAGS,CC,"rdfsbase %rax",-DHAVE_GAS_FSGSBASE)
-$(call as-insn-check,CFLAGS,CC,"rdseed %eax",-DHAVE_GAS_RDSEED)
-$(call as-insn-check,CFLAGS,CC,".equ \"x\"$$(comma)1", \
+$(call as-option-add,CFLAGS,CC,"vmcall",-DHAVE_GAS_VMX)
+$(call as-option-add,CFLAGS,CC,"crc32 %eax$$(comma)%eax",-DHAVE_GAS_SSE4_2)
+$(call as-option-add,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_GAS_EPT)
+$(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_GAS_RDRAND)
+$(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_GAS_FSGSBASE)
+$(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_GAS_RDSEED)
+$(call as-option-add,CFLAGS,CC,".equ \"x\"$$(comma)1", \
                      -U__OBJECT_LABEL__ -DHAVE_GAS_QUOTED_SYM \
                      '-D__OBJECT_LABEL__=$(subst $(BASEDIR)/,,$(CURDIR))/$$@')
 
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v2 1/1
#1 lore raw
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 23.02.18 at 14:10, <[email protected]> wrote:

as-insn-check mutates the passed-in flags. Rename it to as-option-add, in line with cc-option-add, and update all callers.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v2 1/1
#2 lore raw
In reply to Andrew Cooper
Quoted 4 lines · Andrew Cooper

as-insn-check mutates the passed-in flags. Rename it to as-option-add, in line with cc-option-add, and update all callers.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel