common.h
Go to the documentation of this file.
1 /*
2  * Bareflank Hypervisor
3  *
4  * Copyright (C) 2015 Assured Information Security, Inc.
5  * Author: Rian Quinn <quinnr@ainfosec.com>
6  * Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef COMMON_H
24 #define COMMON_H
25 
26 #include <types.h>
27 #include <error_codes.h>
28 #include <bfelf_loader.h>
29 #include <vmcall_interface.h>
30 #include <debug_ring_interface.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /* -------------------------------------------------------------------------- */
37 /* Module */
38 /* -------------------------------------------------------------------------- */
39 
53 struct module_t
54 {
55  char *exec;
56  uint64_t size;
57  struct bfelf_file_t file;
58 };
59 
60 /* -------------------------------------------------------------------------- */
61 /* Common Functions */
62 /* -------------------------------------------------------------------------- */
63 
69 int64_t
70 common_vmm_status(void);
71 
80 int64_t
81 common_reset(void);
82 
92 int64_t
93 common_init(void);
94 
104 int64_t
105 common_fini(void);
106 
123 int64_t
124 common_add_module(const char *file, uint64_t fsize);
125 
136 int64_t
137 common_load_vmm(void);
138 
148 int64_t
149 common_unload_vmm(void);
150 
159 int64_t
160 common_start_vmm(void);
161 
170 int64_t
171 common_stop_vmm(void);
172 
185 int64_t
187 
197 int64_t
198 common_vmcall(struct vmcall_registers_t *regs, uint64_t cpuid);
199 
200 #ifdef __cplusplus
201 }
202 #endif
203 
204 #endif
int64_t common_add_module(const char *file, uint64_t fsize)
Definition: common.c:305
Definition: file.h:35
char * exec
Definition: common.h:55
int64_t common_load_vmm(void)
Definition: common.c:357
int64_t common_fini(void)
Definition: common.c:273
int64_t common_dump_vmm(struct debug_ring_resources_t **drr, uint64_t vcpuid)
Definition: common.c:592
Definition: vcpuid.h:29
debug_ring_resources_t * drr
int64_t common_vmcall(struct vmcall_registers_t *regs, uint64_t cpuid)
Definition: common.c:610
uint64_t size
Definition: common.h:56
int64_t common_stop_vmm(void)
Definition: common.c:543
int64_t common_start_vmm(void)
Definition: common.c:490
int64_t common_init(void)
Definition: common.c:267
int64_t common_unload_vmm(void)
Definition: common.c:451
int64_t common_vmm_status(void)
Definition: common.c:227
int64_t common_reset(void)
Definition: common.c:233