diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-09-08 05:41:28 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-08 05:41:28 -0400 |
commit | 142e27fc8a3619471669d6241784eec9167c47d1 (patch) | |
tree | e88850b63ec910ee28874f93c43fb66421bb8119 /include/asm-m68knommu | |
parent | a9053d0494d3c92807701c0f47df61d50c971581 (diff) | |
parent | caf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'include/asm-m68knommu')
-rw-r--r-- | include/asm-m68knommu/auxvec.h | 4 | ||||
-rw-r--r-- | include/asm-m68knommu/futex.h | 53 | ||||
-rw-r--r-- | include/asm-m68knommu/hdreg.h | 1 | ||||
-rw-r--r-- | include/asm-m68knommu/page.h | 21 | ||||
-rw-r--r-- | include/asm-m68knommu/uaccess.h | 6 |
5 files changed, 62 insertions, 23 deletions
diff --git a/include/asm-m68knommu/auxvec.h b/include/asm-m68knommu/auxvec.h new file mode 100644 index 000000000000..844d6d52204b --- /dev/null +++ b/include/asm-m68knommu/auxvec.h | |||
@@ -0,0 +1,4 @@ | |||
1 | #ifndef __ASMm68k_AUXVEC_H | ||
2 | #define __ASMm68k_AUXVEC_H | ||
3 | |||
4 | #endif | ||
diff --git a/include/asm-m68knommu/futex.h b/include/asm-m68knommu/futex.h new file mode 100644 index 000000000000..2cac5ecd9d00 --- /dev/null +++ b/include/asm-m68knommu/futex.h | |||
@@ -0,0 +1,53 @@ | |||
1 | #ifndef _ASM_FUTEX_H | ||
2 | #define _ASM_FUTEX_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <linux/futex.h> | ||
7 | #include <asm/errno.h> | ||
8 | #include <asm/uaccess.h> | ||
9 | |||
10 | static inline int | ||
11 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | ||
12 | { | ||
13 | int op = (encoded_op >> 28) & 7; | ||
14 | int cmp = (encoded_op >> 24) & 15; | ||
15 | int oparg = (encoded_op << 8) >> 20; | ||
16 | int cmparg = (encoded_op << 20) >> 20; | ||
17 | int oldval = 0, ret, tem; | ||
18 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | ||
19 | oparg = 1 << oparg; | ||
20 | |||
21 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | ||
22 | return -EFAULT; | ||
23 | |||
24 | inc_preempt_count(); | ||
25 | |||
26 | switch (op) { | ||
27 | case FUTEX_OP_SET: | ||
28 | case FUTEX_OP_ADD: | ||
29 | case FUTEX_OP_OR: | ||
30 | case FUTEX_OP_ANDN: | ||
31 | case FUTEX_OP_XOR: | ||
32 | default: | ||
33 | ret = -ENOSYS; | ||
34 | } | ||
35 | |||
36 | dec_preempt_count(); | ||
37 | |||
38 | if (!ret) { | ||
39 | switch (cmp) { | ||
40 | case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; | ||
41 | case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; | ||
42 | case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; | ||
43 | case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; | ||
44 | case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; | ||
45 | case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; | ||
46 | default: ret = -ENOSYS; | ||
47 | } | ||
48 | } | ||
49 | return ret; | ||
50 | } | ||
51 | |||
52 | #endif | ||
53 | #endif | ||
diff --git a/include/asm-m68knommu/hdreg.h b/include/asm-m68knommu/hdreg.h deleted file mode 100644 index 5cdd9b084d37..000000000000 --- a/include/asm-m68knommu/hdreg.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-m68k/hdreg.h> | ||
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h index 05e03df0ec29..942dfbead27f 100644 --- a/include/asm-m68knommu/page.h +++ b/include/asm-m68knommu/page.h | |||
@@ -48,20 +48,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
48 | /* to align the pointer to the (next) page boundary */ | 48 | /* to align the pointer to the (next) page boundary */ |
49 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | 49 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) |
50 | 50 | ||
51 | /* Pure 2^n version of get_order */ | ||
52 | extern __inline__ int get_order(unsigned long size) | ||
53 | { | ||
54 | int order; | ||
55 | |||
56 | size = (size-1) >> (PAGE_SHIFT-1); | ||
57 | order = -1; | ||
58 | do { | ||
59 | size >>= 1; | ||
60 | order++; | ||
61 | } while (size); | ||
62 | return order; | ||
63 | } | ||
64 | |||
65 | extern unsigned long memory_start; | 51 | extern unsigned long memory_start; |
66 | extern unsigned long memory_end; | 52 | extern unsigned long memory_end; |
67 | 53 | ||
@@ -73,8 +59,8 @@ extern unsigned long memory_end; | |||
73 | 59 | ||
74 | #ifndef __ASSEMBLY__ | 60 | #ifndef __ASSEMBLY__ |
75 | 61 | ||
76 | #define __pa(vaddr) virt_to_phys((void *)vaddr) | 62 | #define __pa(vaddr) virt_to_phys((void *)(vaddr)) |
77 | #define __va(paddr) phys_to_virt((unsigned long)paddr) | 63 | #define __va(paddr) phys_to_virt((unsigned long)(paddr)) |
78 | 64 | ||
79 | #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) | 65 | #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) |
80 | #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) | 66 | #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) |
@@ -84,6 +70,7 @@ extern unsigned long memory_end; | |||
84 | 70 | ||
85 | #define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) | 71 | #define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) |
86 | #define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) | 72 | #define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) |
73 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | ||
87 | 74 | ||
88 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ | 75 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ |
89 | ((void *)(kaddr) < (void *)memory_end)) | 76 | ((void *)(kaddr) < (void *)memory_end)) |
@@ -92,4 +79,6 @@ extern unsigned long memory_end; | |||
92 | 79 | ||
93 | #endif /* __KERNEL__ */ | 80 | #endif /* __KERNEL__ */ |
94 | 81 | ||
82 | #include <asm-generic/page.h> | ||
83 | |||
95 | #endif /* _M68KNOMMU_PAGE_H */ | 84 | #endif /* _M68KNOMMU_PAGE_H */ |
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h index f0be74bb353c..05be9515a2d2 100644 --- a/include/asm-m68knommu/uaccess.h +++ b/include/asm-m68knommu/uaccess.h | |||
@@ -23,12 +23,6 @@ static inline int _access_ok(unsigned long addr, unsigned long size) | |||
23 | (is_in_rom(addr) && is_in_rom(addr+size))); | 23 | (is_in_rom(addr) && is_in_rom(addr+size))); |
24 | } | 24 | } |
25 | 25 | ||
26 | /* this function will go away soon - use access_ok() instead */ | ||
27 | extern inline int __deprecated verify_area(int type, const void * addr, unsigned long size) | ||
28 | { | ||
29 | return access_ok(type,addr,size)?0:-EFAULT; | ||
30 | } | ||
31 | |||
32 | /* | 26 | /* |
33 | * The exception table consists of pairs of addresses: the first is the | 27 | * The exception table consists of pairs of addresses: the first is the |
34 | * address of an instruction that is allowed to fault, and the second is | 28 | * address of an instruction that is allowed to fault, and the second is |