Commit 6816e212 authored by Heiko Carstens's avatar Heiko Carstens
Browse files

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: default avatarJuergen Christ <jchrist@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent cd5e5a37
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -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)