linux-old/arch/cris/kernel/entryoffsets.c
<<
>>
Prefs
   1/* linux/arch/cris/entryoffsets.c
   2 *
   3 * Copyright (C) 2001 Axis Communications AB
   4 *
   5 * Generate structure offsets for use in entry.S.  No extra processing
   6 * needed more than compiling this file to assembly code.  Horrendous
   7 * assembly code will be generated, so don't look at that.
   8 *
   9 * Authors:     Hans-Peter Nilsson (hp@axis.com)
  10 */
  11
  12/* There can be string constants fallout from inline functions, so we'd
  13   better make sure we don't assemble anything emitted from inclusions.  */
  14__asm__ (".if 0");
  15
  16#include <linux/sched.h>
  17#include <linux/ptrace.h>
  18#include <asm/processor.h>
  19
  20/* Exclude everything except the assembly by wrapping it in ".if 0".  */
  21#undef VAL
  22#define VAL(NAME, VALUE)                        \
  23void NAME ## _fun (void)                        \
  24 {                                              \
  25  __asm__ (".endif \n"                          \
  26           #NAME " = %0 \n"                     \
  27           ".if 0\n"                            \
  28           : : "i" (VALUE));                    \
  29 }
  30
  31#undef OF
  32#define OF(NAME, TYPE, MEMBER)                  \
  33  VAL (NAME, offsetof (TYPE, MEMBER))
  34
  35/* task_struct offsets.  */
  36OF (LTASK_SIGPENDING, struct task_struct, sigpending)
  37OF (LTASK_NEEDRESCHED, struct task_struct, need_resched)
  38OF (LTASK_PTRACE, struct task_struct, ptrace)
  39OF (LTASK_PID, struct task_struct, pid)
  40
  41/* pt_regs offsets.  */
  42OF (LORIG_R10, struct pt_regs, orig_r10)
  43OF (LR13, struct pt_regs, r13)
  44OF (LR12, struct pt_regs, r12)
  45OF (LR11, struct pt_regs, r11)
  46OF (LR10, struct pt_regs, r10)
  47OF (LR9, struct pt_regs, r9)
  48OF (LMOF, struct pt_regs, mof)
  49OF (LDCCR, struct pt_regs, dccr)
  50OF (LSRP, struct pt_regs, srp)
  51OF (LIRP, struct pt_regs, irp)
  52
  53/* thread_struct offsets.  */
  54OF (LTHREAD_KSP, struct thread_struct, ksp)
  55OF (LTHREAD_USP, struct thread_struct, usp)
  56OF (LTHREAD_DCCR, struct thread_struct, dccr)
  57
  58/* linux/sched.h values - doesn't have an #ifdef __ASSEMBLY__ for these.  */
  59VAL (LCLONE_VM, CLONE_VM)
  60
  61__asm__ (".endif");
  62
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.