aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.h
blob: ee14594681718bf4cdc26cddf49377de1129cca6 (plain) (blame)
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
48
49
50
51
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/* Copyright (c) 2010-2012 Broadcom. All rights reserved. */

#ifndef VCHIQ_UTIL_H
#define VCHIQ_UTIL_H

#include <linux/types.h>
#include <linux/completion.h>
#include <linux/mutex.h>
#include <linux/bitops.h>
#include <linux/kthread.h>
#include <linux/wait.h>
#include <linux/vmalloc.h>
#include <linux/jiffies.h>
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/random.h>
#include <linux/sched/signal.h>
#include <linux/ctype.h>
#include <linux/uaccess.h>
#include <linux/time.h>  /* for time_t */
#include <linux/slab.h>

#include "vchiq_if.h"

struct vchiu_queue {
	int size;
	int read;
	int write;
	int initialized;

	struct completion pop;
	struct completion push;

	struct vchiq_header **storage;
};

extern int  vchiu_queue_init(struct vchiu_queue *queue, int size);
extern void vchiu_queue_delete(struct vchiu_queue *queue);

extern int vchiu_queue_is_empty(struct vchiu_queue *queue);
extern int vchiu_queue_is_full(struct vchiu_queue *queue);

extern void vchiu_queue_push(struct vchiu_queue *queue,
			     struct vchiq_header *header);

extern struct vchiq_header *vchiu_queue_peek(struct vchiu_queue *queue);
extern struct vchiq_header *vchiu_queue_pop(struct vchiu_queue *queue);

#endif