sparc64: prepare module_64.c for unification
[deliverable/linux.git] / arch / sparc / kernel / asm-offsets.c
index 6773ed76e414bec7b851d94cebddf2fec48ff1e7..68f7e1118e9b3a7ab845282e1378304630da87df 100644 (file)
 
 #include <linux/sched.h>
 // #include <linux/mm.h>
+#include <linux/kbuild.h>
 
-#define DEFINE(sym, val) \
-       asm volatile("\n->" #sym " %0 " #val : : "i" (val))
-
-#define BLANK() asm volatile("\n->" : : )
+#ifdef CONFIG_SPARC32
+int sparc32_foo(void)
+{
+       DEFINE(AOFF_thread_fork_kpsr,
+                       offsetof(struct thread_struct, fork_kpsr));
+       return 0;
+}
+#else
+int sparc64_foo(void)
+{
+       return 0;
+}
+#endif
 
 int foo(void)
 {
-       DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread));
        BLANK();
-       /* XXX This is the stuff for sclow.S, kill it. */
-       DEFINE(AOFF_task_pid, offsetof(struct task_struct, pid));
-       DEFINE(AOFF_task_uid, offsetof(struct task_struct, uid));
-       DEFINE(AOFF_task_gid, offsetof(struct task_struct, gid));
-       DEFINE(AOFF_task_euid, offsetof(struct task_struct, euid));
-       DEFINE(AOFF_task_egid, offsetof(struct task_struct, egid));
-       /* DEFINE(THREAD_INFO, offsetof(struct task_struct, stack)); */
-       DEFINE(ASIZ_task_uid,   sizeof(current->uid));
-       DEFINE(ASIZ_task_gid,   sizeof(current->gid));
-       DEFINE(ASIZ_task_euid,  sizeof(current->euid));
-       DEFINE(ASIZ_task_egid,  sizeof(current->egid));
-       BLANK();
-       DEFINE(AOFF_thread_fork_kpsr,
-                       offsetof(struct thread_struct, fork_kpsr));
+       DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread));
        BLANK();
        DEFINE(AOFF_mm_context, offsetof(struct mm_struct, context));
 
        /* DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); */
        return 0;
 }
+
This page took 0.025337 seconds and 5 git commands to generate.