Merge pull request #211 from linkmauve/master
Remove trailing spaces from the entire project
This commit is contained in:
commit
c0cd0fa78e
84 changed files with 459 additions and 459 deletions
|
@ -11,7 +11,7 @@
|
|||
// Address arbiters are an underlying kernel synchronization object that can be created/used via
|
||||
// supervisor calls (SVCs). They function as sort of a global lock. Typically, games/other CTR
|
||||
// applications use them as an underlying mechanism to implement thread-safe barriers, events, and
|
||||
// semphores.
|
||||
// semphores.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Kernel namespace
|
||||
|
|
|
@ -52,14 +52,14 @@ public:
|
|||
FileSys::Archive* backend; ///< Archive backend interface
|
||||
|
||||
/**
|
||||
* Synchronize kernel object
|
||||
* Synchronize kernel object
|
||||
* @param wait Boolean wait set if current thread should wait as a result of sync operation
|
||||
* @return Result of operation, 0 on success, otherwise error code
|
||||
*/
|
||||
Result SyncRequest(bool* wait) override {
|
||||
u32* cmd_buff = Service::GetCommandBuffer();
|
||||
FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]);
|
||||
|
||||
|
||||
switch (cmd) {
|
||||
// Read from archive...
|
||||
case FileCommand::Read:
|
||||
|
@ -343,7 +343,7 @@ Archive* CreateArchive(Handle& handle, FileSys::Archive* backend, const std::str
|
|||
archive->backend = backend;
|
||||
|
||||
MountArchive(archive);
|
||||
|
||||
|
||||
return archive;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
|
@ -95,7 +95,7 @@ Result SignalEvent(const Handle handle) {
|
|||
for (size_t i = 0; i < evt->waiting_threads.size(); ++i) {
|
||||
ResumeThreadFromWait( evt->waiting_threads[i]);
|
||||
|
||||
// If any thread is signalled awake by this event, assume the event was "caught" and reset
|
||||
// If any thread is signalled awake by this event, assume the event was "caught" and reset
|
||||
// the event. This will result in the next thread waiting on the event to block. Otherwise,
|
||||
// the event will not be reset, and the next thread to call WaitSynchronization on it will
|
||||
// not block. Not sure if this is correct behavior, but it seems to work.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project / PPSSPP Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/common.h"
|
||||
|
||||
|
@ -68,7 +68,7 @@ void ObjectPool::List() {
|
|||
for (int i = 0; i < MAX_COUNT; i++) {
|
||||
if (occupied[i]) {
|
||||
if (pool[i]) {
|
||||
INFO_LOG(KERNEL, "KO %i: %s \"%s\"", i + HANDLE_OFFSET, pool[i]->GetTypeName().c_str(),
|
||||
INFO_LOG(KERNEL, "KO %i: %s \"%s\"", i + HANDLE_OFFSET, pool[i]->GetTypeName().c_str(),
|
||||
pool[i]->GetName().c_str());
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ void Shutdown() {
|
|||
*/
|
||||
bool LoadExec(u32 entry_point) {
|
||||
Init();
|
||||
|
||||
|
||||
Core::g_app_core->SetPC(entry_point);
|
||||
|
||||
// 0x30 is the typical main thread priority I've seen used so far
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project / PPSSPP Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
@ -34,7 +34,7 @@ enum class HandleType : u32 {
|
|||
Archive = 12,
|
||||
Directory = 13,
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
DEFAULT_STACK_SIZE = 0x4000,
|
||||
};
|
||||
|
@ -52,7 +52,7 @@ public:
|
|||
virtual Kernel::HandleType GetHandleType() const = 0;
|
||||
|
||||
/**
|
||||
* Synchronize kernel object
|
||||
* Synchronize kernel object
|
||||
* @param wait Boolean wait set if current thread should wait as a result of sync operation
|
||||
* @return Result of operation, 0 on success, otherwise error code
|
||||
*/
|
||||
|
@ -139,7 +139,7 @@ public:
|
|||
}
|
||||
|
||||
bool GetIDType(Handle handle, HandleType* type) const {
|
||||
if ((handle < HANDLE_OFFSET) || (handle >= HANDLE_OFFSET + MAX_COUNT) ||
|
||||
if ((handle < HANDLE_OFFSET) || (handle >= HANDLE_OFFSET + MAX_COUNT) ||
|
||||
!occupied[handle - HANDLE_OFFSET]) {
|
||||
ERROR_LOG(KERNEL, "Kernel: Bad object handle %i (%08x)", handle, handle);
|
||||
return false;
|
||||
|
@ -155,7 +155,7 @@ public:
|
|||
int GetCount();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
enum {
|
||||
MAX_COUNT = 0x1000,
|
||||
HANDLE_OFFSET = 0x100,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
@ -28,7 +28,7 @@ public:
|
|||
std::string name; ///< Name of mutex (optional)
|
||||
|
||||
/**
|
||||
* Synchronize kernel object
|
||||
* Synchronize kernel object
|
||||
* @param wait Boolean wait set if current thread should wait as a result of sync operation
|
||||
* @return Result of operation, 0 on success, otherwise error code
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/common.h"
|
||||
|
||||
|
@ -67,7 +67,7 @@ Handle CreateSharedMemory(const std::string& name) {
|
|||
* @param other_permissions Memory block map other permissions (specified by SVC field)
|
||||
* @return Result of operation, 0 on success, otherwise error code
|
||||
*/
|
||||
Result MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions,
|
||||
Result MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions,
|
||||
MemoryPermission other_permissions) {
|
||||
|
||||
if (address < Memory::SHARED_MEMORY_VADDR || address >= Memory::SHARED_MEMORY_VADDR_END) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
@ -34,7 +34,7 @@ Handle CreateSharedMemory(const std::string& name="Unknown");
|
|||
* @param other_permissions Memory block map other permissions (specified by SVC field)
|
||||
* @return Result of operation, 0 on success, otherwise error code
|
||||
*/
|
||||
Result MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions,
|
||||
Result MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions,
|
||||
MemoryPermission other_permissions);
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project / PPSSPP Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
|
@ -113,7 +113,7 @@ void ResetThread(Thread* t, u32 arg, s32 lowest_priority) {
|
|||
t->context.pc = t->context.reg_15 = t->entry_point;
|
||||
t->context.sp = t->stack_top;
|
||||
t->context.cpsr = 0x1F; // Usermode
|
||||
|
||||
|
||||
// TODO(bunnei): This instructs the CPU core to start the execution as if it is "resuming" a
|
||||
// thread. This is somewhat Sky-Eye specific, and should be re-architected in the future to be
|
||||
// agnostic of the CPU core.
|
||||
|
@ -148,7 +148,7 @@ inline bool VerifyWait(const Handle& handle, WaitType type, Handle wait_handle)
|
|||
Thread* thread = g_object_pool.GetFast<Thread>(handle);
|
||||
_assert_msg_(KERNEL, (thread != nullptr), "called, but thread is nullptr!");
|
||||
|
||||
if (type != thread->wait_type || wait_handle != thread->wait_handle)
|
||||
if (type != thread->wait_type || wait_handle != thread->wait_handle)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -158,7 +158,7 @@ inline bool VerifyWait(const Handle& handle, WaitType type, Handle wait_handle)
|
|||
void StopThread(Handle handle, const char* reason) {
|
||||
Thread* thread = g_object_pool.GetFast<Thread>(handle);
|
||||
_assert_msg_(KERNEL, (thread != nullptr), "called, but thread is nullptr!");
|
||||
|
||||
|
||||
ChangeReadyState(thread, false);
|
||||
thread->status = THREADSTATUS_DORMANT;
|
||||
for (size_t i = 0; i < thread->waiting_threads.size(); ++i) {
|
||||
|
@ -181,7 +181,7 @@ void ChangeThreadState(Thread* t, ThreadStatus new_status) {
|
|||
}
|
||||
ChangeReadyState(t, (new_status & THREADSTATUS_READY) != 0);
|
||||
t->status = new_status;
|
||||
|
||||
|
||||
if (new_status == THREADSTATUS_WAIT) {
|
||||
if (t->wait_type == WAITTYPE_NONE) {
|
||||
ERROR_LOG(KERNEL, "Waittype none not allowed");
|
||||
|
@ -216,7 +216,7 @@ Handle ArbitrateHighestPriorityThread(u32 arbiter, u32 address) {
|
|||
|
||||
/// Arbitrate all threads currently waiting
|
||||
void ArbitrateAllThreads(u32 arbiter, u32 address) {
|
||||
|
||||
|
||||
// Iterate through threads, find highest priority thread that is waiting to be arbitrated...
|
||||
for (const auto& handle : thread_queue) {
|
||||
|
||||
|
@ -238,11 +238,11 @@ void CallThread(Thread* t) {
|
|||
/// Switches CPU context to that of the specified thread
|
||||
void SwitchContext(Thread* t) {
|
||||
Thread* cur = GetCurrentThread();
|
||||
|
||||
|
||||
// Save context for current thread
|
||||
if (cur) {
|
||||
SaveContext(cur->context);
|
||||
|
||||
|
||||
if (cur->IsRunning()) {
|
||||
ChangeReadyState(cur, true);
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ void SwitchContext(Thread* t) {
|
|||
Thread* NextThread() {
|
||||
Handle next;
|
||||
Thread* cur = GetCurrentThread();
|
||||
|
||||
|
||||
if (cur && cur->IsRunning()) {
|
||||
next = thread_ready_queue.pop_first_better(cur->current_priority);
|
||||
} else {
|
||||
|
@ -319,7 +319,7 @@ void DebugThreadQueue() {
|
|||
Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 priority,
|
||||
s32 processor_id, u32 stack_top, int stack_size) {
|
||||
|
||||
_assert_msg_(KERNEL, (priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST),
|
||||
_assert_msg_(KERNEL, (priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST),
|
||||
"CreateThread priority=%d, outside of allowable range!", priority)
|
||||
|
||||
Thread* thread = new Thread;
|
||||
|
@ -351,7 +351,7 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3
|
|||
return -1;
|
||||
}
|
||||
if ((u32)stack_size < 0x200) {
|
||||
ERROR_LOG(KERNEL, "CreateThread(name=%s): invalid stack_size=0x%08X", name,
|
||||
ERROR_LOG(KERNEL, "CreateThread(name=%s): invalid stack_size=0x%08X", name,
|
||||
stack_size);
|
||||
return -1;
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3
|
|||
return -1;
|
||||
}
|
||||
Handle handle;
|
||||
Thread* thread = CreateThread(handle, name, entry_point, priority, processor_id, stack_top,
|
||||
Thread* thread = CreateThread(handle, name, entry_point, priority, processor_id, stack_top,
|
||||
stack_size);
|
||||
|
||||
ResetThread(thread, arg, 0);
|
||||
|
@ -423,19 +423,19 @@ Result SetThreadPriority(Handle handle, s32 priority) {
|
|||
/// Sets up the primary application thread
|
||||
Handle SetupMainThread(s32 priority, int stack_size) {
|
||||
Handle handle;
|
||||
|
||||
|
||||
// Initialize new "main" thread
|
||||
Thread* thread = CreateThread(handle, "main", Core::g_app_core->GetPC(), priority,
|
||||
Thread* thread = CreateThread(handle, "main", Core::g_app_core->GetPC(), priority,
|
||||
THREADPROCESSORID_0, Memory::SCRATCHPAD_VADDR_END, stack_size);
|
||||
|
||||
|
||||
ResetThread(thread, 0, 0);
|
||||
|
||||
|
||||
// If running another thread already, set it to "ready" state
|
||||
Thread* cur = GetCurrentThread();
|
||||
if (cur && cur->IsRunning()) {
|
||||
ChangeReadyState(cur, true);
|
||||
}
|
||||
|
||||
|
||||
// Run new "main" thread
|
||||
SetCurrentThread(thread);
|
||||
thread->status = THREADSTATUS_RUNNING;
|
||||
|
@ -452,12 +452,12 @@ void Reschedule() {
|
|||
HLE::g_reschedule = false;
|
||||
if (next > 0) {
|
||||
INFO_LOG(KERNEL, "context switch 0x%08X -> 0x%08X", prev->GetHandle(), next->GetHandle());
|
||||
|
||||
|
||||
SwitchContext(next);
|
||||
|
||||
// Hack - There is no mechanism yet to waken the primary thread if it has been put to sleep
|
||||
// by a simulated VBLANK thread switch. So, we'll just immediately set it to "ready" again.
|
||||
// This results in the current thread yielding on a VBLANK once, and then it will be
|
||||
// This results in the current thread yielding on a VBLANK once, and then it will be
|
||||
// immediately placed back in the queue for execution.
|
||||
if (prev->wait_type == WAITTYPE_VBLANK) {
|
||||
ResumeThreadFromWait(prev->GetHandle());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2014 Citra Emulator Project / PPSSPP Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue