aboutsummaryrefslogtreecommitdiffstats
path: root/os/various/lwip_bindings
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-06-28 11:40:14 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-06-28 11:40:14 +0000
commit8131d84ea72494d9b60b0ad7477a9f63a1b43f94 (patch)
treea6dd7cd11a7c5dd9e08586c7565d0c184e03d775 /os/various/lwip_bindings
parent32490c00b3f484d228f1a7b80d19213c5c935c9c (diff)
downloadChibiOS-8131d84ea72494d9b60b0ad7477a9f63a1b43f94.tar.gz
ChibiOS-8131d84ea72494d9b60b0ad7477a9f63a1b43f94.tar.bz2
ChibiOS-8131d84ea72494d9b60b0ad7477a9f63a1b43f94.zip
lwIP bindings improvements. Added new function chRegSetThreadNamex().
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8058 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/various/lwip_bindings')
-rw-r--r--os/various/lwip_bindings/arch/sys_arch.c27
-rw-r--r--os/various/lwip_bindings/arch/sys_arch.h2
-rw-r--r--os/various/lwip_bindings/lwipthread.h2
3 files changed, 23 insertions, 8 deletions
diff --git a/os/various/lwip_bindings/arch/sys_arch.c b/os/various/lwip_bindings/arch/sys_arch.c
index 47e8c70a0..835d6f5c5 100644
--- a/os/various/lwip_bindings/arch/sys_arch.c
+++ b/os/various/lwip_bindings/arch/sys_arch.c
@@ -202,28 +202,43 @@ void sys_mbox_set_invalid(sys_mbox_t *mbox) {
sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread,
void *arg, int stacksize, int prio) {
-
size_t wsz;
void *wsp;
+ syssts_t sts;
+ thread_t *tp;
(void)name;
wsz = THD_WORKING_AREA_SIZE(stacksize);
wsp = chCoreAlloc(wsz);
if (wsp == NULL)
return NULL;
- return (sys_thread_t)chThdCreateStatic(wsp, wsz, prio, (tfunc_t)thread, arg);
+
+#if CH_DBG_FILL_THREADS == TRUE
+ _thread_memfill((uint8_t *)wsp,
+ (uint8_t *)wsp + sizeof(thread_t),
+ CH_DBG_THREAD_FILL_VALUE);
+ _thread_memfill((uint8_t *)wsp + sizeof(thread_t),
+ (uint8_t *)wsp + wsz,
+ CH_DBG_STACK_FILL_VALUE);
+#endif
+
+ sts = chSysGetStatusAndLockX();
+ tp = chThdCreateI(wsp, wsz, prio, (tfunc_t)thread, arg);
+ chRegSetThreadNameX(tp, name);
+ chThdStartI(tp);
+ chSysRestoreStatusX(sts);
+
+ return (sys_thread_t)tp;
}
sys_prot_t sys_arch_protect(void) {
- osalSysLock();
- return 0;
+ return chSysGetStatusAndLockX();
}
void sys_arch_unprotect(sys_prot_t pval) {
- (void)pval;
- osalSysUnlock();
+ osalSysRestoreStatusX((syssts_t)pval);
}
u32_t sys_now(void) {
diff --git a/os/various/lwip_bindings/arch/sys_arch.h b/os/various/lwip_bindings/arch/sys_arch.h
index 2eb0bb652..dd1a80ee4 100644
--- a/os/various/lwip_bindings/arch/sys_arch.h
+++ b/os/various/lwip_bindings/arch/sys_arch.h
@@ -56,7 +56,7 @@
typedef semaphore_t * sys_sem_t;
typedef mailbox_t * sys_mbox_t;
typedef thread_t * sys_thread_t;
-typedef int sys_prot_t;
+typedef syssts_t sys_prot_t;
#define SYS_MBOX_NULL (mailbox_t *)0
#define SYS_THREAD_NULL (thread_t *)0
diff --git a/os/various/lwip_bindings/lwipthread.h b/os/various/lwip_bindings/lwipthread.h
index d69323e64..e9b7367a0 100644
--- a/os/various/lwip_bindings/lwipthread.h
+++ b/os/various/lwip_bindings/lwipthread.h
@@ -43,7 +43,7 @@
/** @brief IP Address. */
#if !defined(LWIP_IPADDR) || defined(__DOXYGEN__)
-#define LWIP_IPADDR(p) IP4_ADDR(p, 192, 168, 1, 20)
+#define LWIP_IPADDR(p) IP4_ADDR(p, 192, 168, 1, 10)
#endif
/** @brief IP Gateway. */