-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apps: Move common function declaration to common header
Several platform_*() functions are common across the example machines. They actually have to be as they are consumed by example apps that build across these machines. Move these common declarations to common a header. Signed-off-by: Andrew Davis <afd@ti.com>
- Loading branch information
Showing
7 changed files
with
90 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright (C) 2024 Texas Instruments, Inc. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#ifndef PLATFORM_INFO_COMMON_H | ||
#define PLATFORM_INFO_COMMON_H | ||
|
||
#include <openamp/remoteproc.h> | ||
#include <openamp/virtio.h> | ||
#include <openamp/rpmsg.h> | ||
|
||
#if defined __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* platform_init - initialize the platform | ||
* | ||
* Initialize the platform. | ||
* | ||
* @argc: number of arguments | ||
* @argv: array of the input arguments | ||
* @platform: pointer to store the platform data pointer | ||
* | ||
* return 0 for success or negative value for failure | ||
*/ | ||
int platform_init(int argc, char *argv[], void **platform); | ||
|
||
/** | ||
* platform_create_rpmsg_vdev - create rpmsg vdev | ||
* | ||
* Create rpmsg virtio device, and return the rpmsg virtio | ||
* device pointer. | ||
* | ||
* @platform: pointer to the private data | ||
* @vdev_index: index of the virtio device, there can more than one vdev | ||
* on the platform. | ||
* @role: virtio driver or virtio device of the vdev | ||
* @rst_cb: virtio device reset callback | ||
* @ns_bind_cb: rpmsg name service bind callback | ||
* | ||
* return pointer to the rpmsg virtio device | ||
*/ | ||
struct rpmsg_device * | ||
platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index, | ||
unsigned int role, | ||
void (*rst_cb)(struct virtio_device *vdev), | ||
rpmsg_ns_bind_cb ns_bind_cb); | ||
|
||
/** | ||
* platform_poll - platform poll function | ||
* | ||
* @platform: pointer to the platform | ||
* | ||
* return negative value for errors, otherwise 0. | ||
*/ | ||
int platform_poll(void *platform); | ||
|
||
/** | ||
* platform_release_rpmsg_vdev - release rpmsg virtio device | ||
* | ||
* @rpdev: pointer to the rpmsg device | ||
*/ | ||
void platform_release_rpmsg_vdev(struct rpmsg_device *rpdev, void *platform); | ||
|
||
/** | ||
* platform_cleanup - clean up the platform resource | ||
* | ||
* @platform: pointer to the platform | ||
*/ | ||
void platform_cleanup(void *platform); | ||
|
||
#if defined __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* PLATFORM_INFO_COMMON_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.