Update clang format

This commit is contained in:
James Rowe 2018-07-02 10:20:50 -06:00 committed by bunnei
parent 638956aa81
commit 0d46f0df12
37 changed files with 141 additions and 154 deletions

View File

@ -30,15 +30,14 @@ __declspec(noinline, noreturn)
#define ASSERT(_a_) \ #define ASSERT(_a_) \
do \ do \
if (!(_a_)) { \ if (!(_a_)) { \
assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \ assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \
} \ } \
while (0) while (0)
#define ASSERT_MSG(_a_, ...) \ #define ASSERT_MSG(_a_, ...) \
do \ do \
if (!(_a_)) { \ if (!(_a_)) { \
assert_noinline_call( \ assert_noinline_call([&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \
[&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \
} \ } \
while (0) while (0)

View File

@ -257,7 +257,7 @@ bool Rename(const std::string& srcFilename, const std::string& destFilename) {
return true; return true;
#endif #endif
LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename,
GetLastErrorMsg()); GetLastErrorMsg());
return false; return false;
} }
@ -270,7 +270,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) {
return true; return true;
LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename,
GetLastErrorMsg()); GetLastErrorMsg());
return false; return false;
#else #else
@ -283,7 +283,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) {
FILE* input = fopen(srcFilename.c_str(), "rb"); FILE* input = fopen(srcFilename.c_str(), "rb");
if (!input) { if (!input) {
LOG_ERROR(Common_Filesystem, "opening input failed {} --> {}: {}", srcFilename, LOG_ERROR(Common_Filesystem, "opening input failed {} --> {}: {}", srcFilename,
destFilename, GetLastErrorMsg()); destFilename, GetLastErrorMsg());
return false; return false;
} }
@ -292,7 +292,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) {
if (!output) { if (!output) {
fclose(input); fclose(input);
LOG_ERROR(Common_Filesystem, "opening output failed {} --> {}: {}", srcFilename, LOG_ERROR(Common_Filesystem, "opening output failed {} --> {}: {}", srcFilename,
destFilename, GetLastErrorMsg()); destFilename, GetLastErrorMsg());
return false; return false;
} }
@ -303,7 +303,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) {
if (rnum != BSIZE) { if (rnum != BSIZE) {
if (ferror(input) != 0) { if (ferror(input) != 0) {
LOG_ERROR(Common_Filesystem, "failed reading from source, {} --> {}: {}", LOG_ERROR(Common_Filesystem, "failed reading from source, {} --> {}: {}",
srcFilename, destFilename, GetLastErrorMsg()); srcFilename, destFilename, GetLastErrorMsg());
goto bail; goto bail;
} }
} }
@ -312,7 +312,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) {
size_t wnum = fwrite(buffer, sizeof(char), rnum, output); size_t wnum = fwrite(buffer, sizeof(char), rnum, output);
if (wnum != rnum) { if (wnum != rnum) {
LOG_ERROR(Common_Filesystem, "failed writing to output, {} --> {}: {}", srcFilename, LOG_ERROR(Common_Filesystem, "failed writing to output, {} --> {}: {}", srcFilename,
destFilename, GetLastErrorMsg()); destFilename, GetLastErrorMsg());
goto bail; goto bail;
} }
} }
@ -371,14 +371,12 @@ u64 GetSize(FILE* f) {
// can't use off_t here because it can be 32-bit // can't use off_t here because it can be 32-bit
u64 pos = ftello(f); u64 pos = ftello(f);
if (fseeko(f, 0, SEEK_END) != 0) { if (fseeko(f, 0, SEEK_END) != 0) {
LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), GetLastErrorMsg());
GetLastErrorMsg());
return 0; return 0;
} }
u64 size = ftello(f); u64 size = ftello(f);
if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0)) { if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0)) {
LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), GetLastErrorMsg());
GetLastErrorMsg());
return 0; return 0;
} }
return size; return size;

View File

