diff mbox series

[kvm-unit-tests,v3,1/2] s390x: cleanup and add SCLP defines

Message ID 20181217133854.19752-2-david@redhat.com (mailing list archive)
State New, archived
Headers show
Series s390x: try !FORCE SCLP read SCP info if FORCED is unknown | expand

Commit Message

David Hildenbrand Dec. 17, 2018, 1:38 p.m. UTC
Reading the Linux kernel SCLP code, one might wonder what certain magic
values mean and why we don't have to set them in our SCLP code. So
let's define them for us. We might want to make use of them in the
future.

Add two new defines for values used in the linux kernel
- SCLP_FC_SINGLE_INCREMENT_ASSIGN (used to speed up memory hotplug)
- SCLP_FC_DUMP_INDICATOR (used to get more reasonable dumps)

Also rename SCLP_VARIABLE_LENGTH_RESPONSE to
SCLP_CM2_VARIABLE_LENGTH_RESPONSE, so it is clear where this is actually
used. Move the defines to separate sections.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 lib/s390x/sclp.h | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Janosch Frank Dec. 17, 2018, 2:34 p.m. UTC | #1
On 17.12.18 14:38, David Hildenbrand wrote:
> Reading the Linux kernel SCLP code, one might wonder what certain magic
> values mean and why we don't have to set them in our SCLP code. So
> let's define them for us. We might want to make use of them in the
> future.
> 
> Add two new defines for values used in the linux kernel
> - SCLP_FC_SINGLE_INCREMENT_ASSIGN (used to speed up memory hotplug)
> - SCLP_FC_DUMP_INDICATOR (used to get more reasonable dumps)
> 
> Also rename SCLP_VARIABLE_LENGTH_RESPONSE to
> SCLP_CM2_VARIABLE_LENGTH_RESPONSE, so it is clear where this is actually
> used. Move the defines to separate sections.

LGTM
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>

> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  lib/s390x/sclp.h | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/s390x/sclp.h b/lib/s390x/sclp.h
> index 21d482b..629e9e2 100644
> --- a/lib/s390x/sclp.h
> +++ b/lib/s390x/sclp.h
> @@ -68,14 +68,19 @@
>  #define SCLP_RC_EVENT_BUFFER_SYNTAX_ERROR       0x73f0
>  #define SCLP_RC_INVALID_MASK_LENGTH             0x74f0
>  
> -/* Service Call Control Block (SCCB) and its elements */
> +/* SCLP control mask bits */
> +#define SCLP_CM2_VARIABLE_LENGTH_RESPONSE       0x80
>  
> -#define SCCB_SIZE 4096
> +/* SCLP function codes */
> +#define SCLP_FC_NORMAL_WRITE                    0
> +#define SCLP_FC_SINGLE_INCREMENT_ASSIGN         0x40
> +#define SCLP_FC_DUMP_INDICATOR                  0x80
>  
> -#define SCLP_VARIABLE_LENGTH_RESPONSE           0x80
> +/* SCLP event buffer flags */
>  #define SCLP_EVENT_BUFFER_ACCEPTED              0x80
>  
> -#define SCLP_FC_NORMAL_WRITE                    0
> +/* Service Call Control Block (SCCB) and its elements */
> +#define SCCB_SIZE 4096
>  
>  typedef struct SCCBHeader {
>      uint16_t length;
>
diff mbox series

Patch

diff --git a/lib/s390x/sclp.h b/lib/s390x/sclp.h
index 21d482b..629e9e2 100644
--- a/lib/s390x/sclp.h
+++ b/lib/s390x/sclp.h
@@ -68,14 +68,19 @@ 
 #define SCLP_RC_EVENT_BUFFER_SYNTAX_ERROR       0x73f0
 #define SCLP_RC_INVALID_MASK_LENGTH             0x74f0
 
-/* Service Call Control Block (SCCB) and its elements */
+/* SCLP control mask bits */
+#define SCLP_CM2_VARIABLE_LENGTH_RESPONSE       0x80
 
-#define SCCB_SIZE 4096
+/* SCLP function codes */
+#define SCLP_FC_NORMAL_WRITE                    0
+#define SCLP_FC_SINGLE_INCREMENT_ASSIGN         0x40
+#define SCLP_FC_DUMP_INDICATOR                  0x80
 
-#define SCLP_VARIABLE_LENGTH_RESPONSE           0x80
+/* SCLP event buffer flags */
 #define SCLP_EVENT_BUFFER_ACCEPTED              0x80
 
-#define SCLP_FC_NORMAL_WRITE                    0
+/* Service Call Control Block (SCCB) and its elements */
+#define SCCB_SIZE 4096
 
 typedef struct SCCBHeader {
     uint16_t length;