2006-12-08 03:36:23 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2006 Jeff Dike (jdike@addtoit.com)
|
|
|
|
* Licensed under the GPL V2
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/uaccess.h>
|
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>
2008-02-04 23:30:53 -07:00
|
|
|
#include <asm/errno.h>
|
2006-12-08 03:36:23 -07:00
|
|
|
|
|
|
|
/* Mostly copied from i386/x86_86 - eliminated the eip < PAGE_OFFSET because
|
2007-10-19 17:23:03 -06:00
|
|
|
* that's not relevant in skas mode.
|
2006-12-08 03:36:23 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
int is_valid_bugaddr(unsigned long eip)
|
|
|
|
{
|
|
|
|
unsigned short ud2;
|
|
|
|
|
|
|
|
if (probe_kernel_address((unsigned short __user *)eip, ud2))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return ud2 == 0x0b0f;
|
|
|
|
}
|