[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #50698] Need separate sys_arch functions for interrupt
From: |
Daniel Elstner |
Subject: |
[lwip-devel] [bug #50698] Need separate sys_arch functions for interrupt context |
Date: |
Sat, 1 Apr 2017 15:28:38 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36 |
URL:
<http://savannah.nongnu.org/bugs/?50698>
Summary: Need separate sys_arch functions for interrupt
context
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: danielk
Submitted on: Sat 01 Apr 2017 09:28:36 PM CEST
Category: Platform ports
Severity: 3 - Normal
Item Group: Feature Request
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
lwIP version: git head
_______________________________________________________
Details:
Depending on the configuration, lwIP allows some operations to be executed
from interrupt context. E.g. the static callback mechanism is intended to
allow posting messages to the TCP/IP thread via tcpip_trycallback() directly
from an interrupt handler.
However, I noticed that tcpip_trycallback() calls into the same sys_arch
function -- sys_mbox_trypost() -- as tcpip_callback_with_block() does.
Unfortunately, this makes it impossible to use this feature on systems which
have separate API calls for user context and interrupt context, such as
FreeRTOS.
Thus I think the sys_arch API needs to be extended with a new function, say
sys_mbox_trypost_from_isr(). It would be optional and simply alias to
sys_mbox_trypost() by default. On the public API side, a corresponding
tcpip_trycallback_from_isr() would need to be added. Alternatively,
tcpip_trycallback() could be changed to use the new function and documented as
being callable from interrupt context only.
In order to support LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT, there would also
have to be separate versions of SYS_ARCH_(UN)PROTECT for use from interrupt
context, as some FreeRTOS ports also require different calls for these. This
would in turn also require separate ISR variants of memp_free() and
pbuf_free(), so it may not be worth the effort.
Caveat: In my own design I delegate most interrupt work to high-priority
threads which then in turn post messages to the lwIP thread. So I personally
don't have any immediate need for this, and wouldn't be eating my own dog food
if I contribute a patch.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?50698>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #50698] Need separate sys_arch functions for interrupt context,
Daniel Elstner <=