arch: x86 -> x86_64 and build system changes
This commit is contained in:
committed by
Hannes Weisbach
parent
51982de36b
commit
43ecf06e83
37
arch/x86_64/kernel/include/arch/cpu.h
Normal file
37
arch/x86_64/kernel/include/arch/cpu.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* \file cpu.h
|
||||
* License details are found in the file LICENSE.
|
||||
* \brief
|
||||
* Declare architecture-dependent types and functions to control CPU.
|
||||
* \author Gou Nakamura <go.nakamura.yw@hitachi-solutions.com>
|
||||
* Copyright (C) 2015 RIKEN AICS
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
*/
|
||||
|
||||
#ifndef ARCH_CPU_H
|
||||
#define ARCH_CPU_H
|
||||
|
||||
#define arch_barrier() asm volatile("" : : : "memory")
|
||||
|
||||
static inline void rmb(void)
|
||||
{
|
||||
arch_barrier();
|
||||
}
|
||||
|
||||
static inline void wmb(void)
|
||||
{
|
||||
arch_barrier();
|
||||
}
|
||||
|
||||
static unsigned long read_tsc(void)
|
||||
{
|
||||
unsigned int low, high;
|
||||
|
||||
asm volatile("rdtsc" : "=a"(low), "=d"(high));
|
||||
|
||||
return (low | ((unsigned long)high << 32));
|
||||
}
|
||||
|
||||
#endif /* ARCH_CPU_H */
|
||||
Reference in New Issue
Block a user