event_queue_t, event_port_t rewritten

This commit is contained in:
Nekotekina 2015-03-04 07:42:04 +03:00
parent 78c37ff8b6
commit ad38e9f0fe
22 changed files with 386 additions and 584 deletions

View file

@ -8,7 +8,7 @@ MemoryBase Memory;
u32 MemoryBase::InitRawSPU(MemoryBlock* raw_spu)
{
LV2_LOCK(0);
LV2_LOCK;
u32 index;
for (index = 0; index < sizeof(RawSPUMem) / sizeof(RawSPUMem[0]); index++)
@ -26,7 +26,7 @@ u32 MemoryBase::InitRawSPU(MemoryBlock* raw_spu)
void MemoryBase::CloseRawSPU(MemoryBlock* raw_spu, const u32 num)
{
LV2_LOCK(0);
LV2_LOCK;
for (int i = 0; i < MemoryBlocks.size(); ++i)
{
@ -41,8 +41,6 @@ void MemoryBase::CloseRawSPU(MemoryBlock* raw_spu, const u32 num)
void MemoryBase::Init(MemoryType type)
{
LV2_LOCK(0);
if (m_inited) return;
m_inited = true;
@ -88,8 +86,6 @@ void MemoryBase::Init(MemoryType type)
void MemoryBase::Close()
{
LV2_LOCK(0);
if (!m_inited) return;
m_inited = false;
@ -107,7 +103,7 @@ void MemoryBase::Close()
bool MemoryBase::WriteMMIO32(u32 addr, const u32 data)
{
LV2_LOCK(0);
LV2_LOCK;
if (RawSPUMem[(addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET] && ((RawSPUThread*)RawSPUMem[(addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET])->Write32(addr, data))
{
@ -119,7 +115,7 @@ bool MemoryBase::WriteMMIO32(u32 addr, const u32 data)
bool MemoryBase::ReadMMIO32(u32 addr, u32& result)
{
LV2_LOCK(0);
LV2_LOCK;
if (RawSPUMem[(addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET] && ((RawSPUThread*)RawSPUMem[(addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET])->Read32(addr, &result))
{
@ -133,7 +129,7 @@ bool MemoryBase::Map(const u32 addr, const u32 size)
{
assert(size && (size | addr) % 4096 == 0);
LV2_LOCK(0);
LV2_LOCK;
for (u32 i = addr / 4096; i < addr / 4096 + size / 4096; i++)
{
@ -151,7 +147,7 @@ bool MemoryBase::Map(const u32 addr, const u32 size)
bool MemoryBase::Unmap(const u32 addr)
{
LV2_LOCK(0);
LV2_LOCK;
for (u32 i = 0; i < MemoryBlocks.size(); i++)
{
@ -238,7 +234,7 @@ DynamicMemoryBlockBase::DynamicMemoryBlockBase()
const u32 DynamicMemoryBlockBase::GetUsedSize() const
{
LV2_LOCK(0);
LV2_LOCK;
u32 size = 0;
@ -257,7 +253,7 @@ bool DynamicMemoryBlockBase::IsInMyRange(const u32 addr, const u32 size)
MemoryBlock* DynamicMemoryBlockBase::SetRange(const u32 start, const u32 size)
{
LV2_LOCK(0);
LV2_LOCK;
m_max_size = PAGE_4K(size);
if (!MemoryBlock::SetRange(start, 0))
@ -271,7 +267,7 @@ MemoryBlock* DynamicMemoryBlockBase::SetRange(const u32 start, const u32 size)
void DynamicMemoryBlockBase::Delete()
{
LV2_LOCK(0);
LV2_LOCK;
m_allocated.clear();
m_max_size = 0;
@ -293,7 +289,7 @@ bool DynamicMemoryBlockBase::AllocFixed(u32 addr, u32 size)
return false;
}
LV2_LOCK(0);
LV2_LOCK;
for (u32 i = 0; i<m_allocated.size(); ++i)
{
@ -334,7 +330,7 @@ u32 DynamicMemoryBlockBase::AllocAlign(u32 size, u32 align)
exsize = size + align - 1;
}
LV2_LOCK(0);
LV2_LOCK;
for (u32 addr = MemoryBlock::GetStartAddr(); addr <= MemoryBlock::GetEndAddr() - exsize;)
{
@ -375,7 +371,7 @@ bool DynamicMemoryBlockBase::Alloc()
bool DynamicMemoryBlockBase::Free(u32 addr)
{
LV2_LOCK(0);
LV2_LOCK;
for (u32 num = 0; num < m_allocated.size(); num++)
{