patchlwIP - A Lightweight TCP/IP stack - Patches: patch #7221, Changes to init.c for NO_SYS=1

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #7221: Changes to init.c for NO_SYS=1

Submitter:  Bill Auerbach <billauerbach>
Submitted:  Mon 14 Jun 2010 06:36:31 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Thu 24 Jun 2010 09:54:35 PM UTC, comment #4: 

Thanks Simon. I hope this helps get more users to move to 1.4.

Bill Auerbach <billauerbach>
Thu 24 Jun 2010 08:28:51 PM UTC, comment #3: 

OK, I agree to the upgrading issue. I've added an option NO_SYS_NO_TIMERS to drop timer support for NO_SYS==1 for easier upgrading.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 17 Jun 2010 12:26:33 PM UTC, comment #2: 

It's new in 1.4 (that "for some time now" is less than 6 months). Everyone with NO_SYS=1 will already have timer handling in place (or they won't have a functioning stack).  It's great that it's there, but 1) Should I be forced to use it? and 2) I have one 10 line C function that handles all of the timers with only the overhead of a modulus operator - the change in code size and efficiency going to timers.c is possibly 10 to 1.

We need then an LWIP_SUPPORTS_TIMERS for those who have something working and don't need (or want) to change their method.

I'm working on shipping products and can't easily test CVS_HEAD.  I am now on one project but it's imperative that I can easily go back to 1.3.2 in case I need a maintenance release.  The easier it is to go to 1.4 and back to 1.3.2 from there the more you'll find users will be able to help test 1.4.

Bill Auerbach <billauerbach>
Thu 17 Jun 2010 06:16:01 AM UTC, comment #1: 

There are three changes in the patch:
a) Check for sufficient timeouts in the pool
b) call sys_init
c) call sys_timeouts_init

Since some time, timers.c also handles timeouts for NO_SYS==1, so a) and c) are necessary.

However, b) could be left away, but first I would like to know why this hasn't been a problem so far: it's in there for some time now...

Simon Goldschmidt <goldsimon>
Group administrator
Mon 14 Jun 2010 06:36:31 PM UTC, original submission:  

I think the following is needed for NO_SYS=1


RCS file: /sources/lwip/lwip/src/core/init.c,v
retrieving revision 1.55
diff -u -r1.55 init.c
--- init.c        15 May 2010 17:10:08 -0000        1.55
+++ init.c        14 Jun 2010 18:31:20 -0000
@@ -145,7 +145,7 @@
   #error "One and exactly one of LWIP_EVENT_API and LWIP_CALLBACK_API has to be enabled in your lwipopts.h"
 #endif
 /* There must be sufficient timeouts, taking into account requirements of the subsystems. */
-#if (MEMP_NUM_SYS_TIMEOUT < (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_SUPPORT))
+#if (NO_SYS==0) && (MEMP_NUM_SYS_TIMEOUT < (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_SUPPORT))
   #error "MEMP_NUM_SYS_TIMEOUT is too low to accomodate all required timeouts"
 #endif
 #if (IP_REASSEMBLY && (MEMP_NUM_REASSDATA > IP_REASS_MAX_PBUFS))
@@ -261,7 +261,9 @@

   /* Modules initialization */
   stats_init();
+#if NO_SYS==0
   sys_init();
+#endif
   mem_init();
   memp_init();
   pbuf_init();
@@ -295,5 +297,7 @@
   dns_init();
 #endif /* LWIP_DNS */

+#if NO_SYS==0
   sys_timeouts_init();
+#endif
 }


Bill Auerbach <billauerbach>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by billauerbach (Submitted the item)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-06-24 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code