@ -66,7 +66,7 @@ bool Filter::ParseFilterRule(const std::string::const_iterator begin,
auto level_separator = std::find(begin, end, ':'); auto level_separator = std::find(begin, end, ':');
if (level_separator == end) { if (level_separator == end) {
LOG_ERROR(Log, "Invalid log filter. Must specify a log level after `:`: %s", LOG_ERROR(Log, "Invalid log filter. Must specify a log level after `:`: %s",
std::string(begin, end).c_str()); std::string(begin, end).c_str());
return false; return false;
} }

View File

@ -56,7 +56,7 @@ public:
void InterpreterFallback(u64 pc, size_t num_instructions) override { void InterpreterFallback(u64 pc, size_t num_instructions) override {
LOG_INFO(Core_ARM, "Unicorn fallback @ 0x{:X} for {} instructions (instr = {:08X})", pc, LOG_INFO(Core_ARM, "Unicorn fallback @ 0x{:X} for {} instructions (instr = {:08X})", pc,
num_instructions, MemoryReadCode(pc)); num_instructions, MemoryReadCode(pc));
ARM_Interface::ThreadContext ctx; ARM_Interface::ThreadContext ctx;
parent.SaveContext(ctx); parent.SaveContext(ctx);

View File

@ -95,7 +95,7 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
if (system_mode.second != Loader::ResultStatus::Success) { if (system_mode.second != Loader::ResultStatus::Success) {
LOG_CRITICAL(Core, "Failed to determine system mode (Error {})!", LOG_CRITICAL(Core, "Failed to determine system mode (Error {})!",
static_cast<int>(system_mode.second)); static_cast<int>(system_mode.second));
switch (system_mode.second) { switch (system_mode.second) {
case Loader::ResultStatus::ErrorEncrypted: case Loader::ResultStatus::ErrorEncrypted:
@ -112,7 +112,7 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
ResultStatus init_result{Init(emu_window, system_mode.first.get())}; ResultStatus init_result{Init(emu_window, system_mode.first.get())};
if (init_result != ResultStatus::Success) { if (init_result != ResultStatus::Success) {
LOG_CRITICAL(Core, "Failed to initialize system (Error {})!", LOG_CRITICAL(Core, "Failed to initialize system (Error {})!",
static_cast<int>(init_result)); static_cast<int>(init_result));
System::Shutdown(); System::Shutdown();
return init_result; return init_result;
} }

View File

@ -129,8 +129,8 @@ void PartitionFilesystem::Print() const {
LOG_DEBUG(Service_FS, "Files: {}", pfs_header.num_entries); LOG_DEBUG(Service_FS, "Files: {}", pfs_header.num_entries);
for (u32 i = 0; i < pfs_header.num_entries; i++) { for (u32 i = 0; i < pfs_header.num_entries; i++) {
LOG_DEBUG(Service_FS, " > File {}: {} (0x{:X} bytes, at 0x{:X})", i, LOG_DEBUG(Service_FS, " > File {}: {} (0x{:X} bytes, at 0x{:X})", i,
pfs_entries[i].name.c_str(), pfs_entries[i].fs_entry.size, pfs_entries[i].name.c_str(), pfs_entries[i].fs_entry.size,
GetFileOffset(pfs_entries[i].name)); GetFileOffset(pfs_entries[i].name));
} }
} }
} // namespace FileSys } // namespace FileSys

View File

@ -83,7 +83,7 @@ void ProgramMetadata::Print() const {
LOG_DEBUG(Service_FS, "Process category: {}", npdm_header.process_category); LOG_DEBUG(Service_FS, "Process category: {}", npdm_header.process_category);
LOG_DEBUG(Service_FS, "Flags: 0x{:02X}", npdm_header.flags); LOG_DEBUG(Service_FS, "Flags: 0x{:02X}", npdm_header.flags);
LOG_DEBUG(Service_FS, " > 64-bit instructions: {}", LOG_DEBUG(Service_FS, " > 64-bit instructions: {}",
npdm_header.has_64_bit_instructions ? "YES" : "NO"); npdm_header.has_64_bit_instructions ? "YES" : "NO");
auto address_space = "Unknown"; auto address_space = "Unknown";
switch (npdm_header.address_space_type) { switch (npdm_header.address_space_type) {

View File

@ -28,22 +28,21 @@ ResultCode RomFS_FileSystem::DeleteFile(const std::string& path) const {
ResultCode RomFS_FileSystem::RenameFile(const std::string& src_path, ResultCode RomFS_FileSystem::RenameFile(const std::string& src_path,
const std::string& dest_path) const { const std::string& dest_path) const {
LOG_CRITICAL(Service_FS, "Attempted to rename a file within an ROMFS archive ({}).", LOG_CRITICAL(Service_FS, "Attempted to rename a file within an ROMFS archive ({}).", GetName());
GetName());
// TODO(wwylele): Use correct error code // TODO(wwylele): Use correct error code
return ResultCode(-1); return ResultCode(-1);
} }
ResultCode RomFS_FileSystem::DeleteDirectory(const Path& path) const { ResultCode RomFS_FileSystem::DeleteDirectory(const Path& path) const {
LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an ROMFS archive ({}).", LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an ROMFS archive ({}).",
GetName()); GetName());
// TODO(wwylele): Use correct error code // TODO(wwylele): Use correct error code
return ResultCode(-1); return ResultCode(-1);
} }
ResultCode RomFS_FileSystem::DeleteDirectoryRecursively(const Path& path) const { ResultCode RomFS_FileSystem::DeleteDirectoryRecursively(const Path& path) const {
LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an ROMFS archive ({}).", LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an ROMFS archive ({}).",
GetName()); GetName());
// TODO(wwylele): Use correct error code // TODO(wwylele): Use correct error code
return ResultCode(-1); return ResultCode(-1);
} }
@ -56,14 +55,13 @@ ResultCode RomFS_FileSystem::CreateFile(const std::string& path, u64 size) const
ResultCode RomFS_FileSystem::CreateDirectory(const std::string& path) const { ResultCode RomFS_FileSystem::CreateDirectory(const std::string& path) const {
LOG_CRITICAL(Service_FS, "Attempted to create a directory in an ROMFS archive ({}).", LOG_CRITICAL(Service_FS, "Attempted to create a directory in an ROMFS archive ({}).",
GetName()); GetName());
// TODO(wwylele): Use correct error code // TODO(wwylele): Use correct error code
return ResultCode(-1); return ResultCode(-1);
} }
ResultCode RomFS_FileSystem::RenameDirectory(const Path& src_path, const Path& dest_path) const { ResultCode RomFS_FileSystem::RenameDirectory(const Path& src_path, const Path& dest_path) const {
LOG_CRITICAL(Service_FS, "Attempted to rename a file within an ROMFS archive ({}).", LOG_CRITICAL(Service_FS, "Attempted to rename a file within an ROMFS archive ({}).", GetName());
GetName());
// TODO(wwylele): Use correct error code // TODO(wwylele): Use correct error code
return ResultCode(-1); return ResultCode(-1);
} }

View File

@ -414,7 +414,7 @@ static void RemoveBreakpoint(BreakpointType type, PAddr addr) {
auto bp = p.find(static_cast<u64>(addr)); auto bp = p.find(static_cast<u64>(addr));
if (bp != p.end()) { if (bp != p.end()) {
LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: {:016X} bytes at {:016X} of type {}", LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: {:016X} bytes at {:016X} of type {}",
bp->second.len, bp->second.addr, static_cast<int>(type)); bp->second.len, bp->second.addr, static_cast<int>(type));
p.erase(static_cast<u64>(addr)); p.erase(static_cast<u64>(addr));
} }
} }
@ -460,9 +460,9 @@ bool CheckBreakpoint(PAddr addr, BreakpointType type) {
if (bp->second.active && (addr >= bp->second.addr && addr < bp->second.addr + len)) { if (bp->second.active && (addr >= bp->second.addr && addr < bp->second.addr + len)) {
LOG_DEBUG(Debug_GDBStub, LOG_DEBUG(Debug_GDBStub,
"Found breakpoint type {} @ {:016X}, range: {:016X}" "Found breakpoint type {} @ {:016X}, range: {:016X}"
" - {:016X} ({:X} bytes)", " - {:016X} ({:X} bytes)",
static_cast<int>(type), addr, bp->second.addr, bp->second.addr + len, len); static_cast<int>(type), addr, bp->second.addr, bp->second.addr + len, len);
return true; return true;
} }
} }
@ -658,10 +658,9 @@ static void ReadCommand() {
u8 checksum_calculated = CalculateChecksum(command_buffer, command_length); u8 checksum_calculated = CalculateChecksum(command_buffer, command_length);
if (checksum_received != checksum_calculated) { if (checksum_received != checksum_calculated) {
LOG_ERROR( LOG_ERROR(Debug_GDBStub,
Debug_GDBStub, "gdb: invalid checksum: calculated {:02X} and read {:02X} for ${}# (length: {})",
"gdb: invalid checksum: calculated {:02X} and read {:02X} for ${}# (length: {})", checksum_calculated, checksum_received, command_buffer, command_length);
checksum_calculated, checksum_received, command_buffer, command_length);
command_length = 0; command_length = 0;
@ -889,7 +888,7 @@ static bool CommitBreakpoint(BreakpointType type, PAddr addr, u64 len) {
p.insert({addr, breakpoint}); p.insert({addr, breakpoint});
LOG_DEBUG(Debug_GDBStub, "gdb: added {} breakpoint: {:016X} bytes at {:016X}", LOG_DEBUG(Debug_GDBStub, "gdb: added {} breakpoint: {:016X} bytes at {:016X}",
static_cast<int>(type), breakpoint.len, breakpoint.addr); static_cast<int>(type), breakpoint.len, breakpoint.addr);
return true; return true;
} }

View File

@ -280,7 +280,7 @@ size_t HLERequestContext::WriteBuffer(const void* buffer, size_t size, int buffe
const size_t buffer_size{GetWriteBufferSize(buffer_index)}; const size_t buffer_size{GetWriteBufferSize(buffer_index)};
if (size > buffer_size) { if (size > buffer_size) {
LOG_CRITICAL(Core, "size ({:016X}) is greater than buffer_size ({:016X})", size, LOG_CRITICAL(Core, "size ({:016X}) is greater than buffer_size ({:016X})", size,
buffer_size); buffer_size);
size = buffer_size; // TODO(bunnei): This needs to be HW tested size = buffer_size; // TODO(bunnei): This needs to be HW tested
} }

View File

@ -82,7 +82,7 @@ ResultCode ServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& con
} }
LOG_CRITICAL(IPC, "Unknown domain command={}", LOG_CRITICAL(IPC, "Unknown domain command={}",
static_cast<int>(domain_message_header->command.Value())); static_cast<int>(domain_message_header->command.Value()));
ASSERT(false); ASSERT(false);
} }

View File

