mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-24 06:52:02 +08:00
Add support for EARLY_COUNTER
This commit is contained in:
parent
c1e05b9ea3
commit
b5f802ef43
@ -174,3 +174,6 @@ counter_ratecheck(struct counter_rate *cr, int64_t limit)
|
|||||||
|
|
||||||
return (val);
|
return (val);
|
||||||
}
|
}
|
||||||
|
#ifdef __rtems__
|
||||||
|
uint64_t _bsd_early_counter[_BSD_EARLY_COUNTER_SIZE];
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
@ -227,7 +227,11 @@ extern struct pcpu *cpuid_to_pcpu[];
|
|||||||
#endif
|
#endif
|
||||||
#define curvidata PCPU_GET(vidata)
|
#define curvidata PCPU_GET(vidata)
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
#define UMA_PCPU_ALLOC_SIZE PAGE_SIZE
|
#define UMA_PCPU_ALLOC_SIZE PAGE_SIZE
|
||||||
|
#else /* __rtems__ */
|
||||||
|
#define UMA_PCPU_ALLOC_SIZE (PAGE_SIZE / 32)
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
#ifndef __rtems__
|
#ifndef __rtems__
|
||||||
#ifdef CTASSERT
|
#ifdef CTASSERT
|
||||||
|
@ -36,6 +36,16 @@
|
|||||||
|
|
||||||
#include <rtems/score/isrlevel.h>
|
#include <rtems/score/isrlevel.h>
|
||||||
|
|
||||||
|
#ifdef RTEMS_SMP
|
||||||
|
#define _BSD_EARLY_COUNTER_SIZE (CPU_MAXIMUM_PROCESSORS * UMA_PCPU_ALLOC_SIZE)
|
||||||
|
#else
|
||||||
|
#define _BSD_EARLY_COUNTER_SIZE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern uint64_t _bsd_early_counter[_BSD_EARLY_COUNTER_SIZE];
|
||||||
|
|
||||||
|
#define EARLY_COUNTER (&_bsd_early_counter[0])
|
||||||
|
|
||||||
#ifdef IN_SUBR_COUNTER_C
|
#ifdef IN_SUBR_COUNTER_C
|
||||||
|
|
||||||
static inline uint64_t
|
static inline uint64_t
|
||||||
|
Loading…
x
Reference in New Issue
Block a user