1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
7 #define PLT_INIT_CB_MAX 8
9 static int plt_init_cb_num;
10 static roc_plt_init_cb_t plt_init_cbs[PLT_INIT_CB_MAX];
13 roc_plt_init_cb_register(roc_plt_init_cb_t cb)
15 if (plt_init_cb_num >= PLT_INIT_CB_MAX)
18 plt_init_cbs[plt_init_cb_num++] = cb;
25 const struct rte_memzone *mz;
28 mz = rte_memzone_lookup(PLT_MODEL_MZ_NAME);
29 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
31 mz = rte_memzone_reserve(PLT_MODEL_MZ_NAME,
32 sizeof(struct roc_model),
35 plt_err("Failed to reserve mem for roc_model");
38 roc_model_init(mz->addr);
42 plt_err("Failed to lookup mem for roc_model");
48 for (i = 0; i < plt_init_cb_num; i++) {
49 rc = (*plt_init_cbs[i])();