Separate libbsd and RTEMS clock ticks

This commit is contained in:
Sebastian Huber
2019-05-13 11:19:05 +02:00
parent 6a850e083d
commit c727e4a22e
8 changed files with 15 additions and 26 deletions

View File

@@ -4939,6 +4939,7 @@
#define ticket_altqs_active _bsd_ticket_altqs_active
#define ticket_altqs_inactive _bsd_ticket_altqs_inactive
#define ticket_pabuf _bsd_ticket_pabuf
#define ticks _bsd_ticks
#define tick_sbt _bsd_tick_sbt
#define ti_hwmods _bsd_ti_hwmods
#define ti_hwmods_contains _bsd_ti_hwmods_contains

View File

@@ -85,6 +85,7 @@ void mi_startup(void);
int hz;
int tick;
volatile int ticks;
sbintime_t tick_sbt;
struct bintime bt_timethreshold;
struct bintime bt_tickthreshold;
@@ -105,22 +106,21 @@ SYSCTL_INT(_kern_smp, OID_AUTO, maxid, CTLFLAG_RD|CTLFLAG_CAPRD,
SYSCTL_INT(_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD|CTLFLAG_CAPRD,
&maxid_maxcpus, 0, "Max number of CPUs that the system was compiled for.");
#undef _bsd_ticks
RTEMS_STATIC_ASSERT(sizeof(int) == sizeof(int32_t), ticks);
volatile uint32_t _Watchdog_Ticks_since_boot;
extern volatile int32_t _bsd_ticks
__attribute__ ((__alias__("_Watchdog_Ticks_since_boot")));
rtems_status_code
rtems_bsd_initialize(void)
{
static const char name[] = "TIME";
rtems_status_code sc;
int tps;
/*
* Limit the libbsd ticks per second to 100Hz. This helps to reduce
* the processor load on low end targets which use 1000Hz for the RTEMS
* clock tick.
*/
tps = (int)rtems_clock_get_ticks_per_second();
hz = MIN(100, tps);
hz = (int) rtems_clock_get_ticks_per_second();
tick = 1000000 / hz;
tick_sbt = SBT_1S / hz;
FREQ2BT(hz, &tc_tick_bt);

View File

@@ -53,8 +53,6 @@
#include <rtems/bsd/bsd.h>
#undef ticks
#include <rtems/score/objectimpl.h>
#include <rtems/score/statesimpl.h>
#include <rtems/score/threaddispatch.h>