2 * Copyright (C) 1995-2003 Russell King
3 * 2001-2002 Keith Owens
5 * Generate definitions needed by assembly language modules.
6 * This code generates raw asm output which is post-processed to extract
7 * and format the required data.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/config.h>
15 #include <linux/sched.h>
18 #include <asm/pgtable.h>
19 #include <asm/uaccess.h>
22 * Make sure that the compiler and target are compatible.
24 #if defined(__APCS_26__)
25 #error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32
28 * GCC 2.95.1, 2.95.2: ignores register clobber list in asm().
29 * GCC 3.0, 3.1: general bad code generation.
30 * GCC 3.2.0: incorrect function argument offset calculation.
31 * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c
32 * (http://gcc.gnu.org/PR8896) and incorrect structure
33 * initialisation in fs/jffs2/erase.c
36 (__GNUC__ == 2 && __GNUC_MINOR__ < 95) || \
37 (__GNUC__ == 2 && __GNUC_MINOR__ == 95 && __GNUC_PATCHLEVEL__ != 0 && \
38 __GNUC_PATCHLEVEL__ < 3) || \
39 (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
40 #error Your compiler is too buggy; it is known to miscompile kernels.
41 #error Known good compilers: 2.95.3, 2.95.4, 2.96, 3.3
44 /* Use marker if you need to separate the values later */
46 #define DEFINE(sym, val) \
47 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
49 #define BLANK() asm volatile("\n->" : : )
53 DEFINE(TSK_USED_MATH, offsetof(struct task_struct, used_math));
54 DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
56 DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));
57 DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags));
59 DEFINE(VM_EXEC, VM_EXEC);
61 DEFINE(HPTE_TYPE_SMALL, PTE_TYPE_SMALL);
62 DEFINE(HPTE_AP_READ, PTE_AP_READ);
63 DEFINE(HPTE_AP_WRITE, PTE_AP_WRITE);
65 DEFINE(LPTE_PRESENT, L_PTE_PRESENT);
66 DEFINE(LPTE_YOUNG, L_PTE_YOUNG);
67 DEFINE(LPTE_BUFFERABLE, L_PTE_BUFFERABLE);
68 DEFINE(LPTE_CACHEABLE, L_PTE_CACHEABLE);
69 DEFINE(LPTE_USER, L_PTE_USER);
70 DEFINE(LPTE_WRITE, L_PTE_WRITE);
71 DEFINE(LPTE_EXEC, L_PTE_EXEC);
72 DEFINE(LPTE_DIRTY, L_PTE_DIRTY);
74 DEFINE(PAGE_SZ, PAGE_SIZE);
76 DEFINE(SYS_ERROR0, 0x9f0000);