1 /*
2 * Copyright (c) 2020 Texas Instruments Incorporated - https://www.ti.com
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * * Neither the name of Texas Instruments Incorporated nor the names of
16 * its contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 */
33 #ifndef __RPMSG_CHAR_INTERNAL_H__
34 #define __RPMSG_CHAR_INTERNAL_H__
36 #include <rproc_id.h>
38 #if defined(__cplusplus)
39 extern "C" {
40 #endif
42 struct rproc_map {
43 enum rproc_id id;
44 char *rproc_name;
45 };
47 struct soc_rprocs {
48 int num_rprocs;
49 const struct rproc_map *map;
50 };
52 /* soc.c */
53 int _rpmsg_char_find_soc_family(const char *soc_name, struct soc_rprocs *soc);
55 /* utils.c */
56 char *find_child_dir_by_name(DIR *parent, char *child_name);
57 int get_child_dir_suffix(char *fpath, const char *child_name_pattern,
58 unsigned int *suffix);
59 char *str_join(const char *fmt, ...);
60 int file_read_string(char *fpath, char *buf, int size);
61 int file_read_value(char *fpath);
62 int check_dir(char *dirpath);
63 char *file_deref_link(char *fpath, char *link_name);
65 #if defined(__cplusplus)
66 }
67 #endif
69 #endif