<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-03-04)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
 <font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-04 Joel Sherrill <joel.sherrilL@OARcorp.com>

        PR 1744/doc
        * user/clock.t: rtems_clock_time_value type uses changed to struct
        timeval.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/doc/ChangeLog.diff?r1=text&tr1=1.298&r2=text&tr2=1.299&diff_format=h">M</a></td><td width='1%'>1.299</td><td width='100%'>doc/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/doc/ChangeLog.diff?r1=text&tr1=1.274.2.13&r2=text&tr2=1.274.2.14&diff_format=h">M</a></td><td width='1%'>1.274.2.14</td><td width='100%'>doc/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/doc/user/clock.t.diff?r1=text&tr1=1.26&r2=text&tr2=1.27&diff_format=h">M</a></td><td width='1%'>1.27</td><td width='100%'>doc/user/clock.t</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/doc/user/clock.t.diff?r1=text&tr1=1.26&r2=text&tr2=1.26.2.1&diff_format=h">M</a></td><td width='1%'>1.26.2.1</td><td width='100%'>doc/user/clock.t</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/doc/ChangeLog:1.298 rtems/doc/ChangeLog:1.299
--- rtems/doc/ChangeLog:1.298   Mon Feb 28 15:58:30 2011
+++ rtems/doc/ChangeLog Fri Mar  4 09:34:10 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-03-04    Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+       PR 1744/doc
+       * user/clock.t: rtems_clock_time_value type uses changed to struct
+       timeval.
+
</font> 2011-02-28        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * setup.def, shell/preface.texi: Bump to 4.10.99.0

<font color='#006600'>diff -u rtems/doc/ChangeLog:1.274.2.13 rtems/doc/ChangeLog:1.274.2.14
--- rtems/doc/ChangeLog:1.274.2.13      Tue Feb  8 11:18:29 2011
+++ rtems/doc/ChangeLog Fri Mar  4 09:34:16 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-03-04    Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+       PR 1744/doc
+       * user/clock.t: rtems_clock_time_value type uses changed to struct
+       timeval.
+
</font> 2011-02-08        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
        * common/cpright.texi: Update copyright.

<font color='#006600'>diff -u rtems/doc/user/clock.t:1.26 rtems/doc/user/clock.t:1.27
--- rtems/doc/user/clock.t:1.26 Mon Jan 11 10:18:04 2010
+++ rtems/doc/user/clock.t      Fri Mar  4 09:34:10 2011
</font><font color='#997700'>@@ -345,7 +345,7 @@
</font> 
 @item @code{@value{RPREFIX}CLOCK_GET_TICKS_PER_SECOND} - (rtems_interval *)
 
<font color='#880000'>-@item @code{@value{RPREFIX}CLOCK_GET_TIME_VALUE} - (rtems_clock_time_value *)
</font><font color='#000088'>+@item @code{@value{RPREFIX}CLOCK_GET_TIME_VALUE} - (struct timeval *)
</font> 
 @end itemize
 @end ifset

<font color='#006600'>diff -u rtems/doc/user/clock.t:1.26 rtems/doc/user/clock.t:1.26.2.1
--- rtems/doc/user/clock.t:1.26 Mon Jan 11 10:18:04 2010
+++ rtems/doc/user/clock.t      Fri Mar  4 09:34:16 2011
</font><font color='#997700'>@@ -345,7 +345,7 @@
</font> 
 @item @code{@value{RPREFIX}CLOCK_GET_TICKS_PER_SECOND} - (rtems_interval *)
 
