User manual

83
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.4 Enable/disable bus request
The operation of enabling/disabling a bus request belongs to the group of operations
previously called “Request for bus interrupt”. Such an operation is initiated by the device
instance and CHARON core is defined as the target of the operation. Actually the CPU
instruction interpretation thread is supposed to respond to the bus request
enabling/disabling. When particular bus request is disabled it is just ignored by the bus
server when set and processed and the same situation when enabled.
In order to perform the operation, the initiator invokes a routine identified by the
enable_bus_request field of the chapi_in descriptor supplying in the parameter brq_handle the
identifier of bus request to enable/disable and in the parameter enable the type of
operation (true – enable, false - disable). The procedure is invoked as follows:
brq_handle_t brq_handle;
const chapi_in * ci = …;
// Connect bus request to the bus getting brq_handle as in previous example
// Lets assume that some kind of interrupt enable bit is updated for
// the device and (CSR & IE_BIT) give us the new value…
if (ci->enable_bus_request) {
ci->enable_bus_request(ci, brq_handle, CSR & IE_BIT);
}
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.5 Get interrupt vector
The operation of getting 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 get appropriate interrupt vector for the bus server using particular
emulated device interrupt vector these vector can be different, e.g. for the VAX QBUS
system appropriate interrupt vector which should be passed to the bus server is calculated
as <emulated_device_interrupt_vector> + 0x200.
In order to perform the operation, the initiator invokes a routine identified by the get_vector
field of the chapi_in descriptor supplying in the parameter vector the vector in terms of
emulated device. The procedure is invoked as follows:
// The common place to use get_vector routine is bus request