Current head compilation problem
Joel Sherrill
joel.sherrill at OARcorp.com
Fri Aug 16 20:57:33 UTC 2013
I think the change from #ifdef to #if changed this.
pc386 set CLOCK_DRIVER_ISRS_PER_TICK to a
string rather than a numeric value. I added
CLOCK_DRIVER_ISRS_PER_TICK_VALUE and
did some other clean up on the driver.
With the attached patch, it compiles again and
ticker runs.
Please review and let me know if OK to commit.
On 8/16/2013 11:03 AM, Gedare Bloom wrote:
> OK. If you find the bug in the modified clockdrv_shell.h think about
> how it might be fixed.
>
> On Fri, Aug 16, 2013 at 11:49 AM, Vipul Nayyar <nayyar_vipul at yahoo.com> wrote:
>> Hello,
>>
>> Will look more closely into the matter.
>>
>> FWIW, I compiled the pc386 bsp giving the same configure statement as Sree
>> gave, in my personal fork of rtems from github which is about 18 or so
>> commits behind the master( that means my fork does not contain Sebastian &
>> Chris' #define -> #if patches).
>>
>> And it compiled successfully, without giving any errors.
>>
>> What I feel, is that the following two patches that modified
>> clockdrv_shell.h need to be checked again..
>> http://git.rtems.org/rtems/commit/?id=b7f206097313f794dbe53202542b5894aad6a117
>> http://git.rtems.org/rtems/commit/?id=d473dc0b22d3276130f893a51350c8bfb8beaac8
>>
>> My patches for pc386 were checked carefully by Sebastian, but will have to
>> look more closely to find any bug caused due to my patches.
>>
>> Regards
>> Vipul Nayyar
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
-------------- next part --------------
diff --git a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
index 76024e8..76cc53f 100644
--- a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
+++ b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c
@@ -57,12 +57,11 @@ uint64_t pc586_nanoseconds_per_tick;
uint64_t pc586_tsc_at_tick;
/* this driver may need to count ISRs per tick */
-#define CLOCK_DRIVER_ISRS_PER_TICK pc386_isrs_per_tick
+#define CLOCK_DRIVER_ISRS_PER_TICK 1
+#define CLOCK_DRIVER_ISRS_PER_TICK_VALUE pc386_isrs_per_tick
-/* if so, the driver may use the count in Clock_driver_support_at_tick */
-#ifdef CLOCK_DRIVER_ISRS_PER_TICK
+/* The driver uses the count in Clock_driver_support_at_tick */
extern volatile uint32_t Clock_driver_isrs;
-#endif
#define READ_8254( _lsb, _msb ) \
do { outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_LATCH); \
@@ -83,18 +82,7 @@ uint32_t (*Clock_driver_nanoseconds_since_last_tick)(void) = NULL;
*/
static void Clock_driver_support_at_tick_tsc(void)
{
-#ifdef CLOCK_DRIVER_ISRS_PER_TICK
- /*
- * The driver is multiple ISRs per clock tick.
- */
- if (!Clock_driver_isrs)
- pc586_tsc_at_tick = rdtsc();
-#else
- /*
- * The driver is one ISR per clock tick.
- */
pc586_tsc_at_tick = rdtsc();
-#endif
}
static void Clock_driver_support_at_tick_empty(void)
@@ -271,6 +259,7 @@ static void clockOff(void)
outport_byte(TIMER_CNTR0, 0);
} /* Clock_exit */
+#define Clock_driver_support_shutdown_hardware() clockOff()
bool Clock_isr_enabled = false;
static void Clock_isr_handler(void *param)
diff --git a/c/src/lib/libbsp/shared/clockdrv_shell.h b/c/src/lib/libbsp/shared/clockdrv_shell.h
index 2a7fe0b..a2dc7f5 100644
--- a/c/src/lib/libbsp/shared/clockdrv_shell.h
+++ b/c/src/lib/libbsp/shared/clockdrv_shell.h
@@ -183,7 +183,7 @@ rtems_device_driver Clock_initialize(
* If we are counting ISRs per tick, then initialize the counter.
*/
#if CLOCK_DRIVER_ISRS_PER_TICK
- Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK;
+ Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK_VALUE;
#endif
return RTEMS_SUCCESSFUL;
More information about the devel
mailing list