OSDN Git Service

Use OFFSET macro
authorYoshinori Sato <ysato@users.sourceforge.jp>
Sun, 26 Apr 2015 08:19:06 +0000 (17:19 +0900)
committerYoshinori Sato <ysato@users.sourceforge.jp>
Sun, 26 Apr 2015 08:19:06 +0000 (17:19 +0900)
arch/h8300/kernel/asm-offsets.c

index 9fb9d49..dc2d16c 100644 (file)
 int main(void)
 {
        /* offsets into the task struct */
-       DEFINE(TASK_STATE, offsetof(struct task_struct, state));
-       DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
-       DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
-       DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
-       DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
-       DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
-       DEFINE(TASK_MM, offsetof(struct task_struct, mm));
-       DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
+       OFFSET(TASK_STATE, task_struct, state);
+       OFFSET(TASK_FLAGS, task_struct, flags);
+       OFFSET(TASK_PTRACE, task_struct, ptrace);
+       OFFSET(TASK_BLOCKED, task_struct, blocked);
+       OFFSET(TASK_THREAD, task_struct, thread);
+       OFFSET(TASK_THREAD_INFO, task_struct, stack);
+       OFFSET(TASK_MM, task_struct, mm);
+       OFFSET(TASK_ACTIVE_MM, task_struct, active_mm);
 
        /* offsets into the irq_cpustat_t struct */
-       DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending));
+       DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t,
+                                                __softirq_pending));
 
        /* offsets into the thread struct */
-       DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
-       DEFINE(THREAD_USP, offsetof(struct thread_struct, usp));
-       DEFINE(THREAD_CCR, offsetof(struct thread_struct, ccr));
+       OFFSET(THREAD_KSP, thread_struct, ksp);
+       OFFSET(THREAD_USP, thread_struct, usp);
+       OFFSET(THREAD_CCR, thread_struct, ccr);
 
        /* offsets into the pt_regs struct */
        DEFINE(LER0,  offsetof(struct pt_regs, er0)      - sizeof(long));
@@ -46,7 +47,7 @@ int main(void)
        DEFINE(LER5,  offsetof(struct pt_regs, er5)      - sizeof(long));
        DEFINE(LER6,  offsetof(struct pt_regs, er6)      - sizeof(long));
        DEFINE(LORIG, offsetof(struct pt_regs, orig_er0) - sizeof(long));
-       DEFINE(LSP,  offsetof(struct pt_regs, sp)        - sizeof(long));
+       DEFINE(LSP,   offsetof(struct pt_regs, sp)       - sizeof(long));
        DEFINE(LCCR,  offsetof(struct pt_regs, ccr)      - sizeof(long));
        DEFINE(LVEC,  offsetof(struct pt_regs, vector)   - sizeof(long));
 #if defined(CONFIG_CPU_H8S)
@@ -56,5 +57,11 @@ int main(void)
 
        DEFINE(PT_PTRACED, PT_PTRACED);
 
+       /* offsets in thread_info structure */
+       OFFSET(TI_TASK, thread_info, task);
+       OFFSET(TI_FLAGS, thread_info, flags);
+       OFFSET(TI_CPU, thread_info, cpu);
+       OFFSET(TI_PRE, thread_info, preempt_count);
+
        return 0;
 }