blob: dabf64cd9981f605845dd04edf7486a4fb4aa6c0 [file] [log] [blame]
Kevin O'Connor952974e2008-11-16 18:14:33 -05001// Tool for building defintions accessible from assembler code. This
2// is based on code from the Linux Kernel.
3#ifndef __GEN_DEFS_H
4#define __GEN_DEFS_H
5
6
7#define DEFINE(sym, val) \
8 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
9
10#define BLANK() \
11 asm volatile("\n->" : : )
12
13#define OFFSET(sym, str, mem) \
14 DEFINE(sym, offsetof(struct str, mem))
15
16#define COMMENT(x) \
17 asm volatile("\n->#" x)
18
19#endif // gen-defs.h