Commit 159491f3 authored by Harald Freudenberger's avatar Harald Freudenberger Committed by Martin Schwidefsky

s390/ap: rework assembler functions to use unions for in/out register variables

The inline assembler functions ap_aqic() and ap_qact() used two
variables declared on the very same register. One variable was for
input only, the other for output. Looks like newer versions of the gcc
don't like this. Anyway it is a better coding to use one variable
(which may have a union data type) on one register for input and
output. So this patch introduces unions and uses only one variable now
for input and output for GR1 for the PQAP(QACT) and PQAP(QIC)
invocation.
Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Acked-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent e45a6497
...@@ -221,16 +221,22 @@ static inline struct ap_queue_status ap_aqic(ap_qid_t qid, ...@@ -221,16 +221,22 @@ static inline struct ap_queue_status ap_aqic(ap_qid_t qid,
void *ind) void *ind)
{ {
register unsigned long reg0 asm ("0") = qid | (3UL << 24); register unsigned long reg0 asm ("0") = qid | (3UL << 24);
register struct ap_qirq_ctrl reg1_in asm ("1") = qirqctrl; register union {
register struct ap_queue_status reg1_out asm ("1"); unsigned long value;
struct ap_qirq_ctrl qirqctrl;
struct ap_queue_status status;
} reg1 asm ("1");
register void *reg2 asm ("2") = ind; register void *reg2 asm ("2") = ind;
reg1.qirqctrl = qirqctrl;
asm volatile( asm volatile(
".long 0xb2af0000" /* PQAP(AQIC) */ ".long 0xb2af0000" /* PQAP(AQIC) */
: "=d" (reg1_out) : "+d" (reg1)
: "d" (reg0), "d" (reg1_in), "d" (reg2) : "d" (reg0), "d" (reg2)
: "cc"); : "cc");
return reg1_out;
return reg1.status;
} }
/* /*
...@@ -264,17 +270,21 @@ static inline struct ap_queue_status ap_qact(ap_qid_t qid, int ifbit, ...@@ -264,17 +270,21 @@ static inline struct ap_queue_status ap_qact(ap_qid_t qid, int ifbit,
{ {
register unsigned long reg0 asm ("0") = qid | (5UL << 24) register unsigned long reg0 asm ("0") = qid | (5UL << 24)
| ((ifbit & 0x01) << 22); | ((ifbit & 0x01) << 22);
register unsigned long reg1_in asm ("1") = apinfo->val; register union {
register struct ap_queue_status reg1_out asm ("1"); unsigned long value;
struct ap_queue_status status;
} reg1 asm ("1");
register unsigned long reg2 asm ("2"); register unsigned long reg2 asm ("2");
reg1.value = apinfo->val;
asm volatile( asm volatile(
".long 0xb2af0000" /* PQAP(QACT) */ ".long 0xb2af0000" /* PQAP(QACT) */
: "+d" (reg1_in), "=d" (reg1_out), "=d" (reg2) : "+d" (reg1), "=d" (reg2)
: "d" (reg0) : "d" (reg0)
: "cc"); : "cc");
apinfo->val = reg2; apinfo->val = reg2;
return reg1_out; return reg1.status;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment