Skip to content

Commit

Permalink
rsc_table_parser: Do not expose internal-only functions
Browse files Browse the repository at this point in the history
These functions are only used within rsc_table_parser. These should be
only available there and made static. This prevents them from becoming
part of the API.

Signed-off-by: Andrew Davis <afd@ti.com>
  • Loading branch information
glneo authored and arnopo committed Apr 2, 2024
1 parent 15b4a8b commit d6b3604
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 35 deletions.
31 changes: 0 additions & 31 deletions lib/include/openamp/rsc_table_parser.h
Expand Up @@ -14,11 +14,6 @@
extern "C" {
#endif

#define RSC_TAB_SUPPORTED_VERSION 1

/* Standard control request handling. */
typedef int (*rsc_handler)(struct remoteproc *rproc, void *rsc);

/**
* @internal
*
Expand All @@ -37,32 +32,6 @@ int handle_rsc_table(struct remoteproc *rproc,
struct resource_table *rsc_table, size_t len,
struct metal_io_region *io);

/**
* @internal
*
* @brief Carveout resource handler.
*
* @param rproc Pointer to remote remoteproc
* @param rsc Pointer to carveout resource
*
* @return 0 for success, or negative value for failure
*/
int handle_carve_out_rsc(struct remoteproc *rproc, void *rsc);

/**
* @internal
*
* @brief Trace resource handler.
*
* @param rproc Pointer to remote remoteproc
* @param rsc Pointer to trace resource
*
* @return No service error
*/
int handle_trace_rsc(struct remoteproc *rproc, void *rsc);
int handle_vdev_rsc(struct remoteproc *rproc, void *rsc);
int handle_vendor_rsc(struct remoteproc *rproc, void *rsc);

/**
* @internal
*
Expand Down
38 changes: 34 additions & 4 deletions lib/remoteproc/rsc_table_parser.c
Expand Up @@ -10,8 +10,38 @@
#include <metal/utilities.h>
#include <openamp/rsc_table_parser.h>

#define RSC_TAB_SUPPORTED_VERSION 1

/**
* @internal
*
* @brief Carveout resource handler.
*
* @param rproc Pointer to remote remoteproc
* @param rsc Pointer to carveout resource
*
* @return 0 for success, or negative value for failure
*/
static int handle_carve_out_rsc(struct remoteproc *rproc, void *rsc);

/**
* @internal
*
* @brief Trace resource handler.
*
* @param rproc Pointer to remote remoteproc
* @param rsc Pointer to trace resource
*
* @return No service error
*/
static int handle_trace_rsc(struct remoteproc *rproc, void *rsc);
static int handle_vdev_rsc(struct remoteproc *rproc, void *rsc);
static int handle_vendor_rsc(struct remoteproc *rproc, void *rsc);
static int handle_dummy_rsc(struct remoteproc *rproc, void *rsc);

/* Standard control request handling. */
typedef int (*rsc_handler)(struct remoteproc *rproc, void *rsc);

/* Resources handler */
static const rsc_handler rsc_handler_table[] = {
handle_carve_out_rsc, /**< carved out resource */
Expand Down Expand Up @@ -76,7 +106,7 @@ int handle_rsc_table(struct remoteproc *rproc,
return status;
}

int handle_carve_out_rsc(struct remoteproc *rproc, void *rsc)
static int handle_carve_out_rsc(struct remoteproc *rproc, void *rsc)
{
struct fw_rsc_carveout *carve_rsc = rsc;
metal_phys_addr_t da;
Expand All @@ -102,7 +132,7 @@ int handle_carve_out_rsc(struct remoteproc *rproc, void *rsc)
return -RPROC_EINVAL;
}

int handle_vendor_rsc(struct remoteproc *rproc, void *rsc)
static int handle_vendor_rsc(struct remoteproc *rproc, void *rsc)
{
if (rproc && rproc->ops->handle_rsc) {
struct fw_rsc_vendor *vend_rsc = rsc;
Expand All @@ -113,7 +143,7 @@ int handle_vendor_rsc(struct remoteproc *rproc, void *rsc)
return -RPROC_ERR_RSC_TAB_NS;
}

int handle_vdev_rsc(struct remoteproc *rproc, void *rsc)
static int handle_vdev_rsc(struct remoteproc *rproc, void *rsc)
{
struct fw_rsc_vdev *vdev_rsc = rsc;
int i, num_vrings;
Expand Down Expand Up @@ -157,7 +187,7 @@ int handle_vdev_rsc(struct remoteproc *rproc, void *rsc)
return -RPROC_ERR_RSC_TAB_NP;
}

int handle_trace_rsc(struct remoteproc *rproc, void *rsc)
static int handle_trace_rsc(struct remoteproc *rproc, void *rsc)
{
struct fw_rsc_trace *vdev_rsc = rsc;
(void)rproc;
Expand Down

0 comments on commit d6b3604

Please sign in to comment.