2010-03-10 Gedare Bloom <gedare@gwu.edu>

PR 1495/bsp
	* clock/ckinit.c, make/custom/pc386.cfg: Calling
	rtems_clock_get_uptime() in a tight loop sometimes showed time moving
	backwards.
This commit is contained in:
Joel Sherrill
2010-03-10 17:16:02 +00:00
parent 5deb608389
commit ee07b99715
3 changed files with 34 additions and 11 deletions

View File

@@ -1,3 +1,10 @@
2010-03-10 Gedare Bloom <gedare@gwu.edu>
PR 1495/bsp
* clock/ckinit.c, make/custom/pc386.cfg: Calling
rtems_clock_get_uptime() in a tight loop sometimes showed time moving
backwards.
2009-12-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/bsp.h: Add BSP_HAS_FRAME_BUFFER.

View File

@@ -47,6 +47,11 @@ 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
/* if so, the driver may use the count in Clock_driver_support_at_tick */
#ifdef CLOCK_DRIVER_ISRS_PER_TICK
extern volatile uint32_t Clock_driver_isrs;
#endif
#define READ_8254( _lsb, _msb ) \
do { outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_LATCH); \
inport_byte(TIMER_CNTR0, _lsb); \
@@ -66,7 +71,18 @@ uint32_t (*Clock_driver_nanoseconds_since_last_tick)(void) = NULL;
*/
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
}
void Clock_driver_support_at_tick_empty(void)

View File

@@ -43,17 +43,17 @@ HEADERADDR=0x00097E00
LDFLAGS += -Wl,-Ttext,$(RELOCADDR)
define bsp-post-link
$(default-bsp-post-link)
$(OBJCOPY) -O elf32-i386 \
--remove-section=.comment \
--remove-section=.note \
--strip-unneeded $(basename $@).exe $(basename $@).nxe
$(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin
$(PROJECT_TOOLS)/bin2boot -v $(basename $@)$(DOWNEXT) $(HEADERADDR)\
$(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
rm -f $(basename $@).nxe
endef
#define bsp-post-link
# $(default-bsp-post-link)
# $(OBJCOPY) -O elf32-i386 \
# --remove-section=.comment \
# --remove-section=.note \
# --strip-unneeded $(basename $@).exe $(basename $@).nxe
# $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin
# $(PROJECT_TOOLS)/bin2boot -v $(basename $@)$(DOWNEXT) $(HEADERADDR)\
# $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
# rm -f $(basename $@).nxe
#endef
# BSP-specific tools
BIN2BOOT=$(PROJECT_TOOLS)/bin2boot