diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-01-19 05:12:38 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-19 05:12:38 -0800 |
| commit | eb4f6fb91be878c1acd727d62abb600b77b631fd (patch) | |
| tree | 17350cefa1d36649efe7512b7b48e107c2d2e83e /include/linux | |
| parent | 3ab8835250b69514319969a97661b1d83814b637 (diff) | |
[PATCH] Fix statically declare FIXMAPs
From: Anton Blanchard <anton@samba.org>, me.
Two uses of the FIXADDR_USER_START/END things are problematic:
a) ppc64 wants the FIXADDR area to be at a different location on 32bit and
64bit tasks. On 32bit we want it just below 4GB but that gets in the way
on 64bit. By putting both right at -(some small amount) we can also use
some ppc tricks to get there real quickly (single instruction branches).
b) We assume that FIXADDR_USER_START and FIXADDR_USER_END are constants.
This breaks the UML build.
Fixes:
- Call it all gate. We currently have half the stuff called fixmap and
the other gate, lets be consistent.
- Create in_gate_area(), get_gate_vma() and use it in both places
- Provide defaults for in_gate_area/get_gate_vma, allowing an arch to
override it. (I used CONFIG_* but am open to better suggestions here)
- The /proc/pid/maps vma wasnt marked readable but the get_user
vma was. That sounds suspicious to me, they are now both the same VMA
and so have the same (read,exec) permissions
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mm.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 42f5c2df91d1..3ecd3d633c5f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -642,5 +642,33 @@ kernel_map_pages(struct page *page, int numpages, int enable) } #endif +#ifndef CONFIG_ARCH_GATE_AREA +#ifdef AT_SYSINFO_EHDR +static inline int in_gate_area(struct task_struct *task, unsigned long addr) +{ + if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) + return 1; + else + return 0; +} + +extern struct vm_area_struct gate_vma; +static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ + return &gate_vma; +} +#else +static inline int in_gate_area(struct task_struct *task, unsigned long addr) +{ + return 0; +} + +static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ + return NULL; +} +#endif +#endif + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ |
