Changeset 3fbcadf in rtems


Ignore:
Timestamp:
Nov 16, 2012, 1:17:31 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
7e32b62
Parents:
94eb1bb
git-author:
Sebastian Huber <sebastian.huber@…> (11/16/12 13:17:31)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/21/12 15:29:41)
Message:

libnetworking: Use rtems_clock_get_uptime_seconds

This reduces the start-up time of the network stack.

With a 1ms tick the ticks since boot value overflows after approximately
50 days. This problem is avoided with the
rtems_clock_get_uptime_seconds() function.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/rtems/rtems_bsdnet_internal.h

    r94eb1bb r3fbcadf  
    140140int rtems_bsdnet_parse_driver_name (const struct rtems_bsdnet_ifconfig *config, char **namep);
    141141
    142 unsigned long rtems_bsdnet_seconds_since_boot (void);
     142static inline unsigned long rtems_bsdnet_seconds_since_boot(void)
     143{
     144  return (unsigned long) rtems_clock_get_uptime_seconds() + 1UL;
     145}
     146
    143147unsigned long rtems_bsdnet_random (void);
    144148
  • cpukit/libnetworking/rtems/rtems_glue.c

    r94eb1bb r3fbcadf  
    337337
    338338        /*
    339          * Ensure that `seconds' is greater than 0
    340          */
    341     while (rtems_bsdnet_seconds_since_boot() == 0)
    342         rtems_task_wake_after(1);
    343 
    344         /*
    345339         * Set up BSD-style sockets
    346340         */
     
    713707        rtems_bsdnet_semaphore_obtain ();
    714708        return sc;
    715 }
    716 
    717 unsigned long
    718 rtems_bsdnet_seconds_since_boot (void)
    719 {
    720         rtems_interval now;
    721 
    722         now = rtems_clock_get_ticks_since_boot();
    723         return now / rtems_bsdnet_ticks_per_second;
    724709}
    725710
  • testsuites/libtests/mghttpd01/init.c

    r94eb1bb r3fbcadf  
    4545                        "Date: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n" \
    4646                        "Last-Modified: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n" \
    47                         "Etag: \"21dae501.a2\"\r\n" \
     47                        "Etag: \"21dae500.a2\"\r\n" \
    4848                        "Content-Type: text/html\r\n" \
    4949                        "Content-Length: 162\r\n" \
Note: See TracChangeset for help on using the changeset viewer.