summaryrefslogtreecommitdiffstats
path: root/src/VBox/Devices/Network/lwip-new/vbox/include/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Devices/Network/lwip-new/vbox/include/arch')
-rw-r--r--src/VBox/Devices/Network/lwip-new/vbox/include/arch/bpstruct.h1
-rw-r--r--src/VBox/Devices/Network/lwip-new/vbox/include/arch/cc.h62
-rw-r--r--src/VBox/Devices/Network/lwip-new/vbox/include/arch/epstruct.h1
-rw-r--r--src/VBox/Devices/Network/lwip-new/vbox/include/arch/perf.h7
-rw-r--r--src/VBox/Devices/Network/lwip-new/vbox/include/arch/sys_arch.h39
5 files changed, 110 insertions, 0 deletions
diff --git a/src/VBox/Devices/Network/lwip-new/vbox/include/arch/bpstruct.h b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/bpstruct.h
new file mode 100644
index 00000000..1d81e3f7
--- /dev/null
+++ b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/bpstruct.h
@@ -0,0 +1 @@
+#pragma pack(push,1)
diff --git a/src/VBox/Devices/Network/lwip-new/vbox/include/arch/cc.h b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/cc.h
new file mode 100644
index 00000000..90ed1b53
--- /dev/null
+++ b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/cc.h
@@ -0,0 +1,62 @@
+#ifndef VBOX_ARCH_CC_H_
+#define VBOX_ARCH_CC_H_
+
+#ifndef LOG_GROUP
+#define LOG_GROUP LOG_GROUP_DRV_LWIP
+#endif
+#include <VBox/log.h>
+#include <iprt/stdint.h>
+#include <iprt/cdefs.h>
+#include <iprt/assert.h>
+#include <iprt/time.h>
+
+#ifndef RT_OS_WINDOWS
+# define LWIP_TIMEVAL_PRIVATE 0
+#endif
+
+typedef uint8_t u8_t;
+#ifndef RT_OS_SOLARIS
+typedef int8_t s8_t;
+#else
+/* Solaris /usr/include/sys/int_types.h incorrectly defines int8_t as "char" */
+typedef signed char s8_t;
+#endif
+typedef uint16_t u16_t;
+typedef int16_t s16_t;
+typedef uint32_t u32_t;
+typedef int32_t s32_t;
+
+typedef uintptr_t mem_ptr_t;
+
+#ifdef _MSC_VER
+# define PACK_STRUCT_FIELD(x) x
+# define PACK_STRUCT_STRUCT
+# define PACK_STRUCT_USE_INCLUDES
+# if _MSC_VER < 1600
+# define LWIP_PROVIDE_ERRNO
+# else
+# include <errno.h>
+# endif
+# pragma warning (disable: 4103)
+#elif defined(__GNUC__)
+# define PACK_STRUCT_FIELD(x) x
+# define PACK_STRUCT_STRUCT __attribute__((__packed__))
+# define PACK_STRUCT_BEGIN
+# define PACK_STRUCT_END
+# include <errno.h>
+#else
+# error This header file has not been ported yet for this compiler.
+#endif
+
+/* Provide byte order hint. */
+#undef BYTE_ORDER
+#define BYTE_ORDER LITTLE_ENDIAN
+
+#ifdef DEBUG
+#define LWIP_PLATFORM_DIAG(x) Log(x)
+#else /* !DEBUG */
+#define LWIP_PLATFORM_DIAG(x) LogRel(x)
+#endif /* !DEBUG */
+#define LWIP_PLATFORM_ASSERT(x) AssertReleaseMsgFailed((x))
+
+#endif /* !VBOX_ARCH_CC_H_ */
diff --git a/src/VBox/Devices/Network/lwip-new/vbox/include/arch/epstruct.h b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/epstruct.h
new file mode 100644
index 00000000..65898b54
--- /dev/null
+++ b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/epstruct.h
@@ -0,0 +1 @@
+#pragma pack(pop)
diff --git a/src/VBox/Devices/Network/lwip-new/vbox/include/arch/perf.h b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/perf.h
new file mode 100644
index 00000000..5b364db0
--- /dev/null
+++ b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/perf.h
@@ -0,0 +1,7 @@
+#ifndef VBOX_ARCH_PERF_H_
+#define VBOX_ARCH_PERF_H_
+
+#define PERF_START
+#define PERF_STOP(x)
+
+#endif /* !VBOX_ARCH_PERF_H_ */
diff --git a/src/VBox/Devices/Network/lwip-new/vbox/include/arch/sys_arch.h b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/sys_arch.h
new file mode 100644
index 00000000..6a83cea3
--- /dev/null
+++ b/src/VBox/Devices/Network/lwip-new/vbox/include/arch/sys_arch.h
@@ -0,0 +1,39 @@
+#ifndef VBOX_ARCH_SYS_ARCH_H_
+#define VBOX_ARCH_SYS_ARCH_H_
+
+#include <iprt/semaphore.h>
+#include <iprt/thread.h>
+#ifdef RT_OS_DARWIN
+#include <sys/time.h>
+#endif
+
+/** NULL value for a mbox. */
+#define SYS_MBOX_NULL NULL
+
+/** NULL value for a mutex semaphore. */
+#define SYS_SEM_NULL NIL_RTSEMEVENT
+
+/** The IPRT event semaphore ID just works fine for this type. */
+typedef RTSEMEVENT sys_sem_t;
+
+
+/** The opaque type of a mbox. */
+typedef void *sys_mbox_t;
+
+/** The IPRT thread ID just works fine for this type. */
+typedef RTTHREAD sys_thread_t;
+
+#if SYS_LIGHTWEIGHT_PROT
+/** This is just a dummy. The implementation doesn't need anything. */
+typedef void *sys_prot_t;
+#endif
+
+/** Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid */
+int sys_mbox_valid(sys_mbox_t *mbox);
+/** Set an mbox invalid so that sys_mbox_valid returns 0 */
+void sys_mbox_set_invalid(sys_mbox_t *mbox);
+
+#define sys_sem_valid(sem) ((sem) && (*(sem)))
+#define sys_sem_set_invalid(sem) do {} while(0)
+
+#endif /* !VBOX_ARCH_SYS_ARCH_H_ */