summaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorGravatar James Rowe2018-07-02 10:13:26 -0600
committerGravatar bunnei2018-07-02 21:45:47 -0400
commit638956aa81de255bf4bbd4e69a717eabf4ceadb9 (patch)
tree5783dda790575e047fa757d8c56e11f3fffe7646 /src/core/memory.cpp
parentMerge pull request #608 from Subv/depth (diff)
downloadyuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar.gz
yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar.xz
yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.zip
Rename logging macro back to LOG_*
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index f070dee7d..103ff0b77 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -43,7 +43,7 @@ PageTable* GetCurrentPageTable() {
43} 43}
44 44
45static void MapPages(PageTable& page_table, VAddr base, u64 size, u8* memory, PageType type) { 45static void MapPages(PageTable& page_table, VAddr base, u64 size, u8* memory, PageType type) {
46 NGLOG_DEBUG(HW_Memory, "Mapping {} onto {:016X}-{:016X}", fmt::ptr(memory), base * PAGE_SIZE, 46 LOG_DEBUG(HW_Memory, "Mapping {} onto {:016X}-{:016X}", fmt::ptr(memory), base * PAGE_SIZE,
47 (base + size) * PAGE_SIZE); 47 (base + size) * PAGE_SIZE);
48 48
49 RasterizerFlushVirtualRegion(base << PAGE_BITS, size * PAGE_SIZE, 49 RasterizerFlushVirtualRegion(base << PAGE_BITS, size * PAGE_SIZE,
@@ -173,7 +173,7 @@ T Read(const VAddr vaddr) {
173 PageType type = current_page_table->attributes[vaddr >> PAGE_BITS]; 173 PageType type = current_page_table->attributes[vaddr >> PAGE_BITS];
174 switch (type) { 174 switch (type) {
175 case PageType::Unmapped: 175 case PageType::Unmapped:
176 NGLOG_ERROR(HW_Memory, "Unmapped Read{} @ 0x{:08X}", sizeof(T) * 8, vaddr); 176 LOG_ERROR(HW_Memory, "Unmapped Read{} @ 0x{:08X}", sizeof(T) * 8, vaddr);
177 return 0; 177 return 0;
178 case PageType::Memory: 178 case PageType::Memory:
179 ASSERT_MSG(false, "Mapped memory page without a pointer @ {:016X}", vaddr); 179 ASSERT_MSG(false, "Mapped memory page without a pointer @ {:016X}", vaddr);
@@ -205,7 +205,7 @@ void Write(const VAddr vaddr, const T data) {
205 PageType type = current_page_table->attributes[vaddr >> PAGE_BITS]; 205 PageType type = current_page_table->attributes[vaddr >> PAGE_BITS];
206 switch (type) { 206 switch (type) {
207 case PageType::Unmapped: 207 case PageType::Unmapped:
208 NGLOG_ERROR(HW_Memory, "Unmapped Write{} 0x{:08X} @ 0x{:016X}", sizeof(data) * 8, 208 LOG_ERROR(HW_Memory, "Unmapped Write{} 0x{:08X} @ 0x{:016X}", sizeof(data) * 8,
209 static_cast<u32>(data), vaddr); 209 static_cast<u32>(data), vaddr);
210 return; 210 return;
211 case PageType::Memory: 211 case PageType::Memory:
@@ -259,7 +259,7 @@ u8* GetPointer(const VAddr vaddr) {
259 return GetPointerFromVMA(vaddr); 259 return GetPointerFromVMA(vaddr);
260 } 260 }
261 261
262 NGLOG_ERROR(HW_Memory, "Unknown GetPointer @ 0x{:016X}", vaddr); 262 LOG_ERROR(HW_Memory, "Unknown GetPointer @ 0x{:016X}", vaddr);
263 return nullptr; 263 return nullptr;
264} 264}
265 265
@@ -296,12 +296,12 @@ u8* GetPhysicalPointer(PAddr address) {
296 }); 296 });
297 297
298 if (area == std::end(memory_areas)) { 298 if (area == std::end(memory_areas)) {
299 NGLOG_ERROR(HW_Memory, "Unknown GetPhysicalPointer @ 0x{:016X}", address); 299 LOG_ERROR(HW_Memory, "Unknown GetPhysicalPointer @ 0x{:016X}", address);
300 return nullptr; 300 return nullptr;
301 } 301 }
302 302
303 if (area->paddr_base == IO_AREA_PADDR) { 303 if (area->paddr_base == IO_AREA_PADDR) {
304 NGLOG_ERROR(HW_Memory, "MMIO mappings are not supported yet. phys_addr={:016X}", address); 304 LOG_ERROR(HW_Memory, "MMIO mappings are not supported yet. phys_addr={:016X}", address);
305 return nullptr; 305 return nullptr;
306 } 306 }
307 307
@@ -348,7 +348,7 @@ void RasterizerMarkRegionCached(Tegra::GPUVAddr gpu_addr, u64 size, bool cached)
348 Core::System::GetInstance().GPU().memory_manager->GpuToCpuAddress(gpu_addr); 348 Core::System::GetInstance().GPU().memory_manager->GpuToCpuAddress(gpu_addr);
349 // The GPU <-> CPU virtual memory mapping is not 1:1 349 // The GPU <-> CPU virtual memory mapping is not 1:1
350 if (!maybe_vaddr) { 350 if (!maybe_vaddr) {
351 NGLOG_ERROR(HW_Memory, 351 LOG_ERROR(HW_Memory,
352 "Trying to flush a cached region to an invalid physical address {:016X}", 352 "Trying to flush a cached region to an invalid physical address {:016X}",
353 gpu_addr); 353 gpu_addr);
354 continue; 354 continue;
@@ -484,7 +484,7 @@ void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_
484 484
485 switch (page_table.attributes[page_index]) { 485 switch (page_table.attributes[page_index]) {
486 case PageType::Unmapped: { 486 case PageType::Unmapped: {
487 NGLOG_ERROR(HW_Memory, 487 LOG_ERROR(HW_Memory,
488 "Unmapped ReadBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", 488 "Unmapped ReadBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
489 current_vaddr, src_addr, size); 489 current_vaddr, src_addr, size);
490 std::memset(dest_buffer, 0, copy_amount); 490 std::memset(dest_buffer, 0, copy_amount);
@@ -548,7 +548,7 @@ void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const voi
548 548
549 switch (page_table.attributes[page_index]) { 549 switch (page_table.attributes[page_index]) {
550 case PageType::Unmapped: { 550 case PageType::Unmapped: {
551 NGLOG_ERROR(HW_Memory, 551 LOG_ERROR(HW_Memory,
552 "Unmapped WriteBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", 552 "Unmapped WriteBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
553 current_vaddr, dest_addr, size); 553 current_vaddr, dest_addr, size);
554 break; 554 break;
@@ -596,7 +596,7 @@ void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size
596 596
597 switch (page_table.attributes[page_index]) { 597 switch (page_table.attributes[page_index]) {
598 case PageType::Unmapped: { 598 case PageType::Unmapped: {
599 NGLOG_ERROR(HW_Memory, 599 LOG_ERROR(HW_Memory,
600 "Unmapped ZeroBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", 600 "Unmapped ZeroBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
601 current_vaddr, dest_addr, size); 601 current_vaddr, dest_addr, size);
602 break; 602 break;
@@ -637,7 +637,7 @@ void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr,
637 637
638 switch (page_table.attributes[page_index]) { 638 switch (page_table.attributes[page_index]) {
639 case PageType::Unmapped: { 639 case PageType::Unmapped: {
640 NGLOG_ERROR(HW_Memory, 640 LOG_ERROR(HW_Memory,
641 "Unmapped CopyBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", 641 "Unmapped CopyBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
642 current_vaddr, src_addr, size); 642 current_vaddr, src_addr, size);
643 ZeroBlock(process, dest_addr, copy_amount); 643 ZeroBlock(process, dest_addr, copy_amount);
@@ -692,7 +692,7 @@ boost::optional<PAddr> TryVirtualToPhysicalAddress(const VAddr addr) {
692PAddr VirtualToPhysicalAddress(const VAddr addr) { 692PAddr VirtualToPhysicalAddress(const VAddr addr) {
693 auto paddr = TryVirtualToPhysicalAddress(addr); 693 auto paddr = TryVirtualToPhysicalAddress(addr);
694 if (!paddr) { 694 if (!paddr) {
695 NGLOG_ERROR(HW_Memory, "Unknown virtual address @ 0x{:016X}", addr); 695 LOG_ERROR(HW_Memory, "Unknown virtual address @ 0x{:016X}", addr);
696 // To help with debugging, set bit on address so that it's obviously invalid. 696 // To help with debugging, set bit on address so that it's obviously invalid.
697 return addr | 0x80000000; 697 return addr | 0x80000000;
698 } 698 }