User manual
108
In order to perform the operation, the initiator invokes a routine identified by the
get_configured_ram_size field of the chapi_in descriptor. The procedure is invoked as follows:
const chapi_in * ci = …;
if (ci->get_configured_ram_size) {
ci-> get_configured_ram_size (ci);
}
The example above shows that the CHARON core is not obliged to support the indicated
operation. It also shows why the loadable component instance must retain the chapi_in
descriptor.
4.28 Get RAM segment information (CHARON deep integration)
The operation of getting RAM segment information belongs to the class of operations
called “Replacement hardware support requests”, Using this function could require
Stromasys consulting. Such an operation is initiated by the device instance. The CHARON
core is defined as a target of the operation. This operation is commonly used in different
replacement DMA hardware to get required characteristics of RAM segment to map it for
DMA.
In order to perform the operation, the initiator invokes a routine identified by the
get_ram_segment field of the chapi_in descriptor. The initiator provides int the n_of_segment
parameter the number of RAM segment to get information for (numeration is started from
0), in the addr parameter the reference where to store start RAM address of segment and
in the base parameter the reference where to store the pointer to the start host virtual
address of RAM segment. The procedure is invoked as follows:
const chapi_in * ci = …;
unsigned int seg_addr;
char *seg_base;
unsigned int seg_size;
…
// Check required entry in chapi_in structure
if(!ci || !ci->get_ram_segment) {
return;
}
// Process all RAM segments one by one somehow...
int seg_num = 0;
while((seg_size = ci->get_ram_segment(ci, seg_num, seg_addr, seg_base))) {
// Ok, next segment with seg_size bytes length retreived,
// process it somehow and step to the next one while the
// last is retreived.
…
seg_num++;
}










