diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/spdk/dpdk/examples/performance-thread/common/lthread.h | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/dpdk/examples/performance-thread/common/lthread.h')
-rw-r--r-- | src/spdk/dpdk/examples/performance-thread/common/lthread.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/spdk/dpdk/examples/performance-thread/common/lthread.h b/src/spdk/dpdk/examples/performance-thread/common/lthread.h new file mode 100644 index 00000000..4c945cf7 --- /dev/null +++ b/src/spdk/dpdk/examples/performance-thread/common/lthread.h @@ -0,0 +1,51 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright 2015 Intel Corporation. + * Copyright 2012 Hasan Alayli <halayli@gmail.com> + */ +#ifndef LTHREAD_H_ +#define LTHREAD_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <rte_per_lcore.h> + +#include "lthread_api.h" +#include "lthread_diag.h" + +struct lthread; +struct lthread_sched; + +/* function to be called when a context function returns */ +typedef void (*lthread_exit_func) (struct lthread *); + +void _lthread_exit_handler(struct lthread *lt); + +void lthread_set_funcname(const char *f); + +void _lthread_sched_busy_sleep(struct lthread *lt, uint64_t nsecs); + +int _lthread_desched_sleep(struct lthread *lt); + +void _lthread_free(struct lthread *lt); + +struct lthread_sched *_lthread_sched_get(unsigned int lcore_id); + +struct lthread_stack *_stack_alloc(void); + +struct +lthread_sched *_lthread_sched_create(size_t stack_size); + +void +_lthread_init(struct lthread *lt, + lthread_func_t fun, void *arg, lthread_exit_func exit_handler); + +void _lthread_set_stack(struct lthread *lt, void *stack, size_t stack_size); + +#ifdef __cplusplus +} +#endif + +#endif /* LTHREAD_H_ */ |