User manual
78
space identifier returned in the previous call to create_io_space procedure (see above), and
the chapi_in descriptor.
4.6 Disconnecting I/O space
The operation of disconnecting (additional) I/O space belongs to the class of operations
previously called “Access to device control and status registers”. Such an operation is
initiated by the device instance. The CHARON core is defined as a target of the operation.
Such kind of operation required in case when more than 1 device uses the same address
range depending on some runtime conditions and space should be
disconnected/connected again periodically at runtime.
In order to perform the operation, the initiator invokes a routine identified by the
disconnect_io_space field of the chapi_in descriptor. The initiator is to provide an I/O space
identifier in the sid argument. The procedure is invoked as follows:
io_space_id_t sid = …;
const chapi_in * ci = …;
if (ci->disconnect_io_space) {
ci->disconnect_io_space(ci, sid);
}
The example above shows that the CHARON core is not obliged to support the indicated
operation. But nevertheless it is guaranteed that the CHARON core does either support
both the connect_io_space and the disconnect_io_space procedures, or does not support any
of them. Also, it gives a clue why the device instance is supposed to remember the I/O
space identifier returned in the previous call to create_io_space procedure (see above), and
the chapi_in descriptor.
4.7 Connecting I/O space
The operation of connecting (additional) I/O space bus location belongs to the class of
operations previously called “Access to device control and status registers”. Such an
operation is initiated by the device instance when it is in the execution context
synchronized to the CPU instruction interpretation thread. The CHARON core is defined
as the target of the operation. Such kind of operation required in case when more than 1
device uses the same address range depending on some runtime conditions and space
should be disconnected/connected again periodically at runtime.
In order to perform the operation, the initiator invokes a routine identified by the
connect_io_space field of the chapi_in descriptor. The initiator is to provide an I/O space
identifier in the sid argument and bus location of the I/O space in the addr and the len
arguments. The combination of the addr and the len shall meet the following requirements:
• The length of the address range indicated by the len must be a power of two. Or
more formally:
(len & (len - 1)) == 0










