Virtual registers (guest_shm.h)

The guest_shm.h public header file includes definitions for guests using the shmem vdev.

GUEST_SHM_*

Synopsis:

#define GUEST_SHM_MAX_CLIENTS	16
#define GUEST_SHM_MAX_NAME	32
#define GUEST_SHM_SIGNATURE 0x4d534732474d5651

Data:

The GUEST_SHM_* constants include the following:

GUEST_SHM_MAX_CLIENTS
Maximum number of clients allowed to connect to a shared memory region (16)
GUEST_SHM_MAX_NAME
Maximum length allowed for region name, in bytes (32)
GUEST_SHM_SIGNATURE
Signature value to verify that vdev is present (0x4d534732474d5651)

guest_shm_control

Register layout for a region control page

Synopsis:

struct guest_shm_control {
	uint32_t		status;
	uint32_t		idx;
	uint32_t		notify;
	uint32_t		detach;
	};

Data:

The members of guest_shm_control include:

status
Read only. Lower 16 bits: pending notification bitset; upper 16 bits: current active clients (see guest_shm_status below).
idx
Read only. Connection index for this client.
notify
Write a bitset of clients to notify.
detach
Write here to detach your client from the shared memory region.

guest_shm_factory

Register layout for shared memory factory page registers

Synopsis:

struct guest_shm_factory {
	uint64_t		signature;
	uint64_t		shmem;
	uint32_t		vector;
	uint32_t		status;
	uint32_t		size;
	char			name[GUEST_SHM_MAX_NAME];
	uint32_t		find;
	};

Data:

The members of guest_shm_factory include:

signature
Read only. Is GUEST_SHM_SIGNATURE (see GUEST_SHM_* above).
shmem
Read only. The location of the shared memory in guest-physical memory.
vector
Read only. The interrupt number for this shared memory region.
status
Read only. The status of the last creation attempt (see guest_shm_status above).
size
The size of the requested named shared memory region, in multiples of 4 KB pages. A write with this value creates a shared memory region, if the region with the specified name and size doesn't already exist.
char
The name of the shared memory region.
find
Find an existing shared memory connection.

guest_shm_status

Status of last request to create the named shared memory region

Synopsis:

enum guest_shm_status {
	GSS_OK,
	GSS_UNKNOWN_FAILURE,
	GSS_NOMEM,
	GSS_CLIENT_MAX,
	GSS_ILLEGAL_NAME,
	GSS_NO_PERMISSION,
	GSS_DOES_NOT_EXIST,
	};

Data:

The guest_shm_status definition includes the following:

GSS_OK
The region was successfully created.
GSS_UNKNOWN_FAILURE
The region creation failed; the reason for the failure isn't known.
GSS_NOMEM
There was insufficinet memory to create the region.
GSS_CLIENT_MAX
Unable to connect to the region because the region is already being used by the maximum permitted number of guests.
GSS_ILLEGAL_NAME
The region creation failed because the name used for the region is illegal.
GSS_NO_PERMISSION
The region creation failed because the process attempting to create it has insufficient permissions.
GSS_DOES_NOT_EXIST
An attempt to find a named shared memory region failed.

PCI_VID_*

Vendor IDs

Synopsis:

#define PCI_VID_BlackBerry_QNX    0x1C05						
#define PCI_DID_QNX_GUEST_SHM    0x0001