kernel: add function to query CPU clock cycle count
This commit is contained in:
@@ -35,4 +35,7 @@ void write_once(volatile T *ptr, T value)
|
||||
#undef __aligned
|
||||
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||
|
||||
#undef __weak
|
||||
#define __weak __attribute__((__weak__))
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#ifndef SOCKS_CPU_H_
|
||||
#define SOCKS_CPU_H_
|
||||
|
||||
#include <socks/types.h>
|
||||
#include <socks/machine/cpu.h>
|
||||
#include <stdint.h>
|
||||
#include <socks/sched.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -33,6 +35,8 @@ extern void put_cpu(struct cpu_data *cpu);
|
||||
extern void cpu_set_available(unsigned int cpu_id);
|
||||
extern void cpu_set_online(unsigned int cpu_id);
|
||||
|
||||
extern cycles_t get_cycles(void);
|
||||
|
||||
#define irq_enable() ml_int_enable()
|
||||
#define irq_disable() ml_int_disable()
|
||||
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uintptr_t phys_addr_t;
|
||||
typedef uint64_t cycles_t;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user