User manual

84
// acknowledge routine which should return correct interrupt vector
// to be used by the bus server…
int brq_ack(void *dev_inst, int arg2) {
my_dev_t *dev = (my_dev_t*)dev_inst;
if (dev->ci->get_vector) {
return dev->ci->get_vector(dev->ci, dev->vector);
}
else {
return dev->vector;
}
}
The example above shows that the CHARON core is not obliged to support the indicated
operation. It also indicates why the device instance should remember the chapi_in
descriptor.
4.9.6 Set interrupt vector
The operation of setting an interrupt vector belongs to the group of operations previously
called “Request for a bus interrupt acknowledge”. Such an operation is initiated by the
device instance and CHARON core is defined as the target of the operation. This routine
should be used to set interrupt vector for particular bus request in case when it is set
programmatically for particular device.
In order to perform the operation, the initiator invokes a routine identified by the
set_brq_vector field of the chapi_in descriptor supplying in the parameter brq_handle the
handle of bus request to set vector for and in the parameter vector the vector in terms of
emulated device. The procedure is invoked as follows:
// The common place to use set_brq_vector routine is writing to device
// register containing BRQ vector for the device
if (dev->ci->set_brq_vector) {
dev->ci->set_brq_vector(dev->ci, brq_handle, REG & REG_VEC_MASK);
}
}
The example above shows that the CHARON core is not obliged to support the indicated
operation. It also indicates why the device instance should remember the chapi_in
descriptor.
4.9.7 Set bus request affinity mask
The operation of setting bus request affinity mask belongs to the group of operations
previously called “Request for bus interrupt”. Such an operation is initiated by the device
instance or CHARON core but only CHARON core is defined as the target of the
operation. This routine has sense only for the case of multi CPU emulated system and
defines bit mask specifying which bus server (CPU) can handle bus request.