aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm26/kernel/asm-offsets.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/arm26/kernel/asm-offsets.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/arm26/kernel/asm-offsets.c')
-rw-r--r--arch/arm26/kernel/asm-offsets.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/arch/arm26/kernel/asm-offsets.c b/arch/arm26/kernel/asm-offsets.c
new file mode 100644
index 000000000000..4ccacaef94df
--- /dev/null
+++ b/arch/arm26/kernel/asm-offsets.c
@@ -0,0 +1,63 @@
1/*
2 * Copyright (C) 1995-2001 Russell King
3 * 2001-2002 Keith Owens
4 * 2003 Ian Molton
5 *
6 * Generate definitions needed by assembly language modules.
7 * This code generates raw asm output which is post-processed to extract
8 * and format the required data.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/config.h>
16#include <linux/sched.h>
17#include <linux/mm.h>
18
19#include <asm/pgtable.h>
20#include <asm/uaccess.h>
21
22/*
23 * Make sure that the compiler and target are compatible.
24 */
25#if defined(__APCS_32__) && defined(CONFIG_CPU_26)
26#error Sorry, your compiler targets APCS-32 but this kernel requires APCS-26
27#endif
28#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 95)
29#error Sorry, your compiler is known to miscompile kernels. Only use gcc 2.95.3 and later.
30#endif
31#if __GNUC__ == 2 && __GNUC_MINOR__ == 95
32/* shame we can't detect the .1 or .2 releases */
33#warning GCC 2.95.2 and earlier miscompiles kernels.
34#endif
35
36/* Use marker if you need to separate the values later */
37
38#define DEFINE(sym, val) \
39 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
40
41#define BLANK() asm volatile("\n->" : : )
42
43int main(void)
44{
45 DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
46 BLANK();
47 DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));
48 DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags));
49 BLANK();
50 DEFINE(VM_EXEC, VM_EXEC);
51 BLANK();
52 BLANK();
53 DEFINE(PAGE_PRESENT, _PAGE_PRESENT);
54 DEFINE(PAGE_READONLY, _PAGE_READONLY);
55 DEFINE(PAGE_NOT_USER, _PAGE_NOT_USER);
56 DEFINE(PAGE_OLD, _PAGE_OLD);
57 DEFINE(PAGE_CLEAN, _PAGE_CLEAN);
58 BLANK();
59 DEFINE(PAGE_SZ, PAGE_SIZE);
60 BLANK();
61 DEFINE(SYS_ERROR0, 0x9f0000);
62 return 0;
63}