NAME

vme_read_modify_write - Performs a read/modify/write cycle on the VMEbus.

SYNOPSIS

int vme_read_modify_write ( vme_bus_handle_t bus_handle, vme_master_handle_t window_handle, size_t offset, int dw, uint64_t mask, uint64_t cmp, uint64_t swap )

PARAMETERS

vme_bus_handle_t bus_handle

Handle allocated by vme_init.

vme_master_handle_t window_handle

Window handle allocated by vme_master_window_create.

size_t offset

Offset from the window base.

int dw

Access data width. Possbile values are:

- VME_D8
- VME_D16
- VME_D32
uint64_t mask

Mask of bits to be compared.

uint64_t cmp

Bit value to compare the read value against.

uint64_t swap

Bit values to write to bits that compared true.

DESCRIPTION

Performs a read/modify/write cycle on the VMEbus. The cycle is performed by reading a value from the VMEbus and bitwise-comparing the masked values (true/false) with the contents of cmp. All true bits are swapped with the contents of the swap register.

RETURNS

0 on success, or -1 on failure.

SEE ALSO

vme_master_window_create(3), vme_master_window_release(3)