@ -108,7 +108,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
// Error out if the requested permissions don't match what the creator process allows. // Error out if the requested permissions don't match what the creator process allows.
if (static_cast<u32>(permissions) & ~static_cast<u32>(own_other_permissions)) { if (static_cast<u32>(permissions) & ~static_cast<u32>(own_other_permissions)) {
LOG_ERROR(Kernel, "cannot map id={}, address=0x{:X} name={}, permissions don't match", LOG_ERROR(Kernel, "cannot map id={}, address=0x{:X} name={}, permissions don't match",
GetObjectId(), address, name); GetObjectId(), address, name);
return ERR_INVALID_COMBINATION; return ERR_INVALID_COMBINATION;
} }
@ -116,7 +116,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
if (other_permissions != MemoryPermission::DontCare && if (other_permissions != MemoryPermission::DontCare &&
static_cast<u32>(this->permissions) & ~static_cast<u32>(other_permissions)) { static_cast<u32>(this->permissions) & ~static_cast<u32>(other_permissions)) {
LOG_ERROR(Kernel, "cannot map id={}, address=0x{:X} name={}, permissions don't match", LOG_ERROR(Kernel, "cannot map id={}, address=0x{:X} name={}, permissions don't match",
GetObjectId(), address, name); GetObjectId(), address, name);
return ERR_WRONG_PERMISSION; return ERR_WRONG_PERMISSION;
} }

View File

