Пример #1
0
        /// <summary>
        /// Maps a virtual memory range into a physical memory range.
        /// </summary>
        /// <remarks>
        /// Addresses and size must be page aligned.
        /// </remarks>
        /// <param name="va">Virtual memory address</param>
        /// <param name="hostAddress">Physical memory address</param>
        /// <param name="size">Size to be mapped</param>
        public void Map(ulong va, nuint hostAddress, ulong size)
        {
            AssertValidAddressAndSize(va, size);

            while (size != 0)
            {
                _pageTable.Map(va, hostAddress);

                va          += PageSize;
                hostAddress += PageSize;
                size        -= PageSize;
            }
        }
Пример #2
0
        /// <inheritdoc/>
        public void Map(ulong va, ulong pa, ulong size)
        {
            AssertValidAddressAndSize(va, size);

            while (size != 0)
            {
                _pageTable.Map(va, pa);

                va   += PageSize;
                pa   += PageSize;
                size -= PageSize;
            }
        }