]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: Factor out generic jailhouse/types.h
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 24 Sep 2014 08:11:57 +0000 (10:11 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Thu, 25 Sep 2014 13:49:30 +0000 (15:49 +0200)
Some types in the architecture-specific header are in fact generic. Move
them into a separate header and include this one directly from now on.
Document cpu_set at this chance according to doxygen style.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
17 files changed:
hypervisor/arch/arm/include/asm/bitops.h
hypervisor/arch/arm/include/asm/cell.h
hypervisor/arch/arm/include/asm/paging.h
hypervisor/arch/arm/include/asm/percpu.h
hypervisor/arch/arm/include/asm/types.h
hypervisor/arch/x86/include/asm/bitops.h
hypervisor/arch/x86/include/asm/io.h
hypervisor/arch/x86/include/asm/paging.h
hypervisor/arch/x86/include/asm/pci.h
hypervisor/arch/x86/include/asm/percpu.h
hypervisor/arch/x86/include/asm/processor.h
hypervisor/arch/x86/include/asm/types.h
hypervisor/include/jailhouse/entry.h
hypervisor/include/jailhouse/paging.h
hypervisor/include/jailhouse/printk.h
hypervisor/include/jailhouse/types.h [new file with mode: 0644]
hypervisor/lib.c

index fd3d7855a792dc897cf8f893886d541f7b76699c..c79d285eaff9ed194ce171b80eb9fc7be20cfd19 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef _JAILHOUSE_ASM_BITOPS_H
 #define _JAILHOUSE_ASM_BITOPS_H
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 
 static inline __attribute__((always_inline)) void
 clear_bit(int nr, volatile unsigned long *addr)
index 121115c8129885799b7c8e258b8316ea9038337a..616553cdb28b61a4cdb0077c0cb79a6b2b029536 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef _JAILHOUSE_ASM_CELL_H
 #define _JAILHOUSE_ASM_CELL_H
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 #include <asm/paging.h>
 
 #include <jailhouse/cell-config.h>
index 738a99b66a4266dec575fc4f9a64ccc70d09c6f5..d8615c489490ee2c4d02e85f5b4ac5089cfa1c04 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef _JAILHOUSE_ASM_PAGING_H
 #define _JAILHOUSE_ASM_PAGING_H
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 #include <asm/processor.h>
 
 #define PAGE_SIZE              4096
index 1180c1459248fd9078568fd51ecb723fc73296d8..eda19192e4cdad970149fc0113e8ace2735d6126 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef _JAILHOUSE_ASM_PERCPU_H
 #define _JAILHOUSE_ASM_PERCPU_H
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 #include <asm/paging.h>
 
 #define NUM_ENTRY_REGS                 6
index 38e88bba255a3203587f9992329142c1c6ede29f..b77c75e7d20580fd212b9bb5f9bc0376af648665 100644 (file)
@@ -13,8 +13,6 @@
 #ifndef _JAILHOUSE_ASM_TYPES_H
 #define _JAILHOUSE_ASM_TYPES_H
 
-#define NULL                           ((void *)0)
-
 #define BITS_PER_LONG                  32
 
 #ifndef __ASSEMBLY__
@@ -43,15 +41,6 @@ typedef u32 __u32;
 typedef s64 __s64;
 typedef u64 __u64;
 
-typedef enum { true = 1, false = 0 } bool;
-
-struct cpu_set {
-       unsigned long max_cpu_id;
-       /* Note: The bitmap is supposed to be extended by embedding this
-        * struct into a larger buffer. */
-       unsigned long bitmap[1];
-};
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* !_JAILHOUSE_ASM_TYPES_H */
index c7dd5ab158355ed0ada004fb8e598f56dbd613d3..7f1830d14fd83db734f66eae8093fa0e58a606ba 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef _JAILHOUSE_ASM_BITOPS_H
 #define _JAILHOUSE_ASM_BITOPS_H
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 
 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
 /* Technically wrong, but this avoids compilation errors on some gcc
index c997010ff9764cbf5639f0086794a564a163be34..7bb07657cb79e5324cbd78e2899d96541921aa78 100644 (file)
@@ -10,7 +10,7 @@
  * the COPYING file in the top-level directory.
  */
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 
 static inline void outb(u8 v, u16 port)
 {
index 7c5336857360cc0a6e785fd3f1c244c9636b90f3..0ca298ada7c2f8c4972977701f16870b6ee42db2 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef _JAILHOUSE_ASM_PAGING_H
 #define _JAILHOUSE_ASM_PAGING_H
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 #include <asm/processor.h>
 
 #define PAGE_SIZE              4096
index bd1846ce216639e8fc507bce839e83ed00530bba..b9aeca13b3b5b12848c116942aac626c907e84fd 100644 (file)
@@ -14,8 +14,8 @@
 #ifndef _JAILHOUSE_ASM_PCI_H
 #define _JAILHOUSE_ASM_PCI_H
 
+#include <jailhouse/types.h>
 #include <asm/percpu.h>
-#include <asm/types.h>
 
 /* --- PCI configuration ports --- */
 #define PCI_REG_ADDR_PORT              0xcf8
index 50d35e8ba3f9772117b60f3c9d181905f16c405b..df2797be11969a4f4a30c25c4892c206086834f7 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef _JAILHOUSE_ASM_PERCPU_H
 #define _JAILHOUSE_ASM_PERCPU_H
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 #include <asm/paging.h>
 #include <asm/processor.h>
 
index a8ad12f104313e8fea4f9889f4fac09fee52929b..320245286327e9ec88ba7f37ebe74691afdc00fd 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef _JAILHOUSE_ASM_PROCESSOR_H
 #define _JAILHOUSE_ASM_PROCESSOR_H
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 
 #define X86_FEATURE_VMX                                        (1 << 5)
 #define X86_FEATURE_GBPAGES                            (1 << 26)
index 29fd414294c1dc7367e930c92ed03d19d5400bcd..35c9d8ed47a5fa3f9b306d40509cc205f2e563e6 100644 (file)
@@ -13,8 +13,6 @@
 #ifndef _JAILHOUSE_ASM_TYPES_H
 #define _JAILHOUSE_ASM_TYPES_H
 
-#define NULL                           ((void *)0)
-
 #ifndef BITS_PER_LONG
 #define BITS_PER_LONG                  64
 #endif /* ! BITS_PER_LONG */
@@ -45,15 +43,6 @@ typedef u32 __u32;
 typedef s64 __s64;
 typedef u64 __u64;
 
-typedef enum { true = 1, false = 0 } bool;
-
-struct cpu_set {
-       unsigned long max_cpu_id;
-       /* Note: The bitmap is supposed to be extended by embedding this
-        * struct into a larger buffer. */
-       unsigned long bitmap[1];
-};
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* !_JAILHOUSE_ASM_TYPES_H */
index 6e67454eb73aef538454a2701b89c75051a2cde6..4c2129b3159f695a6ac7bbb77dc1a977b91f6164 100644 (file)
@@ -14,7 +14,7 @@
 #define _JAILHOUSE_ENTRY_H
 
 #include <jailhouse/header.h>
-#include <asm/types.h>
+#include <jailhouse/types.h>
 
 #include <jailhouse/cell-config.h>
 
index 63d3da43958f0dc23b23f1dc06d0cc392e927fce..27286f0056514eed6c62d379078c5f1ba6c4a153 100644 (file)
@@ -14,7 +14,7 @@
 #define _JAILHOUSE_PAGING_H
 
 #include <jailhouse/entry.h>
-#include <asm/types.h>
+#include <jailhouse/types.h>
 #include <asm/paging.h>
 
 /**
index 38423adc989d6a8b99269f33cbf6fd26a8195ab3..2bdcd954b2a1d6f3625139ea4c59a23d48ca3db2 100644 (file)
@@ -10,7 +10,7 @@
  * the COPYING file in the top-level directory.
  */
 
-#include <asm/types.h>
+#include <jailhouse/types.h>
 
 extern volatile unsigned long panic_in_progress;
 extern unsigned int panic_cpu;
diff --git a/hypervisor/include/jailhouse/types.h b/hypervisor/include/jailhouse/types.h
new file mode 100644 (file)
index 0000000..9c2daa7
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Copyright (c) Siemens AG, 2013, 2014
+ *
+ * Authors:
+ *  Jan Kiszka <jan.kiszka@siemens.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ */
+
+#ifndef _JAILHOUSE_TYPES_H
+#define _JAILHOUSE_TYPES_H
+
+#include <asm/types.h>
+
+#define NULL                           ((void *)0)
+
+#ifndef __ASSEMBLY__
+
+typedef enum { true = 1, false = 0 } bool;
+
+/** Describes a CPU set. */
+struct cpu_set {
+       /** Maximum CPU ID expressible with this set. */
+       unsigned long max_cpu_id;
+       /** Bitmap of CPUs in the set.
+        * @note Typically, the bitmap is extended by embedding this structure
+        * into a larger buffer. */
+       unsigned long bitmap[1];
+};
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* !_JAILHOUSE_JAILHOUSE_TYPES_H */
index d29de1c0d386f4ba3e9d8ee72e71e74cabb5a647..f2a27eb6cdfcc34c56ebba0a2dbe0638f5e96650 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include <jailhouse/string.h>
-#include <asm/types.h>
+#include <jailhouse/types.h>
 
 void *memset(void *s, int c, unsigned long n)
 {