Pip
Architecture-dependent parts of Pip: MAL, IAL and boot
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
port.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 __PORT__
40 #define __PORT__
41 
42 #include <stdint.h>
43 
44 #define FAULT_FORBIDDEN 64
45 
46 void outb(uint16_t port, uint8_t value);
47 void outw(uint16_t port, uint16_t value);
48 uint8_t inb(uint16_t port);
49 uint16_t inw(uint16_t port);
50 
51 /* Call-gate IO methods */
52 void cg_outb(uint32_t port, uint32_t value);
53 uint32_t cg_inb(uint32_t port);
54 
55 void cg_outw(uint32_t port, uint32_t value);
56 uint32_t cg_inw(uint32_t port);
57 
58 void cg_outl(uint32_t port, uint32_t value);
59 void cg_outaddrl(uint32_t port, uint32_t value);
60 uint32_t cg_inl(uint32_t port);
61 #endif
uint32_t cg_inw(uint32_t port)
Inw callgate method.
void cg_outaddrl(uint32_t port, uint32_t value)
Outaddrl callgate method.
uint32_t cg_inl(uint32_t port)
Inl callgate method.
uint32_t cg_inb(uint32_t port)
Inb callgate method.
uint8_t inb(uint16_t port)
IO port read byte.
Definition: port.c:110
void outb(uint16_t port, uint8_t value)
IO port write byte.
Definition: port.c:77
uint16_t inw(uint16_t port)
IO port read word.
Definition: port.c:123
void cg_outl(uint32_t port, uint32_t value)
Outl callgate method.
void cg_outw(uint32_t port, uint32_t value)
Outw callgate method.
void cg_outb(uint32_t port, uint32_t value)
Outb callgate method.
void outw(uint16_t port, uint16_t value)
IO port write word.
Definition: port.c:88