]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
Add platform/machine independent <bmk-core/types.h> and use it.
authorAntti Kantee <pooka@iki.fi>
Mon, 12 Oct 2015 14:59:37 +0000 (14:59 +0000)
committerAntti Kantee <pooka@iki.fi>
Mon, 12 Oct 2015 15:27:44 +0000 (15:27 +0000)
12 files changed:
include/bmk-core/types.h
include/bmk-rumpuser/core_types.h
include/bmk-rumpuser/rumpuser.h
platform/hw/include/arch/earm/types.h [deleted file]
platform/hw/include/arch/i386/types.h [deleted file]
platform/hw/include/arch/x86_64/types.h [deleted file]
platform/hw/include/hw/types.h
platform/hw/pci/rumpdma.c
platform/hw/pci/rumppci.c
platform/xen/rumphyper_bio.c
platform/xen/xen/include/mini-os/blkfront.h
platform/xen/xen/include/mini-os/types.h

index b7269d3055efa399e1b946e6b17daeb593c53aec..c6d9b34890bcbebd8c7635b735840c4d855eabc4 100644 (file)
 #ifndef _BMK_CORE_TYPES_H_
 #define _BMK_CORE_TYPES_H_
 
-#ifdef _LP64
-typedef long bmk_time_t;
-#else
-typedef long long bmk_time_t;
-#endif
+typedef __INT64_TYPE__         int64_t;
+typedef __UINT64_TYPE__                uint64_t;
+typedef __INT32_TYPE__         int32_t;
+typedef __UINT32_TYPE__                uint32_t;
+typedef __INT16_TYPE__         int16_t;
+typedef __UINT16_TYPE__                uint16_t;
+typedef __INT8_TYPE__          int8_t;
+typedef __UINT8_TYPE__         uint8_t;
+typedef __INTPTR_TYPE__                intptr_t;
+typedef __UINTPTR_TYPE__       uintptr_t;
+
+typedef __INT64_TYPE__         bmk_time_t;
 
 #endif /* _BMK_CORE_TYPES_H_ */
index 7a58a80e1bbbf4a8bca54be7bd73886db2019898..ac9ff7c1d8777e2cef52403956765b6eca1bbb78 100644 (file)
@@ -41,8 +41,12 @@ typedef int pid_t;
 typedef unsigned long size_t;
 
 #ifdef __GNUC__
+#ifndef __dead
 #define __dead __attribute__((__noreturn__))
+#endif
+#ifndef __printflike
 #define __printflike(a,b) __attribute__((__format__ (__printf__,a,b)))
+#endif
 #else /* __GNUC__ */
 #define __dead
 #define __printflike(a,b)
index ad7d1301e7581581e1196f1f23f8a3b714ecedb2..0c3c2f792082554d03abde41c43f7070c19a227c 100644 (file)
@@ -28,6 +28,8 @@
 int rumprun_platform_rumpuser_init(void);
 
 #define LIBRUMPUSER
+#include <bmk-rumpuser/core_types.h>
+
 #include <rump/rumpuser.h>
 
 extern struct rumpuser_hyperup rumpuser__hyp;
