aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp_schedule_internal.h
blob: 85afc31a2bc2d170abac1e042d65a578662c0756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* Copyright (c) 2016, Linaro Limited
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

#ifndef ODP_SCHEDULE_INTERNAL_H_
#define ODP_SCHEDULE_INTERNAL_H_

#ifdef __cplusplus
extern "C" {
#endif

/* Maximum number of dequeues */
#define MAX_DEQ 4

typedef struct {
	int thr;
	int num;
	int index;
	int pause;
	uint16_t round;
	uint16_t prefer_offset;
	uint16_t pktin_polls;
	odp_queue_t pri_queue;
	odp_event_t cmd_ev;
	odp_queue_t queue;
	odp_event_t ev_stash[MAX_DEQ];
	void *origin_qe;
	uint64_t order;
	uint64_t sync[SCHEDULE_ORDERED_LOCKS_PER_QUEUE];
	odp_pool_t pool;
	int enq_called;
	int ignore_ordered_context;
} sched_local_t;

extern __thread sched_local_t sched_local;

void cache_order_info(uint32_t queue_index);
int release_order(void *origin_qe, uint64_t order,
		  odp_pool_t pool, int enq_called);

#ifdef __cplusplus
}
#endif

#endif