/* Copyright (c) 2013-2018, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef ODP_GLOBAL_DATA_H_ #define ODP_GLOBAL_DATA_H_ #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include #include #include #include #define MODEL_STR_SIZE 128 #define UID_MAXLEN 30 typedef struct { uint64_t cpu_hz_max[CONFIG_NUM_CPU_IDS]; uint64_t default_cpu_hz_max; uint64_t default_cpu_hz; uint64_t page_size; int cache_line_size; int cpu_count; odp_cpu_arch_t cpu_arch; odp_cpu_arch_isa_t cpu_isa_sw; odp_cpu_arch_isa_t cpu_isa_hw; char cpu_arch_str[128]; char model_str[CONFIG_NUM_CPU_IDS][MODEL_STR_SIZE]; } system_info_t; typedef struct { uint64_t default_huge_page_size; char *default_huge_page_dir; } hugepage_info_t; /* Read-only global data. Members should not be modified after global init * to enable process more support. */ typedef struct odp_global_data_ro_t { odp_init_t init_param; /* directory for odp mmaped files */ char *shm_dir; /* overload default with env */ int shm_dir_from_env; uint64_t shm_max_memory; uint64_t shm_max_size; int shm_single_va; pid_t main_pid; pid_t fdserver_pid; char uid[UID_MAXLEN]; odp_log_func_t log_fn; odp_abort_func_t abort_fn; system_info_t system_info; hugepage_info_t hugepage_info; odp_cpumask_t control_cpus; odp_cpumask_t worker_cpus; int num_cpus_installed; uint8_t has_config_rt; config_t libconfig_default; config_t libconfig_runtime; odp_random_kind_t ipsec_rand_kind; /* Disabled features during global init */ struct { uint8_t compress; uint8_t crypto; uint8_t ipsec; uint8_t stash; uint8_t traffic_mngr; } disable; } odp_global_data_ro_t; /* Modifiable global data. Memory region is shared and synchronized amongst all * worker processes. */ typedef struct odp_global_data_rw_t { odp_bool_t dpdk_initialized; odp_bool_t inline_timers; odp_bool_t schedule_configured; } odp_global_data_rw_t; extern odp_global_data_ro_t odp_global_ro; extern odp_global_data_rw_t *odp_global_rw; #ifdef __cplusplus } #endif #endif