Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144956
b: refs/heads/master
c: d0aab92
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed May 14, 2009
1 parent af07465 commit 3f81eba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1699e5c9c414f0e3b393eb87c4acfc319fe7a1c4
refs/heads/master: d0aab922b19aaaef13c946236cc71ab9b7f895ee
16 changes: 13 additions & 3 deletions trunk/arch/mips/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,21 @@

#define __access_mask get_fs().seg

#define __access_ok(addr, size, mask) \
(((signed long)((mask) & ((addr) | ((addr) + (size)) | __ua_size(size)))) == 0)
#define __access_ok(addr, size, mask) \
({ \
const volatile void __user *__up = addr; \
unsigned long __addr = (unsigned long) __up; \
unsigned long __size = size; \
unsigned long __mask = mask; \
unsigned long __ok; \
\
__ok = (signed long)(__mask & (__addr | (__addr + __size) | \
__ua_size(__size))); \
__ok == 0; \
})

#define access_ok(type, addr, size) \
likely(__access_ok((unsigned long)(addr), (size), __access_mask))
likely(__access_ok((addr), (size), __access_mask))

/*
* put_user: - Write a simple value into user space.
Expand Down

0 comments on commit 3f81eba

Please sign in to comment.