mirror of
https://gitlab.freedesktop.org/xorg/proto/xorgproto.git
synced 2026-05-08 12:28:09 +02:00
Add extended shared memory attach structure
This provides an extended version of `X_ShmAttachFd`, called `X_ShmAttachFdExt`, which allows the client to specify two additional parameters: 1. The size of the mapping, in bytes. 2. The offset that should be passed to `mmap`, in bytes. The intended use-case for this extension is when one needs to map a drawable from a character special device, but it can also be used with regular files if one needs to map with a nonzero offset. Qubes OS needs the X server to map the `/dev/xen/gntdev` character device, which represents memory shared from a different virtual machine. This is currently accomplished with an `LD_PRELOAD`’d shared library that overrides `shmat`, `shmctl`, and `shmdt`, and I have written a version that instead overrides `fstat` and `mmap`. With this extension, the preloaded shared library will not be required. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
parent
ad6412624e
commit
06dd38480f
1 changed files with 16 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ in this Software without prior written authorization from The Open Group.
|
|||
#define X_ShmCreatePixmap 5
|
||||
#define X_ShmAttachFd 6
|
||||
#define X_ShmCreateSegment 7
|
||||
#define X_ShmAttachFdExt 8
|
||||
|
||||
typedef struct _ShmQueryVersion {
|
||||
CARD8 reqType; /* always ShmReqCode */
|
||||
|
|
@ -220,6 +221,21 @@ typedef struct {
|
|||
/* File descriptor is passed with this reply */
|
||||
#define sz_xShmCreateSegmentReply 32
|
||||
|
||||
/* Version 1.3 additions */
|
||||
typedef struct _ShmAttachFdExt {
|
||||
CARD8 reqType; /* always ShmReqCode */
|
||||
CARD8 shmReqType; /* always X_ShmAttachFdExt */
|
||||
CARD16 length;
|
||||
ShmSeg shmseg;
|
||||
BOOL readOnly;
|
||||
BYTE pad0;
|
||||
CARD16 pad1;
|
||||
CARD32 size; /* size of the buffer */
|
||||
CARD64 offset; /* offset to pass to mmap() */
|
||||
} xShmAttachFdExtReq;
|
||||
/* File descriptor is passed with this request */
|
||||
#define sz_xShmAttachFdExtReq 32
|
||||
|
||||
#undef ShmSeg
|
||||
#undef Drawable
|
||||
#undef VisualID
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue