Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 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 Stroesser | c578455 | 2005-05-05 16:15:31 -0700 | [diff] [blame] | 10 | /* include faultinfo structure */ |
| 11 | #include "sysdep/faultinfo.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | |
| 13 | struct arch_thread { |
Bodo Stroesser | c578455 | 2005-05-05 16:15:31 -0700 | [diff] [blame] | 14 | unsigned long debugregs[8]; |
| 15 | int debugregs_seq; |
| 16 | struct faultinfo faultinfo; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | }; |
| 18 | |
| 19 | /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ |
| 20 | extern inline void rep_nop(void) |
| 21 | { |
| 22 | __asm__ __volatile__("rep;nop": : :"memory"); |
| 23 | } |
| 24 | |
| 25 | #define cpu_relax() rep_nop() |
| 26 | |
Bodo Stroesser | c578455 | 2005-05-05 16:15:31 -0700 | [diff] [blame] | 27 | #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ |
| 28 | .debugregs_seq = 0, \ |
| 29 | .faultinfo = { 0, 0, 0 } } |
| 30 | |
Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 31 | static inline void arch_flush_thread(struct arch_thread *thread) |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | static inline void arch_copy_thread(struct arch_thread *from, |
| 36 | struct arch_thread *to) |
| 37 | { |
| 38 | } |
| 39 | |
Bodo Stroesser | c578455 | 2005-05-05 16:15:31 -0700 | [diff] [blame] | 40 | #include "asm/arch/user.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
| 42 | #define current_text_addr() \ |
| 43 | ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) |
| 44 | |
| 45 | #define ARCH_IS_STACKGROW(address) \ |
| 46 | (address + 128 >= UPT_SP(¤t->thread.regs.regs)) |
| 47 | |
Allan Graves | fad1c45 | 2005-10-04 14:53:52 -0400 | [diff] [blame] | 48 | #define KSTK_EIP(tsk) KSTK_REG(tsk, RIP) |
| 49 | #define KSTK_ESP(tsk) KSTK_REG(tsk, RSP) |
| 50 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | #include "asm/processor-generic.h" |
| 52 | |
| 53 | #endif |