#ifndef _ASM_FSGSBASE_H
#define _ASM_FSGSBASE_H
#ifndef __ASSEMBLY__
#ifdef CONFIG_X86_64
#include <asm/msr.h>
extern unsigned long x86_fsbase_read_task(struct task_struct *task);
extern unsigned long x86_gsbase_read_task(struct task_struct *task);
extern void x86_fsbase_write_task(struct task_struct *task, unsigned long fsbase);
extern void x86_gsbase_write_task(struct task_struct *task, unsigned long gsbase);
static __always_inline unsigned long rdfsbase(void)
{ … }
static __always_inline unsigned long rdgsbase(void)
{ … }
static __always_inline void wrfsbase(unsigned long fsbase)
{ … }
static __always_inline void wrgsbase(unsigned long gsbase)
{ … }
#include <asm/cpufeature.h>
static inline unsigned long x86_fsbase_read_cpu(void)
{ … }
static inline void x86_fsbase_write_cpu(unsigned long fsbase)
{ … }
extern unsigned long x86_gsbase_read_cpu_inactive(void);
extern void x86_gsbase_write_cpu_inactive(unsigned long gsbase);
extern unsigned long x86_fsgsbase_read_task(struct task_struct *task,
unsigned short selector);
#endif
#endif
#endif