lwIP - A Lightweight TCP/IP stack - Bugs: bug #25608, Unable to use NO_SYS=1 and...
You are not allowed to post comments on this tracker with your current authentication level.
bug #25608: Unable to use NO_SYS=1 and SYS_LIGHTWEIGHT_PROT=1
Submitter: | Bill Auerbach <billauerbach> | ||
Submitted: | Tue 17 Feb 2009 02:55:15 PM UTC | ||
Category: | pbufs | Severity: | 3 - Normal |
Item Group: | Change Request | Status: | Fixed |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | CVS Head |
Jump to the original submission
Mon 27 Apr 2009 08:15:40 PM UTC, comment #21: |
Simon Goldschmidt <goldsimon> |
Mon 27 Apr 2009 08:05:15 PM UTC, comment #20: I'll check it in as I think it really is minor: I thought about incompatibilities because sys_prot_t is not defined any more, but if SYS_LIGHTWEIGHT_PROT is not defined (as it might well be up to now for the ones using NO_SYS=1), it does not matter if sys_prot_t is defined to u8_t or not defined at all. |
Simon Goldschmidt <goldsimon> |
Mon 27 Apr 2009 07:48:28 PM UTC, comment #19: Thanks. I for one am fine with that approach and can test a build with it implemented like that. I know these kinds of things are truly minor. |
Bill Auerbach <billauerbach> |
Mon 27 Apr 2009 07:43:36 PM UTC, comment #18: I guess this is a more generic problem since it also affects the TCP timestamp option (not working with NO_SYS=1 right now) since it needs sys_now().
|
Simon Goldschmidt <goldsimon> |
Wed 08 Apr 2009 09:24:03 PM UTC, comment #17: From Kieren's message above: "I can see what Bill is getting at. It looks to me as though the code in sys.h has been written to assume that if you're using NO_SYS=1, you are not using SYS_LIGHTWEIGHT_PROT=1: the SYS_LIGHTWEIGHT_PROT stuff requires sys_arch.c, but we only include sys_arch.h if NO_SYS=0"
|
Bill Auerbach <billauerbach> |
Wed 08 Apr 2009 07:58:13 PM UTC, comment #16: Bill, last time I checked I could use the defines with NO_SYS=1, not by implementing the functions but by overriding the defines (sys.h checks if they are already defined and does not re-define them).
|
Simon Goldschmidt <goldsimon> |
Wed 08 Apr 2009 07:04:04 PM UTC, comment #15: Maybe I meant to say that they belong in cc.h, not sys.h. Since I don't use a "sys", I don't focus on either of these files. :-)
|
Bill Auerbach <billauerbach> |
Wed 08 Apr 2009 06:59:24 PM UTC, comment #14: The point was, or is, in a nutshell, that one cannot use the protection macros as is with NO_SYS=1. The use of these macros shouldn't be prevented by using NO_SYS=1, because they can still be used in ISRs as you noted.
|
Bill Auerbach <billauerbach> |
Wed 08 Apr 2009 06:30:37 PM UTC, comment #13:
|
Jim Pettinato <jim_pettinato> |
Tue 03 Mar 2009 06:51:16 PM UTC, comment #12: What I meant was that in the NO_SYS=1 section in sys.h, there are some typedefs that would also have to be removed if including sys_arch.h. Of course we could have the ports use #if NO_SYS in sys_arch.h, but that would be a break to the existing ports (which we should avoid if it isn't necessary).
|
Simon Goldschmidt <goldsimon> |
Tue 03 Mar 2009 05:07:00 PM UTC, comment #11: Kieran, if protection isn't NO_SYS dependent, doesn't it make sense to move the protection #defines outside of the #if NO_SYS #else #endif group entirely?
|
Bill Auerbach <billauerbach> |
Tue 03 Mar 2009 04:52:11 PM UTC, comment #10: Your "shortcut" and adding the #defines to lwipopts.h is the only way to implement the protection macros without modifying lwip base files. Thanks for the tip - I didn't think about just not using the typedef at all. :-) |
Bill Auerbach <billauerbach> |
Tue 03 Mar 2009 04:51:04 PM UTC, comment #9: I can see what Bill is getting at. It looks to me as though the code in sys.h has been written to assume that if you're using NO_SYS=1, you are not using SYS_LIGHTWEIGHT_PROT=1: the SYS_LIGHTWEIGHT_PROT stuff requires sys_arch.c, but we only include sys_arch.h if NO_SYS=0
|
Kieran Mansley <kieranm> |
Tue 03 Mar 2009 04:02:59 PM UTC, comment #8:
|
Jim Pettinato <jim_pettinato> |
Tue 03 Mar 2009 03:53:57 PM UTC, comment #7: No, it needs 32 bits to store the current interrupt state which is then set to 0. To restore interrupts, this 32-bit value is written back to the register to enable only those interrupts that were on to begin with.
|
Bill Auerbach <billauerbach> |
Tue 03 Mar 2009 03:20:54 PM UTC, comment #6:
|
Jim Pettinato <jim_pettinato> |
Tue 03 Mar 2009 02:56:16 PM UTC, comment #5: Jim, you didn't need to change sys_prot_t? I do since my arch needs a u32_t.
|
Bill Auerbach <billauerbach> |
Tue 03 Mar 2009 02:51:03 PM UTC, comment #4:
|
Jim Pettinato <jim_pettinato> |
Tue 03 Mar 2009 02:11:09 PM UTC, comment #3: For NO_SYS=1:
|
Bill Auerbach <billauerbach> |
Sun 01 Mar 2009 05:32:55 PM UTC, comment #2: Having a look over sys.h, I just thought it would be nice to define SYS_PROT_xxx as macros, not as functions like it is now.
|
Simon Goldschmidt <goldsimon> |
Wed 18 Feb 2009 01:44:08 PM UTC, comment #1: This can be accomplished by 2 changes to sys.h:
|
Bill Auerbach <billauerbach> |
Tue 17 Feb 2009 02:55:15 PM UTC, original submission:
In sys.h, the sys_arch.h #include is bypassed when NO_SYS=1 preventing one from using SYS_LIGHTWEIGHT_PROT and the PROTECT macros. pbuf.c and memp.c use PROTECT macros which are needed when NO_SYS=1 as well to allow calling pbuf_free from an Interrupt Service Routine. |
Bill Auerbach <billauerbach> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2009-04-27 | goldsimon | Status | In Progress | Fixed | |
Open/Closed | Open | Closed | |||
2009-04-27 | goldsimon | Status | None | In Progress | |
Assigned to | None | goldsimon |
Powered by Savane 3.13-f8d8.
Corresponding source code
Done by moving sys_now out of the #if NO_SYS and removing the typedef for sys_prot_t from #if NO_SYS (can be defined in cc.h now). Please reopen if you disagree.