4.7.2 Image_loadDataRead() callback

The callee of image_loadDataPull(), the consumer, calls this function on the caller of image_loadDataPull(), the client, to retrieve a chunk of data. The consumer determines the read position and the size of each chunk.

Consumers should not use this function for fine-grain parsing, for example to parse a symbol table, symbol by symbol. The function call overhead should not become significant, even for IPC connections, so very small chunks should not be used. On the other hand, very large chunks should also not be used, because they block the IPC connection for the transfer of a single block. The chunk size should be between 100KB and 10MB, typically around 1MB.

On reaching the end of the file, the client returns fewer bytes than requested, possibly zero bytes, and returns E_ok. Reading past the end of the file is not treated as an E_io_error.

The client can return E_operation_interrupted if a user interrupted or canceled loading a large image. The implementation of image_loadData() should then stop calling image_loadDataRead() and should return E_operation_interrupted.

If a read error occurs, for example an error from the host OS while reading a file, the client returns E_io_error. Since a function can either return an error code or a result object, therefore it does not return ImageReadResult nor any bytes. The implementation of image_loadData() should then stop calling image_loadDataRead() and should return E_io_error.

Non-ConfidentialPDF file icon PDF version101196_0100_00_en
Copyright © 2018 Arm Limited or its affiliates. All rights reserved.