diff --git a/platform/hw/include/arch/earm/types.h b/platform/hw/include/arch/earm/types.h
deleted file mode 100644 (file)
index 11e7072..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Some selection of types */
-
-typedef unsigned long long     uint64_t;
-typedef long long              int64_t;
-typedef unsigned int           uint32_t;
-typedef int                    int32_t;
-typedef unsigned short         uint16_t;
-typedef short                  int16_t;
-typedef unsigned char          uint8_t;
-typedef signed char            int8_t;
-
-/* developed using waterfall model */
-typedef int32_t                        pid_t;
-typedef unsigned long          size_t;
-typedef long                   ssize_t;
-typedef long                   intptr_t;
-typedef unsigned long          uintptr_t;
-typedef unsigned long          register_t;
-
-typedef volatile unsigned char  __cpu_simple_lock_t;
diff --git a/platform/hw/include/arch/i386/types.h b/platform/hw/include/arch/i386/types.h
deleted file mode 100644 (file)
index a852937..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Some selection of types */
-
-typedef unsigned long long     uint64_t;
-typedef long long              int64_t;
-typedef unsigned int           uint32_t;
-typedef int                    int32_t;
-typedef unsigned short         uint16_t;
-typedef short                  int16_t;
-typedef unsigned char          uint8_t;
-typedef signed char            int8_t;
-
-/* developed using waterfall model */
-typedef short                  pid_t;
-typedef unsigned long          size_t;
-typedef long                   ssize_t;
-typedef long                   intptr_t;
-typedef unsigned long          uintptr_t;
-typedef unsigned long          register_t;
diff --git a/platform/hw/include/arch/x86_64/types.h b/platform/hw/include/arch/x86_64/types.h
deleted file mode 100644 (file)
index c9b2eeb..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Some selection of types */
-
-typedef unsigned long          uint64_t;
-typedef long                   int64_t;
-typedef unsigned int           uint32_t;
-typedef int                    int32_t;
-typedef unsigned short         uint16_t;
-typedef short                  int16_t;
-typedef unsigned char          uint8_t;
-typedef signed char            int8_t;
-
-/* developed using waterfall model */
-typedef short                  pid_t;
-typedef unsigned long          size_t;
-typedef long                   ssize_t;
-typedef long                   intptr_t;
-typedef unsigned long          uintptr_t;
-typedef unsigned long          register_t;
index 2cf18b557ec3dbf302c38d1ed244004f6c5c661b..83a0f2bfc86b9731384e90565e260ef57926fe59 100644 (file)
@@ -2,7 +2,6 @@
 #define _BMK_TYPES_H_
 
 #include <bmk-core/types.h>
-#include <hw/machine/types.h>
 
 /*
  * MI types
index 63a83becc94a315ab0800c5dd1d68e226491aebe..b8f89c698201c20de3bc89ebec20b50028494613 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <bmk-pcpu/pcpu.h>
 
+#include <bmk-rumpuser/core_types.h>
+
 #include "pci_user.h"
 
 int
index d2e8e66e86af022a53f052df337733f7a26ee7f4..eb2984d129f2f8d9d5f360e25c2ef201cf7cd233 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <bmk-pcpu/pcpu.h>
 
+#include <bmk-rumpuser/core_types.h>
+
 #include "pci_user.h"
 
 #define PCI_CONF_ADDR 0xcf8
index 89d9500a0ddcef0945c27d9da7186233c76b61ce..2df203ad0be16ddc4dc51b2fb17d40ee6cc52aa4 100644 (file)
@@ -36,6 +36,7 @@
 #include <bmk-core/sched.h>
 #include <bmk-core/string.h>
 
+#include <bmk-rumpuser/core_types.h>
 #include <bmk-rumpuser/rumpuser.h>
 
 static struct rumpuser_mtx *bio_mtx;
index c21b69c0f43e44fa0dff1db9fd259d55422e3336..a684d2c3277c5935f367443ac2df79d39876dbee 100644 (file)
@@ -10,7 +10,7 @@ struct blkfront_aiocb
     struct blkfront_dev *aio_dev;
     uint8_t *aio_buf;
     size_t aio_nbytes;
-    off_t aio_offset;
+    int64_t aio_offset;
     size_t total_bytes;
     uint8_t is_write;
     void *data;
index c6e8e752972c47fbca807669dc01f5e8c1bc3921..c8721e567878cbc60091738ecbdd32a84ac660d9 100644 (file)
 #ifndef _MINIOS_TYPES_H_
 #define _MINIOS_TYPES_H_
 
-#include <sys/types.h>
+#include <bmk-core/types.h>
 
+typedef unsigned int           u_int;
+typedef unsigned long          u_long;
+typedef unsigned long          size_t;
+
+/* XXX: fix the kernelside Xen driver #include abuse */
+#ifndef offsetof
 #define offsetof(_t_,_e_) __builtin_offsetof(_t_,_e_)
+#endif
 
 #ifdef __i386__
 typedef struct { unsigned long pte_low, pte_high; } pte_t;