PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/arch/s390/include/asm/io.h

https://bitbucket.org/thekraven/iscream_thunderc-2.6.35
C++ Header | 54 lines | 24 code | 10 blank | 20 comment | 0 complexity | 97ccc3d211dd98a74bb672b98ce612d5 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
  1. /*
  2. * include/asm-s390/io.h
  3. *
  4. * S390 version
  5. * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
  6. * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
  7. *
  8. * Derived from "include/asm-i386/io.h"
  9. */
  10. #ifndef _S390_IO_H
  11. #define _S390_IO_H
  12. #ifdef __KERNEL__
  13. #include <asm/page.h>
  14. #define IO_SPACE_LIMIT 0xffffffff
  15. /*
  16. * Change virtual addresses to physical addresses and vv.
  17. * These are pretty trivial
  18. */
  19. static inline unsigned long virt_to_phys(volatile void * address)
  20. {
  21. unsigned long real_address;
  22. asm volatile(
  23. " lra %0,0(%1)\n"
  24. " jz 0f\n"
  25. " la %0,0\n"
  26. "0:"
  27. : "=a" (real_address) : "a" (address) : "cc");
  28. return real_address;
  29. }
  30. static inline void * phys_to_virt(unsigned long address)
  31. {
  32. return (void *) address;
  33. }
  34. /*
  35. * Convert a physical pointer to a virtual kernel pointer for /dev/mem
  36. * access
  37. */
  38. #define xlate_dev_mem_ptr(p) __va(p)
  39. /*
  40. * Convert a virtual cached pointer to an uncached pointer
  41. */
  42. #define xlate_dev_kmem_ptr(p) p
  43. #endif /* __KERNEL__ */
  44. #endif