mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 00:38:39 +08:00
Separate libbsd and RTEMS clock ticks
This commit is contained in:
@@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$");
|
||||
#else /* __rtems__ */
|
||||
#include <machine/rtems-bsd-thread.h>
|
||||
#define RTEMSBSD_SWI_WAKEUP_EVENT RTEMS_EVENT_31
|
||||
#undef ticks
|
||||
#include <rtems/score/threadimpl.h>
|
||||
#endif /* __rtems__ */
|
||||
#include <machine/stdarg.h>
|
||||
|
@@ -317,6 +317,7 @@ rtems_bsd_callout_timer(rtems_id id, void *arg)
|
||||
sc = rtems_timer_reset(id);
|
||||
BSD_ASSERT(sc == RTEMS_SUCCESSFUL);
|
||||
|
||||
++ticks;
|
||||
callout_process(sbinuptime());
|
||||
}
|
||||
|
||||
@@ -339,7 +340,9 @@ rtems_bsd_timeout_init_late(void *unused)
|
||||
sc = rtems_timer_create(rtems_build_name('_', 'C', 'L', 'O'), &id);
|
||||
BSD_ASSERT(sc == RTEMS_SUCCESSFUL);
|
||||
|
||||
sc = rtems_timer_server_fire_after(id, 1, rtems_bsd_callout_timer, NULL);
|
||||
sc = rtems_timer_server_fire_after(id,
|
||||
rtems_clock_get_ticks_per_second() / (rtems_interval)hz,
|
||||
rtems_bsd_callout_timer, NULL);
|
||||
BSD_ASSERT(sc == RTEMS_SUCCESSFUL);
|
||||
}
|
||||
|
||||
|
@@ -94,7 +94,6 @@ __FBSDID("$FreeBSD$");
|
||||
#endif
|
||||
#ifdef __rtems__
|
||||
#include <machine/rtems-bsd-thread.h>
|
||||
#undef ticks
|
||||
#include <rtems/score/threadimpl.h>
|
||||
#include <rtems/score/watchdogimpl.h>
|
||||
#endif /* __rtems__ */
|
||||
|
@@ -1999,8 +1999,6 @@ kern_posix_error(struct thread *td, int error)
|
||||
#ifdef __rtems__
|
||||
#include <machine/rtems-bsd-thread.h>
|
||||
|
||||
#undef ticks
|
||||
|
||||
#include <rtems/score/objectimpl.h>
|
||||
#include <rtems/score/threadimpl.h>
|
||||
|
||||
|
@@ -70,16 +70,7 @@ extern int psratio; /* ratio: prof / stat */
|
||||
extern int stathz; /* statistics clock's frequency */
|
||||
extern int profhz; /* profiling clock's frequency */
|
||||
extern int profprocs; /* number of process's profiling */
|
||||
#ifndef __rtems__
|
||||
extern volatile int ticks;
|
||||
#else /* __rtems__ */
|
||||
/*
|
||||
* This must be a singed integer type, otherwise expressions like
|
||||
* (x - ticks) > 0 would yield unexpected results.
|
||||
*/
|
||||
extern volatile int32_t _bsd_ticks;
|
||||
#define ticks _bsd_ticks
|
||||
#endif /* __rtems__ */
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
Reference in New Issue
Block a user