diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2011-02-03 12:19:04 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-02-14 14:16:17 -0500 |
commit | bdc612dc6903c4ea06e40d02f84ad5e25d93459d (patch) | |
tree | f7f3e3272b21ae3c6015e86f9c1f7be31534704d /include/xen/gntalloc.h | |
parent | dd3140588d9551235ebc2a0dacdca098e7677573 (diff) |
xen/gntalloc,gntdev: Add unmap notify ioctl
This ioctl allows the users of a shared page to be notified when
the other end exits abnormally.
[v2: updated description in structs]
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'include/xen/gntalloc.h')
-rw-r--r-- | include/xen/gntalloc.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/xen/gntalloc.h b/include/xen/gntalloc.h index bc3b85e8bff7..76bd58065f4f 100644 --- a/include/xen/gntalloc.h +++ b/include/xen/gntalloc.h | |||
@@ -47,4 +47,36 @@ struct ioctl_gntalloc_dealloc_gref { | |||
47 | /* Number of references to unmap */ | 47 | /* Number of references to unmap */ |
48 | uint32_t count; | 48 | uint32_t count; |
49 | }; | 49 | }; |
50 | |||
51 | /* | ||
52 | * Sets up an unmap notification within the page, so that the other side can do | ||
53 | * cleanup if this side crashes. Required to implement cross-domain robust | ||
54 | * mutexes or close notification on communication channels. | ||
55 | * | ||
56 | * Each mapped page only supports one notification; multiple calls referring to | ||
57 | * the same page overwrite the previous notification. You must clear the | ||
58 | * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it | ||
59 | * to occur. | ||
60 | */ | ||
61 | #define IOCTL_GNTALLOC_SET_UNMAP_NOTIFY \ | ||
62 | _IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntalloc_unmap_notify)) | ||
63 | struct ioctl_gntalloc_unmap_notify { | ||
64 | /* IN parameters */ | ||
65 | /* Offset in the file descriptor for a byte within the page (same as | ||
66 | * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to | ||
67 | * be cleared. Otherwise, it can be any byte in the page whose | ||
68 | * notification we are adjusting. | ||
69 | */ | ||
70 | uint64_t index; | ||
71 | /* Action(s) to take on unmap */ | ||
72 | uint32_t action; | ||
73 | /* Event channel to notify */ | ||
74 | uint32_t event_channel_port; | ||
75 | }; | ||
76 | |||
77 | /* Clear (set to zero) the byte specified by index */ | ||
78 | #define UNMAP_NOTIFY_CLEAR_BYTE 0x1 | ||
79 | /* Send an interrupt on the indicated event channel */ | ||
80 | #define UNMAP_NOTIFY_SEND_EVENT 0x2 | ||
81 | |||
50 | #endif /* __LINUX_PUBLIC_GNTALLOC_H__ */ | 82 | #endif /* __LINUX_PUBLIC_GNTALLOC_H__ */ |