<font color='#880000'>-@item @code{@value{RPREFIX}CLOCK_GET_TIME_VALUE} - (rtems_clock_time_value *)
</font><font color='#000088'>+@item @code{@value{RPREFIX}CLOCK_GET_TIME_VALUE} - (struct timeval *)
</font> 
 @end itemize
 @end ifset
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
 <font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-04 Till Straumann <strauman@slac.stanford.edu>

        PR 1738/bsps
        * clock/clock.c, include/bsp.h, network/network.c: system clock driver
        programs the PIT w/o assuming the CPU clock frequency being a power
        of two.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog.diff?r1=text&tr1=1.119&r2=text&tr2=1.120&diff_format=h">M</a></td><td width='1%'>1.120</td><td width='100%'>c/src/lib/libbsp/m68k/uC5282/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog.diff?r1=text&tr1=1.115.2.2&r2=text&tr2=1.115.2.3&diff_format=h">M</a></td><td width='1%'>1.115.2.3</td><td width='100%'>c/src/lib/libbsp/m68k/uC5282/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c.diff?r1=text&tr1=1.17&r2=text&tr2=1.18&diff_format=h">M</a></td><td width='1%'>1.18</td><td width='100%'>c/src/lib/libbsp/m68k/uC5282/clock/clock.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c.diff?r1=text&tr1=1.16&r2=text&tr2=1.16.2.1&diff_format=h">M</a></td><td width='1%'>1.16.2.1</td><td width='100%'>c/src/lib/libbsp/m68k/uC5282/clock/clock.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h.diff?r1=text&tr1=1.25&r2=text&tr2=1.26&diff_format=h">M</a></td><td width='1%'>1.26</td><td width='100%'>c/src/lib/libbsp/m68k/uC5282/include/bsp.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h.diff?r1=text&tr1=1.25&r2=text&tr2=1.25.2.1&diff_format=h">M</a></td><td width='1%'>1.25.2.1</td><td width='100%'>c/src/lib/libbsp/m68k/uC5282/include/bsp.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c.diff?r1=text&tr1=1.30&r2=text&tr2=1.31&diff_format=h">M</a></td><td width='1%'>1.31</td><td width='100%'>c/src/lib/libbsp/m68k/uC5282/network/network.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c.diff?r1=text&tr1=1.30&r2=text&tr2=1.30.2.1&diff_format=h">M</a></td><td width='1%'>1.30.2.1</td><td width='100%'>c/src/lib/libbsp/m68k/uC5282/network/network.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog:1.119 rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog:1.120
--- rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog:1.119  Thu Feb 17 07:25:10 2011
+++ rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog        Fri Mar  4 10:03:46 2011
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2011-03-04    Till Straumann <strauman@slac.stanford.edu>
+
+       PR 1738/bsps
+       * clock/clock.c, include/bsp.h, network/network.c: system clock driver
+       programs the PIT w/o assuming the CPU clock frequency being a power
+       of two.
+
</font> 2011-02-17        Till Straumann <strauman@slac.stanford.edu>
 
        PR 1738/bsps

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog:1.115.2.2 rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog:1.115.2.3
--- rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog:1.115.2.2      Thu Feb 17 07:25:24 2011
+++ rtems/c/src/lib/libbsp/m68k/uC5282/ChangeLog        Fri Mar  4 10:03:53 2011
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2011-03-04    Till Straumann <strauman@slac.stanford.edu>
+
+       PR 1738/bsps
+       * clock/clock.c, include/bsp.h, network/network.c: system clock driver
+       programs the PIT w/o assuming the CPU clock frequency being a power
+       of two.
+
</font> 2011-02-17        Till Straumann <strauman@slac.stanford.edu>
 
        PR 1738/bsps

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c:1.17 rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c:1.18
--- rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c:1.17       Fri Feb 11 06:34:18 2011
+++ rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c    Fri Mar  4 10:03:46 2011
</font><font color='#997700'>@@ -26,19 +26,19 @@
</font>  * CPU load counters
  * Place in static RAM so updates don't hit the SDRAM
  */
<font color='#880000'>-extern int __SRAMBASE[];
-#define IDLE_COUNTER      __SRAMBASE[0]
-#define FILTERED_IDLE     __SRAMBASE[1]
-#define MAX_IDLE_COUNT    __SRAMBASE[2]
-#define USEC_PER_TICK     __SRAMBASE[3]
</font><font color='#000088'>+#define IDLE_COUNTER    __SRAMBASE.idle_counter
+#define FILTERED_IDLE   __SRAMBASE.filtered_idle
+#define MAX_IDLE_COUNT  __SRAMBASE.max_idle_count
+#define PITC_PER_TICK   __SRAMBASE.pitc_per_tick
+#define NSEC_PER_PITC   __SRAMBASE.nsec_per_pitc
</font> #define FILTER_SHIFT    6
 
 uint32_t bsp_clock_nanoseconds_since_last_tick(void)
 {
     int i = MCF5282_PIT3_PCNTR;
     if (MCF5282_PIT3_PCSR & MCF5282_PIT_PCSR_PIF)
<font color='#880000'>-        i = MCF5282_PIT3_PCNTR - USEC_PER_TICK;
-    return (USEC_PER_TICK - i) * 1000;
</font><font color='#000088'>+        i = MCF5282_PIT3_PCNTR - PITC_PER_TICK;
+    return (PITC_PER_TICK - i) * NSEC_PER_PITC;
</font> }
 
 #define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
