blob: 2c13de321f2fb330eb5dc162fe53bffca57f3bad [file] [log] [blame]
Al Viroa31769e2005-05-05 16:15:25 -07001#include <linux/stddef.h>
2#include <linux/sched.h>
viro@ZenIV.linux.org.uk95608262005-09-06 22:33:51 +01003#include <linux/elf.h>
Jeff Dikeb73781c2006-04-18 22:20:24 -07004#include <asm/mman.h>
Al Viroa31769e2005-05-05 16:15:25 -07005
6#define DEFINE(sym, val) \
Jeff Dike4ee189a2006-01-11 12:17:23 -08007 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
Al Viroa31769e2005-05-05 16:15:25 -07008
9#define STR(x) #x
10#define DEFINE_STR(sym, val) asm volatile("\n->" #sym " " STR(val) " " #val: : )
11
12#define BLANK() asm volatile("\n->" : : )
13
14#define OFFSET(sym, str, mem) \
15 DEFINE(sym, offsetof(struct str, mem));
16
17void foo(void)
18{
Al Viroecba97d2005-09-28 22:27:23 +010019 OFFSET(HOST_TASK_DEBUGREGS, task_struct, thread.arch.debugregs);
Jeff Dikeb73781c2006-04-18 22:20:24 -070020 DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE);
Al Viroa31769e2005-05-05 16:15:25 -070021#ifdef CONFIG_MODE_TT
Al Viroecba97d2005-09-28 22:27:23 +010022 OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid);
Al Viroa31769e2005-05-05 16:15:25 -070023#endif
24#include <common-offsets.h>
25}