Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/ap: Extend struct ap_queue_status with some convenience fields

Sometimes there is a different view of the AP status word
needed. So here is slight rework of the struct ap_queue_status
to open up the possibility to have different ways of accessing
the AP status bits and fields.

The new struct ap_queue_status

struct ap_queue_status {
union {
unsigned int value : 32;
struct {
unsigned int status_bits : 8;
unsigned int rc : 8;
unsigned int : 16;
};
struct {
unsigned int queue_empty : 1;
unsigned int replies_waiting : 1;
unsigned int queue_full : 1;
unsigned int : 3;
unsigned int async : 1;
unsigned int irq_enabled : 1;
unsigned int response_code : 8;
unsigned int : 16;
};
};
};

comprises the old struct ap_queue_status but extends it
to have this also accessible as an unsigned int required
for example for a simple print or trace of the whole value.

Note that this rework is fully backward compatible to the
existing code exploiting the struct ap_queue_status.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Anthony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Harald Freudenberger and committed by
Heiko Carstens
7f124d78 507cff24

+22 -8
+22 -8
arch/s390/include/asm/ap.h
··· 38 38 * The ap queue status word is returned by all three AP functions 39 39 * (PQAP, NQAP and DQAP). There's a set of flags in the first 40 40 * byte, followed by a 1 byte response code. 41 + * 42 + * For convenience the 'value' field is a 32 bit access of the 43 + * whole status and the 'status_bits' and 'rc' fields comprise 44 + * the leftmost 8 status bits and the response_code. 41 45 */ 42 46 struct ap_queue_status { 43 - unsigned int queue_empty : 1; 44 - unsigned int replies_waiting : 1; 45 - unsigned int queue_full : 1; 46 - unsigned int : 3; 47 - unsigned int async : 1; 48 - unsigned int irq_enabled : 1; 49 - unsigned int response_code : 8; 50 - unsigned int : 16; 47 + union { 48 + unsigned int value : 32; 49 + struct { 50 + unsigned int status_bits : 8; 51 + unsigned int rc : 8; 52 + unsigned int : 16; 53 + }; 54 + struct { 55 + unsigned int queue_empty : 1; 56 + unsigned int replies_waiting : 1; 57 + unsigned int queue_full : 1; 58 + unsigned int : 3; 59 + unsigned int async : 1; 60 + unsigned int irq_enabled : 1; 61 + unsigned int response_code : 8; 62 + unsigned int : 16; 63 + }; 64 + }; 51 65 }; 52 66 53 67 /*