summaryrefslogtreecommitdiff
path: root/compote-uapi.h
blob: 8b10c1b092c2907639effbef517b32a6e76e7088 (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
48
49
50
51
52
53
/*
 * Copyright 2017 Red Hat Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * Authors: Jérôme Glisse <jglisse@redhat.com>
 */
#ifndef COMPOTE_UAPI_H
#define COMPOTE_UAPI_H

#include <linux/types.h>
#include <linux/ioctl.h>
#include <linux/irqnr.h>

struct compote_ioctl_mem_alloc {
	uint64_t		nbytes;
	uint64_t		foffset;
};

struct compote_ioctl_mem_free {
	uint64_t		foffset;
};

struct compote_ioctl_channel_alloc {
	uint64_t		channel;
};

struct compote_ioctl_channel_free {
	uint64_t		channel;
};

struct compote_ioctl_channel_execute {
	uint64_t		channel;
	uint64_t		addr;
	uint32_t		ndw;
};

/* Expose the address space of the calling process through hmm dummy dev file */
#define COMPOTE_IOCTL_MEM_ALLOC		_IOWR('H', 0x00, struct compote_ioctl_mem_alloc)
#define COMPOTE_IOCTL_MEM_FREE		_IOWR('H', 0x01, struct compote_ioctl_mem_free)
#define COMPOTE_IOCTL_CHAN_ALLOC	_IOWR('H', 0x02, struct compote_ioctl_channel_alloc)
#define COMPOTE_IOCTL_CHAN_FREE		_IOWR('H', 0x03, struct compote_ioctl_channel_free)
#define COMPOTE_IOCTL_CHAN_EXEC		_IOWR('H', 0x04, struct compote_ioctl_channel_execute)

#endif /* COMPOTE_UAPI_H */