diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/arm/arm_interface.h | 3 | ||||
-rw-r--r-- | src/core/hle/ipc.h | 11 | ||||
-rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 4 | ||||
-rw-r--r-- | src/core/hle/kernel/kernel.h | 1 | ||||
-rw-r--r-- | src/core/hle/kernel/memory.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/mutex.h | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 10 | ||||
-rw-r--r-- | src/core/hle/kernel/vm_manager.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/service/apm/apm.cpp | 3 | ||||
-rw-r--r-- | src/core/hle/service/nvdrv/nvdrv.h | 1 | ||||
-rw-r--r-- | src/core/loader/linker.cpp | 12 | ||||
-rw-r--r-- | src/core/loader/nso.cpp | 3 | ||||
-rw-r--r-- | src/core/loader/nso.h | 3 |
13 files changed, 31 insertions, 37 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 531875006..5ae60214e 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -39,7 +39,8 @@ public: Run(1); } - virtual void MapBackingMemory(VAddr address, size_t size, u8* memory, Kernel::VMAPermission perms) {} + virtual void MapBackingMemory(VAddr address, size_t size, u8* memory, + Kernel::VMAPermission perms) {} /// Clear all instruction cache virtual void ClearInstructionCache() = 0; diff --git a/src/core/hle/ipc.h b/src/core/hle/ipc.h index ec08be0f4..88ba105e5 100644 --- a/src/core/hle/ipc.h +++ b/src/core/hle/ipc.h @@ -19,7 +19,6 @@ constexpr size_t COMMAND_BUFFER_LENGTH = 0x100 / sizeof(u32); // TODO(yuriks): These will probably go away once translation is implemented inside the kernel. constexpr auto ERR_INVALID_HANDLE = Kernel::ERR_INVALID_HANDLE_OS; - enum class ControlCommand : u32 { ConvertSessionToDomain = 0, ConvertDomainToSession = 1, @@ -81,13 +80,13 @@ struct BufferDescriptorX { u32_le address_bits_0_31; u32_le Counter() const { - u32_le counter{ counter_bits_0_5 }; + u32_le counter{counter_bits_0_5}; counter |= counter_bits_9_11 << 9; return counter; } VAddr Address() const { - VAddr address{ address_bits_0_31 }; + VAddr address{address_bits_0_31}; address |= static_cast<VAddr>(address_bits_32_35) << 32; address |= static_cast<VAddr>(address_bits_36_38) << 36; return address; @@ -107,14 +106,14 @@ struct BufferDescriptorABW { }; VAddr Address() const { - VAddr address{ address_bits_0_31 }; + VAddr address{address_bits_0_31}; address |= static_cast<VAddr>(address_bits_32_35) << 32; address |= static_cast<VAddr>(address_bits_36_38) << 36; return address; } u64 Size() const { - u64 size{ size_bits_0_31 }; + u64 size{size_bits_0_31}; size |= static_cast<u64>(size_bits_32_35) << 32; return size; } @@ -130,7 +129,7 @@ struct BufferDescriptorC { }; VAddr Address() const { - VAddr address{ address_bits_0_31 }; + VAddr address{address_bits_0_31}; address |= static_cast<VAddr>(address_bits_32_47) << 32; return address; } diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 09caa43df..164c6db69 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -151,13 +151,13 @@ public: return domain != nullptr; } - template<typename T> + template <typename T> SharedPtr<T> GetCopyObject(size_t index) { ASSERT(index < copy_objects.size()); return DynamicObjectCast<T>(copy_objects[index]); } - template<typename T> + template <typename T> SharedPtr<T> GetMoveObject(size_t index) { ASSERT(index < move_objects.size()); return DynamicObjectCast<T>(move_objects[index]); diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index df3b4083e..4d9549e45 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -105,7 +105,6 @@ public: UNREACHABLE(); } - public: static unsigned int next_object_id; diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp index d990d0569..d2600cdd7 100644 --- a/src/core/hle/kernel/memory.cpp +++ b/src/core/hle/kernel/memory.cpp @@ -95,10 +95,8 @@ MemoryRegionInfo* GetMemoryRegion(MemoryRegion region) { } } -void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mapping) { -} +void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mapping) {} -void MapSharedPages(VMManager& address_space) { -} +void MapSharedPages(VMManager& address_space) {} } // namespace Kernel diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h index 49b6b454e..38db21005 100644 --- a/src/core/hle/kernel/mutex.h +++ b/src/core/hle/kernel/mutex.h @@ -41,9 +41,9 @@ public: return HANDLE_TYPE; } - u32 priority; ///< The priority of the mutex, used for priority inheritance. - std::string name; ///< Name of mutex (optional) - VAddr guest_addr; ///< Address of the guest mutex value + u32 priority; ///< The priority of the mutex, used for priority inheritance. + std::string name; ///< Name of mutex (optional) + VAddr guest_addr; ///< Address of the guest mutex value /** * Elevate the mutex priority to the best priority diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 9c60576c1..6b3fd13c9 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -255,9 +255,8 @@ static ResultCode CancelSynchronization(Handle thread_handle) { /// Attempts to locks a mutex, creating it if it does not already exist static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr, Handle requesting_thread_handle) { - LOG_TRACE(Kernel_SVC, - "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, " - "requesting_current_thread_handle=0x%08X", + LOG_TRACE(Kernel_SVC, "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, " + "requesting_current_thread_handle=0x%08X", holding_thread_handle, mutex_addr, requesting_thread_handle); SharedPtr<Thread> holding_thread = g_handle_table.Get<Thread>(holding_thread_handle); @@ -522,9 +521,8 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V Core::System::GetInstance().PrepareReschedule(); - LOG_TRACE(Kernel_SVC, - "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " - "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X", + LOG_TRACE(Kernel_SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " + "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X", entry_point, name.c_str(), arg, stack_top, priority, processor_id, *out_handle); return RESULT_SUCCESS; diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index dca637dde..650d47925 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -6,9 +6,9 @@ #include "common/assert.h" #include "common/logging/log.h" #include "core/arm/arm_interface.h" +#include "core/core.h" #include "core/hle/kernel/errors.h" #include "core/hle/kernel/vm_manager.h" -#include "core/core.h" #include "core/memory.h" #include "core/memory_setup.h" #include "core/mmio.h" @@ -86,7 +86,8 @@ ResultVal<VMManager::VMAHandle> VMManager::MapMemoryBlock(VAddr target, VirtualMemoryArea& final_vma = vma_handle->second; ASSERT(final_vma.size == size); - Core::CPU().MapBackingMemory(target, size, block->data() + offset, VMAPermission::ReadWriteExecute); + Core::CPU().MapBackingMemory(target, size, block->data() + offset, + VMAPermission::ReadWriteExecute); final_vma.type = VMAType::AllocatedMemoryBlock; final_vma.permissions = VMAPermission::ReadWrite; diff --git a/src/core/hle/service/apm/apm.cpp b/src/core/hle/service/apm/apm.cpp index f70b9fc10..957abdd66 100644 --- a/src/core/hle/service/apm/apm.cpp +++ b/src/core/hle/service/apm/apm.cpp @@ -15,8 +15,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) { APM::APM() : ServiceFramework("apm") { static const FunctionInfo functions[] = { - {0x00000000, nullptr, "OpenSession"}, - {0x00000001, nullptr, "GetPerformanceMode"}, + {0x00000000, nullptr, "OpenSession"}, {0x00000001, nullptr, "GetPerformanceMode"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h index 7530d80ad..a1c050416 100644 --- a/src/core/hle/service/nvdrv/nvdrv.h +++ b/src/core/hle/service/nvdrv/nvdrv.h @@ -26,6 +26,7 @@ public: VAddr GetObjectAddress(u32 handle) const; u32 ioctl(u32 command, const std::vector<u8>& input, std::vector<u8>& output) override; + private: // Represents an nvmap object. struct Object { diff --git a/src/core/loader/linker.cpp b/src/core/loader/linker.cpp index f82c6f4b4..87cc65e91 100644 --- a/src/core/loader/linker.cpp +++ b/src/core/loader/linker.cpp @@ -48,9 +48,9 @@ struct Elf64_Sym { }; static_assert(sizeof(Elf64_Sym) == 0x18, "Elf64_Sym has incorrect size."); -void Linker::WriteRelocations(std::vector<u8>& program_image, - const std::vector<Symbol>& symbols, u64 relocation_offset, - u64 size, bool is_jump_relocation, VAddr load_base) { +void Linker::WriteRelocations(std::vector<u8>& program_image, const std::vector<Symbol>& symbols, + u64 relocation_offset, u64 size, bool is_jump_relocation, + VAddr load_base) { for (u64 i = 0; i < size; i += sizeof(Elf64_Rela)) { Elf64_Rela rela; std::memcpy(&rela, &program_image[relocation_offset + i], sizeof(Elf64_Rela)); @@ -90,8 +90,7 @@ void Linker::WriteRelocations(std::vector<u8>& program_image, } } -void Linker::Relocate(std::vector<u8>& program_image, u32 dynamic_section_offset, - VAddr load_base) { +void Linker::Relocate(std::vector<u8>& program_image, u32 dynamic_section_offset, VAddr load_base) { std::map<u64, u64> dynamic; while (dynamic_section_offset < program_image.size()) { Elf64_Dyn dyn; @@ -141,8 +140,7 @@ void Linker::ResolveImports() { const auto& search = exports.find(import.first); if (search != exports.end()) { Memory::Write64(import.second.ea, search->second + import.second.addend); - } - else { + } else { LOG_ERROR(Loader, "Unresolved import: %s", import.first.c_str()); } } diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 7e1953701..a7d714bc8 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -157,7 +157,8 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) { // Load NSO modules VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR}; - for (const auto& module : {"rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", "subsdk3", "subsdk4"}) { + for (const auto& module : + {"rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", "subsdk3", "subsdk4"}) { const std::string path = filepath.substr(0, filepath.find_last_of("/\\")) + "/" + module; const VAddr load_addr = next_load_addr; next_load_addr = LoadNso(path, load_addr); diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index 28df00384..03424e70d 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h @@ -18,8 +18,7 @@ namespace Loader { class AppLoader_NSO final : public AppLoader, Linker { public: AppLoader_NSO(FileUtil::IOFile&& file, std::string filepath) - : AppLoader(std::move(file)), filepath(std::move(filepath)) { - } + : AppLoader(std::move(file)), filepath(std::move(filepath)) {} /** * Returns the type of the file |