Rev 6936 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6936 | Rev 7143 | ||
---|---|---|---|
Line 61... | Line 61... | ||
61 | #define __round_mask(x, y) ((__typeof__(x))((y)-1)) |
61 | #define __round_mask(x, y) ((__typeof__(x))((y)-1)) |
62 | #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) |
62 | #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) |
63 | #define round_down(x, y) ((x) & ~__round_mask(x, y)) |
63 | #define round_down(x, y) ((x) & ~__round_mask(x, y)) |
Line 64... | Line 64... | ||
64 | 64 | ||
65 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
65 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
66 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
66 | #define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP |
67 | #define DIV_ROUND_UP_ULL(ll,d) \ |
67 | #define DIV_ROUND_UP_ULL(ll,d) \ |
Line 68... | Line 68... | ||
68 | ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; }) |
68 | ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; }) |
69 | 69 | ||
Line 786... | Line 786... | ||
786 | func(info); \ |
786 | func(info); \ |
787 | 0; \ |
787 | 0; \ |
788 | }) |
788 | }) |
Line 789... | Line -... | ||
789 | - | ||
790 | - | ||
791 | static inline __must_check long __copy_to_user(void __user *to, |
- | |
792 | const void *from, unsigned long n) |
- | |
793 | { |
- | |
794 | if (__builtin_constant_p(n)) { |
- | |
795 | switch(n) { |
- | |
796 | case 1: |
- | |
797 | *(u8 __force *)to = *(u8 *)from; |
- | |
798 | return 0; |
- | |
799 | case 2: |
- | |
800 | *(u16 __force *)to = *(u16 *)from; |
- | |
801 | return 0; |
- | |
802 | case 4: |
- | |
803 | *(u32 __force *)to = *(u32 *)from; |
- | |
804 | return 0; |
- | |
805 | default: |
- | |
806 | break; |
- | |
807 | } |
- | |
808 | } |
- | |
809 | - | ||
810 | __builtin_memcpy((void __force *)to, from, n); |
- | |
811 | return 0; |
- | |
812 | } |
- | |
813 | - | ||
814 | static __always_inline unsigned long |
- | |
815 | __copy_from_user(void *to, const void __user *from, unsigned long n) |
- | |
816 | { |
- | |
817 | if (__builtin_constant_p(n)) { |
- | |
818 | unsigned long ret; |
- | |
819 | - | ||
820 | switch (n) { |
- | |
821 | case 1: |
- | |
822 | *(u8 __force *)to = *(u8 *)from; |
- | |
823 | return 0; |
- | |
824 | case 2: |
- | |
825 | *(u16 __force *)to = *(u16 *)from; |
- | |
826 | return 0; |
- | |
827 | case 4: |
- | |
828 | *(u32 __force *)to = *(u32 *)from; |
- | |
829 | return 0; |
- | |
830 | default: |
- | |
831 | break; |
- | |
832 | } |
- | |
833 | } |
- | |
834 | __builtin_memcpy((void __force *)to, from, n); |
- | |
835 | } |
- | |
836 | - | ||
837 | static inline long copy_from_user(void *to, |
- | |
838 | const void __user * from, unsigned long n) |
- | |
839 | { |
- | |
840 | return __copy_from_user(to, from, n); |
- | |
841 | } |
- | |
842 | - | ||
843 | static inline long copy_to_user(void __user *to, |
- | |
844 | const void *from, unsigned long n) |
- | |
845 | { |
- | |
846 | return __copy_to_user(to, from, n); |
- | |
847 | } |
789 | |
Line 848... | Line 790... | ||
848 | 790 | ||
849 | #define CAP_SYS_ADMIN 21 |
791 | #define CAP_SYS_ADMIN 21 |
850 | 792 | ||
Line 859... | Line 801... | ||
859 | void kunmap(struct page *page); |
801 | void kunmap(struct page *page); |
860 | void kunmap_atomic(void *vaddr); |
802 | void kunmap_atomic(void *vaddr); |
Line 861... | Line 803... | ||
861 | 803 | ||
Line 862... | Line -... | ||
862 | typedef u64 async_cookie_t; |
- | |
863 | - | ||
864 | //#define iowrite32(v, addr) writel((v), (addr)) |
804 | typedef u64 async_cookie_t; |
Line 865... | Line 805... | ||
865 | 805 | ||
Line 866... | Line -... | ||
866 | #define __init |
- | |
867 | - | ||
868 | #define CONFIG_PAGE_OFFSET 0 |
- | |
869 | - | ||
870 | typedef long long __kernel_long_t; |
806 | #define __init |