aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/mem.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2008-02-05 01:30:53 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:28 -0500
commit8192ab42bf60e1e9b7efa046990e9cc5e4a95cf4 (patch)
treef61fee85b0eccbc055ec8c5a98932b20eca64bf1 /arch/um/kernel/mem.c
parent9157f90f08f7db3188cd06971f41cb2ba5646e57 (diff)
uml: header untangling
Untangle UML headers somewhat and add some includes where they were needed explicitly, but gotten accidentally via some other header. arch/um/include/um_uaccess.h loses asm/fixmap.h because it uses no fixmap stuff and gains elf.h, because it needs FIXADDR_USER_*, and archsetjmp.h, because it needs jmp_buf. pmd_alloc_one is uninlined because it needs mm_struct, and that's inconvenient to provide in asm-um/pgtable-3level.h. elf_core_copy_fpregs is also uninlined from elf-i386.h and elf-x86_64.h, which duplicated the code anyway, to arch/um/kernel/process.c, so that the reference to current_thread doesn't pull sched.h or anything related into asm/elf.h. arch/um/sys-i386/ldt.c, arch/um/kernel/tlb.c and arch/um/kernel/skas/uaccess.c got sched.h because they dereference task_structs. Its includes of linux and asm headers got turned from "" to <>. arch/um/sys-i386/bug.c gets asm/errno.h because it needs errno constants. asm/elf-i386 gets asm/user.h because it needs user_regs_struct. asm/fixmap.h gets page.h because it needs PAGE_SIZE and PAGE_MASK and system.h for BUG_ON. asm/pgtable doesn't need sched.h. asm/processor-generic.h defined mm_segment_t, but didn't use it. So, that definition is moved to uaccess.h, which defines a bunch of mm_segment_t-related stuff. thread_info.h uses mm_segment_t, and includes uaccess.h, which causes a recursion. So, the definition is placed above the include of thread_info. in uaccess.h. thread_info.h also gets page.h because it needs PAGE_SIZE. ObCheckpatchViolationJustification - I'm not adding a typedef; I'm moving mm_segment_t from one place to another. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/kernel/mem.c')
-rw-r--r--arch/um/kernel/mem.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 96072e27a0e7..1f8f0c195173 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -152,7 +152,7 @@ pgprot_t kmap_prot;
152 152
153#define kmap_get_fixmap_pte(vaddr) \ 153#define kmap_get_fixmap_pte(vaddr) \
154 pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)),\ 154 pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)),\
155 (vaddr)), (vaddr)) 155 (vaddr)), (vaddr))
156 156
157static void __init kmap_init(void) 157static void __init kmap_init(void)
158{ 158{
@@ -278,7 +278,8 @@ struct page *arch_validate(struct page *page, gfp_t mask, int order)
278 goto again; 278 goto again;
279} 279}
280 280
281/* This can't do anything because nothing in the kernel image can be freed 281/*
282 * This can't do anything because nothing in the kernel image can be freed
282 * since it's not in kernel physical memory. 283 * since it's not in kernel physical memory.
283 */ 284 */
284 285
@@ -331,9 +332,7 @@ void show_mem(void)
331 printk("%d pages swap cached\n", cached); 332 printk("%d pages swap cached\n", cached);
332} 333}
333 334
334/* 335/* Allocate and free page tables. */
335 * Allocate and free page tables.
336 */
337 336
338pgd_t *pgd_alloc(struct mm_struct *mm) 337pgd_t *pgd_alloc(struct mm_struct *mm)
339{ 338{
@@ -368,3 +367,15 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
368 pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); 367 pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
369 return pte; 368 return pte;
370} 369}
370
371#ifdef CONFIG_3_LEVEL_PGTABLES
372pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
373{
374 pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL);
375
376 if (pmd)
377 memset(pmd, 0, PAGE_SIZE);
378
379 return pmd;
380}
381#endif