mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 05:09:34 +08:00
Use signed integer type for ticks
This commit is contained in:
parent
8b722dba65
commit
c6e85efd7e
@ -68,8 +68,12 @@ extern int profprocs; /* number of process's profiling */
|
||||
#ifndef __rtems__
|
||||
extern volatile int ticks;
|
||||
#else /* __rtems__ */
|
||||
#include <rtems/score/watchdogimpl.h>
|
||||
#define ticks _Watchdog_Ticks_since_boot
|
||||
/*
|
||||
* 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 */
|
||||
|
@ -85,6 +85,13 @@ 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.");
|
||||
|
||||
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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user