Skip to content

Commit

Permalink
[S390] Move stfle to header file.
Browse files Browse the repository at this point in the history
stfle will be needed by the ap_bus module to figure out wether the AP
queue adapter interruption facility is installed.

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 Dec 25, 2008
1 parent ca9fc75 commit 320c04c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
20 changes: 18 additions & 2 deletions arch/s390/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define __ASM_SYSTEM_H

#include <linux/kernel.h>
#include <linux/errno.h>
#include <asm/types.h>
#include <asm/ptrace.h>
#include <asm/setup.h>
Expand Down Expand Up @@ -413,8 +414,6 @@ __set_psw_mask(unsigned long mask)
#define local_mcck_enable() __set_psw_mask(psw_kernel_bits)
#define local_mcck_disable() __set_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK)

int stfle(unsigned long long *list, int doublewords);

#ifdef CONFIG_SMP

extern void smp_ctl_set_bit(int cr, int bit);
Expand All @@ -438,6 +437,23 @@ static inline unsigned int stfl(void)
return S390_lowcore.stfl_fac_list;
}

static inline int __stfle(unsigned long long *list, int doublewords)
{
typedef struct { unsigned long long _[doublewords]; } addrtype;
register unsigned long __nr asm("0") = doublewords - 1;

asm volatile(".insn s,0xb2b00000,%0" /* stfle */
: "=m" (*(addrtype *) list), "+d" (__nr) : : "cc");
return __nr + 1;
}

static inline int stfle(unsigned long long *list, int doublewords)
{
if (!(stfl() & (1UL << 24)))
return -EOPNOTSUPP;
return __stfle(list, doublewords);
}

static inline unsigned short stap(void)
{
unsigned short cpu_address;
Expand Down
17 changes: 0 additions & 17 deletions arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,23 +651,6 @@ setup_memory(void)
#endif
}

static int __init __stfle(unsigned long long *list, int doublewords)
{
typedef struct { unsigned long long _[doublewords]; } addrtype;
register unsigned long __nr asm("0") = doublewords - 1;

asm volatile(".insn s,0xb2b00000,%0" /* stfle */
: "=m" (*(addrtype *) list), "+d" (__nr) : : "cc");
return __nr + 1;
}

int __init stfle(unsigned long long *list, int doublewords)
{
if (!(stfl() & (1UL << 24)))
return -EOPNOTSUPP;
return __stfle(list, doublewords);
}

/*
* Setup hardware capabilities.
*/
Expand Down

0 comments on commit 320c04c

Please sign in to comment.