File: /usr/src/linux/arch/arm/tools/getconstants.c

1     /*
2      *  linux/arch/arm/tools/getconsdata.c
3      *
4      *  Copyright (C) 1995-2001 Russell King
5      *
6      * This program is free software; you can redistribute it and/or modify
7      * it under the terms of the GNU General Public License version 2 as
8      * published by the Free Software Foundation.
9      */
10     #include <linux/config.h>
11     #include <linux/sched.h>
12     #include <linux/mm.h>
13     
14     #include <asm/pgtable.h>
15     #include <asm/uaccess.h>
16     
17     #ifndef __APCS_32__
18     #error APCS-32 required
19     #endif
20     
21     #define OFF_TSK(n) (unsigned long)&(((struct task_struct *)0)->n)
22     
23     #define DEFN(name,off) asm("\n#define "name" %0" :: "I" (off))
24     
25     void func(void)
26     {
27     DEFN("TSK_SIGPENDING",		OFF_TSK(sigpending));
28     DEFN("TSK_ADDR_LIMIT",		OFF_TSK(addr_limit));
29     DEFN("TSK_NEED_RESCHED",	OFF_TSK(need_resched));
30     DEFN("TSK_PTRACE",		OFF_TSK(ptrace));
31     DEFN("TSK_USED_MATH",		OFF_TSK(used_math));
32     
33     DEFN("TSS_SAVE",		OFF_TSK(thread.save));
34     DEFN("TSS_FPESAVE",		OFF_TSK(thread.fpstate.soft.save));
35     
36     #ifdef CONFIG_CPU_32
37     DEFN("TSS_DOMAIN",		OFF_TSK(thread.domain));
38     
39     DEFN("HPTE_TYPE_SMALL",		PTE_TYPE_SMALL);
40     DEFN("HPTE_AP_READ",		PTE_AP_READ);
41     DEFN("HPTE_AP_WRITE",		PTE_AP_WRITE);
42     
43     DEFN("LPTE_PRESENT",		L_PTE_PRESENT);
44     DEFN("LPTE_YOUNG",		L_PTE_YOUNG);
45     DEFN("LPTE_BUFFERABLE",		L_PTE_BUFFERABLE);
46     DEFN("LPTE_CACHEABLE",		L_PTE_CACHEABLE);
47     DEFN("LPTE_USER",		L_PTE_USER);
48     DEFN("LPTE_WRITE",		L_PTE_WRITE);
49     DEFN("LPTE_EXEC",		L_PTE_EXEC);
50     DEFN("LPTE_DIRTY",		L_PTE_DIRTY);
51     #endif
52     
53     #ifdef CONFIG_CPU_26
54     DEFN("PAGE_PRESENT",		_PAGE_PRESENT);
55     DEFN("PAGE_READONLY",		_PAGE_READONLY);
56     DEFN("PAGE_NOT_USER",		_PAGE_NOT_USER);
57     DEFN("PAGE_OLD",		_PAGE_OLD);
58     DEFN("PAGE_CLEAN",		_PAGE_CLEAN);
59     #endif
60     
61     DEFN("PAGE_SZ",			PAGE_SIZE);
62     
63     DEFN("SYS_ERROR0",		0x9f0000);
64     }
65