OpenCores
URL https://opencores.org/ocsvn/or1k_soc_on_altera_embedded_dev_kit/or1k_soc_on_altera_embedded_dev_kit/trunk

Subversion Repositories or1k_soc_on_altera_embedded_dev_kit

[/] [or1k_soc_on_altera_embedded_dev_kit/] [trunk/] [linux-2.6/] [linux-2.6.24/] [arch/] [or32/] [kernel/] [asm-offsets.c] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 xianfeng
/*
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 <linux/signal.h>
16
#include <linux/sched.h>
17
#include <linux/kernel.h>
18
#include <linux/errno.h>
19
#include <linux/string.h>
20
#include <linux/types.h>
21
#include <linux/ptrace.h>
22
#include <linux/mman.h>
23
#include <linux/mm.h>
24
#include <asm/io.h>
25
#include <asm/page.h>
26
#include <asm/pgtable.h>
27
#include <asm/processor.h>
28
#include <asm/thread_info.h>
29
 
30
#define DEFINE(sym, val) \
31
        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
32
 
33
#define BLANK() asm volatile("\n->" : : )
34
 
35
int
36
main(void)
37
{
38
  /* offsets into the task_struct */
39
  DEFINE(TASK_STATE, offsetof(struct task_struct, state));
40
  DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
41
  DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
42
  DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
43
  DEFINE(TASK_MM, offsetof(struct task_struct, mm));
44
  DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
45
 
46
  /* offsets into thread_info */
47
#if 0
48
  DEFINE(TI_TASK, offsetof(struct thread_info, task));
49
  DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
50
  DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
51
#endif
52
  DEFINE(TI_KSP, offsetof(struct thread_info, ksp));
53
 
54
  /* Interrupt register frame */
55
  DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD);
56
  DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
57
 
58
  DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
59
  return 0;
60
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.