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:
parent
90ddb35d44
commit
41e97c6393
1 changed files with 3 additions and 0 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue