Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.1
openucx
openucx-s390x-support.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File openucx-s390x-support.patch of Package openucx
commit c4261cb194ce2f87c564c22f5cb795f33fce6f5f Author: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com> Date: Thu Aug 9 07:41:24 2018 +0200 openucx s390x support Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com> diff --git src/ucs/Makefile.am src/ucs/Makefile.am index 74edce424728..43a50e893f77 100644 --- src/ucs/Makefile.am +++ src/ucs/Makefile.am @@ -53,6 +53,8 @@ noinst_HEADERS = \ arch/generic/cpu.h \ arch/ppc64/bitops.h \ arch/ppc64/cpu.h \ + arch/s390x/bitops.h \ + arch/s390x/cpu.h \ arch/x86_64/atomic.h \ arch/x86_64/bitops.h \ arch/x86_64/cpu.h \ diff --git src/ucs/arch/atomic.h src/ucs/arch/atomic.h index 7649971b407b..7bb2bc36c483 100644 --- src/ucs/arch/atomic.h +++ src/ucs/arch/atomic.h @@ -15,6 +15,8 @@ # include "generic/atomic.h" #elif defined(__aarch64__) # include "generic/atomic.h" +#elif defined(__s390x__) +# include "generic/atomic.h" #else # error "Unsupported architecture" #endif diff --git src/ucs/arch/bitops.h src/ucs/arch/bitops.h index f4dd3ab45964..de53bde0d33f 100644 --- src/ucs/arch/bitops.h +++ src/ucs/arch/bitops.h @@ -14,6 +14,8 @@ # include "ppc64/bitops.h" #elif defined(__aarch64__) # include "aarch64/bitops.h" +#elif defined(__s390x__) +# include "s390x/bitops.h" #else # error "Unsupported architecture" #endif diff --git src/ucs/arch/cpu.h src/ucs/arch/cpu.h index 1c362bc92fba..14172218e24c 100644 --- src/ucs/arch/cpu.h +++ src/ucs/arch/cpu.h @@ -56,6 +56,8 @@ typedef enum ucs_cpu_flag { # include "ppc64/cpu.h" #elif defined(__aarch64__) # include "aarch64/cpu.h" +#elif defined(__s390x__) +# include "s390x/cpu.h" #else # error "Unsupported architecture" #endif diff --git src/ucs/arch/s390x/bitops.h src/ucs/arch/s390x/bitops.h new file mode 100644 index 000000000000..39ad125107e9 --- /dev/null +++ src/ucs/arch/s390x/bitops.h @@ -0,0 +1,32 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2015. ALL RIGHTS RESERVED. +* +* See file LICENSE for terms. +*/ + +#ifndef UCS_S390X_BITOPS_H_ +#define UCS_S390X_BITOPS_H_ + +#include <stdint.h> + + +static inline unsigned __ucs_ilog2_u32(uint32_t n) +{ + if (!n) + return 0; + return 31 - __builtin_clz(n); +} + +static inline unsigned __ucs_ilog2_u64(uint64_t n) +{ + if (!n) + return 0; + return 63 - __builtin_clz(n); +} + +static inline unsigned ucs_ffs64(uint64_t n) +{ + return __ucs_ilog2_u64(n & -n); +} + +#endif diff --git src/ucs/arch/s390x/cpu.h src/ucs/arch/s390x/cpu.h new file mode 100644 index 000000000000..f5131ea30a8f --- /dev/null +++ src/ucs/arch/s390x/cpu.h @@ -0,0 +1,51 @@ +/** +* Copyright (C) Mellanox Technologies Ltd. 2001-2013. ALL RIGHTS RESERVED. +* Copyright (C) ARM Ltd. 2016-2017. ALL RIGHTS RESERVED. +* +* See file LICENSE for terms. +*/ + + +#ifndef UCS_S390X_CPU_H_ +#define UCS_S390X_CPU_H_ + +#include <ucs/sys/compiler.h> +#include <ucs/arch/generic/cpu.h> +#include <stdint.h> + + +#define UCS_ARCH_CACHE_LINE_SIZE 256 + +/* Assume the worst - weak memory ordering */ +#define ucs_memory_bus_fence() asm volatile (""::: "memory") +#define ucs_memory_bus_store_fence() ucs_memory_bus_fence() +#define ucs_memory_bus_load_fence() ucs_memory_bus_fence() +#define ucs_memory_cpu_fence() ucs_memory_bus_fence() +#define ucs_memory_cpu_store_fence() ucs_memory_bus_fence() +#define ucs_memory_cpu_load_fence() ucs_memory_bus_fence() + + +static inline uint64_t ucs_arch_read_hres_clock() +{ + unsigned long clk; + asm volatile("stck %0" : "=Q" (clk) : : "cc"); + return clk >> 2; +} +#define ucs_arch_get_clocks_per_sec ucs_arch_generic_get_clocks_per_sec + + +static inline ucs_cpu_model_t ucs_arch_get_cpu_model() +{ + return UCS_CPU_MODEL_UNKNOWN; +} + +static inline int ucs_arch_get_cpu_flag() +{ + return UCS_CPU_FLAG_UNKNOWN; +} + +double ucs_arch_get_clocks_per_sec(); + +#define ucs_arch_wait_mem ucs_arch_generic_wait_mem + +#endif
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor