1 /* 2 * Copyright (c) 2014, Mentor Graphics Corporation 3 * All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 #ifndef RSC_TABLE_PARSER_H 9 #define RSC_TABLE_PARSER_H 10 11 #include <openamp/remoteproc.h> 12 13 #if defined __cplusplus 14 extern "C" { 15 #endif 16 17 /** 18 * @internal 19 * 20 * @brief This function parses resource table. 21 * 22 * @param rproc Pointer to remote remoteproc 23 * @param rsc_table Resource table to parse 24 * @param len Size of rsc table 25 * @param io Pointer to the resource table I/O region 26 * It can be NULL if the resource table 27 * is in the local memory. 28 * 29 * @return Execution status 30 */ 31 int handle_rsc_table(struct remoteproc *rproc, 32 struct resource_table *rsc_table, size_t len, 33 struct metal_io_region *io); 34 35 /** 36 * @internal 37 * 38 * @brief Find out location of a resource type in the resource table. 39 * 40 * @param rsc_table Pointer to the resource table 41 * @param rsc_type Type of the resource 42 * @param index Index of the resource of the specified type 43 * 44 * @return The offset to the resource on success, or 0 on failure 45 */ 46 size_t find_rsc(void *rsc_table, unsigned int rsc_type, unsigned int index); 47 48 #if defined __cplusplus 49 } 50 #endif 51 52 #endif /* RSC_TABLE_PARSER_H */ 53