diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/um/kernel/tt/include/uaccess-tt.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/um/kernel/tt/include/uaccess-tt.h')
-rw-r--r-- | arch/um/kernel/tt/include/uaccess-tt.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/arch/um/kernel/tt/include/uaccess-tt.h b/arch/um/kernel/tt/include/uaccess-tt.h new file mode 100644 index 000000000000..f0bad010cebd --- /dev/null +++ b/arch/um/kernel/tt/include/uaccess-tt.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TT_UACCESS_H | ||
7 | #define __TT_UACCESS_H | ||
8 | |||
9 | #include "linux/string.h" | ||
10 | #include "linux/sched.h" | ||
11 | #include "asm/processor.h" | ||
12 | #include "asm/errno.h" | ||
13 | #include "asm/current.h" | ||
14 | #include "asm/a.out.h" | ||
15 | #include "uml_uaccess.h" | ||
16 | |||
17 | #define ABOVE_KMEM (16 * 1024 * 1024) | ||
18 | |||
19 | extern unsigned long end_vm; | ||
20 | extern unsigned long uml_physmem; | ||
21 | |||
22 | #define under_task_size(addr, size) \ | ||
23 | (((unsigned long) (addr) < TASK_SIZE) && \ | ||
24 | (((unsigned long) (addr) + (size)) < TASK_SIZE)) | ||
25 | |||
26 | #define is_stack(addr, size) \ | ||
27 | (((unsigned long) (addr) < STACK_TOP) && \ | ||
28 | ((unsigned long) (addr) >= STACK_TOP - ABOVE_KMEM) && \ | ||
29 | (((unsigned long) (addr) + (size)) <= STACK_TOP)) | ||
30 | |||
31 | #define access_ok_tt(type, addr, size) \ | ||
32 | ((type == VERIFY_READ) || (segment_eq(get_fs(), KERNEL_DS)) || \ | ||
33 | (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \ | ||
34 | (under_task_size(addr, size) || is_stack(addr, size)))) | ||
35 | |||
36 | static inline int verify_area_tt(int type, const void * addr, | ||
37 | unsigned long size) | ||
38 | { | ||
39 | return(access_ok_tt(type, addr, size) ? 0 : -EFAULT); | ||
40 | } | ||
41 | |||
42 | extern unsigned long get_fault_addr(void); | ||
43 | |||
44 | extern int __do_copy_from_user(void *to, const void *from, int n, | ||
45 | void **fault_addr, void **fault_catcher); | ||
46 | extern int __do_strncpy_from_user(char *dst, const char *src, size_t n, | ||
47 | void **fault_addr, void **fault_catcher); | ||
48 | extern int __do_clear_user(void *mem, size_t len, void **fault_addr, | ||
49 | void **fault_catcher); | ||
50 | extern int __do_strnlen_user(const char *str, unsigned long n, | ||
51 | void **fault_addr, void **fault_catcher); | ||
52 | |||
53 | extern int copy_from_user_tt(void *to, const void *from, int n); | ||
54 | extern int copy_to_user_tt(void *to, const void *from, int n); | ||
55 | extern int strncpy_from_user_tt(char *dst, const char *src, int count); | ||
56 | extern int __clear_user_tt(void *mem, int len); | ||
57 | extern int clear_user_tt(void *mem, int len); | ||
58 | extern int strnlen_user_tt(const void *str, int len); | ||
59 | |||
60 | #endif | ||
61 | |||
62 | /* | ||
63 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
64 | * Emacs will notice this stuff at the end of the file and automatically | ||
65 | * adjust the settings for this buffer only. This must remain at the end | ||
66 | * of the file. | ||
67 | * --------------------------------------------------------------------------- | ||
68 | * Local variables: | ||
69 | * c-file-style: "linux" | ||
70 | * End: | ||
71 | */ | ||