Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4815ac6 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

s390/headers: replace __s390x__ with CONFIG_64BIT where possible



Replace __s390x__ with CONFIG_64BIT in all places that are not exported
to userspace or guarded with #ifdef __KERNEL__.

Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent da477737
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ extern const char _ni_bitmap[];
extern const char _zb_findmap[];
extern const char _sb_findmap[];

#ifndef __s390x__
#ifndef CONFIG_64BIT

#define __BITOPS_ALIGN		3
#define __BITOPS_WORDSIZE	32
@@ -81,7 +81,7 @@ extern const char _sb_findmap[];
		: "d" (__val), "Q" (*(unsigned long *) __addr)	\
		: "cc");

#else /* __s390x__ */
#else /* CONFIG_64BIT */

#define __BITOPS_ALIGN		7
#define __BITOPS_WORDSIZE	64
@@ -101,7 +101,7 @@ extern const char _sb_findmap[];
		: "d" (__val), "Q" (*(unsigned long *) __addr)	\
		: "cc");

#endif /* __s390x__ */
#endif /* CONFIG_64BIT */

#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE)
#define __BITOPS_BARRIER() asm volatile("" : : : "memory")
@@ -410,7 +410,7 @@ static inline unsigned long __ffz_word_loop(const unsigned long *addr,
	unsigned long bytes = 0;

	asm volatile(
#ifndef __s390x__
#ifndef CONFIG_64BIT
		"	ahi	%1,-1\n"
		"	sra	%1,5\n"
		"	jz	1f\n"
@@ -447,7 +447,7 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr,
	unsigned long bytes = 0;

	asm volatile(
#ifndef __s390x__
#ifndef CONFIG_64BIT
		"	ahi	%1,-1\n"
		"	sra	%1,5\n"
		"	jz	1f\n"
@@ -479,7 +479,7 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr,
 */
static inline unsigned long __ffz_word(unsigned long nr, unsigned long word)
{
#ifdef __s390x__
#ifdef CONFIG_64BIT
	if ((word & 0xffffffff) == 0xffffffff) {
		word >>= 32;
		nr += 32;
@@ -503,7 +503,7 @@ static inline unsigned long __ffz_word(unsigned long nr, unsigned long word)
 */
static inline unsigned long __ffs_word(unsigned long nr, unsigned long word)
{
#ifdef __s390x__
#ifdef CONFIG_64BIT
	if ((word & 0xffffffff) == 0) {
		word >>= 32;
		nr += 32;
@@ -544,7 +544,7 @@ static inline unsigned long __load_ulong_le(const unsigned long *p,
	unsigned long word;

	p = (unsigned long *)((unsigned long) p + offset);
#ifndef __s390x__
#ifndef CONFIG_64BIT
	asm volatile(
		"	ic	%0,%O1(%R1)\n"
		"	icm	%0,2,%O1+1(%R1)\n"
+5 −5
Original line number Diff line number Diff line
@@ -21,15 +21,15 @@ typedef unsigned long long __nocast cputime64_t;

static inline unsigned long __div(unsigned long long n, unsigned long base)
{
#ifndef __s390x__
#ifndef CONFIG_64BIT
	register_pair rp;

	rp.pair = n >> 1;
	asm ("dr %0,%1" : "+d" (rp) : "d" (base >> 1));
	return rp.subreg.odd;
#else /* __s390x__ */
#else /* CONFIG_64BIT */
	return n / base;
#endif /* __s390x__ */
#endif /* CONFIG_64BIT */
}

#define cputime_one_jiffy		jiffies_to_cputime(1)
@@ -100,7 +100,7 @@ static inline void cputime_to_timespec(const cputime_t cputime,
				       struct timespec *value)
{
	unsigned long long __cputime = (__force unsigned long long) cputime;
#ifndef __s390x__
#ifndef CONFIG_64BIT
	register_pair rp;

	rp.pair = __cputime >> 1;
@@ -128,7 +128,7 @@ static inline void cputime_to_timeval(const cputime_t cputime,
				      struct timeval *value)
{
	unsigned long long __cputime = (__force unsigned long long) cputime;
#ifndef __s390x__
#ifndef CONFIG_64BIT
	register_pair rp;

	rp.pair = __cputime >> 1;
+3 −3
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
#ifndef __ASM_CTL_REG_H
#define __ASM_CTL_REG_H

#ifdef __s390x__
#ifdef CONFIG_64BIT

#define __ctl_load(array, low, high) ({				\
	typedef struct { char _[sizeof(array)]; } addrtype;	\
@@ -25,7 +25,7 @@
		: "i" (low), "i" (high));			\
	})

#else /* __s390x__ */
#else /* CONFIG_64BIT */

#define __ctl_load(array, low, high) ({				\
	typedef struct { char _[sizeof(array)]; } addrtype;	\
@@ -43,7 +43,7 @@
		: "i" (low), "i" (high));			\
	})

#endif /* __s390x__ */
#endif /* CONFIG_64BIT */

#define __ctl_set_bit(cr, bit) ({	\
	unsigned long __dummy;		\
+6 −6
Original line number Diff line number Diff line
@@ -107,11 +107,11 @@
/*
 * These are used to set parameters in the core dumps.
 */
#ifndef __s390x__
#ifndef CONFIG_64BIT
#define ELF_CLASS	ELFCLASS32
#else /* __s390x__ */
#else /* CONFIG_64BIT */
#define ELF_CLASS	ELFCLASS64
#endif /* __s390x__ */
#endif /* CONFIG_64BIT */
#define ELF_DATA	ELFDATA2MSB
#define ELF_ARCH	EM_S390

@@ -181,9 +181,9 @@ extern unsigned long elf_hwcap;
extern char elf_platform[];
#define ELF_PLATFORM (elf_platform)

#ifndef __s390x__
#ifndef CONFIG_64BIT
#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
#else /* __s390x__ */
#else /* CONFIG_64BIT */
#define SET_PERSONALITY(ex)					\
do {								\
	if (personality(current->personality) != PER_LINUX32)	\
@@ -194,7 +194,7 @@ do { \
	else							\
		clear_thread_flag(TIF_31BIT);			\
} while (0)
#endif /* __s390x__ */
#endif /* CONFIG_64BIT */

#define STACK_RND_MASK	0x7ffUL

+5 −5
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
#include <asm/cio.h>
#include <asm/uaccess.h>

#ifdef __s390x__
#ifdef CONFIG_64BIT
#define IDA_SIZE_LOG 12 /* 11 for 2k , 12 for 4k */
#else
#define IDA_SIZE_LOG 11 /* 11 for 2k , 12 for 4k */
@@ -33,7 +33,7 @@
static inline int
idal_is_needed(void *vaddr, unsigned int length)
{
#ifdef __s390x__
#ifdef CONFIG_64BIT
	return ((__pa(vaddr) + length - 1) >> 31) != 0;
#else
	return 0;
@@ -78,7 +78,7 @@ static inline unsigned long *idal_create_words(unsigned long *idaws,
static inline int
set_normalized_cda(struct ccw1 * ccw, void *vaddr)
{
#ifdef __s390x__
#ifdef CONFIG_64BIT
	unsigned int nridaws;
	unsigned long *idal;

@@ -105,7 +105,7 @@ set_normalized_cda(struct ccw1 * ccw, void *vaddr)
static inline void
clear_normalized_cda(struct ccw1 * ccw)
{
#ifdef __s390x__
#ifdef CONFIG_64BIT
	if (ccw->flags & CCW_FLAG_IDA) {
		kfree((void *)(unsigned long) ccw->cda);
		ccw->flags &= ~CCW_FLAG_IDA;
@@ -182,7 +182,7 @@ idal_buffer_free(struct idal_buffer *ib)
static inline int
__idal_buffer_is_needed(struct idal_buffer *ib)
{
#ifdef __s390x__
#ifdef CONFIG_64BIT
	return ib->size > (4096ul << ib->page_order) ||
		idal_is_needed(ib->data[0], ib->size);
#else
Loading