Module Name:    src
Committed By:   jdolecek
Date:           Tue Apr 21 14:51:07 UTC 2020

Modified Files:
        src/sys/arch/xen/include: xenring.h

Log Message:
add blkif_x86_{32,64}_request_indirect types


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xenring.h
diff -u src/sys/arch/xen/include/xenring.h:1.4 src/sys/arch/xen/include/xenring.h:1.5
--- src/sys/arch/xen/include/xenring.h:1.4	Sun Apr  7 12:23:54 2019
+++ src/sys/arch/xen/include/xenring.h	Tue Apr 21 14:51:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: xenring.h,v 1.4 2019/04/07 12:23:54 bouyer Exp $ */
+/* $NetBSD: xenring.h,v 1.5 2020/04/21 14:51:06 jdolecek Exp $ */
 
 /*
  * Glue goop for xbd ring request/response protocol structures.
@@ -51,6 +51,19 @@ struct blkif_x86_32_response {
 } __packed;
 typedef struct blkif_x86_32_response blkif_x86_32_response_t;
 
+struct blkif_x86_32_request_indirect {
+    uint8_t        operation;    /* BLKIF_OP_INDIRECT                    */
+    uint8_t        indirect_op;  /* BLKIF_OP_{READ/WRITE}                */
+    uint16_t       nr_segments;  /* number of segments                   */
+    uint64_t       id;		 /* private guest value, echoed in resp  */
+    blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+    blkif_vdev_t   handle;       /* only for read/write requests         */
+    uint16_t	   _pad2;
+    grant_ref_t    indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST];
+    uint64_t       _pad3;	 /* make it 64 byte aligned */
+} __packed;
+typedef struct blkif_x86_32_request_indirect blkif_x86_32_request_indirect_t;
+
 /* amd64-type requests/responses (always used in frontends ) */
 
 struct blkif_x86_64_request {
@@ -70,6 +83,25 @@ struct blkif_x86_64_response {
 };
 typedef struct blkif_x86_64_response blkif_x86_64_response_t;
 
+struct blkif_x86_64_request_indirect {
+    uint8_t        operation;    /* BLKIF_OP_INDIRECT                    */
+    uint8_t        indirect_op;  /* BLKIF_OP_{READ/WRITE}                */
+    uint16_t       nr_segments;  /* number of segments                   */
+    uint32_t       _pad1;
+    uint64_t       id;           /* private guest value, echoed in resp  */
+    blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+    blkif_vdev_t   handle;       /* only for read/write requests         */
+    uint16_t	   _pad2;
+    grant_ref_t    indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST];
+    uint32_t       _pad3;	 /* make it 64 byte aligned */
+} __packed;
+typedef struct blkif_x86_64_request_indirect blkif_x86_64_request_indirect_t;
+
+CTASSERT(sizeof(struct blkif_x86_32_request_indirect)
+	== sizeof(struct blkif_x86_64_request_indirect));
+CTASSERT(sizeof(struct blkif_request_indirect)
+	== sizeof(struct blkif_x86_64_request_indirect));
+
 DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, struct blkif_x86_32_response);
 DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, struct blkif_x86_64_response);
 

Reply via email to