@ -47,14 +47,14 @@ static ResultCode SetMemoryAttribute(VAddr addr, u64 size, u32 state0, u32 state
/// Maps a memory range into a different range. /// Maps a memory range into a different range.
static ResultCode MapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { static ResultCode MapMemory(VAddr dst_addr, VAddr src_addr, u64 size) {
LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr, LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr,
src_addr, size); src_addr, size);
return Core::CurrentProcess()->MirrorMemory(dst_addr, src_addr, size); return Core::CurrentProcess()->MirrorMemory(dst_addr, src_addr, size);
} }
/// Unmaps a region that was previously mapped with svcMapMemory /// Unmaps a region that was previously mapped with svcMapMemory
static ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { static ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size) {
LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr, LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr,
src_addr, size); src_addr, size);
return Core::CurrentProcess()->UnmapMemory(dst_addr, src_addr, size); return Core::CurrentProcess()->UnmapMemory(dst_addr, src_addr, size);
} }
@ -150,7 +150,7 @@ static bool DefaultThreadWakeupCallback(ThreadWakeupReason reason, SharedPtr<Thr
static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64 handle_count, static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64 handle_count,
s64 nano_seconds) { s64 nano_seconds) {
LOG_TRACE(Kernel_SVC, "called handles_address=0x{:X}, handle_count={}, nano_seconds={}", LOG_TRACE(Kernel_SVC, "called handles_address=0x{:X}, handle_count={}, nano_seconds={}",
handles_address, handle_count, nano_seconds); handles_address, handle_count, nano_seconds);
if (!Memory::IsValidVirtualAddress(handles_address)) if (!Memory::IsValidVirtualAddress(handles_address))
return ERR_INVALID_POINTER; return ERR_INVALID_POINTER;
@ -228,9 +228,9 @@ static ResultCode CancelSynchronization(Handle thread_handle) {
static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr, static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr,
Handle requesting_thread_handle) { Handle requesting_thread_handle) {
LOG_TRACE(Kernel_SVC, LOG_TRACE(Kernel_SVC,
"called holding_thread_handle=0x{:08X}, mutex_addr=0x{:X}, " "called holding_thread_handle=0x{:08X}, mutex_addr=0x{:X}, "
"requesting_current_thread_handle=0x{:08X}", "requesting_current_thread_handle=0x{:08X}",
holding_thread_handle, mutex_addr, requesting_thread_handle); holding_thread_handle, mutex_addr, requesting_thread_handle);
return Mutex::TryAcquire(mutex_addr, holding_thread_handle, requesting_thread_handle); return Mutex::TryAcquire(mutex_addr, holding_thread_handle, requesting_thread_handle);
} }
@ -258,7 +258,7 @@ static void OutputDebugString(VAddr address, s32 len) {
/// Gets system/memory information for the current process /// Gets system/memory information for the current process
static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) { static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) {
LOG_TRACE(Kernel_SVC, "called info_id=0x{:X}, info_sub_id=0x{:X}, handle=0x{:08X}", info_id, LOG_TRACE(Kernel_SVC, "called info_id=0x{:X}, info_sub_id=0x{:X}, handle=0x{:08X}", info_id,
info_sub_id, handle); info_sub_id, handle);
auto& vm_manager = Core::CurrentProcess()->vm_manager; auto& vm_manager = Core::CurrentProcess()->vm_manager;
@ -314,12 +314,12 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
break; break;
case GetInfoType::PrivilegedProcessId: case GetInfoType::PrivilegedProcessId:
LOG_WARNING(Kernel_SVC, LOG_WARNING(Kernel_SVC,
"(STUBBED) Attempted to query privileged process id bounds, returned 0"); "(STUBBED) Attempted to query privileged process id bounds, returned 0");
*result = 0; *result = 0;
break; break;
case GetInfoType::UserExceptionContextAddr: case GetInfoType::UserExceptionContextAddr:
LOG_WARNING(Kernel_SVC, LOG_WARNING(Kernel_SVC,
"(STUBBED) Attempted to query user exception context address, returned 0"); "(STUBBED) Attempted to query user exception context address, returned 0");
*result = 0; *result = 0;
break; break;
default: default:
@ -331,8 +331,7 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
/// Sets the thread activity /// Sets the thread activity
static ResultCode SetThreadActivity(Handle handle, u32 unknown) { static ResultCode SetThreadActivity(Handle handle, u32 unknown) {
LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}, unknown=0x{:08X}", handle, LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}, unknown=0x{:08X}", handle, unknown);
unknown);
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }
@ -383,10 +382,9 @@ static u32 GetCurrentProcessorNumber() {
static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size, static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size,
u32 permissions) { u32 permissions) {
LOG_TRACE( LOG_TRACE(Kernel_SVC,
Kernel_SVC, "called, shared_memory_handle=0x{:X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}",
"called, shared_memory_handle=0x{:X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}", shared_memory_handle, addr, size, permissions);
shared_memory_handle, addr, size, permissions);
SharedPtr<SharedMemory> shared_memory = g_handle_table.Get<SharedMemory>(shared_memory_handle); SharedPtr<SharedMemory> shared_memory = g_handle_table.Get<SharedMemory>(shared_memory_handle);
if (!shared_memory) { if (!shared_memory) {
@ -414,7 +412,7 @@ static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 s
static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size) { static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size) {
LOG_WARNING(Kernel_SVC, "called, shared_memory_handle=0x{:08X}, addr=0x{:X}, size=0x{:X}", LOG_WARNING(Kernel_SVC, "called, shared_memory_handle=0x{:08X}, addr=0x{:X}, size=0x{:X}",
shared_memory_handle, addr, size); shared_memory_handle, addr, size);
SharedPtr<SharedMemory> shared_memory = g_handle_table.Get<SharedMemory>(shared_memory_handle); SharedPtr<SharedMemory> shared_memory = g_handle_table.Get<SharedMemory>(shared_memory_handle);
@ -531,9 +529,9 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V
Core::System::GetInstance().CpuCore(thread->processor_id).PrepareReschedule(); Core::System::GetInstance().CpuCore(thread->processor_id).PrepareReschedule();
LOG_TRACE(Kernel_SVC, LOG_TRACE(Kernel_SVC,
"called entrypoint=0x{:08X} ({}), arg=0x{:08X}, stacktop=0x{:08X}, " "called entrypoint=0x{:08X} ({}), arg=0x{:08X}, stacktop=0x{:08X}, "
"threadpriority=0x{:08X}, processorid=0x{:08X} : created handle=0x{:08X}", "threadpriority=0x{:08X}, processorid=0x{:08X} : created handle=0x{:08X}",
entry_point, name, arg, stack_top, priority, processor_id, *out_handle); entry_point, name, arg, stack_top, priority, processor_id, *out_handle);
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }
@ -612,7 +610,7 @@ static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr condition_var
/// Signal process wide key /// Signal process wide key
static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target) { static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target) {
LOG_TRACE(Kernel_SVC, "called, condition_variable_addr=0x{:X}, target=0x{:08X}", LOG_TRACE(Kernel_SVC, "called, condition_variable_addr=0x{:X}, target=0x{:08X}",
condition_variable_addr, target); condition_variable_addr, target);
auto RetrieveWaitingThreads = auto RetrieveWaitingThreads =
[](size_t core_index, std::vector<SharedPtr<Thread>>& waiting_threads, VAddr condvar_addr) { [](size_t core_index, std::vector<SharedPtr<Thread>>& waiting_threads, VAddr condvar_addr) {
@ -693,7 +691,7 @@ static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target
// Wait for an address (via Address Arbiter) // Wait for an address (via Address Arbiter)
static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout) { static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout) {
LOG_WARNING(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, timeout={}", LOG_WARNING(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, timeout={}",
address, type, value, timeout); address, type, value, timeout);
// If the passed address is a kernel virtual address, return invalid memory state. // If the passed address is a kernel virtual address, return invalid memory state.
if (Memory::IsKernelVirtualAddress(address)) { if (Memory::IsKernelVirtualAddress(address)) {
return ERR_INVALID_ADDRESS_STATE; return ERR_INVALID_ADDRESS_STATE;
@ -717,9 +715,8 @@ static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout
// Signals to an address (via Address Arbiter) // Signals to an address (via Address Arbiter)
static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to_wake) { static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to_wake) {
LOG_WARNING(Kernel_SVC, LOG_WARNING(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, num_to_wake=0x{:X}",
"called, address=0x{:X}, type=0x{:X}, value=0x{:X}, num_to_wake=0x{:X}", address, address, type, value, num_to_wake);
type, value, num_to_wake);
// If the passed address is a kernel virtual address, return invalid memory state. // If the passed address is a kernel virtual address, return invalid memory state.
if (Memory::IsKernelVirtualAddress(address)) { if (Memory::IsKernelVirtualAddress(address)) {
return ERR_INVALID_ADDRESS_STATE; return ERR_INVALID_ADDRESS_STATE;
@ -769,8 +766,8 @@ static ResultCode ResetSignal(Handle handle) {
/// Creates a TransferMemory object /// Creates a TransferMemory object
static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) { static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) {
LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x{:X}, size=0x{:X}, perms=0x{:08X}", addr, LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x{:X}, size=0x{:X}, perms=0x{:08X}", addr, size,
size, permissions); permissions);
*handle = 0; *handle = 0;
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }
@ -791,7 +788,7 @@ static ResultCode GetThreadCoreMask(Handle thread_handle, u32* core, u64* mask)
static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) { static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) {
LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, mask=0x{:16X}, core=0x{:X}", thread_handle, LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, mask=0x{:16X}, core=0x{:X}", thread_handle,
mask, core); mask, core);
const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle);
if (!thread) { if (!thread) {
@ -831,7 +828,7 @@ static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) {
static ResultCode CreateSharedMemory(Handle* handle, u64 size, u32 local_permissions, static ResultCode CreateSharedMemory(Handle* handle, u64 size, u32 local_permissions,
u32 remote_permissions) { u32 remote_permissions) {
LOG_TRACE(Kernel_SVC, "called, size=0x{:X}, localPerms=0x{:08X}, remotePerms=0x{:08X}", size, LOG_TRACE(Kernel_SVC, "called, size=0x{:X}, localPerms=0x{:08X}, remotePerms=0x{:08X}", size,
local_permissions, remote_permissions); local_permissions, remote_permissions);
auto sharedMemHandle = auto sharedMemHandle =
SharedMemory::Create(g_handle_table.Get<Process>(KernelHandle::CurrentProcess), size, SharedMemory::Create(g_handle_table.Get<Process>(KernelHandle::CurrentProcess), size,
static_cast<MemoryPermission>(local_permissions), static_cast<MemoryPermission>(local_permissions),

View File

@ -344,7 +344,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point,
if (linheap_memory->size() + Memory::PAGE_SIZE > memory_region->size) { if (linheap_memory->size() + Memory::PAGE_SIZE > memory_region->size) {
LOG_ERROR(Kernel_SVC, LOG_ERROR(Kernel_SVC,
"Not enough space in region to allocate a new TLS page for thread"); "Not enough space in region to allocate a new TLS page for thread");
return ERR_OUT_OF_MEMORY; return ERR_OUT_OF_MEMORY;
} }

View File

@ -243,11 +243,11 @@ void VMManager::LogLayout() const {
for (const auto& p : vma_map) { for (const auto& p : vma_map) {
const VirtualMemoryArea& vma = p.second; const VirtualMemoryArea& vma = p.second;
LOG_DEBUG(Kernel, "{:016X} - {:016X} size: {:016X} {}{}{} {}", vma.base, LOG_DEBUG(Kernel, "{:016X} - {:016X} size: {:016X} {}{}{} {}", vma.base,
vma.base + vma.size, vma.size, vma.base + vma.size, vma.size,
(u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-', (u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-',
(u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-', (u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-',
(u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-', (u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-',
GetMemoryStateName(vma.meminfo_state)); GetMemoryStateName(vma.meminfo_state));
} }
} }

View File

@ -30,7 +30,7 @@ private:
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service_APM, "(STUBBED) called mode={} config={}", static_cast<u32>(mode), LOG_WARNING(Service_APM, "(STUBBED) called mode={} config={}", static_cast<u32>(mode),
config); config);
} }
void GetPerformanceConfiguration(Kernel::HLERequestContext& ctx) { void GetPerformanceConfiguration(Kernel::HLERequestContext& ctx) {

View File

@ -25,8 +25,8 @@ ResultCode RegisterFileSystem(std::unique_ptr<FileSys::FileSystemFactory>&& fact
ASSERT_MSG(inserted, "Tried to register more than one system with same id code"); ASSERT_MSG(inserted, "Tried to register more than one system with same id code");
auto& filesystem = result.first->second; auto& filesystem = result.first->second;
LOG_DEBUG(Service_FS, "Registered file system {} with id code 0x{:08X}", LOG_DEBUG(Service_FS, "Registered file system {} with id code 0x{:08X}", filesystem->GetName(),
filesystem->GetName(), static_cast<u32>(type)); static_cast<u32>(type));
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }

View File

@ -21,8 +21,8 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u3
u32 stride, NVFlinger::BufferQueue::BufferTransformFlags transform) { u32 stride, NVFlinger::BufferQueue::BufferTransformFlags transform) {
VAddr addr = nvmap_dev->GetObjectAddress(buffer_handle); VAddr addr = nvmap_dev->GetObjectAddress(buffer_handle);
LOG_WARNING(Service, LOG_WARNING(Service,
"Drawing from address {:X} offset {:08X} Width {} Height {} Stride {} Format {}", "Drawing from address {:X} offset {:08X} Width {} Height {} Stride {} Format {}",
addr, offset, width, height, stride, format); addr, offset, width, height, stride, format);
using PixelFormat = Tegra::FramebufferConfig::PixelFormat; using PixelFormat = Tegra::FramebufferConfig::PixelFormat;
const Tegra::FramebufferConfig framebuffer{ const Tegra::FramebufferConfig framebuffer{

View File

@ -15,7 +15,7 @@ namespace Service::Nvidia::Devices {
u32 nvhost_as_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_as_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());
switch (static_cast<IoctlCommand>(command.raw)) { switch (static_cast<IoctlCommand>(command.raw)) {
case IoctlCommand::IocInitalizeExCommand: case IoctlCommand::IocInitalizeExCommand:
@ -50,7 +50,7 @@ u32 nvhost_as_gpu::AllocateSpace(const std::vector<u8>& input, std::vector<u8>&
IoctlAllocSpace params{}; IoctlAllocSpace params{};
std::memcpy(&params, input.data(), input.size()); std::memcpy(&params, input.data(), input.size());
LOG_DEBUG(Service_NVDRV, "called, pages={:X}, page_size={:X}, flags={:X}", params.pages, LOG_DEBUG(Service_NVDRV, "called, pages={:X}, page_size={:X}, flags={:X}", params.pages,
params.page_size, params.flags); params.page_size, params.flags);
auto& gpu = Core::System::GetInstance().GPU(); auto& gpu = Core::System::GetInstance().GPU();
const u64 size{static_cast<u64>(params.pages) * static_cast<u64>(params.page_size)}; const u64 size{static_cast<u64>(params.pages) * static_cast<u64>(params.page_size)};
@ -76,7 +76,7 @@ u32 nvhost_as_gpu::Remap(const std::vector<u8>& input, std::vector<u8>& output)
for (const auto& entry : entries) { for (const auto& entry : entries) {
LOG_WARNING(Service_NVDRV, "remap entry, offset=0x{:X} handle=0x{:X} pages=0x{:X}", LOG_WARNING(Service_NVDRV, "remap entry, offset=0x{:X} handle=0x{:X} pages=0x{:X}",
entry.offset, entry.nvmap_handle, entry.pages); entry.offset, entry.nvmap_handle, entry.pages);
Tegra::GPUVAddr offset = static_cast<Tegra::GPUVAddr>(entry.offset) << 0x10; Tegra::GPUVAddr offset = static_cast<Tegra::GPUVAddr>(entry.offset) << 0x10;
auto object = nvmap_dev->GetObject(entry.nvmap_handle); auto object = nvmap_dev->GetObject(entry.nvmap_handle);
@ -99,10 +99,10 @@ u32 nvhost_as_gpu::MapBufferEx(const std::vector<u8>& input, std::vector<u8>& ou
std::memcpy(&params, input.data(), input.size()); std::memcpy(&params, input.data(), input.size());
LOG_DEBUG(Service_NVDRV, LOG_DEBUG(Service_NVDRV,
"called, flags={:X}, nvmap_handle={:X}, buffer_offset={}, mapping_size={}" "called, flags={:X}, nvmap_handle={:X}, buffer_offset={}, mapping_size={}"
", offset={}", ", offset={}",
params.flags, params.nvmap_handle, params.buffer_offset, params.mapping_size, params.flags, params.nvmap_handle, params.buffer_offset, params.mapping_size,
params.offset); params.offset);
if (!params.nvmap_handle) { if (!params.nvmap_handle) {
return 0; return 0;
@ -179,7 +179,7 @@ u32 nvhost_as_gpu::GetVARegions(const std::vector<u8>& input, std::vector<u8>& o
IoctlGetVaRegions params{}; IoctlGetVaRegions params{};
std::memcpy(&params, input.data(), input.size()); std::memcpy(&params, input.data(), input.size());
LOG_WARNING(Service_NVDRV, "(STUBBED) called, buf_addr={:X}, buf_size={:X}", params.buf_addr, LOG_WARNING(Service_NVDRV, "(STUBBED) called, buf_addr={:X}, buf_size={:X}", params.buf_addr,
params.buf_size); params.buf_size);
params.buf_size = 0x30; params.buf_size = 0x30;
params.regions[0].offset = 0x04000000; params.regions[0].offset = 0x04000000;

View File

@ -10,7 +10,7 @@ namespace Service::Nvidia::Devices {
u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());
switch (static_cast<IoctlCommand>(command.raw)) { switch (static_cast<IoctlCommand>(command.raw)) {
case IoctlCommand::IocGetConfigCommand: case IoctlCommand::IocGetConfigCommand:
@ -30,7 +30,7 @@ u32 nvhost_ctrl::NvOsGetConfigU32(const std::vector<u8>& input, std::vector<u8>&
IocGetConfigParams params{}; IocGetConfigParams params{};
std::memcpy(&params, input.data(), sizeof(params)); std::memcpy(&params, input.data(), sizeof(params));
LOG_DEBUG(Service_NVDRV, "called, setting={}!{}", params.domain_str.data(), LOG_DEBUG(Service_NVDRV, "called, setting={}!{}", params.domain_str.data(),
params.param_str.data()); params.param_str.data());
if (!strcmp(params.domain_str.data(), "nv")) { if (!strcmp(params.domain_str.data(), "nv")) {
if (!strcmp(params.param_str.data(), "NV_MEMORY_PROFILER")) { if (!strcmp(params.param_str.data(), "NV_MEMORY_PROFILER")) {
@ -54,8 +54,8 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
IocCtrlEventWaitParams params{}; IocCtrlEventWaitParams params{};
std::memcpy(&params, input.data(), sizeof(params)); std::memcpy(&params, input.data(), sizeof(params));
LOG_WARNING(Service_NVDRV, LOG_WARNING(Service_NVDRV,
"(STUBBED) called, syncpt_id={}, threshold={}, timeout={}, is_async={}", "(STUBBED) called, syncpt_id={}, threshold={}, timeout={}, is_async={}",
params.syncpt_id, params.threshold, params.timeout, is_async); params.syncpt_id, params.threshold, params.timeout, is_async);
// TODO(Subv): Implement actual syncpt waiting. // TODO(Subv): Implement actual syncpt waiting.
params.value = 0; params.value = 0;

View File

@ -11,7 +11,7 @@ namespace Service::Nvidia::Devices {
u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());
switch (static_cast<IoctlCommand>(command.raw)) { switch (static_cast<IoctlCommand>(command.raw)) {
case IoctlCommand::IocGetCharacteristicsCommand: case IoctlCommand::IocGetCharacteristicsCommand:
@ -84,7 +84,7 @@ u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector<u8>& input, std::vector<u8>&
IoctlGpuGetTpcMasksArgs params{}; IoctlGpuGetTpcMasksArgs params{};
std::memcpy(&params, input.data(), input.size()); std::memcpy(&params, input.data(), input.size());
LOG_INFO(Service_NVDRV, "called, mask=0x{:X}, mask_buf_addr=0x{:X}", params.mask_buf_size, LOG_INFO(Service_NVDRV, "called, mask=0x{:X}, mask_buf_addr=0x{:X}", params.mask_buf_size,
params.mask_buf_addr); params.mask_buf_addr);
// TODO(ogniK): Confirm value on hardware // TODO(ogniK): Confirm value on hardware
if (params.mask_buf_size) if (params.mask_buf_size)
params.tpc_mask_size = 4 * 1; // 4 * num_gpc params.tpc_mask_size = 4 * 1; // 4 * num_gpc

View File

@ -13,7 +13,7 @@ namespace Service::Nvidia::Devices {
u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());
switch (static_cast<IoctlCommand>(command.raw)) { switch (static_cast<IoctlCommand>(command.raw)) {
case IoctlCommand::IocSetNVMAPfdCommand: case IoctlCommand::IocSetNVMAPfdCommand:
@ -76,7 +76,7 @@ u32 nvhost_gpu::GetClientData(const std::vector<u8>& input, std::vector<u8>& out
u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output) {
std::memcpy(&zcull_params, input.data(), input.size()); std::memcpy(&zcull_params, input.data(), input.size());
LOG_DEBUG(Service_NVDRV, "called, gpu_va={:X}, mode={:X}", zcull_params.gpu_va, LOG_DEBUG(Service_NVDRV, "called, gpu_va={:X}, mode={:X}", zcull_params.gpu_va,
zcull_params.mode); zcull_params.mode);
std::memcpy(output.data(), &zcull_params, output.size()); std::memcpy(output.data(), &zcull_params, output.size());
return 0; return 0;
} }
@ -84,8 +84,8 @@ u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output)
u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>& output) {
IoctlSetErrorNotifier params{}; IoctlSetErrorNotifier params{};
std::memcpy(&params, input.data(), input.size()); std::memcpy(&params, input.data(), input.size());
LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset={:X}, size={:X}, mem={:X}", LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset={:X}, size={:X}, mem={:X}", params.offset,
params.offset, params.size, params.mem); params.size, params.mem);
std::memcpy(output.data(), &params, output.size()); std::memcpy(output.data(), &params, output.size());
return 0; return 0;
} }
@ -100,10 +100,10 @@ u32 nvhost_gpu::AllocGPFIFOEx2(const std::vector<u8>& input, std::vector<u8>& ou
IoctlAllocGpfifoEx2 params{}; IoctlAllocGpfifoEx2 params{};
std::memcpy(&params, input.data(), input.size()); std::memcpy(&params, input.data(), input.size());
LOG_WARNING(Service_NVDRV, LOG_WARNING(Service_NVDRV,
"(STUBBED) called, num_entries={:X}, flags={:X}, unk0={:X}, " "(STUBBED) called, num_entries={:X}, flags={:X}, unk0={:X}, "
"unk1={:X}, unk2={:X}, unk3={:X}", "unk1={:X}, unk2={:X}, unk3={:X}",
params.num_entries, params.flags, params.unk0, params.unk1, params.unk2, params.num_entries, params.flags, params.unk0, params.unk1, params.unk2,
params.unk3); params.unk3);
params.fence_out.id = 0; params.fence_out.id = 0;
params.fence_out.value = 0; params.fence_out.value = 0;
std::memcpy(output.data(), &params, output.size()); std::memcpy(output.data(), &params, output.size());
@ -114,7 +114,7 @@ u32 nvhost_gpu::AllocateObjectContext(const std::vector<u8>& input, std::vector<
IoctlAllocObjCtx params{}; IoctlAllocObjCtx params{};
std::memcpy(&params, input.data(), input.size()); std::memcpy(&params, input.data(), input.size());
LOG_WARNING(Service_NVDRV, "(STUBBED) called, class_num={:X}, flags={:X}", params.class_num, LOG_WARNING(Service_NVDRV, "(STUBBED) called, class_num={:X}, flags={:X}", params.class_num,
params.flags); params.flags);
params.obj_id = 0x0; params.obj_id = 0x0;
std::memcpy(output.data(), &params, output.size()); std::memcpy(output.data(), &params, output.size());
return 0; return 0;
@ -127,7 +127,7 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp
IoctlSubmitGpfifo params{}; IoctlSubmitGpfifo params{};
std::memcpy(&params, input.data(), sizeof(IoctlSubmitGpfifo)); std::memcpy(&params, input.data(), sizeof(IoctlSubmitGpfifo));
LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}",
params.gpfifo, params.num_entries, params.flags); params.gpfifo, params.num_entries, params.flags);
auto entries = std::vector<IoctlGpfifoEntry>(); auto entries = std::vector<IoctlGpfifoEntry>();
entries.resize(params.num_entries); entries.resize(params.num_entries);

View File

@ -10,7 +10,7 @@ namespace Service::Nvidia::Devices {
u32 nvhost_nvdec::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_nvdec::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());
switch (static_cast<IoctlCommand>(command.raw)) { switch (static_cast<IoctlCommand>(command.raw)) {
case IoctlCommand::IocSetNVMAPfdCommand: case IoctlCommand::IocSetNVMAPfdCommand:

View File

@ -102,8 +102,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
if (client_port.Failed()) { if (client_port.Failed()) {
IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(client_port.Code()); rb.Push(client_port.Code());
LOG_ERROR(Service_SM, "called service={} -> error 0x{:08X}", name, LOG_ERROR(Service_SM, "called service={} -> error 0x{:08X}", name, client_port.Code().raw);
client_port.Code().raw);
if (name.length() == 0) if (name.length() == 0)
return; // LibNX Fix return; // LibNX Fix
UNIMPLEMENTED(); UNIMPLEMENTED();

View File

@ -32,8 +32,7 @@ void BSD::Socket(Kernel::HLERequestContext& ctx) {
u32 type = rp.Pop<u32>(); u32 type = rp.Pop<u32>();
u32 protocol = rp.Pop<u32>(); u32 protocol = rp.Pop<u32>();
LOG_WARNING(Service, "(STUBBED) called domain={} type={} protocol={}", domain, type, LOG_WARNING(Service, "(STUBBED) called domain={} type={} protocol={}", domain, type, protocol);
protocol);
u32 fd = next_fd++; u32 fd = next_fd++;

View File

@ -548,7 +548,7 @@ private:
u32 type = rp.Pop<u32>(); u32 type = rp.Pop<u32>();
LOG_WARNING(Service_VI, "(STUBBED) called id={}, addval={:08X}, type={:08X}", id, addval, LOG_WARNING(Service_VI, "(STUBBED) called id={}, addval={:08X}, type={:08X}", id, addval,
type); type);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
@ -641,7 +641,7 @@ private:
IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:08X}, visibility={}", layer_id, LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:08X}, visibility={}", layer_id,
visibility); visibility);
} }
}; };
@ -763,7 +763,7 @@ private:
IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:X}, visibility={}", layer_id, LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:X}, visibility={}", layer_id,
visibility); visibility);
} }
std::shared_ptr<NVFlinger::NVFlinger> nv_flinger; std::shared_ptr<NVFlinger::NVFlinger> nv_flinger;

View File

@ -305,7 +305,7 @@ SharedPtr<CodeSet> ElfReader::LoadInto(u32 vaddr) {
for (unsigned int i = 0; i < header->e_phnum; ++i) { for (unsigned int i = 0; i < header->e_phnum; ++i) {
Elf32_Phdr* p = &segments[i]; Elf32_Phdr* p = &segments[i];
LOG_DEBUG(Loader, "Type: {} Vaddr: {:08X} Filesz: {:08X} Memsz: {:08X} ", p->p_type, LOG_DEBUG(Loader, "Type: {} Vaddr: {:08X} Filesz: {:08X} Memsz: {:08X} ", p->p_type,
p->p_vaddr, p->p_filesz, p->p_memsz); p->p_vaddr, p->p_filesz, p->p_memsz);
if (p->p_type == PT_LOAD) { if (p->p_type == PT_LOAD) {
CodeSet::Segment* codeset_segment; CodeSet::Segment* codeset_segment;
@ -318,15 +318,15 @@ SharedPtr<CodeSet> ElfReader::LoadInto(u32 vaddr) {
codeset_segment = &codeset->data; codeset_segment = &codeset->data;
} else { } else {
LOG_ERROR(Loader, "Unexpected ELF PT_LOAD segment id {} with flags {:X}", i, LOG_ERROR(Loader, "Unexpected ELF PT_LOAD segment id {} with flags {:X}", i,
p->p_flags); p->p_flags);
continue; continue;
} }
if (codeset_segment->size != 0) { if (codeset_segment->size != 0) {
LOG_ERROR(Loader, LOG_ERROR(Loader,
"ELF has more than one segment of the same type. Skipping extra " "ELF has more than one segment of the same type. Skipping extra "
"segment (id {})", "segment (id {})",
i); i);
continue; continue;
} }

View File

@ -44,7 +44,7 @@ PageTable* GetCurrentPageTable() {
static void MapPages(PageTable& page_table, VAddr base, u64 size, u8* memory, PageType type) { static void MapPages(PageTable& page_table, VAddr base, u64 size, u8* memory, PageType type) {
LOG_DEBUG(HW_Memory, "Mapping {} onto {:016X}-{:016X}", fmt::ptr(memory), base * PAGE_SIZE, LOG_DEBUG(HW_Memory, "Mapping {} onto {:016X}-{:016X}", fmt::ptr(memory), base * PAGE_SIZE,
(base + size) * PAGE_SIZE); (base + size) * PAGE_SIZE);
RasterizerFlushVirtualRegion(base << PAGE_BITS, size * PAGE_SIZE, RasterizerFlushVirtualRegion(base << PAGE_BITS, size * PAGE_SIZE,
FlushMode::FlushAndInvalidate); FlushMode::FlushAndInvalidate);
@ -206,7 +206,7 @@ void Write(const VAddr vaddr, const T data) {
switch (type) { switch (type) {
case PageType::Unmapped: case PageType::Unmapped:
LOG_ERROR(HW_Memory, "Unmapped Write{} 0x{:08X} @ 0x{:016X}", sizeof(data) * 8, LOG_ERROR(HW_Memory, "Unmapped Write{} 0x{:08X} @ 0x{:016X}", sizeof(data) * 8,
static_cast<u32>(data), vaddr); static_cast<u32>(data), vaddr);
return; return;
case PageType::Memory: case PageType::Memory:
ASSERT_MSG(false, "Mapped memory page without a pointer @ {:016X}", vaddr); ASSERT_MSG(false, "Mapped memory page without a pointer @ {:016X}", vaddr);
@ -349,8 +349,8 @@ void RasterizerMarkRegionCached(Tegra::GPUVAddr gpu_addr, u64 size, bool cached)
// The GPU <-> CPU virtual memory mapping is not 1:1 // The GPU <-> CPU virtual memory mapping is not 1:1
if (!maybe_vaddr) { if (!maybe_vaddr) {
LOG_ERROR(HW_Memory, LOG_ERROR(HW_Memory,
"Trying to flush a cached region to an invalid physical address {:016X}", "Trying to flush a cached region to an invalid physical address {:016X}",
gpu_addr); gpu_addr);
continue; continue;
} }
VAddr vaddr = *maybe_vaddr; VAddr vaddr = *maybe_vaddr;
@ -485,8 +485,8 @@ void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_
switch (page_table.attributes[page_index]) { switch (page_table.attributes[page_index]) {
case PageType::Unmapped: { case PageType::Unmapped: {
LOG_ERROR(HW_Memory, LOG_ERROR(HW_Memory,
"Unmapped ReadBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", "Unmapped ReadBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
current_vaddr, src_addr, size); current_vaddr, src_addr, size);
std::memset(dest_buffer, 0, copy_amount); std::memset(dest_buffer, 0, copy_amount);
break; break;
} }
@ -549,8 +549,8 @@ void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const voi
switch (page_table.attributes[page_index]) { switch (page_table.attributes[page_index]) {
case PageType::Unmapped: { case PageType::Unmapped: {
LOG_ERROR(HW_Memory, LOG_ERROR(HW_Memory,
"Unmapped WriteBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", "Unmapped WriteBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
current_vaddr, dest_addr, size); current_vaddr, dest_addr, size);
break; break;
} }
case PageType::Memory: { case PageType::Memory: {
@ -597,8 +597,8 @@ void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size
switch (page_table.attributes[page_index]) { switch (page_table.attributes[page_index]) {
case PageType::Unmapped: { case PageType::Unmapped: {
LOG_ERROR(HW_Memory, LOG_ERROR(HW_Memory,
"Unmapped ZeroBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", "Unmapped ZeroBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
current_vaddr, dest_addr, size); current_vaddr, dest_addr, size);
break; break;
} }
case PageType::Memory: { case PageType::Memory: {
@ -638,8 +638,8 @@ void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr,
switch (page_table.attributes[page_index]) { switch (page_table.attributes[page_index]) {
case PageType::Unmapped: { case PageType::Unmapped: {
LOG_ERROR(HW_Memory, LOG_ERROR(HW_Memory,
"Unmapped CopyBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", "Unmapped CopyBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
current_vaddr, src_addr, size); current_vaddr, src_addr, size);
ZeroBlock(process, dest_addr, copy_amount); ZeroBlock(process, dest_addr, copy_amount);
break; break;
} }

View File

@ -30,9 +30,9 @@ enum class BufferMethods {
void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params) { void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params) {
LOG_WARNING(HW_GPU, LOG_WARNING(HW_GPU,
"Processing method {:08X} on subchannel {} value " "Processing method {:08X} on subchannel {} value "
"{:08X} remaining params {}", "{:08X} remaining params {}",
method, subchannel, value, remaining_params); method, subchannel, value, remaining_params);
if (method == static_cast<u32>(BufferMethods::BindObject)) { if (method == static_cast<u32>(BufferMethods::BindObject)) {
// Bind the current subchannel to the desired engine id. // Bind the current subchannel to the desired engine id.

View File

@ -27,7 +27,7 @@ void Fermi2D::WriteReg(u32 method, u32 value) {
void Fermi2D::HandleSurfaceCopy() { void Fermi2D::HandleSurfaceCopy() {
LOG_WARNING(HW_GPU, "Requested a surface copy with operation {}", LOG_WARNING(HW_GPU, "Requested a surface copy with operation {}",
static_cast<u32>(regs.operation)); static_cast<u32>(regs.operation));
const GPUVAddr source = regs.src.Address(); const GPUVAddr source = regs.src.Address();
const GPUVAddr dest = regs.dst.Address(); const GPUVAddr dest = regs.dst.Address();

View File

@ -207,8 +207,8 @@ void Maxwell3D::ProcessQueryGet() {
} }
void Maxwell3D::DrawArrays() { void Maxwell3D::DrawArrays() {
LOG_DEBUG(HW_GPU, "called, topology={}, count={}", LOG_DEBUG(HW_GPU, "called, topology={}, count={}", static_cast<u32>(regs.draw.topology.Value()),
static_cast<u32>(regs.draw.topology.Value()), regs.vertex_buffer.count); regs.vertex_buffer.count);
ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?"); ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?");
auto debug_context = Core::System::GetInstance().GetGPUDebugContext(); auto debug_context = Core::System::GetInstance().GetGPUDebugContext();

View File

@ -166,8 +166,8 @@ std::pair<u8*, GLintptr> RasterizerOpenGL::SetupVertexArrays(u8* array_ptr,
for (unsigned index = 0; index < 16; ++index) { for (unsigned index = 0; index < 16; ++index) {
auto& attrib = regs.vertex_attrib_format[index]; auto& attrib = regs.vertex_attrib_format[index];
LOG_DEBUG(HW_GPU, "vertex attrib {}, count={}, size={}, type={}, offset={}, normalize={}", LOG_DEBUG(HW_GPU, "vertex attrib {}, count={}, size={}, type={}, offset={}, normalize={}",
index, attrib.ComponentCount(), attrib.SizeString(), attrib.TypeString(), index, attrib.ComponentCount(), attrib.SizeString(), attrib.TypeString(),
attrib.offset.Value(), attrib.IsNormalized()); attrib.offset.Value(), attrib.IsNormalized());
auto& buffer = regs.vertex_array[attrib.buffer]; auto& buffer = regs.vertex_array[attrib.buffer];
ASSERT(buffer.IsEnabled()); ASSERT(buffer.IsEnabled());
@ -251,8 +251,8 @@ void RasterizerOpenGL::SetupShaders(u8* buffer_ptr, GLintptr buffer_offset) {
break; break;
} }
default: default:
LOG_CRITICAL(HW_GPU, "Unimplemented shader index={}, enable={}, offset=0x{:08X}", LOG_CRITICAL(HW_GPU, "Unimplemented shader index={}, enable={}, offset=0x{:08X}", index,
index, shader_config.enable.Value(), shader_config.offset); shader_config.enable.Value(), shader_config.offset);
UNREACHABLE(); UNREACHABLE();
} }
@ -588,7 +588,7 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
if (size > MaxConstbufferSize) { if (size > MaxConstbufferSize) {
LOG_ERROR(HW_GPU, "indirect constbuffer size {} exceeds maximum {}", size, LOG_ERROR(HW_GPU, "indirect constbuffer size {} exceeds maximum {}", size,
MaxConstbufferSize); MaxConstbufferSize);
size = MaxConstbufferSize; size = MaxConstbufferSize;
} }
} else { } else {

View File

@ -919,7 +919,7 @@ private:
break; break;
default: default:
LOG_CRITICAL(HW_GPU, "Unhandled MUFU sub op: {0:x}", LOG_CRITICAL(HW_GPU, "Unhandled MUFU sub op: {0:x}",
static_cast<unsigned>(instr.sub_op.Value())); static_cast<unsigned>(instr.sub_op.Value()));
UNREACHABLE(); UNREACHABLE();
} }
break; break;
@ -1059,7 +1059,7 @@ private:
} }
default: { default: {
LOG_CRITICAL(HW_GPU, "Unhandled ArithmeticIntegerImmediate instruction: {}", LOG_CRITICAL(HW_GPU, "Unhandled ArithmeticIntegerImmediate instruction: {}",
opcode->GetName()); opcode->GetName());
UNREACHABLE(); UNREACHABLE();
} }
} }
@ -1125,7 +1125,7 @@ private:
} }
default: { default: {
LOG_CRITICAL(HW_GPU, "Unhandled ArithmeticInteger instruction: {}", LOG_CRITICAL(HW_GPU, "Unhandled ArithmeticInteger instruction: {}",
opcode->GetName()); opcode->GetName());
UNREACHABLE(); UNREACHABLE();
} }
} }
@ -1220,7 +1220,7 @@ private:
break; break;
default: default:
LOG_CRITICAL(HW_GPU, "Unimplemented f2f rounding mode {}", LOG_CRITICAL(HW_GPU, "Unimplemented f2f rounding mode {}",
static_cast<u32>(instr.conversion.f2f.rounding.Value())); static_cast<u32>(instr.conversion.f2f.rounding.Value()));
UNREACHABLE(); UNREACHABLE();
break; break;
} }
@ -1254,7 +1254,7 @@ private:
break; break;
default: default:
LOG_CRITICAL(HW_GPU, "Unimplemented f2i rounding mode {}", LOG_CRITICAL(HW_GPU, "Unimplemented f2i rounding mode {}",
static_cast<u32>(instr.conversion.f2i.rounding.Value())); static_cast<u32>(instr.conversion.f2i.rounding.Value()));
UNREACHABLE(); UNREACHABLE();
break; break;
} }
@ -1306,7 +1306,7 @@ private:
default: default:
LOG_CRITICAL(HW_GPU, "Unhandled type: {}", LOG_CRITICAL(HW_GPU, "Unhandled type: {}",
static_cast<unsigned>(instr.ld_c.type.Value())); static_cast<unsigned>(instr.ld_c.type.Value()));
UNREACHABLE(); UNREACHABLE();
} }
break; break;

View File

@ -91,7 +91,7 @@ inline GLenum TextureFilterMode(Tegra::Texture::TextureFilter filter_mode) {
return GL_NEAREST; return GL_NEAREST;
} }
LOG_CRITICAL(Render_OpenGL, "Unimplemented texture filter mode={}", LOG_CRITICAL(Render_OpenGL, "Unimplemented texture filter mode={}",
static_cast<u32>(filter_mode)); static_cast<u32>(filter_mode));
UNREACHABLE(); UNREACHABLE();
return {}; return {};
} }
@ -110,8 +110,7 @@ inline GLenum WrapMode(Tegra::Texture::WrapMode wrap_mode) {
// manually mix them. However the shader part of this is not yet implemented. // manually mix them. However the shader part of this is not yet implemented.
return GL_CLAMP_TO_BORDER; return GL_CLAMP_TO_BORDER;
} }
LOG_CRITICAL(Render_OpenGL, "Unimplemented texture wrap mode={}", LOG_CRITICAL(Render_OpenGL, "Unimplemented texture wrap mode={}", static_cast<u32>(wrap_mode));
static_cast<u32>(wrap_mode));
UNREACHABLE(); UNREACHABLE();
return {}; return {};
} }

View File

@ -302,7 +302,7 @@ void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x,
} else { } else {
// Other transformations are unsupported // Other transformations are unsupported
LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}", LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}",
static_cast<u32>(framebuffer_transform_flags)); static_cast<u32>(framebuffer_transform_flags));
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
} }

View File

@ -325,8 +325,7 @@ void GameList::PopupContextMenu(const QPoint& menu_location) {
void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) { void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) {
if (!FileUtil::Exists(dir_path.toStdString()) || if (!FileUtil::Exists(dir_path.toStdString()) ||
!FileUtil::IsDirectory(dir_path.toStdString())) { !FileUtil::IsDirectory(dir_path.toStdString())) {
LOG_ERROR(Frontend, "Could not find game list folder at {}", LOG_ERROR(Frontend, "Could not find game list folder at {}", dir_path.toLocal8Bit().data());
dir_path.toLocal8Bit().data());
search_field->setFilterResult(0, 0); search_field->setFilterResult(0, 0);
return; return;
} }

View File

@ -160,9 +160,9 @@ int main(int argc, char** argv) {
return -1; return -1;
case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted:
LOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " LOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before "
"being used with yuzu. \n\n For more information on dumping and " "being used with yuzu. \n\n For more information on dumping and "
"decrypting games, please refer to: " "decrypting games, please refer to: "
"https://yuzu-emu.org/wiki/dumping-game-cartridges/"); "https://yuzu-emu.org/wiki/dumping-game-cartridges/");
return -1; return -1;
case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat:
LOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); LOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported.");