Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function header description consistency #478

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ SEPARATE_MEMBER_PAGES = NO
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.

TAB_SIZE = 4
TAB_SIZE = 8
arnopo marked this conversation as resolved.
Show resolved Hide resolved

# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
Expand Down Expand Up @@ -523,7 +523,7 @@ EXTRACT_PACKAGE = NO
# included in the documentation.
# The default value is: NO.

EXTRACT_STATIC = NO
EXTRACT_STATIC = YES

# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO,
Expand Down
117 changes: 69 additions & 48 deletions lib/include/openamp/elf_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,66 +311,81 @@ struct elf64_info {
extern const struct loader_ops elf_ops;

/**
* elf_identify - check if it is an ELF file
* @internal
*
* @brief Check if it is an ELF file
*
* It will check if the input image header is an ELF header.
*
* @img_data: firmware private data which will be passed to user defined loader
* operations
* @len: firmware header length
* @param img_data Firmware private data which will be passed to user
* defined loader operations
* @param len Firmware header length
*
* return 0 for success or negative value for failure.
* @return 0 for success or negative value for failure.
*/
int elf_identify(const void *img_data, size_t len);

/**
* elf_load_header - Load ELF headers
* @internal
*
* @brief Load ELF headers
*
* It will get the ELF header, the program header, and the section header.
*
* @img_data: image data
* @offset: input image data offset to the start of image file
* @len: input image data length
* @img_info: pointer to store image information data
* @last_load_state: last state return by this function
* @noffset: pointer to next offset required by loading ELF header
* @nlen: pointer to next data length required by loading ELF header
* @param img_data Image data
* @param offset Input image data offset to the start of image
* file
* @param len Input image data length
* @param img_info Pointer to store image information data
* @param last_load_state Last state return by this function
* @param noffset Pointer to next offset required by loading ELF
* header
* @param nlen Pointer to next data length required by loading
* ELF header
*
* return ELF loading header state, or negative value for failure
* @return ELF loading header state, or negative value for failure
*/
int elf_load_header(const void *img_data, size_t offset, size_t len,
void **img_info, int last_load_state,
size_t *noffset, size_t *nlen);

/**
* elf_load - load ELF data
* @internal
*
* @brief Load ELF data
*
* It will parse the ELF image and return the target device address,
* offset to the start of the ELF image of the data to load and the
* length of the data to load.
*
* @rproc: pointer to remoteproc instance
* @img_data: image data which will passed to the function.
* it can be NULL, if image data doesn't need to be handled
* by the load function. E.g. binary data which was
* loaded to the target memory.
* @offset: last loaded image data offset to the start of image file
* @len: last loaded image data length
* @img_info: pointer to store image information data
* @last_load_state: the returned state of the last function call.
* @da: target device address, if the data to load is not for target memory
* the da will be set to ANY.
* @noffset: pointer to next offset required by loading ELF header
* @nlen: pointer to next data length required by loading ELF header
* @padding: value to pad it is possible that a size of a segment in memory
* is larger than what it is in the ELF image. e.g. a segment
* can have stack section .bss. It doesn't need to copy image file
* space, in this case, it will be packed with 0.
* @nmemsize: pointer to next data target memory size. The size of a segment
* in the target memory can be larger than the its size in the
* image file.
* @param rproc Pointer to remoteproc instance
* @param img_data Image data which will passed to the function.
* it can be NULL, if image data doesn't need to
* be handled by the load function. E.g. binary
* data which was loaded to the target memory.
* @param offset Last loaded image data offset to the start of
* image file
* @param len Last loaded image data length
* @param img_info Pointer to store image information data
* @param last_load_state The returned state of the last function call.
* @param da Target device address, if the data to load is
* not for target memory the da will be set to
* ANY.
* @param noffset Pointer to next offset required by loading ELF
* header
* @param nlen Pointer to next data length required by loading
* ELF header
* @param padding Value to pad it is possible that a size of a
* segment in memory is larger than what it is in
* the ELF image. e.g. a segment can have stack
* section .bss. It doesn't need to copy image
* file space, in this case, it will be packed
* with 0.
* @param nmemsize Pointer to next data target memory size. The
* size of a segment in the target memory can be
* larger than the its size in the image file.
*
* return 0 for success, otherwise negative value for failure
* @return 0 for success, otherwise negative value for failure
*/
int elf_load(struct remoteproc *rproc, const void *img_data,
size_t offset, size_t len,
Expand All @@ -380,38 +395,44 @@ int elf_load(struct remoteproc *rproc, const void *img_data,
unsigned char *padding, size_t *nmemsize);

/**
* elf_release - Release ELF image information
* @internal
*
* @brief Release ELF image information
*
* It will release ELF image information data.
*
* @img_info: pointer to ELF image information
* @param img_info Pointer to ELF image information
*/
void elf_release(void *img_info);

/**
* elf_get_entry - Get entry point
* @internal
*
* @brief Get entry point
*
* It will return entry point specified in the ELF file.
*
* @img_info: pointer to ELF image information
* @param img_info Pointer to ELF image information
*
* return entry address
* @return Entry address
*/
metal_phys_addr_t elf_get_entry(void *img_info);

/**
* elf_locate_rsc_table - locate the resource table information
* @internal
*
* @brief Locate the resource table information
*
* It will return the length of the resource table, and the device address of
* the resource table.
*
* @img_info: pointer to ELF image information
* @da: pointer to the device address
* @offset: pointer to the offset to in the ELF image of the resource
* table section.
* @size: pointer to the size of the resource table section.
* @param img_info Pointer to ELF image information
* @param da Pointer to the device address
* @param offset Pointer to the offset to in the ELF image of the
* resource table section.
* @param size Pointer to the size of the resource table section.
*
* return 0 if successfully locate the resource table, negative value for
* @return 0 if successfully locate the resource table, negative value for
* failure.
*/
int elf_locate_rsc_table(void *img_info, metal_phys_addr_t *da,
Expand Down
Loading