lwip operating system abstraction layer implementation based on CMSIS-RTOS

Dependents:   LwIPNetworking NetServicesMin EthernetInterface EthernetInterface_RSF ... more

Files at this revision

API Documentation at this revision

Comitter:
donatien
Date:
Mon Jul 16 14:46:19 2012 +0000
Parent:
4:dd37867293e7
Child:
6:2ace1ff71ae6
Commit message:
Fixed sys_arch.c for compatibility with mbed-rtos rev. 1 +; If you need to stick to using mbed-rtos rev. 0 do NOT update or the compilation will fail

Changed in this revision

arch/sys_arch.c Show annotated file Show diff for this revision Revisions of this file
--- a/arch/sys_arch.c	Fri Jul 06 08:55:22 2012 +0000
+++ b/arch/sys_arch.c	Mon Jul 16 14:46:19 2012 +0000
@@ -443,8 +443,12 @@
 #ifdef CMSIS_OS_RTX
     t->def.pthread = (os_pthread)thread;
     t->def.tpriority = (osPriority)priority;
-    t->def.instances = 1;
     t->def.stacksize = stacksize;
+    t->def.stack_pointer = (unsigned char*) malloc(stacksize); //Note DG: I don't think that malloc is always thread-safe, this could lead to memory corruption in some cases
+    if (t->def.stack_pointer == NULL)
+    {
+      error("Error allocating the stack memory");
+    }
 #endif
     t->id = osThreadCreate(&t->def, arg);
     if (t->id == NULL)