User manual
75
4.CHAPI operation
4.1 Reading the device control and status register
The operation of reading a device control and status register belongs to the class of
operations previously called “Access to device control and status registers”. The CHARON
core initiates such an operation. More precisely, one of the CPU instruction interpretation
threads is the initiator. The device is considered to be a target of the operation.
In order to perform the operation, the initiator invokes a routine identified by the read field
of the chapi_out descriptor. The initiator provides in the addr parameter a bus address of
the register to read from, and in the is_byte parameter the length of the transaction. The
procedure is invoked as follows:
const chapi_out * co = …;
if (co->read) {
val = co->read(co, addr, is_byte);
}
The example above shows that the device is not obliged to support the indicated
operation.
4.2 Writing device control and status register
The operation of writing device control and status register belongs to the class of
operations previously called “Access to device control and status registers”. The CHARON
core initiates such an operation. More precisely, one of the CPU instruction interpretation
threads is the initiator. The device is defined as the target of the operation.
In order to perform the operation, the initiator invokes a routine identified by the write field
of the chapi_out descriptor. The initiator provides in the addr parameter a bus address of
the register to read from, in the val parameter a value to be written, and in the is_byte
parameter the length of the transaction. The procedure is invoked as follows:
const chapi_out * co = …;
if (co->write) {
co->write(co, addr, val, is_byte);
}
The example above shows that the device is not obliged to support the indicated
operation.
4.3 Creating additional I/O space
The operation of creating 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.










