Misc correctness improvement

Use let_<u64> for name_64 and prefer it when possible.
This commit is contained in:
Eladash 2019-07-08 20:00:27 +03:00 committed by kd-11
parent 9d9e158b9a
commit 6fba3dd90c
9 changed files with 26 additions and 26 deletions

View File

@ -765,7 +765,7 @@ void _spurs::event_helper_entry(ppu_thread& ppu, vm::ptr<CellSpurs> spurs)
s32 _spurs::create_event_helper(ppu_thread& ppu, vm::ptr<CellSpurs> spurs, u32 ppuPriority) s32 _spurs::create_event_helper(ppu_thread& ppu, vm::ptr<CellSpurs> spurs, u32 ppuPriority)
{ {
if (s32 rc = _spurs::create_lv2_eq(ppu, spurs, spurs.ptr(&CellSpurs::eventQueue), spurs.ptr(&CellSpurs::spuPort), 0x2A, sys_event_queue_attribute_t{ SYS_SYNC_PRIORITY, SYS_PPU_QUEUE, "_spuPrv" })) if (s32 rc = _spurs::create_lv2_eq(ppu, spurs, spurs.ptr(&CellSpurs::eventQueue), spurs.ptr(&CellSpurs::spuPort), 0x2A, sys_event_queue_attribute_t{ SYS_SYNC_PRIORITY, SYS_PPU_QUEUE, "_spuPrv\0"_u64 }))
{ {
return rc; return rc;
} }
@ -1014,7 +1014,7 @@ s32 _spurs::initialize(ppu_thread& ppu, vm::ptr<CellSpurs> spurs, u32 revision,
semAttr->pshared = SYS_SYNC_NOT_PROCESS_SHARED; semAttr->pshared = SYS_SYNC_NOT_PROCESS_SHARED;
semAttr->ipc_key = 0; semAttr->ipc_key = 0;
semAttr->flags = 0; semAttr->flags = 0;
std::memcpy(semAttr->name, "_spuWkl", 8); semAttr->name_u64 = "_spuWkl\0"_u64;
for (u32 i = 0; i < CELL_SPURS_MAX_WORKLOAD; i++) for (u32 i = 0; i < CELL_SPURS_MAX_WORKLOAD; i++)
{ {
@ -1037,7 +1037,7 @@ s32 _spurs::initialize(ppu_thread& ppu, vm::ptr<CellSpurs> spurs, u32 revision,
} }
// Create semaphore // Create semaphore
std::memcpy(semAttr->name, "_spuPrv", 8); semAttr->name_u64 = "_spuPrv\0"_u64;
if (s32 rc = sys_semaphore_create(sem, semAttr, 0, 1)) if (s32 rc = sys_semaphore_create(sem, semAttr, 0, 1))
{ {
return rollback(), rc; return rollback(), rc;
@ -1142,14 +1142,14 @@ s32 _spurs::initialize(ppu_thread& ppu, vm::ptr<CellSpurs> spurs, u32 revision,
const auto lwCond = spurs.ptr(&CellSpurs::cond); const auto lwCond = spurs.ptr(&CellSpurs::cond);
// Create a mutex to protect access to SPURS handler thread data // Create a mutex to protect access to SPURS handler thread data
if (s32 rc = sys_lwmutex_create(ppu, lwMutex, vm::make_var(sys_lwmutex_attribute_t{ SYS_SYNC_PRIORITY, SYS_SYNC_NOT_RECURSIVE, "_spuPrv" }))) if (s32 rc = sys_lwmutex_create(ppu, lwMutex, vm::make_var(sys_lwmutex_attribute_t{ SYS_SYNC_PRIORITY, SYS_SYNC_NOT_RECURSIVE, "_spuPrv\0"_u64 })))
{ {
_spurs::finalize_spu(ppu, spurs); _spurs::finalize_spu(ppu, spurs);
return rollback(), rc; return rollback(), rc;
} }
// Create condition variable to signal the SPURS handler thread // Create condition variable to signal the SPURS handler thread
if (s32 rc = sys_lwcond_create(ppu, lwCond, lwMutex, vm::make_var(sys_lwcond_attribute_t{ "_spuPrv" }))) if (s32 rc = sys_lwcond_create(ppu, lwCond, lwMutex, vm::make_var(sys_lwcond_attribute_t{ "_spuPrv\0"_u64 })))
{ {
sys_lwmutex_destroy(ppu, lwMutex); sys_lwmutex_destroy(ppu, lwMutex);
_spurs::finalize_spu(ppu, spurs); _spurs::finalize_spu(ppu, spurs);
@ -3046,7 +3046,7 @@ s32 cellSpursEventFlagAttachLv2EventQueue(ppu_thread& ppu, vm::ptr<CellSpursEven
return (rc & 0x0FFF0000) == 0x00410000 ? rc : (0x80410900 | (rc & 0xFF)); return (rc & 0x0FFF0000) == 0x00410000 ? rc : (0x80410900 | (rc & 0xFF));
}; };
if (s32 rc = _spurs::create_lv2_eq(ppu, spurs, eventQueueId, port, 1, sys_event_queue_attribute_t{ SYS_SYNC_PRIORITY, SYS_PPU_QUEUE, "_spuEvF" })) if (s32 rc = _spurs::create_lv2_eq(ppu, spurs, eventQueueId, port, 1, sys_event_queue_attribute_t{ SYS_SYNC_PRIORITY, SYS_PPU_QUEUE, "_spuEvF\0"_u64 }))
{ {
return failure(rc); return failure(rc);
} }

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "sys_sync.h" #include "sys_sync.h"
#include "sys_mutex.h" #include "sys_mutex.h"
@ -13,8 +13,8 @@ struct sys_cond_attribute_t
union union
{ {
char name[8]; le_t<u64> name_u64;
u64 name_u64; char name[sizeof(u64)];
}; };
}; };

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "sys_sync.h" #include "sys_sync.h"
@ -59,8 +59,8 @@ struct sys_event_queue_attribute_t
union union
{ {
char name[8]; le_t<u64> name_u64;
u64 name_u64; char name[sizeof(u64)];
}; };
}; };

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "sys_sync.h" #include "sys_sync.h"
@ -26,8 +26,8 @@ struct sys_event_flag_attribute_t
union union
{ {
char name[8]; le_t<u64> name_u64;
u64 name_u64; char name[sizeof(u64)];
}; };
}; };

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "sys_sync.h" #include "sys_sync.h"
@ -10,8 +10,8 @@ struct sys_lwcond_attribute_t
{ {
union union
{ {
char name[8]; le_t<u64> name_u64;
u64 name_u64; char name[sizeof(u64)];
}; };
}; };

View File

@ -11,8 +11,8 @@ struct sys_lwmutex_attribute_t
union union
{ {
char name[8]; le_t<u64> name_u64;
u64 name_u64; char name[sizeof(u64)];
}; };
}; };

View File

@ -16,8 +16,8 @@ struct sys_mutex_attribute_t
union union
{ {
char name[8]; le_t<u64> name_u64;
u64 name_u64; char name[sizeof(u64)];
}; };
}; };

View File

@ -14,8 +14,8 @@ struct sys_rwlock_attribute_t
union union
{ {
char name[8]; le_t<u64> name_u64;
u64 name_u64; char name[sizeof(u64)];
}; };
}; };

View File

@ -14,8 +14,8 @@ struct sys_semaphore_attribute_t
union union
{ {
char name[8]; le_t<u64> name_u64;
u64 name_u64; char name[sizeof(u64)];
}; };
}; };