[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #7885] modification of api modules to support FreeRT
From: |
Artem Pisarenko |
Subject: |
[lwip-devel] [patch #7885] modification of api modules to support FreeRTOS-MPU (NO_SYS = 0) |
Date: |
Wed, 14 Nov 2012 05:08:15 +0000 |
User-agent: |
Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.10 |
URL:
<http://savannah.nongnu.org/patch/?7885>
Summary: modification of api modules to support FreeRTOS-MPU
(NO_SYS = 0)
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: jblackarty
Submitted on: Wed 14 Nov 2012 11:08:13 AM OMST
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
The patch makes lwip support system architectures (ports) based on
FreeRTOS-MPU (with memory protection unit) where tcpip thread must be run in
user mode. (Modification support lwip usage in all cases but I didn't
considered PPP. Maybe PPP module doesn't require modifications ever and will
work.)
FreeRTOS-MPU doesn't allow user-mode tasks to get access to other threads'
stacks. Current lwip code violates this rule because tcpip_thread accesses
local variables located on stack of api function (which belongs to application
thread) being passed by pointer via tcpip_msg. Based on static analysis of
code (manual, no special instruments :)) I followed all references to local
variables and moved them on heap/pool. This increases heap/pool usage but
decreases stack usage in application and tcpip threads.
There are also other MPU constraints which isn't being meet by lwip design.
They may be solved by means of port and application configuration. But this is
topic of separate discussion. This patch only makes strictly required changes
to lwip code itself.
"Release notes":
- LWIP_TCPIP_CORE_LOCKING option wasn't mentioned although I tried to consider
it
- new MEMP_NUM_SOCKET_API option added
- struct dns_api_msg (in api_msg.h) changed
- struct api_msg_msg (in api_msg.h) changed
- struct netifapi_msg_msg (in netifapi.h) changed
- some definitions of socket structures from sockets.c moved to header
I made some basic tests which covering code I modified except
lwip_getsockopt()/lwip_setsockopt() because I don't know sockets API so much.
Everything seems to work stable for me.
I expect project maintainers provide me with support to pass modified code
through all your internal tests and I'll report results.
I have STM3220G-EVAL board and from-scratch-made sys arch port and ethernet
driver designed to work in mem-pools configuration of lwip.
You can read discussion on this topic was started on mailing list
"[lwip-users] lwip and MPU (FreeRTOS-MPU)".
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Wed 14 Nov 2012 11:08:13 AM OMST Name: lwip_mpu_redesign__draft2.patch
Size: 39kB By: jblackarty
<http://savannah.nongnu.org/patch/download.php?file_id=26912>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?7885>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [patch #7885] modification of api modules to support FreeRTOS-MPU (NO_SYS = 0),
Artem Pisarenko <=