API Reference Manual 1.51.0
Loading...
Searching...
No Matches
api/spec/init.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2013-2018 Linaro Limited
3 * Copyright (c) 2019-2024 Nokia
4 */
5
10#ifndef ODP_API_SPEC_INIT_H_
11#define ODP_API_SPEC_INIT_H_
12#include <odp/visibility_begin.h>
13
14#include <odp/api/std_types.h>
15#include <odp/api/hints.h>
17#include <odp/api/cpumask.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
36#define ODP_TERM_FROM_SIGH ((uint64_t)0x1)
37
43#define ODP_TERM_LAST_FLAG ODP_TERM_FROM_SIGH
44
68
92int odp_override_log(odp_log_level_t level, const char *fmt, ...) ODP_PRINTF_FORMAT(2, 3);
93
115
117typedef int (*odp_log_func_t)(odp_log_level_t level, const char *fmt, ...) ODP_PRINTF_FORMAT(2, 3);
118
120typedef void (*odp_abort_func_t)(void) ODP_NORETURN;
121
147
230
237
295 const odp_init_t *params,
296 const odp_platform_init_t *platform_params);
297
321
342
360
392int odp_term_abnormal(odp_instance_t instance, uint64_t flags, void *data);
393
407
423
437
451
460
465#ifdef __cplusplus
466}
467#endif
468
469#include <odp/visibility_end.h>
470#endif
ODP CPU masks and enumeration.
Standard C language types and definitions for ODP.
ODP thread.
#define ODP_PRINTF_FORMAT(x, y)
Printf format attribute.
Definition spec/hints.h:49
#define ODP_NORETURN
Define a function that does not return.
Definition spec/hints.h:28
int odp_instance(odp_instance_t *instance)
Get instance handle.
void odp_init_param_init(odp_init_t *param)
Initialize the odp_init_t to default values for all fields.
int void odp_override_abort(void) ODP_NORETURN
ODP abort function.
int(* odp_log_func_t)(odp_log_level_t level, const char *fmt,...) ODP_PRINTF_FORMAT(2
Replaceable logging function.
int odp_init_local(odp_instance_t instance, odp_thread_type_t thr_type)
Thread local ODP initialization.
uint64_t odp_instance_to_u64(odp_instance_t instance)
Get printable value for ODP instance handle.
odp_mem_model_t
Application memory model.
odp_log_level_t
ODP log level.
int odp_init_global(odp_instance_t *instance, const odp_init_t *params, const odp_platform_init_t *platform_params)
Global ODP initialization.
odp_abort_func_t odp_abort_fn_get(void)
Get abort function.
int odp_term_local(void)
Thread local ODP termination.
int odp_term_global(odp_instance_t instance)
Global ODP termination.
uint64_t odp_instance_t
ODP instance ID.
int(*) typedef void(* odp_abort_func_t)(void) ODP_NORETURN
Replaceable abort function.
int odp_override_log(odp_log_level_t level, const char *fmt,...) ODP_PRINTF_FORMAT(2
ODP log function.
odp_log_func_t odp_log_fn_get(void)
Get current log function.
int odp_term_abnormal(odp_instance_t instance, uint64_t flags, void *data)
Abnormal ODP termination after a non-recoverable error.
void odp_log_thread_fn_set(odp_log_func_t func)
Set thread specific log function.
@ ODP_MEM_MODEL_PROCESS
Process memory model: by default all memory is not shareable between processes.
@ ODP_MEM_MODEL_THREAD
Thread memory model: by default all memory is shareable between threads.
@ ODP_LOG_ERR
Error.
@ ODP_LOG_DBG
Debug.
@ ODP_LOG_UNIMPLEMENTED
Unimplemented.
@ ODP_LOG_ABORT
Abort.
@ ODP_LOG_PRINT
Print.
@ ODP_LOG_WARN
Warning.
enum odp_thread_type_e odp_thread_type_t
Thread type.
ODP compiler hints.
Global initialization parameters.
odp_log_func_t log_fn
Replacement for the default log fn.
int num_control
Maximum number of control threads the user will run concurrently.
odp_abort_func_t abort_fn
Replacement for the default abort fn.
uint64_t max_memory
Maximum memory usage in bytes.
int num_worker
Maximum number of worker threads the user will run concurrently.
odp_mem_model_t mem_model
Application memory model.
const odp_cpumask_t * control_cpus
Pointer to bit mask mapping CPUs available to this ODP instance for running control threads.
odp_feature_t not_used
Unused features.
const odp_cpumask_t * worker_cpus
Pointer to bit mask mapping CPUs available to this ODP instance for running worker threads.
struct odp_init_t::@41 shm
Shared memory parameters.
Definition of ODP features.