blob: c77db228898225d02e72d524e656a4e20a1d8aa0 [file] [log] [blame]
Al Viro27f85f12011-08-18 20:02:59 +01001#ifndef __UM_PROCESSOR_H
2#define __UM_PROCESSOR_H
3
4/* include faultinfo structure */
5#include <sysdep/faultinfo.h>
6
7#ifdef CONFIG_X86_32
8# include "processor_32.h"
9#else
10# include "processor_64.h"
11#endif
12
Al Viroa10c95d2011-08-18 20:12:09 +010013#define KSTK_EIP(tsk) KSTK_REG(tsk, HOST_IP)
Al Virocc11f9e2011-11-21 03:52:18 +000014#define KSTK_ESP(tsk) KSTK_REG(tsk, HOST_SP)
Al Viroa10c95d2011-08-18 20:12:09 +010015#define KSTK_EBP(tsk) KSTK_REG(tsk, HOST_BP)
16
Al Viroc7ea5912011-08-18 20:10:19 +010017#define ARCH_IS_STACKGROW(address) \
18 (address + 65536 + 32 * sizeof(unsigned long) >= UPT_SP(&current->thread.regs.regs))
19
Al Viroc56334d2011-11-20 17:23:39 -050020#include <asm/user.h>
21
22/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
23static inline void rep_nop(void)
24{
25 __asm__ __volatile__("rep;nop": : :"memory");
26}
27
Davidlohr Bueso3a6bfbc2014-06-29 15:09:33 -070028#define cpu_relax() rep_nop()
Al Viroc56334d2011-11-20 17:23:39 -050029
Richard Weinbergerf8d65d22015-05-12 00:17:28 +020030#define task_pt_regs(t) (&(t)->thread.regs)
31
Al Viro27f85f12011-08-18 20:02:59 +010032#include <asm/processor-generic.h>
33
34#endif