]> rtime.felk.cvut.cz Git - jailhouse.git/blob - inmates/tiny-demo.c
x86: Handle more SIB cases in MMIO instruction parser
[jailhouse.git] / inmates / tiny-demo.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Siemens AG, 2013
5  *
6  * Authors:
7  *  Jan Kiszka <jan.kiszka@siemens.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  */
12
13 #include <inmate.h>
14
15 #ifdef CONFIG_UART_OXPCIE952
16 #define UART_BASE               0xe000
17 #else
18 #define UART_BASE               0x2f8
19 #endif
20
21 static struct jailhouse_comm_region *comm_region =
22         (struct jailhouse_comm_region *)0x100000UL;
23
24 void inmate_main(void)
25 {
26         unsigned long long start, now;
27         int n;
28
29         printk_uart_base = UART_BASE;
30         printk("Hello from this tiny cell!\n");
31
32         start = read_pm_timer(comm_region);
33         for (n = 0; n < 10; n++) {
34                 do {
35                         now = read_pm_timer(comm_region);
36                         cpu_relax();
37                 } while (now - start < 1000000000ULL);
38                 start += 1000000000ULL;
39                 printk("PM Timer: %11lu\n", now);
40         }
41
42         asm volatile("hlt");
43 }