diff options
| author | 2015-01-11 01:20:49 -0200 | |
|---|---|---|
| committer | 2015-01-30 11:47:01 -0200 | |
| commit | 9a345de2bd73c280de16442f78a313c1b6bee84c (patch) | |
| tree | e28e8dee9dd183aa08e8b47141a2887cb834757e /src | |
| parent | Merge pull request #412 from purpasmart96/svc_table_cleanup (diff) | |
| download | yuzu-9a345de2bd73c280de16442f78a313c1b6bee84c.tar.gz yuzu-9a345de2bd73c280de16442f78a313c1b6bee84c.tar.xz yuzu-9a345de2bd73c280de16442f78a313c1b6bee84c.zip | |
Kernel: Remove useless/duplicated comments; mark functions static
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/kernel/address_arbiter.h | 3 | ||||
| -rw-r--r-- | src/core/hle/kernel/event.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 18 | ||||
| -rw-r--r-- | src/core/hle/kernel/shared_memory.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/kernel/timer.cpp | 2 |
6 files changed, 8 insertions, 32 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 9e855b0bf..2a66f8dd5 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp | |||
| @@ -28,7 +28,6 @@ public: | |||
| 28 | 28 | ||
| 29 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 29 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 30 | 30 | ||
| 31 | /// Arbitrate an address | ||
| 32 | ResultCode ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s32 value, u64 nanoseconds) { | 31 | ResultCode ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s32 value, u64 nanoseconds) { |
| 33 | AddressArbiter* object = Kernel::g_handle_table.Get<AddressArbiter>(handle).get(); | 32 | AddressArbiter* object = Kernel::g_handle_table.Get<AddressArbiter>(handle).get(); |
| 34 | 33 | ||
| @@ -92,8 +91,7 @@ ResultCode ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s3 | |||
| 92 | return RESULT_SUCCESS; | 91 | return RESULT_SUCCESS; |
| 93 | } | 92 | } |
| 94 | 93 | ||
| 95 | /// Create an address arbiter | 94 | static AddressArbiter* CreateAddressArbiter(Handle& handle, const std::string& name) { |
| 96 | AddressArbiter* CreateAddressArbiter(Handle& handle, const std::string& name) { | ||
| 97 | AddressArbiter* address_arbiter = new AddressArbiter; | 95 | AddressArbiter* address_arbiter = new AddressArbiter; |
| 98 | // TOOD(yuriks): Fix error reporting | 96 | // TOOD(yuriks): Fix error reporting |
| 99 | handle = Kernel::g_handle_table.Create(address_arbiter).ValueOr(INVALID_HANDLE); | 97 | handle = Kernel::g_handle_table.Create(address_arbiter).ValueOr(INVALID_HANDLE); |
| @@ -101,7 +99,6 @@ AddressArbiter* CreateAddressArbiter(Handle& handle, const std::string& name) { | |||
| 101 | return address_arbiter; | 99 | return address_arbiter; |
| 102 | } | 100 | } |
| 103 | 101 | ||
| 104 | /// Create an address arbiter | ||
| 105 | Handle CreateAddressArbiter(const std::string& name) { | 102 | Handle CreateAddressArbiter(const std::string& name) { |
| 106 | Handle handle; | 103 | Handle handle; |
| 107 | CreateAddressArbiter(handle, name); | 104 | CreateAddressArbiter(handle, name); |
diff --git a/src/core/hle/kernel/address_arbiter.h b/src/core/hle/kernel/address_arbiter.h index 3ffd465a2..81084bdc8 100644 --- a/src/core/hle/kernel/address_arbiter.h +++ b/src/core/hle/kernel/address_arbiter.h | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | 18 | ||
| 19 | namespace Kernel { | 19 | namespace Kernel { |
| 20 | 20 | ||
| 21 | /// Address arbitration types | ||
| 22 | enum class ArbitrationType : u32 { | 21 | enum class ArbitrationType : u32 { |
| 23 | Signal, | 22 | Signal, |
| 24 | WaitIfLessThan, | 23 | WaitIfLessThan, |
| @@ -27,10 +26,8 @@ enum class ArbitrationType : u32 { | |||
| 27 | DecrementAndWaitIfLessThanWithTimeout, | 26 | DecrementAndWaitIfLessThanWithTimeout, |
| 28 | }; | 27 | }; |
| 29 | 28 | ||
| 30 | /// Arbitrate an address | ||
| 31 | ResultCode ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s32 value, u64 nanoseconds); | 29 | ResultCode ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s32 value, u64 nanoseconds); |
| 32 | 30 | ||
| 33 | /// Create an address arbiter | ||
| 34 | Handle CreateAddressArbiter(const std::string& name = "Unknown"); | 31 | Handle CreateAddressArbiter(const std::string& name = "Unknown"); |
| 35 | 32 | ||
| 36 | } // namespace FileSys | 33 | } // namespace FileSys |
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index a48125965..74df47a05 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp | |||
| @@ -69,7 +69,7 @@ ResultCode ClearEvent(Handle handle) { | |||
| 69 | * @param name Optional name of event | 69 | * @param name Optional name of event |
| 70 | * @return Newly created Event object | 70 | * @return Newly created Event object |
| 71 | */ | 71 | */ |
| 72 | Event* CreateEvent(Handle& handle, const ResetType reset_type, const std::string& name) { | 72 | static Event* CreateEvent(Handle& handle, const ResetType reset_type, const std::string& name) { |
| 73 | Event* evt = new Event; | 73 | Event* evt = new Event; |
| 74 | 74 | ||
| 75 | // TOOD(yuriks): Fix error reporting | 75 | // TOOD(yuriks): Fix error reporting |
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index cd05a1397..c94c2acc9 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -40,7 +40,7 @@ static MutexMap g_mutex_held_locks; | |||
| 40 | * @param mutex Mutex that is to be acquired | 40 | * @param mutex Mutex that is to be acquired |
| 41 | * @param thread Thread that will acquire the mutex | 41 | * @param thread Thread that will acquire the mutex |
| 42 | */ | 42 | */ |
| 43 | void MutexAcquireLock(Mutex* mutex, Thread* thread) { | 43 | static void MutexAcquireLock(Mutex* mutex, Thread* thread) { |
| 44 | g_mutex_held_locks.insert(std::make_pair(thread, mutex)); | 44 | g_mutex_held_locks.insert(std::make_pair(thread, mutex)); |
| 45 | mutex->holding_thread = thread; | 45 | mutex->holding_thread = thread; |
| 46 | } | 46 | } |
| @@ -49,7 +49,7 @@ void MutexAcquireLock(Mutex* mutex, Thread* thread) { | |||
| 49 | * Resumes a thread waiting for the specified mutex | 49 | * Resumes a thread waiting for the specified mutex |
| 50 | * @param mutex The mutex that some thread is waiting on | 50 | * @param mutex The mutex that some thread is waiting on |
| 51 | */ | 51 | */ |
| 52 | void ResumeWaitingThread(Mutex* mutex) { | 52 | static void ResumeWaitingThread(Mutex* mutex) { |
| 53 | // Find the next waiting thread for the mutex... | 53 | // Find the next waiting thread for the mutex... |
| 54 | auto next_thread = mutex->WakeupNextThread(); | 54 | auto next_thread = mutex->WakeupNextThread(); |
| 55 | if (next_thread != nullptr) { | 55 | if (next_thread != nullptr) { |
| @@ -73,7 +73,7 @@ void ReleaseThreadMutexes(Thread* thread) { | |||
| 73 | g_mutex_held_locks.erase(thread); | 73 | g_mutex_held_locks.erase(thread); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | bool ReleaseMutex(Mutex* mutex) { | 76 | static bool ReleaseMutex(Mutex* mutex) { |
| 77 | if (mutex->locked) { | 77 | if (mutex->locked) { |
| 78 | auto locked = g_mutex_held_locks.equal_range(mutex->holding_thread); | 78 | auto locked = g_mutex_held_locks.equal_range(mutex->holding_thread); |
| 79 | 79 | ||
| @@ -89,10 +89,6 @@ bool ReleaseMutex(Mutex* mutex) { | |||
| 89 | return true; | 89 | return true; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | /** | ||
| 93 | * Releases a mutex | ||
| 94 | * @param handle Handle to mutex to release | ||
| 95 | */ | ||
| 96 | ResultCode ReleaseMutex(Handle handle) { | 92 | ResultCode ReleaseMutex(Handle handle) { |
| 97 | Mutex* mutex = Kernel::g_handle_table.Get<Mutex>(handle).get(); | 93 | Mutex* mutex = Kernel::g_handle_table.Get<Mutex>(handle).get(); |
| 98 | if (mutex == nullptr) return InvalidHandle(ErrorModule::Kernel); | 94 | if (mutex == nullptr) return InvalidHandle(ErrorModule::Kernel); |
| @@ -113,7 +109,7 @@ ResultCode ReleaseMutex(Handle handle) { | |||
| 113 | * @param name Optional name of mutex | 109 | * @param name Optional name of mutex |
| 114 | * @return Pointer to new Mutex object | 110 | * @return Pointer to new Mutex object |
| 115 | */ | 111 | */ |
| 116 | Mutex* CreateMutex(Handle& handle, bool initial_locked, const std::string& name) { | 112 | static Mutex* CreateMutex(Handle& handle, bool initial_locked, const std::string& name) { |
| 117 | Mutex* mutex = new Mutex; | 113 | Mutex* mutex = new Mutex; |
| 118 | // TODO(yuriks): Fix error reporting | 114 | // TODO(yuriks): Fix error reporting |
| 119 | handle = Kernel::g_handle_table.Create(mutex).ValueOr(INVALID_HANDLE); | 115 | handle = Kernel::g_handle_table.Create(mutex).ValueOr(INVALID_HANDLE); |
| @@ -129,12 +125,6 @@ Mutex* CreateMutex(Handle& handle, bool initial_locked, const std::string& name) | |||
| 129 | return mutex; | 125 | return mutex; |
| 130 | } | 126 | } |
| 131 | 127 | ||
| 132 | /** | ||
| 133 | * Creates a mutex | ||
| 134 | * @param initial_locked Specifies if the mutex should be locked initially | ||
| 135 | * @param name Optional name of mutex | ||
| 136 | * @return Handle to newly created object | ||
| 137 | */ | ||
| 138 | Handle CreateMutex(bool initial_locked, const std::string& name) { | 128 | Handle CreateMutex(bool initial_locked, const std::string& name) { |
| 139 | Handle handle; | 129 | Handle handle; |
| 140 | Mutex* mutex = CreateMutex(handle, initial_locked, name); | 130 | Mutex* mutex = CreateMutex(handle, initial_locked, name); |
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 5368e4728..fa8fc6f92 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp | |||
| @@ -30,7 +30,7 @@ public: | |||
| 30 | * @param name Name of shared memory object | 30 | * @param name Name of shared memory object |
| 31 | * @return Pointer to newly created shared memory object | 31 | * @return Pointer to newly created shared memory object |
| 32 | */ | 32 | */ |
| 33 | SharedMemory* CreateSharedMemory(Handle& handle, const std::string& name) { | 33 | static SharedMemory* CreateSharedMemory(Handle& handle, const std::string& name) { |
| 34 | SharedMemory* shared_memory = new SharedMemory; | 34 | SharedMemory* shared_memory = new SharedMemory; |
| 35 | // TOOD(yuriks): Fix error reporting | 35 | // TOOD(yuriks): Fix error reporting |
| 36 | handle = Kernel::g_handle_table.Create(shared_memory).ValueOr(INVALID_HANDLE); | 36 | handle = Kernel::g_handle_table.Create(shared_memory).ValueOr(INVALID_HANDLE); |
| @@ -44,14 +44,6 @@ Handle CreateSharedMemory(const std::string& name) { | |||
| 44 | return handle; | 44 | return handle; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | /** | ||
| 48 | * Maps a shared memory block to an address in system memory | ||
| 49 | * @param handle Shared memory block handle | ||
| 50 | * @param address Address in system memory to map shared memory block to | ||
| 51 | * @param permissions Memory block map permissions (specified by SVC field) | ||
| 52 | * @param other_permissions Memory block map other permissions (specified by SVC field) | ||
| 53 | * @return Result of operation, 0 on success, otherwise error code | ||
| 54 | */ | ||
| 55 | ResultCode MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions, | 47 | ResultCode MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions, |
| 56 | MemoryPermission other_permissions) { | 48 | MemoryPermission other_permissions) { |
| 57 | 49 | ||
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index ec0b2c323..aee5dc599 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp | |||
| @@ -45,7 +45,7 @@ public: | |||
| 45 | * @param name Optional name of timer | 45 | * @param name Optional name of timer |
| 46 | * @return Newly created Timer object | 46 | * @return Newly created Timer object |
| 47 | */ | 47 | */ |
| 48 | Timer* CreateTimer(Handle& handle, const ResetType reset_type, const std::string& name) { | 48 | static Timer* CreateTimer(Handle& handle, const ResetType reset_type, const std::string& name) { |
| 49 | Timer* timer = new Timer; | 49 | Timer* timer = new Timer; |
| 50 | 50 | ||
| 51 | handle = Kernel::g_handle_table.Create(timer).ValueOr(INVALID_HANDLE); | 51 | handle = Kernel::g_handle_table.Create(timer).ValueOr(INVALID_HANDLE); |