Skip to content

Commit

Permalink
s390/zcrypt: Add ZAPQ inline function.
Browse files Browse the repository at this point in the history
Added new inline function ap_pqap_zapq()
which is a C inline function wrapper for
the AP PQAP(ZAPQ) instruction.

Signed-off-by: Harald Freudenberger <freude@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Harald Freudenberger authored and Martin Schwidefsky committed Jun 25, 2018
1 parent 7daf201 commit ea3c418
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/s390/crypto/ap_asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,25 @@ static inline struct ap_queue_status ap_rapq(ap_qid_t qid)
return reg1;
}

/**
* ap_pqap_zapq(): Reset and zeroize adjunct processor queue.
* @qid: The AP queue number
*
* Returns AP queue status structure.
*/
static inline struct ap_queue_status ap_zapq(ap_qid_t qid)
{
register unsigned long reg0 asm ("0") = qid | (2UL << 24);
register struct ap_queue_status reg1 asm ("1");

asm volatile(
".long 0xb2af0000" /* PQAP(ZAPQ) */
: "=d" (reg1)
: "d" (reg0)
: "cc");
return reg1;
}

/**
* ap_aqic(): Control interruption for a specific AP.
* @qid: The AP queue number
Expand Down

0 comments on commit ea3c418

Please sign in to comment.