uaccess-tt.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __TT_UACCESS_H
  6. #define __TT_UACCESS_H
  7. #include "linux/string.h"
  8. #include "linux/sched.h"
  9. #include "asm/processor.h"
  10. #include "asm/errno.h"
  11. #include "asm/current.h"
  12. #include "asm/a.out.h"
  13. #include "uml_uaccess.h"
  14. #define ABOVE_KMEM (16 * 1024 * 1024)
  15. extern unsigned long end_vm;
  16. extern unsigned long uml_physmem;
  17. #define is_stack(addr, size) \
  18. (((unsigned long) (addr) < STACK_TOP) && \
  19. ((unsigned long) (addr) >= STACK_TOP - ABOVE_KMEM) && \
  20. (((unsigned long) (addr) + (size)) <= STACK_TOP))
  21. #define access_ok_tt(type, addr, size) \
  22. (is_stack(addr, size))
  23. extern int __do_copy_from_user(void *to, const void *from, int n,
  24. void **fault_addr, void **fault_catcher);
  25. extern int __do_strncpy_from_user(char *dst, const char *src, size_t n,
  26. void **fault_addr, void **fault_catcher);
  27. extern int __do_clear_user(void *mem, size_t len, void **fault_addr,
  28. void **fault_catcher);
  29. extern int __do_strnlen_user(const char *str, unsigned long n,
  30. void **fault_addr, void **fault_catcher);
  31. extern int copy_from_user_tt(void *to, const void __user *from, int n);
  32. extern int copy_to_user_tt(void __user *to, const void *from, int n);
  33. extern int strncpy_from_user_tt(char *dst, const char __user *src, int count);
  34. extern int __clear_user_tt(void __user *mem, int len);
  35. extern int clear_user_tt(void __user *mem, int len);
  36. extern int strnlen_user_tt(const void __user *str, int len);
  37. #endif