1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Netronome Systems, Inc.
6 #ifndef __NFP_RTSYM_H__
7 #define __NFP_RTSYM_H__
9 #define NFP_RTSYM_TYPE_NONE 0
10 #define NFP_RTSYM_TYPE_OBJECT 1
11 #define NFP_RTSYM_TYPE_FUNCTION 2
12 #define NFP_RTSYM_TYPE_ABS 3
14 #define NFP_RTSYM_TARGET_NONE 0
15 #define NFP_RTSYM_TARGET_LMEM -1
16 #define NFP_RTSYM_TARGET_EMU_CACHE -7
19 * Structure describing a run-time NFP symbol.
21 * The memory target of the symbol is generally the CPP target number and can be
22 * used directly by the nfp_cpp API calls. However, in some cases (i.e., for
23 * local memory or control store) the target is encoded using a negative number.
25 * When the target type can not be used to fully describe the location of a
26 * symbol the domain field is used to further specify the location (i.e., the
27 * specific ME or island number).
29 * For ME target resources, 'domain' is an MEID.
30 * For Island target resources, 'domain' is an island ID, with the one exception
31 * of "sram" symbols for backward compatibility, which are viewed as global.
42 struct nfp_rtsym_table;
44 struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp);
46 struct nfp_rtsym_table *
47 __nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip);
49 int nfp_rtsym_count(struct nfp_rtsym_table *rtbl);
51 const struct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx);
53 const struct nfp_rtsym *
54 nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name);
56 uint64_t nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name,
59 nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
60 unsigned int min_size, struct nfp_cpp_area **area);