Rev 6102 | Rev 6934 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6102 | Rev 6293 | ||
---|---|---|---|
Line 682... | Line 682... | ||
682 | u32 euid; |
682 | u32 euid; |
683 | }; |
683 | }; |
684 | u64 raw; |
684 | u64 raw; |
685 | }evhandle_t; |
685 | }evhandle_t; |
Line 686... | Line -... | ||
686 | - | ||
687 | struct file |
- | |
688 | { |
- | |
689 | struct page **pages; /* physical memory backend */ |
- | |
690 | unsigned int count; |
- | |
691 | unsigned int allocated; |
- | |
692 | void *vma; |
- | |
693 | }; |
- | |
694 | 686 | ||
695 | struct vm_area_struct {}; |
687 | struct vm_area_struct {}; |
Line 696... | Line 688... | ||
696 | struct address_space {}; |
688 | struct address_space {}; |
Line 834... | Line 826... | ||
834 | *(u16 __force *)to = *(u16 *)from; |
826 | *(u16 __force *)to = *(u16 *)from; |
835 | return 0; |
827 | return 0; |
836 | case 4: |
828 | case 4: |
837 | *(u32 __force *)to = *(u32 *)from; |
829 | *(u32 __force *)to = *(u32 *)from; |
838 | return 0; |
830 | return 0; |
839 | #ifdef CONFIG_64BIT |
- | |
840 | case 8: |
- | |
841 | *(u64 __force *)to = *(u64 *)from; |
- | |
842 | return 0; |
- | |
843 | #endif |
- | |
844 | default: |
831 | default: |
845 | break; |
832 | break; |
846 | } |
833 | } |
847 | } |
834 | } |
Line 848... | Line 835... | ||
848 | 835 | ||
849 | __builtin_memcpy((void __force *)to, from, n); |
836 | __builtin_memcpy((void __force *)to, from, n); |
850 | return 0; |
837 | return 0; |
Line -... | Line 838... | ||
- | 838 | } |
|
- | 839 | ||
- | 840 | static __always_inline unsigned long |
|
- | 841 | __copy_from_user(void *to, const void __user *from, unsigned long n) |
|
- | 842 | { |
|
- | 843 | if (__builtin_constant_p(n)) { |
|
- | 844 | unsigned long ret; |
|
- | 845 | ||
- | 846 | switch (n) { |
|
- | 847 | case 1: |
|
- | 848 | *(u8 __force *)to = *(u8 *)from; |
|
- | 849 | return 0; |
|
- | 850 | case 2: |
|
- | 851 | *(u16 __force *)to = *(u16 *)from; |
|
- | 852 | return 0; |
|
- | 853 | case 4: |
|
- | 854 | *(u32 __force *)to = *(u32 *)from; |
|
- | 855 | return 0; |
|
- | 856 | default: |
|
- | 857 | break; |
|
- | 858 | } |
|
- | 859 | } |
|
- | 860 | __builtin_memcpy((void __force *)to, from, n); |
|
- | 861 | } |
|
- | 862 | ||
- | 863 | static inline long copy_from_user(void *to, |
|
- | 864 | const void __user * from, unsigned long n) |
|
- | 865 | { |
|
- | 866 | return __copy_from_user(to, from, n); |
|
- | 867 | } |
|
- | 868 | ||
- | 869 | static inline long copy_to_user(void __user *to, |
|
- | 870 | const void *from, unsigned long n) |
|
- | 871 | { |
|
- | 872 | return __copy_to_user(to, from, n); |
|
851 | } |
873 | } |
852 | 874 | ||
853 | void *kmap(struct page *page); |
875 | void *kmap(struct page *page); |
854 | void *kmap_atomic(struct page *page); |
876 | void *kmap_atomic(struct page *page); |