]> rtime.felk.cvut.cz Git - jailhouse.git/blob - driver/jailhouse.h
driver: Add BSD 2-Clause license to user space interface header
[jailhouse.git] / driver / jailhouse.h
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Siemens AG, 2013-2015
5  *
6  * Authors:
7  *  Jan Kiszka <jan.kiszka@siemens.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  *
12  * Alternatively, you can use or redistribute this file under the following
13  * BSD license:
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions
17  * are met:
18  *
19  * 1. Redistributions of source code must retain the above copyright
20  *    notice, this list of conditions and the following disclaimer.
21  *
22  * 2. Redistributions in binary form must reproduce the above copyright
23  *    notice, this list of conditions and the following disclaimer in the
24  *    documentation and/or other materials provided with the distribution.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
36  * THE POSSIBILITY OF SUCH DAMAGE.
37  */
38
39 #ifndef _JAILHOUSE_DRIVER_H
40 #define _JAILHOUSE_DRIVER_H
41
42 #include <linux/ioctl.h>
43 #include <linux/types.h>
44
45 #define JAILHOUSE_CELL_ID_NAMELEN       31
46
47 struct jailhouse_cell_create {
48         __u64 config_address;
49         __u32 config_size;
50         __u32 padding;
51 };
52
53 struct jailhouse_preload_image {
54         __u64 source_address;
55         __u64 size;
56         __u64 target_address;
57         __u64 padding;
58 };
59
60 struct jailhouse_cell_id {
61         __s32 id;
62         __u32 padding;
63         char name[JAILHOUSE_CELL_ID_NAMELEN + 1];
64 };
65
66 struct jailhouse_cell_load {
67         struct jailhouse_cell_id cell_id;
68         __u32 num_preload_images;
69         __u32 padding;
70         struct jailhouse_preload_image image[];
71 };
72
73 #define JAILHOUSE_CELL_ID_UNUSED        (-1)
74
75 #define JAILHOUSE_ENABLE                _IOW(0, 0, void *)
76 #define JAILHOUSE_DISABLE               _IO(0, 1)
77 #define JAILHOUSE_CELL_CREATE           _IOW(0, 2, struct jailhouse_cell_create)
78 #define JAILHOUSE_CELL_LOAD             _IOW(0, 3, struct jailhouse_cell_load)
79 #define JAILHOUSE_CELL_START            _IOW(0, 4, struct jailhouse_cell_id)
80 #define JAILHOUSE_CELL_DESTROY          _IOW(0, 5, struct jailhouse_cell_id)
81
82 #endif /* !_JAILHOUSE_DRIVER_H */