From: Kefu Chai Date: Wed, 13 Sep 2017 07:28:08 +0000 (+0800) Subject: crc32c: mach-o 64 follows the same calling convention as elf64 does X-Git-Tag: v13.0.1~880^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=de1cc425be55b3fb8e0a7adc669ae97b97d99367;p=ceph.git crc32c: mach-o 64 follows the same calling convention as elf64 does so reuse the register-parameter/variable mappings Signed-off-by: Kefu Chai --- diff --git a/src/common/crc32c_intel_fast_asm.s b/src/common/crc32c_intel_fast_asm.s index 5c3cd3b197e5d..c9fc1b9d5c161 100644 --- a/src/common/crc32c_intel_fast_asm.s +++ b/src/common/crc32c_intel_fast_asm.s @@ -130,6 +130,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%ifidn __OUTPUT_FORMAT__, elf64 +%define ABI_IS_AMD64 +%elifidn __OUTPUT_FORMAT__, macho64 +%define ABI_IS_AMD64 +%endif + ;;; ISCSI CRC 32 Implementation with crc32 Instruction ;;; unsigned int crc32_iscsi_00(unsigned char * buffer, int len, unsigned int crc_init); @@ -142,7 +148,7 @@ global crc32_iscsi_00:function crc32_iscsi_00: -%ifidn __OUTPUT_FORMAT__, elf64 +%ifdef ABI_IS_AMD64 %define bufp rdi %define bufp_dw edi %define bufp_w di diff --git a/src/common/crc32c_intel_fast_zero_asm.s b/src/common/crc32c_intel_fast_zero_asm.s index ec1b78ffcb27d..e648396392714 100644 --- a/src/common/crc32c_intel_fast_zero_asm.s +++ b/src/common/crc32c_intel_fast_zero_asm.s @@ -130,6 +130,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +%ifidn __OUTPUT_FORMAT__, elf64 +%define ABI_IS_AMD64 +%elifidn __OUTPUT_FORMAT__, macho64 +%define ABI_IS_AMD64 +%endif + ;;; ISCSI CRC 32 Implementation with crc32 Instruction ;;; unsigned int crc32_iscsi_00(unsigned char * buffer, int len, unsigned int crc_init); @@ -142,7 +148,7 @@ global crc32_iscsi_zero_00:function crc32_iscsi_zero_00: -%ifidn __OUTPUT_FORMAT__, elf64 +%ifdef ABI_IS_AMD64 %define bufp rdi %define bufp_dw edi %define bufp_w di