blob: e1e1255a1d3655c18bc2aa2206eead6187170a2b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
7#ifndef __UM_PROCESSOR_X86_64_H
8#define __UM_PROCESSOR_X86_64_H
9
Bodo Stroesserc5784552005-05-05 16:15:31 -070010/* include faultinfo structure */
11#include "sysdep/faultinfo.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
13struct arch_thread {
Bodo Stroesserc5784552005-05-05 16:15:31 -070014 unsigned long debugregs[8];
15 int debugregs_seq;
16 struct faultinfo faultinfo;
Linus Torvalds1da177e2005-04-16 15:20:36 -070017};
18
19/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
20extern inline void rep_nop(void)
21{
22 __asm__ __volatile__("rep;nop": : :"memory");
23}
24
25#define cpu_relax() rep_nop()
26
Bodo Stroesserc5784552005-05-05 16:15:31 -070027#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
28 .debugregs_seq = 0, \
29 .faultinfo = { 0, 0, 0 } }
30
31#include "asm/arch/user.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
33#define current_text_addr() \
34 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
35
36#define ARCH_IS_STACKGROW(address) \
37 (address + 128 >= UPT_SP(&current->thread.regs.regs))
38
Allan Gravesfad1c452005-10-04 14:53:52 -040039#define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)
40#define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)
41
Linus Torvalds1da177e2005-04-16 15:20:36 -070042#include "asm/processor-generic.h"
43
44#endif