Skip to content

Commit

Permalink
s390/headers: replace __s390x__ with CONFIG_64BIT where possible
Browse files Browse the repository at this point in the history
Replace __s390x__ with CONFIG_64BIT in all places that are not exported
to userspace or guarded with #ifdef __KERNEL__.

Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
heicarst authored and Martin Schwidefsky committed May 24, 2012
1 parent da47773 commit f4815ac
Show file tree
Hide file tree
Showing 22 changed files with 123 additions and 123 deletions.
16 changes: 8 additions & 8 deletions arch/s390/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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")
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions arch/s390/include/asm/cputime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions arch/s390/include/asm/ctl_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand All @@ -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; \
Expand All @@ -43,7 +43,7 @@
: "i" (low), "i" (high)); \
})

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

#define __ctl_set_bit(cr, bit) ({ \
unsigned long __dummy; \
Expand Down
12 changes: 6 additions & 6 deletions arch/s390/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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) \
Expand All @@ -194,7 +194,7 @@ do { \
else \
clear_thread_flag(TIF_31BIT); \
} while (0)
#endif /* __s390x__ */
#endif /* CONFIG_64BIT */

#define STACK_RND_MASK 0x7ffUL

Expand Down
10 changes: 5 additions & 5 deletions arch/s390/include/asm/idals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static inline int init_new_context(struct task_struct *tsk,

#define destroy_context(mm) do { } while (0)

#ifndef __s390x__
#ifndef CONFIG_64BIT
#define LCTL_OPCODE "lctl"
#else
#define LCTL_OPCODE "lctlg"
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct mod_arch_specific
struct mod_arch_syminfo *syminfo;
};

#ifdef __s390x__
#ifdef CONFIG_64BIT
#define ElfW(x) Elf64_ ## x
#define ELFW(x) ELF64_ ## x
#else
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/percpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* per cpu area, use weak definitions to force the compiler to
* generate external references.
*/
#if defined(CONFIG_SMP) && defined(__s390x__) && defined(MODULE)
#if defined(CONFIG_SMP) && defined(CONFIG_64BIT) && defined(MODULE)
#define ARCH_NEEDS_WEAK_PER_CPU
#endif

Expand Down
6 changes: 3 additions & 3 deletions arch/s390/include/asm/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static inline void crst_table_init(unsigned long *crst, unsigned long entry)
clear_table(crst, entry, sizeof(unsigned long)*2048);
}

#ifndef __s390x__
#ifndef CONFIG_64BIT

static inline unsigned long pgd_entry_type(struct mm_struct *mm)
{
Expand All @@ -64,7 +64,7 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm)
#define pgd_populate(mm, pgd, pud) BUG()
#define pud_populate(mm, pud, pmd) BUG()

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

static inline unsigned long pgd_entry_type(struct mm_struct *mm)
{
Expand Down Expand Up @@ -106,7 +106,7 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
pud_val(*pud) = _REGION3_ENTRY | __pa(pmd);
}

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

static inline pgd_t *pgd_alloc(struct mm_struct *mm)
{
Expand Down
Loading

0 comments on commit f4815ac

Please sign in to comment.