uaccess-skas.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __SKAS_UACCESS_H
  6. #define __SKAS_UACCESS_H
  7. #include "asm/errno.h"
  8. #include "asm/fixmap.h"
  9. #define access_ok_skas(type, addr, size) \
  10. ((segment_eq(get_fs(), KERNEL_DS)) || \
  11. (((unsigned long) (addr) < TASK_SIZE) && \
  12. ((unsigned long) (addr) + (size) <= TASK_SIZE)) || \
  13. ((type == VERIFY_READ ) && \
  14. ((unsigned long) (addr) >= FIXADDR_USER_START) && \
  15. ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \
  16. ((unsigned long) (addr) + (size) >= (unsigned long)(addr))))
  17. static inline int verify_area_skas(int type, const void * addr,
  18. unsigned long size)
  19. {
  20. return(access_ok_skas(type, addr, size) ? 0 : -EFAULT);
  21. }
  22. extern int copy_from_user_skas(void *to, const void *from, int n);
  23. extern int copy_to_user_skas(void *to, const void *from, int n);
  24. extern int strncpy_from_user_skas(char *dst, const char *src, int count);
  25. extern int __clear_user_skas(void *mem, int len);
  26. extern int clear_user_skas(void *mem, int len);
  27. extern int strnlen_user_skas(const void *str, int len);
  28. #endif
  29. /*
  30. * Overrides for Emacs so that we follow Linus's tabbing style.
  31. * Emacs will notice this stuff at the end of the file and automatically
  32. * adjust the settings for this buffer only. This must remain at the end
  33. * of the file.
  34. * ---------------------------------------------------------------------------
  35. * Local variables:
  36. * c-file-style: "linux"
  37. * End:
  38. */