arch/x86: refactor z_do_read_cpu_timestamp32()
This function, like its cousin z_tsc_read(), can be shared between subarches. Note: it's unclear to me if we actually need these to be two separate functions (do we need serialization?) or if they can be combined into one function. Add that to the to-do list. Signed-off-by: Charles E. Youse <charles.youse@intel.com>
This commit is contained in:
parent
3cf1bff71c
commit
6244676a51
2 changed files with 13 additions and 17 deletions
|
@ -307,23 +307,6 @@ struct _x86_syscall_stack_frame {
|
|||
u32_t ss;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Get a 32 bit CPU timestamp counter
|
||||
*
|
||||
* @return a 32-bit number
|
||||
*/
|
||||
|
||||
static ALWAYS_INLINE
|
||||
u32_t z_do_read_cpu_timestamp32(void)
|
||||
{
|
||||
u32_t rv;
|
||||
|
||||
__asm__ volatile("rdtsc" : "=a"(rv) : : "%edx");
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable all interrupts on the CPU (inline)
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue