/** * nfp_rtsym_count() - Get the number of RTSYM descriptors * @rtbl: NFP RTsym table * * Return: Number of RTSYM descriptors
*/ int nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
{ if (!rtbl) return -EINVAL; return rtbl->num;
}
/** * nfp_rtsym_get() - Get the Nth RTSYM descriptor * @rtbl: NFP RTsym table * @idx: Index (0-based) of the RTSYM descriptor * * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
*/ conststruct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
{ if (!rtbl) return NULL; if (idx >= rtbl->num) return NULL;
return &rtbl->symtab[idx];
}
/** * nfp_rtsym_lookup() - Return the RTSYM descriptor for a symbol name * @rtbl: NFP RTsym table * @name: Symbol name * * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
*/ conststruct nfp_rtsym *
nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, constchar *name)
{ int n;
if (!rtbl) return NULL;
for (n = 0; n < rtbl->num; n++) if (strcmp(name, rtbl->symtab[n].name) == 0) return &rtbl->symtab[n];
return NULL;
}
u64 nfp_rtsym_size(conststruct nfp_rtsym *sym)
{ switch (sym->type) { case NFP_RTSYM_TYPE_NONE:
pr_err("rtsym '%s': type NONE\n", sym->name); return0; default:
pr_warn("rtsym '%s': unknown type: %d\n", sym->name, sym->type);
fallthrough; case NFP_RTSYM_TYPE_OBJECT: case NFP_RTSYM_TYPE_FUNCTION: return sym->size; case NFP_RTSYM_TYPE_ABS: returnsizeof(u64);
}
}
/** * nfp_rtsym_read_le() - Read a simple unsigned scalar value from symbol * @rtbl: NFP RTsym table * @name: Symbol name * @error: Poniter to error code (optional) * * Lookup a symbol, map, read it and return it's value. Value of the symbol * will be interpreted as a simple little-endian unsigned value. Symbol can * be 4 or 8 bytes in size. * * Return: value read, on error sets the error and returns ~0ULL.
*/
u64 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, constchar *name, int *error)
{ conststruct nfp_rtsym *sym;
u32 val32;
u64 val; int err;
/** * nfp_rtsym_write_le() - Write an unsigned scalar value to a symbol * @rtbl: NFP RTsym table * @name: Symbol name * @value: Value to write * * Lookup a symbol and write a value to it. Symbol can be 4 or 8 bytes in size. * If 4 bytes then the lower 32-bits of 'value' are used. Value will be * written as simple little-endian unsigned value. * * Return: 0 on success or error code.
*/ int nfp_rtsym_write_le(struct nfp_rtsym_table *rtbl, constchar *name,
u64 value)
{ conststruct nfp_rtsym *sym; int err;
sym = nfp_rtsym_lookup(rtbl, name); if (!sym) return -ENOENT;
if (sym->size < min_size) {
nfp_err(rtbl->cpp, "rtsym '%s': too small\n", name); return (u8 __iomem *)ERR_PTR(-EINVAL);
}
mem = nfp_cpp_map_area(rtbl->cpp, id, cpp_id, addr, sym->size, area); if (IS_ERR(mem)) {
nfp_err(rtbl->cpp, "rtysm '%s': failed to map: %ld\n",
name, PTR_ERR(mem)); return mem;
}
return mem;
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.2Bemerkung:
(vorverarbeitet am 2026-06-07)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.