]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/include/jailhouse/control.h
Jailhouse public release
[jailhouse.git] / hypervisor / include / jailhouse / control.h
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Siemens AG, 2013
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
13 #include <asm/types.h>
14 #include <asm/percpu.h>
15 #include <jailhouse/cell-config.h>
16
17 extern struct jailhouse_system *system_config;
18
19 unsigned int next_cpu(unsigned int cpu, struct cpu_set *cpu_set,
20                       int exception);
21
22 #define for_each_cpu(cpu, set)                                  \
23         for ((cpu) = -1;                                        \
24              (cpu) = next_cpu((cpu), (set), -1),                \
25              (cpu) <= (set)->max_cpu_id;                        \
26             )
27
28 #define for_each_cpu_except(cpu, set, exception)                \
29         for ((cpu) = -1;                                        \
30              (cpu) = next_cpu((cpu), (set), (exception)),       \
31              (cpu) <= (set)->max_cpu_id;                        \
32             )
33
34 int check_mem_regions(struct jailhouse_cell_desc *config);
35 int cell_init(struct cell *cell, struct jailhouse_cell_desc *config,
36               bool copy_cpu_set);
37
38 int cell_create(struct per_cpu *cpu_data, unsigned long config_address);
39
40 int shutdown(struct per_cpu *cpu_data);
41
42 void arch_suspend_cpu(unsigned int cpu_id);
43 void arch_resume_cpu(unsigned int cpu_id);
44 void arch_reset_cpu(unsigned int cpu_id);
45 void arch_shutdown_cpu(unsigned int cpu_id);
46
47 int arch_cell_create(struct per_cpu *cpu_data, struct cell *new_cell,
48                      struct jailhouse_cell_desc *config);