<font color='#997700'>@@ -48,7 +48,7 @@
</font>  */
 #define Clock_driver_support_at_tick()                                       \
     do {                                                                     \
<font color='#880000'>-        int idle = IDLE_COUNTER;                                             \
</font><font color='#000088'>+        unsigned idle = IDLE_COUNTER;                                        \
</font>         IDLE_COUNTER = 0;                                                    \
         if (idle > MAX_IDLE_COUNT)                                           \
             MAX_IDLE_COUNT = idle;                                           \
<font color='#997700'>@@ -75,20 +75,31 @@
</font> /*
  * Set up the clock hardware
  *
<font color='#880000'>- * Prescale so that it counts in microseconds
- * System clock frequency better be 2**n (1<=n<=16) MHz!
</font><font color='#000088'>+ * f_pit = f_clk / 2^(preScaleCode+1) / N  = 1/(us_per_tick/us_per_s)
+ *
+ * N = f_clk / 2^(preScaleCode+1) * us_per_tick / us_per_s
+ *
+ * ns_per_pit_clk = ns_per_s / (f_clk / 2^(preScaleCode+1))
+ *                = ns_per_s * 2^(preScaleCode+1) / f_clk;
</font>  */
 #define Clock_driver_support_initialize_hardware()                       \
     do {                                                                 \
<font color='#000088'>+           unsigned long long N;                                            \
</font>         int level;                                                       \
<font color='#880000'>-        int preScaleCode = -2;                                           \
-        int preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;       \
-        while (preScaleDivisor) {                                        \
-            preScaleDivisor >>= 1;                                       \
-            preScaleCode++;                                              \
-        }                                                                \
-        IDLE_COUNTER = 0;                                                \
-        FILTERED_IDLE = 0;                                               \
</font><font color='#000088'>+        int preScaleCode = 0;                                            \
+               N  = bsp_get_CPU_clock_speed();                                  \
+               N *= rtems_configuration_get_microseconds_per_tick();            \
+               N /= 2*1000000; /* min_prescale * us_per_s */                    \
+               while ( N > 0x10000 ) {                                          \
+                       preScaleCode++;                                              \
+                       N >>= 1;                                                     \
+               }                                                                \
+               PITC_PER_TICK  = N;                                              \
+               N  = 2000000000ULL << preScaleCode;                              \
+               N /= bsp_get_CPU_clock_speed();                                  \
+               NSEC_PER_PITC  = N;                                              \
+        IDLE_COUNTER   = 0;                                              \
+        FILTERED_IDLE  = 0;                                              \
</font>         MAX_IDLE_COUNT = 0;                                              \
         bsp_allocate_interrupt(PIT3_IRQ_LEVEL, PIT3_IRQ_PRIORITY);       \
         MCF5282_INTC0_ICR58 = MCF5282_INTC_ICR_IL(PIT3_IRQ_LEVEL) |      \
<font color='#997700'>@@ -101,8 +112,7 @@
</font>                             MCF5282_PIT_PCSR_OVW |                       \
                             MCF5282_PIT_PCSR_PIE |                       \
                             MCF5282_PIT_PCSR_RLD;                        \
<font color='#880000'>-        USEC_PER_TICK = rtems_configuration_get_microseconds_per_tick(); \
-        MCF5282_PIT3_PMR = USEC_PER_TICK - 1;                            \
</font><font color='#000088'>+        MCF5282_PIT3_PMR = PITC_PER_TICK - 1;                            \
</font>         MCF5282_PIT3_PCSR = MCF5282_PIT_PCSR_PRE(preScaleCode) |         \
                             MCF5282_PIT_PCSR_PIE |                       \
                             MCF5282_PIT_PCSR_RLD |                       \
<font color='#997700'>@@ -114,8 +124,9 @@
</font>  */
 Thread bsp_idle_thread(uint32_t ignored)
 {
<font color='#880000'>-    for(;;)
-        __asm__ volatile ("addq.l #1,__SRAMBASE"); /* Atomic increment */
</font><font color='#000088'>+  /* Atomic increment */
+  for(;;)
+    __asm__ volatile ("addq.l #1,%0"::"m"(IDLE_COUNTER));
</font> }
 
 int rtems_bsp_cpu_load_percentage(void)

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c:1.16 rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c:1.16.2.1
--- rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c:1.16       Wed Aug 26 08:32:22 2009
+++ rtems/c/src/lib/libbsp/m68k/uC5282/clock/clock.c    Fri Mar  4 10:03:53 2011
</font><font color='#997700'>@@ -26,19 +26,19 @@
</font>  * CPU load counters
  * Place in static RAM so updates don't hit the SDRAM
  */
<font color='#880000'>-extern int __SRAMBASE[];
-#define IDLE_COUNTER      __SRAMBASE[0]
-#define FILTERED_IDLE     __SRAMBASE[1]
-#define MAX_IDLE_COUNT    __SRAMBASE[2]
-#define USEC_PER_TICK     __SRAMBASE[3]
</font><font color='#000088'>+#define IDLE_COUNTER    __SRAMBASE.idle_counter
+#define FILTERED_IDLE   __SRAMBASE.filtered_idle
+#define MAX_IDLE_COUNT  __SRAMBASE.max_idle_count
+#define PITC_PER_TICK   __SRAMBASE.pitc_per_tick
+#define NSEC_PER_PITC   __SRAMBASE.nsec_per_pitc
</font> #define FILTER_SHIFT    6
 
 uint32_t bsp_clock_nanoseconds_since_last_tick(void)
 {
     int i = MCF5282_PIT3_PCNTR;
     if (MCF5282_PIT3_PCSR & MCF5282_PIT_PCSR_PIF)
<font color='#880000'>-        i = MCF5282_PIT3_PCNTR - USEC_PER_TICK;
-    return (USEC_PER_TICK - i) * 1000;
</font><font color='#000088'>+        i = MCF5282_PIT3_PCNTR - PITC_PER_TICK;
+    return (PITC_PER_TICK - i) * NSEC_PER_PITC;
</font> }
 
 #define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
<font color='#997700'>@@ -48,7 +48,7 @@
</font>  */
 #define Clock_driver_support_at_tick()                                       \
     do {                                                                     \
<font color='#880000'>-        int idle = IDLE_COUNTER;                                             \
</font><font color='#000088'>+        unsigned idle = IDLE_COUNTER;                                        \
</font>         IDLE_COUNTER = 0;                                                    \
         if (idle > MAX_IDLE_COUNT)                                           \
             MAX_IDLE_COUNT = idle;                                           \
<font color='#997700'>@@ -75,20 +75,31 @@
</font> /*
  * Set up the clock hardware
  *
<font color='#880000'>- * Prescale so that it counts in microseconds
- * System clock frequency better be 2**n (1<=n<=16) MHz!
</font><font color='#000088'>+ * f_pit = f_clk / 2^(preScaleCode+1) / N  = 1/(us_per_tick/us_per_s)
+ *
+ * N = f_clk / 2^(preScaleCode+1) * us_per_tick / us_per_s
+ *
+ * ns_per_pit_clk = ns_per_s / (f_clk / 2^(preScaleCode+1))
+ *                = ns_per_s * 2^(preScaleCode+1) / f_clk;
</font>  */
 #define Clock_driver_support_initialize_hardware()                       \
     do {                                                                 \
<font color='#000088'>+           unsigned long long N;                                            \
</font>         int level;                                                       \
<font color='#880000'>-        int preScaleCode = -2;                                           \
-        int preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;       \
-        while (preScaleDivisor) {                                        \
-            preScaleDivisor >>= 1;                                       \
-            preScaleCode++;                                              \
-        }                                                                \
-        IDLE_COUNTER = 0;                                                \
-        FILTERED_IDLE = 0;                                               \
</font><font color='#000088'>+        int preScaleCode = 0;                                            \
+               N  = bsp_get_CPU_clock_speed();                                  \
+               N *= rtems_configuration_get_microseconds_per_tick();            \
+               N /= 2*1000000; /* min_prescale * us_per_s */                    \
+               while ( N > 0x10000 ) {                                          \
+                       preScaleCode++;                                              \
+                       N >>= 1;                                                     \
+               }                                                                \
+               PITC_PER_TICK  = N;                                              \
+               N  = 2000000000ULL << preScaleCode;                              \
+               N /= bsp_get_CPU_clock_speed();                                  \
+               NSEC_PER_PITC  = N;                                              \
+        IDLE_COUNTER   = 0;                                              \
+        FILTERED_IDLE  = 0;                                              \
</font>         MAX_IDLE_COUNT = 0;                                              \
         bsp_allocate_interrupt(PIT3_IRQ_LEVEL, PIT3_IRQ_PRIORITY);       \
         MCF5282_INTC0_ICR58 = MCF5282_INTC_ICR_IL(PIT3_IRQ_LEVEL) |      \
<font color='#997700'>@@ -101,8 +112,7 @@
</font>                             MCF5282_PIT_PCSR_OVW |                       \
                             MCF5282_PIT_PCSR_PIE |                       \
                             MCF5282_PIT_PCSR_RLD;                        \
<font color='#880000'>-        USEC_PER_TICK = rtems_configuration_get_microseconds_per_tick(); \
-        MCF5282_PIT3_PMR = USEC_PER_TICK - 1;                            \
</font><font color='#000088'>+        MCF5282_PIT3_PMR = PITC_PER_TICK - 1;                            \
</font>         MCF5282_PIT3_PCSR = MCF5282_PIT_PCSR_PRE(preScaleCode) |         \
                             MCF5282_PIT_PCSR_PIE |                       \
                             MCF5282_PIT_PCSR_RLD |                       \
<font color='#997700'>@@ -115,7 +125,7 @@
</font> Thread bsp_idle_thread(uint32_t ignored)
 {
     for(;;)
<font color='#880000'>-        asm volatile ("addq.l #1,__SRAMBASE"); /* Atomic increment */
</font><font color='#000088'>+        asm volatile ("addq.l #1,%0"::"m"(IDLE_COUNTER)); /* Atomic increment */
</font> }
 
 int rtems_bsp_cpu_load_percentage(void)

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h:1.25 rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h:1.26
--- rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h:1.25       Sun Nov 29 08:59:41 2009
+++ rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h    Fri Mar  4 10:03:46 2011
</font><font color='#997700'>@@ -134,6 +134,31 @@
</font> void *bsp_idle_thread( uintptr_t ignored );
 #define BSP_IDLE_TASK_BODY bsp_idle_thread
 
<font color='#000088'>+/*
+ * SRAM. The BSP uses SRAM for maintaining some clock-driver data
+ *       and for ethernet descriptors (and the initial stack during
+ *       early boot).
+ */
+
+typedef struct mcf5282BufferDescriptor_ {
+    volatile uint16_t   status;
+    uint16_t                   length;
+    volatile void      *buffer;
+} mcf5282BufferDescriptor_t;
+
+extern struct {
+       uint32_t                  idle_counter;
+       uint32_t                  filtered_idle;
+       uint32_t                  max_idle_count;
+       uint32_t                  pitc_per_tick;
+       uint32_t                  nsec_per_pitc;
+       uint32_t                  pad[3]; /* align to 16-bytes for descriptors */
+       mcf5282BufferDescriptor_t fec_descriptors[];
+       /* buffer descriptors are allocated from here */
+
+    /* initial stack is at top of SRAM (start.S)  */
+} __SRAMBASE;
+
</font> #ifdef __cplusplus
 }
 #endif

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h:1.25 rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h:1.25.2.1
--- rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h:1.25       Sun Nov 29 08:59:41 2009
+++ rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h    Fri Mar  4 10:03:53 2011
</font><font color='#997700'>@@ -134,6 +134,31 @@
</font> void *bsp_idle_thread( uintptr_t ignored );
 #define BSP_IDLE_TASK_BODY bsp_idle_thread
 
<font color='#000088'>+/*
+ * SRAM. The BSP uses SRAM for maintaining some clock-driver data
+ *       and for ethernet descriptors (and the initial stack during
+ *       early boot).
+ */
+
+typedef struct mcf5282BufferDescriptor_ {
+    volatile uint16_t   status;
+    uint16_t                   length;
+    volatile void      *buffer;
+} mcf5282BufferDescriptor_t;
+
+extern struct {
+       uint32_t                  idle_counter;
+       uint32_t                  filtered_idle;
+       uint32_t                  max_idle_count;
+       uint32_t                  pitc_per_tick;
+       uint32_t                  nsec_per_pitc;
+       uint32_t                  pad[3]; /* align to 16-bytes for descriptors */
+       mcf5282BufferDescriptor_t fec_descriptors[];
+       /* buffer descriptors are allocated from here */
+
+    /* initial stack is at top of SRAM (start.S)  */
+} __SRAMBASE;
+
</font> #ifdef __cplusplus
 }
 #endif

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c:1.30 rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c:1.31
--- rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c:1.30   Tue Apr 27 13:23:44 2010
+++ rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c        Fri Mar  4 10:03:46 2011
</font><font color='#997700'>@@ -81,12 +81,6 @@
</font>     #error "Driver must have MCLBYTES > RBUF_SIZE"
 #endif
 
<font color='#880000'>-typedef struct mcf5282BufferDescriptor_ {
-    volatile uint16_t   status;
-    uint16_t                   length;
-    volatile void      *buffer;
-} mcf5282BufferDescriptor_t;
-
</font> /*
  * Per-device data
  */
<font color='#997700'>@@ -197,11 +191,10 @@
</font>  * Ensure 128-bit (16-byte) alignment
  * Allow some space at the beginning for other diagnostic counters
  */
<font color='#880000'>-extern char __SRAMBASE[];
</font> static mcf5282BufferDescriptor_t *
 mcf5282_bd_allocate(unsigned int count)
 {
<font color='#880000'>-    static mcf5282BufferDescriptor_t *bdp = (mcf5282BufferDescriptor_t *)(__SRAMBASE+16);
</font><font color='#000088'>+    static mcf5282BufferDescriptor_t *bdp = __SRAMBASE.fec_descriptors;
</font>     mcf5282BufferDescriptor_t *p = bdp;
 
     bdp += count;

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c:1.30 rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c:1.30.2.1
--- rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c:1.30   Tue Apr 27 13:23:44 2010
+++ rtems/c/src/lib/libbsp/m68k/uC5282/network/network.c        Fri Mar  4 10:03:53 2011
</font><font color='#997700'>@@ -81,12 +81,6 @@
</font>     #error "Driver must have MCLBYTES > RBUF_SIZE"
 #endif
 
<font color='#880000'>-typedef struct mcf5282BufferDescriptor_ {
-    volatile uint16_t   status;
-    uint16_t                   length;
-    volatile void      *buffer;
-} mcf5282BufferDescriptor_t;
-
</font> /*
  * Per-device data
  */
<font color='#997700'>@@ -197,11 +191,10 @@
</font>  * Ensure 128-bit (16-byte) alignment
  * Allow some space at the beginning for other diagnostic counters
  */
<font color='#880000'>-extern char __SRAMBASE[];
</font> static mcf5282BufferDescriptor_t *
 mcf5282_bd_allocate(unsigned int count)
 {
<font color='#880000'>-    static mcf5282BufferDescriptor_t *bdp = (mcf5282BufferDescriptor_t *)(__SRAMBASE+16);
</font><font color='#000088'>+    static mcf5282BufferDescriptor_t *bdp = __SRAMBASE.fec_descriptors;
</font>     mcf5282BufferDescriptor_t *p = bdp;
 
     bdp += count;
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>