Commit 20c994e4 authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by Masahiro Yamada

frv: Use OFFSET macro in DEF_*REG()

Avoid code duplication by using OFFSET() in DEF_*REG() instead of
replicating the macro.
Signed-off-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 90ad4052
...@@ -14,21 +14,10 @@ ...@@ -14,21 +14,10 @@
#include <asm/thread_info.h> #include <asm/thread_info.h>
#include <asm/gdb-stub.h> #include <asm/gdb-stub.h>
#define DEF_PTREG(sym, reg) \ #define DEF_PTREG(sym, reg) OFFSET(sym, pt_regs, reg)
asm volatile("\n->" #sym " %0 offsetof(struct pt_regs, " #reg ")" \ #define DEF_IREG(sym, reg) OFFSET(sym, user_context, reg)
: : "i" (offsetof(struct pt_regs, reg))) #define DEF_FREG(sym, reg) OFFSET(sym, user_context, reg)
#define DEF_0REG(sym, reg) OFFSET(sym, frv_frame0, reg)
#define DEF_IREG(sym, reg) \
asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \
: : "i" (offsetof(struct user_context, reg)))
#define DEF_FREG(sym, reg) \
asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \
: : "i" (offsetof(struct user_context, reg)))
#define DEF_0REG(sym, reg) \
asm volatile("\n->" #sym " %0 offsetof(struct frv_frame0, " #reg ")" \
: : "i" (offsetof(struct frv_frame0, reg)))
void foo(void) void foo(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment