Commit ebcc369f authored by Heiko Carstens's avatar Heiko Carstens
Browse files

s390: Use MARCH_HAS_*_FEATURES defines



Replace CONFIG_HAVE_MARCH_*_FEATURES with MARCH_HAS_*_FEATURES
everywhere so code gets compiled correctly depending on if the
target is the kernel or the decompressor.

Reviewed-by: default avatarSven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 697b3737
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#define _ASM_S390_ARCH_HWEIGHT_H

#include <linux/types.h>
#include <asm/march.h>

static __always_inline unsigned long popcnt_z196(unsigned long w)
{
@@ -29,9 +30,9 @@ static __always_inline unsigned long popcnt_z15(unsigned long w)

static __always_inline unsigned long __arch_hweight64(__u64 w)
{
	if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES))
	if (__is_defined(MARCH_HAS_Z15_FEATURES))
		return popcnt_z15(w);
	if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) {
	if (__is_defined(MARCH_HAS_Z196_FEATURES)) {
		w = popcnt_z196(w);
		w += w >> 32;
		w += w >> 16;
@@ -43,9 +44,9 @@ static __always_inline unsigned long __arch_hweight64(__u64 w)

static __always_inline unsigned int __arch_hweight32(unsigned int w)
{
	if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES))
	if (__is_defined(MARCH_HAS_Z15_FEATURES))
		return popcnt_z15(w);
	if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) {
	if (__is_defined(MARCH_HAS_Z196_FEATURES)) {
		w = popcnt_z196(w);
		w += w >> 16;
		w += w >> 8;
@@ -56,9 +57,9 @@ static __always_inline unsigned int __arch_hweight32(unsigned int w)

static __always_inline unsigned int __arch_hweight16(unsigned int w)
{
	if (IS_ENABLED(CONFIG_HAVE_MARCH_Z15_FEATURES))
	if (__is_defined(MARCH_HAS_Z15_FEATURES))
		return popcnt_z15((unsigned short)w);
	if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES)) {
	if (__is_defined(MARCH_HAS_Z196_FEATURES)) {
		w = popcnt_z196(w);
		w += w >> 8;
		return w & 0xff;
@@ -68,7 +69,7 @@ static __always_inline unsigned int __arch_hweight16(unsigned int w)

static __always_inline unsigned int __arch_hweight8(unsigned int w)
{
	if (IS_ENABLED(CONFIG_HAVE_MARCH_Z196_FEATURES))
	if (__is_defined(MARCH_HAS_Z196_FEATURES))
		return popcnt_z196((unsigned char)w);
	return __sw_hweight8(w);
}
+4 −3
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
#define __ARCH_S390_ATOMIC_OPS__

#include <linux/limits.h>
#include <asm/march.h>

static __always_inline int __atomic_read(const atomic_t *v)
{
@@ -56,7 +57,7 @@ static __always_inline void __atomic64_set(atomic64_t *v, s64 i)
	}
}

#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
#ifdef MARCH_HAS_Z196_FEATURES

#define __ATOMIC_OP(op_name, op_type, op_string, op_barrier)		\
static __always_inline op_type op_name(op_type val, op_type *ptr)	\
@@ -107,7 +108,7 @@ __ATOMIC_CONST_OPS(__atomic64_add_const, long, "agsi")
#undef __ATOMIC_CONST_OPS
#undef __ATOMIC_CONST_OP

#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
#else /* MARCH_HAS_Z196_FEATURES */

#define __ATOMIC_OP(op_name, op_string)					\
static __always_inline int op_name(int val, int *ptr)			\
@@ -166,7 +167,7 @@ __ATOMIC64_OPS(__atomic64_xor, "xgr")
#define __atomic64_add_const(val, ptr)		__atomic64_add(val, ptr)
#define __atomic64_add_const_barrier(val, ptr)	__atomic64_add(val, ptr)

#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
#endif /* MARCH_HAS_Z196_FEATURES */

static __always_inline int __atomic_cmpxchg(int *ptr, int old, int new)
{
+3 −1
Original line number Diff line number Diff line
@@ -8,13 +8,15 @@
#ifndef __ASM_BARRIER_H
#define __ASM_BARRIER_H

#include <asm/march.h>

/*
 * Force strict CPU ordering.
 * And yes, this is required on UP too when we're talking
 * to devices.
 */

#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
#ifdef MARCH_HAS_Z196_FEATURES
/* Fast-BCR without checkpoint synchronization */
#define __ASM_BCR_SERIALIZE "bcr 14,0\n"
#else
+4 −3
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

#include <linux/preempt.h>
#include <asm/cmpxchg.h>
#include <asm/march.h>

/*
 * s390 uses its own implementation for per cpu data, the offset of
@@ -50,7 +51,7 @@
#define this_cpu_or_1(pcp, val)		arch_this_cpu_to_op_simple(pcp, val, |)
#define this_cpu_or_2(pcp, val)		arch_this_cpu_to_op_simple(pcp, val, |)

#ifndef CONFIG_HAVE_MARCH_Z196_FEATURES
#ifndef MARCH_HAS_Z196_FEATURES

#define this_cpu_add_4(pcp, val)	arch_this_cpu_to_op_simple(pcp, val, +)
#define this_cpu_add_8(pcp, val)	arch_this_cpu_to_op_simple(pcp, val, +)
@@ -61,7 +62,7 @@
#define this_cpu_or_4(pcp, val)		arch_this_cpu_to_op_simple(pcp, val, |)
#define this_cpu_or_8(pcp, val)		arch_this_cpu_to_op_simple(pcp, val, |)

#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
#else /* MARCH_HAS_Z196_FEATURES */

#define arch_this_cpu_add(pcp, val, op1, op2, szcast)			\
{									\
@@ -129,7 +130,7 @@
#define this_cpu_or_4(pcp, val)		arch_this_cpu_to_op(pcp, val, "lao")
#define this_cpu_or_8(pcp, val)		arch_this_cpu_to_op(pcp, val, "laog")

#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
#endif /* MARCH_HAS_Z196_FEATURES */

#define arch_this_cpu_cmpxchg(pcp, oval, nval)				\
({									\
+4 −3
Original line number Diff line number Diff line
@@ -5,8 +5,9 @@
#include <asm/current.h>
#include <linux/thread_info.h>
#include <asm/atomic_ops.h>
#include <asm/march.h>

#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
#ifdef MARCH_HAS_Z196_FEATURES

/* We use the MSB mostly because its available */
#define PREEMPT_NEED_RESCHED	0x80000000
@@ -75,7 +76,7 @@ static __always_inline bool should_resched(int preempt_offset)
			preempt_offset);
}

#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
#else /* MARCH_HAS_Z196_FEATURES */

#define PREEMPT_ENABLED	(0)

@@ -123,7 +124,7 @@ static __always_inline bool should_resched(int preempt_offset)
			tif_need_resched());
}

#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
#endif /* MARCH_HAS_Z196_FEATURES */

#define init_task_preempt_count(p)	do { } while (0)
/* Deferred to CPU bringup time */
Loading