You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.2 KiB
57 lines
1.2 KiB
20 years ago
|
/*
|
||
|
* Copyright 2003 PathScale, Inc.
|
||
|
*
|
||
|
* Licensed under the GPL
|
||
|
*/
|
||
|
|
||
|
#ifndef __UM_PROCESSOR_X86_64_H
|
||
|
#define __UM_PROCESSOR_X86_64_H
|
||
|
|
||
20 years ago
|
/* include faultinfo structure */
|
||
|
#include "sysdep/faultinfo.h"
|
||
20 years ago
|
|
||
|
struct arch_thread {
|
||
20 years ago
|
unsigned long debugregs[8];
|
||
|
int debugregs_seq;
|
||
18 years ago
|
unsigned long fs;
|
||
20 years ago
|
struct faultinfo faultinfo;
|
||
20 years ago
|
};
|
||
|
|
||
|
/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
|
||
17 years ago
|
static inline void rep_nop(void)
|
||
20 years ago
|
{
|
||
|
__asm__ __volatile__("rep;nop": : :"memory");
|
||
|
}
|
||
|
|
||
|
#define cpu_relax() rep_nop()
|
||
|
|
||
20 years ago
|
#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
|
||
17 years ago
|
.debugregs_seq = 0, \
|
||
18 years ago
|
.fs = 0, \
|
||
|
.faultinfo = { 0, 0, 0 } }
|
||
20 years ago
|
|
||
19 years ago
|
static inline void arch_flush_thread(struct arch_thread *thread)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
static inline void arch_copy_thread(struct arch_thread *from,
|
||
|
struct arch_thread *to)
|
||
|
{
|
||
17 years ago
|
to->fs = from->fs;
|
||
19 years ago
|
}
|
||
|
|
||
17 years ago
|
#include <asm/user.h>
|
||
20 years ago
|
|
||
|
#define current_text_addr() \
|
||
|
({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
|
||
|
|
||
|
#define ARCH_IS_STACKGROW(address) \
|
||
|
(address + 128 >= UPT_SP(¤t->thread.regs.regs))
|
||
|
|
||
20 years ago
|
#define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)
|
||
|
#define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)
|
||
|
|
||
20 years ago
|
#include "asm/processor-generic.h"
|
||
|
|
||
|
#endif
|