raw1394_start_lock

Name

raw1394_start_lock --  initiate a 32-bit compare-swap lock transaction

Synopsis

int raw1394_start_lock (raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, unsigned int extcode, quadlet_t data, quadlet_t arg, quadlet_t * result, unsigned long tag);

Arguments

handle

libraw1394 handle

node

target node ID

addr

address to read from

extcode

extended transaction code determining the lock operation

data

data part of lock parameters

arg

arg part of lock parameters

result

address where return value will be written

tag

data to identify the request to completion handler

Description

This function starts the specified lock request. The transaction is only started, no success of the transaction is implied with a successful return of this function. When the transaction completes, a raw1394_loop_iterate will call the tag handler and pass it the tag and error code of the transaction. tag should therefore be set to something that uniquely identifies this transaction (e.g. a struct pointer casted to unsigned long).

Returns

0 on success or -1 on failure (sets errno)