AudioProcessorMemoryManager.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // Copyright (c) 2019-2021 Ryujinx
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Lesser General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. //
  17. using System.Runtime.CompilerServices;
  18. using DspAddress = System.UInt64;
  19. using CpuAddress = System.UInt64;
  20. namespace Ryujinx.Audio.Renderer.Utils
  21. {
  22. /// <summary>
  23. /// The <see cref="Dsp.AudioProcessor"/> memory management
  24. /// </summary>
  25. /// <remarks>This is stub for the most part but is kept to permit LLE if wanted.</remarks>
  26. static class AudioProcessorMemoryManager
  27. {
  28. /// <summary>
  29. /// Map the given <see cref="CpuAddress"/> to the <see cref="Dsp.AudioProcessor"/> address space.
  30. /// </summary>
  31. /// <param name="processHandle">The process owning the CPU memory.</param>
  32. /// <param name="cpuAddress">The <see cref="CpuAddress"/> to map.</param>
  33. /// <param name="size">The size of the CPU memory region to map.</param>
  34. /// <returns>The address on the <see cref="Dsp.AudioProcessor"/> address space.</returns>
  35. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  36. public static DspAddress Map(uint processHandle, CpuAddress cpuAddress, ulong size)
  37. {
  38. return cpuAddress;
  39. }
  40. /// <summary>
  41. /// Unmap the given <see cref="CpuAddress"/> from the <see cref="Dsp.AudioProcessor"/> address space.
  42. /// </summary>
  43. /// <param name="processHandle">The process owning the CPU memory.</param>
  44. /// <param name="cpuAddress">The <see cref="CpuAddress"/> to unmap.</param>
  45. /// <param name="size">The size of the CPU memory region to unmap.</param>
  46. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  47. public static void Unmap(uint processHandle, CpuAddress cpuAddress, ulong size)
  48. {
  49. }
  50. /// <summary>
  51. /// Invalidate the <see cref="Dsp.AudioProcessor"/> data cache at the given address.
  52. /// </summary>
  53. /// <param name="address">The base DSP address to invalidate</param>
  54. /// <param name="size">The size of the DSP memory region to invalidate.</param>
  55. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  56. public static void InvalidateDspCache(DspAddress address, ulong size)
  57. {
  58. }
  59. /// <summary>
  60. /// Invalidate the CPU data cache at the given address.
  61. /// </summary>
  62. /// <param name="address">The base <see cref="CpuAddress"/> to invalidate</param>
  63. /// <param name="size">The size of the CPU memory region to invalidate.</param>
  64. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  65. public static void InvalidateDataCache(CpuAddress address, ulong size)
  66. {
  67. }
  68. }
  69. }