| 1 |
1275 |
phoenix |
/*
|
| 2 |
|
|
* linux/arch/or32/kernel/or32_defs.c
|
| 3 |
|
|
*
|
| 4 |
|
|
* or32 version
|
| 5 |
|
|
*
|
| 6 |
|
|
* This program is used to generate definitions needed by
|
| 7 |
|
|
* assembly language modules.
|
| 8 |
|
|
*
|
| 9 |
|
|
* We use the technique used in the OSF Mach kernel code:
|
| 10 |
|
|
* generate asm statements containing #defines,
|
| 11 |
|
|
* compile this file to assembler, and then extract the
|
| 12 |
|
|
* #defines from the assembly-language output.
|
| 13 |
|
|
*/
|
| 14 |
|
|
|
| 15 |
|
|
#include <stddef.h>
|
| 16 |
|
|
#include <linux/config.h>
|
| 17 |
|
|
#include <linux/signal.h>
|
| 18 |
|
|
#include <linux/sched.h>
|
| 19 |
|
|
#include <linux/kernel.h>
|
| 20 |
|
|
#include <linux/errno.h>
|
| 21 |
|
|
#include <linux/string.h>
|
| 22 |
|
|
#include <linux/types.h>
|
| 23 |
|
|
#include <linux/ptrace.h>
|
| 24 |
|
|
#include <linux/mman.h>
|
| 25 |
|
|
#include <linux/mm.h>
|
| 26 |
|
|
#include <asm/io.h>
|
| 27 |
|
|
#include <asm/page.h>
|
| 28 |
|
|
#include <asm/pgtable.h>
|
| 29 |
|
|
#include <asm/processor.h>
|
| 30 |
|
|
|
| 31 |
|
|
#define DEFINE(sym, val) \
|
| 32 |
|
|
asm volatile("\n#define\t" #sym "\t%0" : : "i" (val))
|
| 33 |
|
|
|
| 34 |
|
|
int
|
| 35 |
|
|
main(void)
|
| 36 |
|
|
{
|
| 37 |
|
|
/*DEFINE(KERNELBASE, KERNELBASE);*/
|
| 38 |
|
|
DEFINE(STATE, offsetof(struct task_struct, state));
|
| 39 |
|
|
DEFINE(NEXT_TASK, offsetof(struct task_struct, next_task));
|
| 40 |
|
|
DEFINE(COUNTER, offsetof(struct task_struct, counter));
|
| 41 |
|
|
DEFINE(PROCESSOR, offsetof(struct task_struct, processor));
|
| 42 |
|
|
DEFINE(SIGPENDING, offsetof(struct task_struct, sigpending));
|
| 43 |
|
|
DEFINE(THREAD, offsetof(struct task_struct, thread));
|
| 44 |
|
|
DEFINE(MM, offsetof(struct task_struct, mm));
|
| 45 |
|
|
DEFINE(ACTIVE_MM, offsetof(struct task_struct, active_mm));
|
| 46 |
|
|
DEFINE(TASK_STRUCT_SIZE, sizeof(struct task_struct));
|
| 47 |
|
|
DEFINE(KSP, offsetof(struct thread_struct, ksp));
|
| 48 |
|
|
DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall));
|
| 49 |
|
|
DEFINE(PT_REGS, offsetof(struct thread_struct, regs));
|
| 50 |
|
|
DEFINE(PT_TRACESYS, PT_TRACESYS);
|
| 51 |
|
|
DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
|
| 52 |
|
|
DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
|
| 53 |
|
|
DEFINE(NEED_RESCHED, offsetof(struct task_struct, need_resched));
|
| 54 |
|
|
DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
|
| 55 |
|
|
/* Interrupt register frame */
|
| 56 |
|
|
DEFINE(TASK_UNION_SIZE, sizeof(union task_union));
|
| 57 |
|
|
DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD);
|
| 58 |
|
|
DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
|
| 59 |
|
|
|
| 60 |
|
|
DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
|
| 61 |
|
|
return 0;
|
| 62 |
|
|
}
|