io.h 989 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #include <asm/page.h>
  13. #define IO_SPACE_LIMIT 0xffffffff
  14. /*
  15. * Change virtual addresses to physical addresses and vv.
  16. * These are pretty trivial
  17. */
  18. static inline unsigned long virt_to_phys(volatile void * address)
  19. {
  20. unsigned long real_address;
  21. asm volatile(
  22. " lra %0,0(%1)\n"
  23. " jz 0f\n"
  24. " la %0,0\n"
  25. "0:"
  26. : "=a" (real_address) : "a" (address) : "cc");
  27. return real_address;
  28. }
  29. static inline void * phys_to_virt(unsigned long address)
  30. {
  31. return (void *) address;
  32. }
  33. void *xlate_dev_mem_ptr(unsigned long phys);
  34. void unxlate_dev_mem_ptr(unsigned long phys, void *addr);
  35. /*
  36. * Convert a virtual cached pointer to an uncached pointer
  37. */
  38. #define xlate_dev_kmem_ptr(p) p
  39. #endif