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: Harald Freudenberger <freude@linux.ibm.com> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
e45a64975b
commit
159491f3b5
|
@ -221,16 +221,22 @@ static inline struct ap_queue_status ap_aqic(ap_qid_t qid,
|
|||
void *ind)
|
||||
{
|
||||
register unsigned long reg0 asm ("0") = qid | (3UL << 24);
|
||||
register struct ap_qirq_ctrl reg1_in asm ("1") = qirqctrl;
|
||||
register struct ap_queue_status reg1_out asm ("1");
|
||||
register union {
|
||||
unsigned long value;
|
||||
struct ap_qirq_ctrl qirqctrl;
|
||||
struct ap_queue_status status;
|
||||
} reg1 asm ("1");
|
||||
register void *reg2 asm ("2") = ind;
|
||||
|
||||
reg1.qirqctrl = qirqctrl;
|
||||
|
||||
asm volatile(
|
||||
".long 0xb2af0000" /* PQAP(AQIC) */
|
||||
: "=d" (reg1_out)
|
||||
: "d" (reg0), "d" (reg1_in), "d" (reg2)
|
||||
: "+d" (reg1)
|
||||
: "d" (reg0), "d" (reg2)
|
||||
: "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,
|
|||
{
|
||||
register unsigned long reg0 asm ("0") = qid | (5UL << 24)
|
||||
| ((ifbit & 0x01) << 22);
|
||||
register unsigned long reg1_in asm ("1") = apinfo->val;
|
||||
register struct ap_queue_status reg1_out asm ("1");
|
||||
register union {
|
||||
unsigned long value;
|
||||
struct ap_queue_status status;
|
||||
} reg1 asm ("1");
|
||||
register unsigned long reg2 asm ("2");
|
||||
|
||||
reg1.value = apinfo->val;
|
||||
|
||||
asm volatile(
|
||||
".long 0xb2af0000" /* PQAP(QACT) */
|
||||
: "+d" (reg1_in), "=d" (reg1_out), "=d" (reg2)
|
||||
: "+d" (reg1), "=d" (reg2)
|
||||
: "d" (reg0)
|
||||
: "cc");
|
||||
apinfo->val = reg2;
|
||||
return reg1_out;
|
||||
return reg1.status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue