x86: pin timer related get functions

Both arch_k_cycle_get_32() and z_tsc_read() are marked inline.
However, compiler may decide not to inline them which would put
them in the generic text section. Pin them in physical memory
as they are frequently used functions to avoid page fault costs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-07-22 13:22:12 -07:00 committed by Christopher Friedt
commit 41e97c6393

View file

@ -22,6 +22,7 @@
#include <irq.h> #include <irq.h>
#include <arch/x86/mmustructs.h> #include <arch/x86/mmustructs.h>
#include <arch/x86/thread_stack.h> #include <arch/x86/thread_stack.h>
#include <linker/sections.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -248,6 +249,7 @@ extern void arch_irq_disable(unsigned int irq);
extern uint32_t sys_clock_cycle_get_32(void); extern uint32_t sys_clock_cycle_get_32(void);
__pinned_func
static inline uint32_t arch_k_cycle_get_32(void) static inline uint32_t arch_k_cycle_get_32(void)
{ {
return sys_clock_cycle_get_32(); return sys_clock_cycle_get_32();
@ -275,6 +277,7 @@ static ALWAYS_INLINE uint32_t z_do_read_cpu_timestamp32(void)
* @brief read timestamp register ensuring serialization * @brief read timestamp register ensuring serialization
*/ */
__pinned_func
static inline uint64_t z_tsc_read(void) static inline uint64_t z_tsc_read(void)
{ {
union { union {