mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 04:38:03 +00:00
s390/sclp: Convert to use flag output macros
Use flag output macros in inline asm to allow for better code generation if the compiler has support for the flag output constraint. Reviewed-by: Juergen Christ <jchrist@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
cd5e5a3723
commit
6816e2124d
@ -14,6 +14,7 @@
|
||||
#include <asm/asm-extable.h>
|
||||
#include <asm/sclp.h>
|
||||
#include <asm/ebcdic.h>
|
||||
#include <asm/asm.h>
|
||||
|
||||
/* maximum number of pages concerning our own memory management */
|
||||
#define MAX_KMEM_PAGES (sizeof(unsigned long) << 3)
|
||||
@ -325,19 +326,22 @@ struct read_info_sccb * __init sclp_early_get_info(void);
|
||||
/* Perform service call. Return 0 on success, non-zero otherwise. */
|
||||
static inline int sclp_service_call(sclp_cmdw_t command, void *sccb)
|
||||
{
|
||||
int cc = 4; /* Initialize for program check handling */
|
||||
int cc, exception;
|
||||
|
||||
exception = 1;
|
||||
asm volatile(
|
||||
"0: .insn rre,0xb2200000,%1,%2\n" /* servc %1,%2 */
|
||||
"1: ipm %0\n"
|
||||
" srl %0,28\n"
|
||||
"0: .insn rre,0xb2200000,%[cmd],%[sccb]\n" /* servc */
|
||||
"1: lhi %[exc],0\n"
|
||||
"2:\n"
|
||||
CC_IPM(cc)
|
||||
EX_TABLE(0b, 2b)
|
||||
EX_TABLE(1b, 2b)
|
||||
: "+&d" (cc) : "d" (command), "a" (__pa(sccb))
|
||||
: "cc", "memory");
|
||||
if (cc == 4)
|
||||
: CC_OUT(cc, cc), [exc] "+d" (exception)
|
||||
: [cmd] "d" (command), [sccb] "a" (__pa(sccb))
|
||||
: CC_CLOBBER_LIST("memory"));
|
||||
if (exception)
|
||||
return -EINVAL;
|
||||
cc = CC_TRANSFORM(cc);
|
||||
if (cc == 3)
|
||||
return -EIO;
|
||||
if (cc == 2)
|
||||
|
Loading…
Reference in New Issue
Block a user