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 #define FSEGMENT_BASE 0x0f0000
14 #define COMM_REGION_BASE 0x100000
16 #define INMATE_CS32 0x8
17 #define INMATE_CS64 0x10
18 #define INMATE_DS32 0x18
21 typedef signed char s8;
22 typedef unsigned char u8;
24 typedef signed short s16;
25 typedef unsigned short u16;
27 typedef signed int s32;
28 typedef unsigned int u32;
30 typedef signed long s64;
31 typedef unsigned long u64;
45 typedef enum { true=1, false=0 } bool;
47 static inline void cpu_relax(void)
49 asm volatile("rep; nop" : : : "memory");
52 static inline void outb(u8 v, u16 port)
54 asm volatile("outb %0,%1" : : "a" (v), "dN" (port));
57 static inline u8 inb(u16 port)
60 asm volatile("inb %1,%0" : "=a" (v) : "dN" (port));
64 static inline u32 inl(u16 port)
67 asm volatile("inl %1,%0" : "=a" (v) : "dN" (port));
71 #include <jailhouse/hypercall.h>
73 #define comm_region ((struct jailhouse_comm_region *)COMM_REGION_BASE)
75 extern unsigned int printk_uart_base;
76 void printk(const char *fmt, ...);
78 void *memset(void *s, int c, unsigned long n);
80 extern u8 irq_entry[];
81 void irq_handler(void);
83 void inmate_main(void);
85 unsigned long read_pm_timer(void);