Firmware for MNT ZZ9000 graphics and ARM coprocessor card for Amiga computers.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

io-generic.h 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Generic I/O functions.
  4. *
  5. * Copyright (c) 2016 Imagination Technologies Ltd.
  6. */
  7. #ifndef __ASM_GENERIC_IO_H__
  8. #define __ASM_GENERIC_IO_H__
  9. /*
  10. * This file should be included at the end of each architecture-specific
  11. * asm/io.h such that we may provide generic implementations without
  12. * conflicting with architecture-specific code.
  13. */
  14. #ifndef __ASSEMBLY__
  15. /**
  16. * phys_to_virt() - Return a virtual address mapped to a given physical address
  17. * @paddr: the physical address
  18. *
  19. * Returns a virtual address which the CPU can access that maps to the physical
  20. * address @paddr. This should only be used where it is known that no dynamic
  21. * mapping is required. In general, map_physmem should be used instead.
  22. *
  23. * Returns: a virtual address which maps to @paddr
  24. */
  25. /*
  26. * Flags for use with map_physmem() & unmap_physmem(). Architectures need not
  27. * support all of these, in which case they will be defined as zero here &
  28. * ignored. Callers that may run on multiple architectures should therefore
  29. * treat them as hints rather than requirements.
  30. */
  31. #ifndef MAP_NOCACHE
  32. # define MAP_NOCACHE 0 /* Produce an uncached mapping */
  33. #endif
  34. #ifndef MAP_WRCOMBINE
  35. # define MAP_WRCOMBINE 0 /* Allow write-combining on the mapping */
  36. #endif
  37. #ifndef MAP_WRBACK
  38. # define MAP_WRBACK 0 /* Map using write-back caching */
  39. #endif
  40. #ifndef MAP_WRTHROUGH
  41. # define MAP_WRTHROUGH 0 /* Map using write-through caching */
  42. #endif
  43. /**
  44. * map_physmem() - Return a virtual address mapped to a given physical address
  45. * @paddr: the physical address
  46. * @len: the length of the required mapping
  47. * @flags: flags affecting the type of mapping
  48. *
  49. * Return a virtual address through which the CPU may access the memory at
  50. * physical address @paddr. The mapping will be valid for at least @len bytes,
  51. * and may be affected by flags passed to the @flags argument. This function
  52. * may create new mappings, so should generally be paired with a matching call
  53. * to unmap_physmem once the caller is finished with the memory in question.
  54. *
  55. * Returns: a virtual address suitably mapped to @paddr
  56. */
  57. /**
  58. * unmap_physmem() - Remove mappings created by a prior call to map_physmem()
  59. * @vaddr: the virtual address which map_physmem() previously returned
  60. * @flags: flags matching those originally passed to map_physmem()
  61. *
  62. * Unmap memory which was previously mapped by a call to map_physmem(). If
  63. * map_physmem() dynamically created a mapping for the memory in question then
  64. * unmap_physmem() will remove that mapping.
  65. */
  66. #ifndef unmap_physmem
  67. static inline void unmap_physmem(void *vaddr, unsigned long flags)
  68. {
  69. }
  70. #endif
  71. #endif /* !__ASSEMBLY__ */
  72. #endif /* __ASM_GENERIC_IO_H__ */