mirror of
https://github.com/wiiu-env/MemoryMappingModule.git
synced 2024-11-26 03:34:15 +01:00
Formatting
This commit is contained in:
parent
5ac51ef3ce
commit
6c5a2edf6d
@ -27,10 +27,7 @@ public:
|
|||||||
|
|
||||||
//! constructor
|
//! constructor
|
||||||
CThread(int32_t iAttr, int32_t iPriority = 16, int32_t iStackSize = 0x8000, CThread::Callback callback = NULL, void *callbackArg = NULL)
|
CThread(int32_t iAttr, int32_t iPriority = 16, int32_t iStackSize = 0x8000, CThread::Callback callback = NULL, void *callbackArg = NULL)
|
||||||
: pThread(NULL)
|
: pThread(NULL), pThreadStack(NULL), pCallback(callback), pCallbackArg(callbackArg) {
|
||||||
, pThreadStack(NULL)
|
|
||||||
, pCallback(callback)
|
|
||||||
, pCallbackArg(callbackArg) {
|
|
||||||
//! save attribute assignment
|
//! save attribute assignment
|
||||||
iAttributes = iAttr;
|
iAttributes = iAttr;
|
||||||
//! allocate the thread
|
//! allocate the thread
|
||||||
@ -56,35 +53,42 @@ public:
|
|||||||
virtual void *getThread() const {
|
virtual void *getThread() const {
|
||||||
return pThread;
|
return pThread;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Thread entry function
|
//! Thread entry function
|
||||||
virtual void executeThread(void) {
|
virtual void executeThread(void) {
|
||||||
if (pCallback)
|
if (pCallback)
|
||||||
pCallback(this, pCallbackArg);
|
pCallback(this, pCallbackArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Suspend thread
|
//! Suspend thread
|
||||||
virtual void suspendThread(void) {
|
virtual void suspendThread(void) {
|
||||||
if (isThreadSuspended()) return;
|
if (isThreadSuspended()) return;
|
||||||
if (pThread) OSSuspendThread(pThread);
|
if (pThread) OSSuspendThread(pThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Resume thread
|
//! Resume thread
|
||||||
virtual void resumeThread(void) {
|
virtual void resumeThread(void) {
|
||||||
if (!isThreadSuspended()) return;
|
if (!isThreadSuspended()) return;
|
||||||
if (pThread) OSResumeThread(pThread);
|
if (pThread) OSResumeThread(pThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Set thread priority
|
//! Set thread priority
|
||||||
virtual void setThreadPriority(int32_t prio) {
|
virtual void setThreadPriority(int32_t prio) {
|
||||||
if (pThread) OSSetThreadPriority(pThread, prio);
|
if (pThread) OSSetThreadPriority(pThread, prio);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Check if thread is suspended
|
//! Check if thread is suspended
|
||||||
virtual bool isThreadSuspended(void) const {
|
virtual bool isThreadSuspended(void) const {
|
||||||
if (pThread) return OSIsThreadSuspended(pThread);
|
if (pThread) return OSIsThreadSuspended(pThread);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Check if thread is terminated
|
//! Check if thread is terminated
|
||||||
virtual bool isThreadTerminated(void) const {
|
virtual bool isThreadTerminated(void) const {
|
||||||
if (pThread) return OSIsThreadTerminated(pThread);
|
if (pThread) return OSIsThreadTerminated(pThread);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Check if thread is running
|
//! Check if thread is running
|
||||||
virtual bool isThreadRunning(void) const {
|
virtual bool isThreadRunning(void) const {
|
||||||
return !isThreadSuspended() && !isThreadRunning();
|
return !isThreadSuspended() && !isThreadRunning();
|
||||||
@ -115,6 +119,7 @@ public:
|
|||||||
pThread = NULL;
|
pThread = NULL;
|
||||||
pThreadStack = NULL;
|
pThreadStack = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Thread attributes
|
//! Thread attributes
|
||||||
enum eCThreadAttributes {
|
enum eCThreadAttributes {
|
||||||
eAttributeNone = 0x07,
|
eAttributeNone = 0x07,
|
||||||
@ -130,6 +135,7 @@ private:
|
|||||||
((CThread *) arg)->executeThread();
|
((CThread *) arg)->executeThread();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t iAttributes;
|
int32_t iAttributes;
|
||||||
OSThread *pThread;
|
OSThread *pThread;
|
||||||
uint8_t *pThreadStack;
|
uint8_t *pThreadStack;
|
||||||
|
@ -38,6 +38,7 @@ void MemoryMappingFree(void* ptr){
|
|||||||
uint32_t MemoryMappingEffectiveToPhysical(uint32_t address) {
|
uint32_t MemoryMappingEffectiveToPhysical(uint32_t address) {
|
||||||
return MemoryMapping::EffectiveToPhysical(address);
|
return MemoryMapping::EffectiveToPhysical(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t MemoryMappingPhysicalToEffective(uint32_t address) {
|
uint32_t MemoryMappingPhysicalToEffective(uint32_t address) {
|
||||||
return MemoryMapping::PhysicalToEffective(address);
|
return MemoryMapping::PhysicalToEffective(address);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,8 @@ void MemoryMapping::searchEmptyMemoryRegions() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (startGood != 0 && (startGood != ea_start_address + ea_size)) {
|
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) {
|
} 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);
|
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