summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/lwip-include/arch
diff options
context:
space:
mode:
authorGalen Hazelwood <galenhz@gmail.com>2015-10-11 16:43:33 -0700
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-10-23 19:30:02 +0300
commit805c6534f8503f14a4d9e4169502e309b2a51bba (patch)
treea5c8425f8b1dafd4f780077bc5f717deff90f4e1 /extmod/lwip-include/arch
parent22cb7cd95336a4ce2f42e8f16cee71127f4728ce (diff)
downloadmicropython-805c6534f8503f14a4d9e4169502e309b2a51bba.tar.gz
micropython-805c6534f8503f14a4d9e4169502e309b2a51bba.zip
extmod/modlwip: Initial commit of the lwip network stack module
Diffstat (limited to 'extmod/lwip-include/arch')
-rw-r--r--extmod/lwip-include/arch/cc.h41
-rw-r--r--extmod/lwip-include/arch/perf.h7
2 files changed, 48 insertions, 0 deletions
diff --git a/extmod/lwip-include/arch/cc.h b/extmod/lwip-include/arch/cc.h
new file mode 100644
index 0000000000..0a7907d347
--- /dev/null
+++ b/extmod/lwip-include/arch/cc.h
@@ -0,0 +1,41 @@
+#ifndef __CC_H__
+#define __CC_H__
+
+#include <stdint.h>
+
+// Generate lwip's internal types from stdint
+
+typedef uint8_t u8_t;
+typedef int8_t s8_t;
+typedef uint16_t u16_t;
+typedef int16_t s16_t;
+typedef uint32_t u32_t;
+typedef int32_t s32_t;
+
+typedef u32_t mem_ptr_t;
+
+#define U16_F "hu"
+#define S16_F "hd"
+#define X16_F "hx"
+#define U32_F "u"
+#define S32_F "d"
+#define X32_F "x"
+
+#define X8_F "02x"
+#define SZT_F "u"
+
+#define BYTE_ORDER LITTLE_ENDIAN
+
+#define LWIP_CHKSUM_ALGORITHM 2
+
+#include <assert.h>
+#define LWIP_PLATFORM_DIAG(x)
+#define LWIP_PLATFORM_ASSERT(x) { assert(1); }
+
+//#define PACK_STRUCT_FIELD(x) x __attribute__((packed))
+#define PACK_STRUCT_FIELD(x) x
+#define PACK_STRUCT_STRUCT __attribute__((packed))
+#define PACK_STRUCT_BEGIN
+#define PACK_STRUCT_END
+
+#endif /* __ARCH_CC_H__ */
diff --git a/extmod/lwip-include/arch/perf.h b/extmod/lwip-include/arch/perf.h
new file mode 100644
index 0000000000..51710701a2
--- /dev/null
+++ b/extmod/lwip-include/arch/perf.h
@@ -0,0 +1,7 @@
+#ifndef __PERF_H__
+#define __PERF_H__
+
+#define PERF_START /* null definition */
+#define PERF_STOP(x) /* null definition */
+
+#endif /* __PERF_H__ */