mirror of
https://github.com/wiiu-env/MemoryMappingModule.git
synced 2024-11-22 09:49:20 +01:00
Formatting
This commit is contained in:
parent
5ac51ef3ce
commit
6c5a2edf6d
@ -27,10 +27,7 @@ public:
|
||||
|
||||
//! constructor
|
||||
CThread(int32_t iAttr, int32_t iPriority = 16, int32_t iStackSize = 0x8000, CThread::Callback callback = NULL, void *callbackArg = NULL)
|
||||
: pThread(NULL)
|
||||
, pThreadStack(NULL)
|
||||
, pCallback(callback)
|
||||
, pCallbackArg(callbackArg) {
|
||||
: pThread(NULL), pThreadStack(NULL), pCallback(callback), pCallbackArg(callbackArg) {
|
||||
//! save attribute assignment
|
||||
iAttributes = iAttr;
|
||||
//! allocate the thread
|
||||
@ -56,35 +53,42 @@ public:
|
||||
virtual void *getThread() const {
|
||||
return pThread;
|
||||
}
|
||||
|
||||
//! Thread entry function
|
||||
virtual void executeThread(void) {
|
||||
if (pCallback)
|
||||
pCallback(this, pCallbackArg);
|
||||
}
|
||||
|
||||
//! Suspend thread
|
||||
virtual void suspendThread(void) {
|
||||
if (isThreadSuspended()) return;
|
||||
if (pThread) OSSuspendThread(pThread);
|
||||
}
|
||||
|
||||
//! Resume thread
|
||||
virtual void resumeThread(void) {
|
||||
if (!isThreadSuspended()) return;
|
||||
if (pThread) OSResumeThread(pThread);
|
||||
}
|
||||
|
||||
//! Set thread priority
|
||||
virtual void setThreadPriority(int32_t prio) {
|
||||
if (pThread) OSSetThreadPriority(pThread, prio);
|
||||
}
|
||||
|
||||
//! Check if thread is suspended
|
||||
virtual bool isThreadSuspended(void) const {
|
||||
if (pThread) return OSIsThreadSuspended(pThread);
|
||||
return false;
|
||||
}
|
||||
|
||||
//! Check if thread is terminated
|
||||
virtual bool isThreadTerminated(void) const {
|
||||
if (pThread) return OSIsThreadTerminated(pThread);
|
||||
return false;
|
||||
}
|
||||
|
||||
//! Check if thread is running
|
||||
virtual bool isThreadRunning(void) const {
|
||||
return !isThreadSuspended() && !isThreadRunning();
|
||||
@ -115,6 +119,7 @@ public:
|
||||
pThread = NULL;
|
||||
pThreadStack = NULL;
|
||||
}
|
||||
|
||||
//! Thread attributes
|
||||
enum eCThreadAttributes {
|
||||
eAttributeNone = 0x07,
|
||||
@ -130,6 +135,7 @@ private:
|
||||
((CThread *) arg)->executeThread();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t iAttributes;
|
||||
OSThread *pThread;
|
||||
uint8_t *pThreadStack;
|
||||
|
@ -38,6 +38,7 @@ void MemoryMappingFree(void* ptr){
|
||||
uint32_t MemoryMappingEffectiveToPhysical(uint32_t address) {
|
||||
return MemoryMapping::EffectiveToPhysical(address);
|
||||
}
|
||||
|
||||
uint32_t MemoryMappingPhysicalToEffective(uint32_t address) {
|
||||
return MemoryMapping::PhysicalToEffective(address);
|
||||
}
|
||||
|
@ -132,7 +132,8 @@ void MemoryMapping::searchEmptyMemoryRegions() {
|
||||
}
|
||||
}
|
||||
if (startGood != 0 && (startGood != ea_start_address + ea_size)) {
|
||||
DEBUG_FUNCTION_LINE("+ Good between 0x%08X and 0x%08X size: %u kB",startGood - MEMORY_START_BASE,((uint32_t)(ea_start_address + ea_size) - (uint32_t)MEMORY_START_BASE),((uint32_t)(ea_start_address + ea_size) - (uint32_t)startGood)/1024);
|
||||
DEBUG_FUNCTION_LINE("+ Good between 0x%08X and 0x%08X size: %u kB", startGood - MEMORY_START_BASE, ((uint32_t) (ea_start_address + ea_size) - (uint32_t) MEMORY_START_BASE),
|
||||
((uint32_t) (ea_start_address + ea_size) - (uint32_t) startGood) / 1024);
|
||||
} else if (inFailRange) {
|
||||
DEBUG_FUNCTION_LINE("- Used between 0x%08X and 0x%08X size: %u kB", startFailing, ea_start_address + ea_size, ((uint32_t) (ea_start_address + ea_size) - (uint32_t) startFailing) / 1024);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user