Pip
Architecture-dependent parts of Pip: MAL, IAL and boot
ial.h
Go to the documentation of this file.
1 /*******************************************************************************/
2 /* © Université de Lille, The Pip Development Team (2015-2021) */
3 /* */
4 /* This software is a computer program whose purpose is to run a minimal, */
5 /* hypervisor relying on proven properties such as memory isolation. */
6 /* */
7 /* This software is governed by the CeCILL license under French law and */
8 /* abiding by the rules of distribution of free software. You can use, */
9 /* modify and/ or redistribute the software under the terms of the CeCILL */
10 /* license as circulated by CEA, CNRS and INRIA at the following URL */
11 /* "http://www.cecill.info". */
12 /* */
13 /* As a counterpart to the access to the source code and rights to copy, */
14 /* modify and redistribute granted by the license, users are provided only */
15 /* with a limited warranty and the software's author, the holder of the */
16 /* economic rights, and the successive licensors have only limited */
17 /* liability. */
18 /* */
19 /* In this respect, the user's attention is drawn to the risks associated */
20 /* with loading, using, modifying and/or developing or reproducing the */
21 /* software by the user in light of its specific status of free software, */
22 /* that may mean that it is complicated to manipulate, and that also */
23 /* therefore means that it is reserved for developers and experienced */
24 /* professionals having in-depth computer knowledge. Users are therefore */
25 /* encouraged to load and test the software's suitability as regards their */
26 /* requirements in conditions enabling the security of their systems and/or */
27 /* data to be ensured and, more generally, to use and operate it in the */
28 /* same conditions as regards security. */
29 /* */
30 /* The fact that you are presently reading this means that you have had */
31 /* knowledge of the CeCILL license and that you accept its terms. */
32 /*******************************************************************************/
33 
39 #ifndef __IAL__
40 #define __IAL__
41 
42 #include <stdint.h>
43 
44 typedef enum user_ctx_role_e {
45  /* saved when an interruption occurs*/
46  INT_CTX = 0,
47  /* saved when partition triggers fault*/
48  ISR_CTX = 1,
49  /* saved in parent when notifying a child */
51  /* saved in child when notifying the parent */
53  /* the invalid index */
56 
57 // These are deprecated and are about to be removed
58 void initInterrupts();
59 void panic();
60 
61 // The TRUE interface
62 void enableInterrupts();
63 void disableInterrupts();
64 void dispatch2 (uint32_t partition, uint32_t vint, uint32_t data1, uint32_t data2, uint32_t caller);
65 void resume (uint32_t descriptor, uint32_t pipflags);
66 
67 // FIXME: move this away
68 #include <x86int.h>
69 void
70 dispatchGlue (uint32_t descriptor, uint32_t vint, uint32_t notify,
71  uint32_t data1, uint32_t data2
72 #ifndef X86SMP
73  , gate_ctx_t *ctx);
74 #else
75  );
76 #endif
77 
78 void
79 yieldGlue (uint32_t calleePartDescVAddr, uint32_t userTargetInterrupt, uint32_t userCallerContextSaveIndex, uint32_t flagsOnWake, uint32_t flagsOnYield
80 #ifndef X86SMP
81  , gate_ctx_t *ctx);
82 #else
83  );
84 #endif
85 
89 struct partition_id {
90  uint32_t partition;
91  uint32_t id;
92 };
93 
98 struct hardware_def {
99  const char* name;
100  uintptr_t paddr_base;
101  uintptr_t vaddr_base;
102  uintptr_t limit;
103 };
104 
105 typedef struct partition_id pip_pid;
106 
107 #endif
void disableInterrupts()
Interface for interrupt desactivation.
void initInterrupts()
Interface for interrupt initialization.
Definition: ial.h:46
void dispatchGlue(uint32_t descriptor, uint32_t vint, uint32_t notify, uint32_t data1, uint32_t data2, gate_ctx_t *ctx)
Definition: context.h:62
enum user_ctx_role_e user_ctx_role_t
uint32_t id
Definition: ial.h:91
Definition: ial.h:50
Definition: ial.h:54
Platform-specific hardware memory range definition.
Definition: hdef.h:49
Definition: ial.h:52
void enableInterrupts()
Interface for interrupt activation.
void resume(uint32_t descriptor, uint32_t pipflags)
Resume interrupted partition.
Definition: ial.h:48
x86 interrupts include file for x86 IAL
void dispatch2(uint32_t partition, uint32_t vint, uint32_t data1, uint32_t data2, uint32_t caller)
Dispatch & switch to given partition.
uint32_t partition
Definition: ial.h:90
unsigned short limit
Address limit.
Definition: gdt.h:96
void yieldGlue(uint32_t calleePartDescVAddr, uint32_t userTargetInterrupt, uint32_t userCallerContextSaveIndex, uint32_t flagsOnWake, uint32_t flagsOnYield, gate_ctx_t *ctx)
Partition-to-PartitionID structure.
Definition: ial.h:89
user_ctx_role_e
Definition: ial.h:44
void panic()
Interface for kernel panic.