Skip to content

Commit

Permalink
[S390] cleanup bitops.h.
Browse files Browse the repository at this point in the history
Encapsulate complete bitops.h with #ifdef __KERNEL__ and remove the now
superfluous ALIGN_CS define and its users.
This patch is needed for compiling klibc.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Jun 29, 2006
1 parent 0a6047e commit c406abd
Showing 1 changed file with 3 additions and 39 deletions.
42 changes: 3 additions & 39 deletions include/asm-s390/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* Copyright (C) 1992, Linus Torvalds
*
*/

#ifdef __KERNEL__

#include <linux/compiler.h>

/*
Expand Down Expand Up @@ -50,19 +53,6 @@
* with operation of the form "set_bit(bitnr, flags)".
*/

/* set ALIGN_CS to 1 if the SMP safe bit operations should
* align the address to 4 byte boundary. It seems to work
* without the alignment.
*/
#ifdef __KERNEL__
#define ALIGN_CS 0
#else
#define ALIGN_CS 1
#ifndef CONFIG_SMP
#error "bitops won't work without CONFIG_SMP"
#endif
#endif

/* bitmap tables from arch/S390/kernel/bitmap.S */
extern const char _oi_bitmap[];
extern const char _ni_bitmap[];
Expand Down Expand Up @@ -121,10 +111,6 @@ static inline void set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
unsigned long addr, old, new, mask;

addr = (unsigned long) ptr;
#if ALIGN_CS == 1
nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
#endif
/* calculate address for CS */
addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
/* make OR mask */
Expand All @@ -141,10 +127,6 @@ static inline void clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
unsigned long addr, old, new, mask;

addr = (unsigned long) ptr;
#if ALIGN_CS == 1
nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
#endif
/* calculate address for CS */
addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
/* make AND mask */
Expand All @@ -161,10 +143,6 @@ static inline void change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
unsigned long addr, old, new, mask;

addr = (unsigned long) ptr;
#if ALIGN_CS == 1
nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
#endif
/* calculate address for CS */
addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
/* make XOR mask */
Expand All @@ -182,10 +160,6 @@ test_and_set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
unsigned long addr, old, new, mask;

addr = (unsigned long) ptr;
#if ALIGN_CS == 1
nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
#endif
/* calculate address for CS */
addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
/* make OR/test mask */
Expand All @@ -205,10 +179,6 @@ test_and_clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
unsigned long addr, old, new, mask;

addr = (unsigned long) ptr;
#if ALIGN_CS == 1
nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
#endif
/* calculate address for CS */
addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
/* make AND/test mask */
Expand All @@ -228,10 +198,6 @@ test_and_change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
unsigned long addr, old, new, mask;

addr = (unsigned long) ptr;
#if ALIGN_CS == 1
nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
#endif
/* calculate address for CS */
addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
/* make XOR/test mask */
Expand Down Expand Up @@ -834,8 +800,6 @@ static inline int sched_find_first_bit(unsigned long *b)

#include <asm-generic/bitops/hweight.h>

#ifdef __KERNEL__

/*
* ATTENTION: intel byte ordering convention for ext2 and minix !!
* bit 0 is the LSB of addr; bit 31 is the MSB of addr;
Expand Down

0 comments on commit c406abd

Please sign in to comment.