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

remoteproc: Un-inline remoteproc_init_mem() and remoteproc_add_mem() #572

Merged
merged 1 commit into from
Apr 9, 2024
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
27 changes: 4 additions & 23 deletions lib/include/openamp/remoteproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,36 +573,17 @@ int remoteproc_remove(struct remoteproc *rproc);
* @param size Memory size
* @param io Pointer to the I/O region
*/
static inline void
remoteproc_init_mem(struct remoteproc_mem *mem, const char *name,
metal_phys_addr_t pa, metal_phys_addr_t da,
size_t size, struct metal_io_region *io)
{
if (!mem || !io || size == 0)
return;
if (name)
strncpy(mem->name, name, sizeof(mem->name));
else
mem->name[0] = 0;
mem->pa = pa;
mem->da = da;
mem->io = io;
mem->size = size;
}
void remoteproc_init_mem(struct remoteproc_mem *mem, const char *name,
metal_phys_addr_t pa, metal_phys_addr_t da,
size_t size, struct metal_io_region *io);

/**
* @brief Add remoteproc memory
*
* @param rproc Pointer to remoteproc
* @param mem Pointer to remoteproc memory
*/
static inline void
remoteproc_add_mem(struct remoteproc *rproc, struct remoteproc_mem *mem)
{
if (!rproc || !mem)
return;
metal_list_add_tail(&rproc->mems, &mem->node);
}
void remoteproc_add_mem(struct remoteproc *rproc, struct remoteproc_mem *mem);

/**
* @brief Get remoteproc memory I/O region with name
Expand Down
23 changes: 23 additions & 0 deletions lib/remoteproc/remoteproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,29 @@ int remoteproc_shutdown(struct remoteproc *rproc)
return ret;
}

void remoteproc_init_mem(struct remoteproc_mem *mem, const char *name,
metal_phys_addr_t pa, metal_phys_addr_t da,
size_t size, struct metal_io_region *io)
{
if (!mem || !io || size == 0)
return;
if (name)
strncpy(mem->name, name, sizeof(mem->name));
else
mem->name[0] = 0;
mem->pa = pa;
mem->da = da;
mem->io = io;
mem->size = size;
}

void remoteproc_add_mem(struct remoteproc *rproc, struct remoteproc_mem *mem)
{
if (!rproc || !mem)
return;
metal_list_add_tail(&rproc->mems, &mem->node);
}

struct metal_io_region *
remoteproc_get_io_with_name(struct remoteproc *rproc,
const char *name)
Expand Down
Loading