Path: blob/master/arch/um/sys-x86_64/asm/processor.h
10818 views
/*1* Copyright 2003 PathScale, Inc.2*3* Licensed under the GPL4*/56#ifndef __UM_PROCESSOR_X86_64_H7#define __UM_PROCESSOR_X86_64_H89/* include faultinfo structure */10#include "sysdep/faultinfo.h"1112struct arch_thread {13unsigned long debugregs[8];14int debugregs_seq;15unsigned long fs;16struct faultinfo faultinfo;17};1819/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */20static inline void rep_nop(void)21{22__asm__ __volatile__("rep;nop": : :"memory");23}2425#define cpu_relax() rep_nop()2627#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \28.debugregs_seq = 0, \29.fs = 0, \30.faultinfo = { 0, 0, 0 } }3132static inline void arch_flush_thread(struct arch_thread *thread)33{34}3536static inline void arch_copy_thread(struct arch_thread *from,37struct arch_thread *to)38{39to->fs = from->fs;40}4142#include <asm/user.h>4344#define current_text_addr() \45({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })4647#define ARCH_IS_STACKGROW(address) \48(address + 128 >= UPT_SP(¤t->thread.regs.regs))4950#define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)51#define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)5253#include "asm/processor-generic.h"5455#endif565758