2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2013
7 * Jan Kiszka <jan.kiszka@siemens.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #include <asm/types.h>
14 #include <asm/percpu.h>
15 #include <jailhouse/cell-config.h>
17 #define SHUTDOWN_NONE 0
18 #define SHUTDOWN_STARTED 1
20 extern struct jailhouse_system *system_config;
22 unsigned int next_cpu(unsigned int cpu, struct cpu_set *cpu_set,
25 #define for_each_cpu(cpu, set) \
27 (cpu) = next_cpu((cpu), (set), -1), \
28 (cpu) <= (set)->max_cpu_id; \
31 #define for_each_cpu_except(cpu, set, exception) \
33 (cpu) = next_cpu((cpu), (set), (exception)), \
34 (cpu) <= (set)->max_cpu_id; \
37 bool cpu_id_valid(unsigned long cpu_id);
39 int check_mem_regions(const struct jailhouse_cell_desc *config);
40 int cell_init(struct cell *cell);
42 long hypercall(struct per_cpu *cpu_data, unsigned long code,
43 unsigned long arg1, unsigned long arg2);
45 void __attribute__((noreturn)) panic_stop(struct per_cpu *cpu_data);
46 void panic_halt(struct per_cpu *cpu_data);
48 void arch_suspend_cpu(unsigned int cpu_id);
49 void arch_resume_cpu(unsigned int cpu_id);
50 void arch_reset_cpu(unsigned int cpu_id);
51 void arch_park_cpu(unsigned int cpu_id);
52 void arch_shutdown_cpu(unsigned int cpu_id);
54 int arch_map_memory_region(struct cell *cell,
55 const struct jailhouse_memory *mem);
56 int arch_unmap_memory_region(struct cell *cell,
57 const struct jailhouse_memory *mem);
59 int arch_cell_create(struct per_cpu *cpu_data, struct cell *cell);
60 void arch_cell_destroy(struct per_cpu *cpu_data, struct cell *cell);
62 void arch_config_commit(struct per_cpu *cpu_data,
63 struct cell *cell_added_removed);
65 void arch_shutdown(void);
67 void __attribute__((noreturn)) arch_panic_stop(struct per_cpu *cpu_data);
68 void arch_panic_halt(struct per_cpu *cpu_data);