kernel/shared_memory: Make data members private
Rather than allow unfettered access to the class internals, we hide all members by default and create and API that other code can operate against.
This commit is contained in:
parent
662c3ff684
commit
1cb9bea504
7 changed files with 31 additions and 18 deletions
|
@ -217,7 +217,7 @@ void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) {
|
|||
// shared font, different linear heap region would have required shared font to relocate
|
||||
// according to two different addresses at the same time, which is impossible.
|
||||
VAddr target_address =
|
||||
apt->shared_font_mem->linear_heap_phys_offset + Memory::LINEAR_HEAP_VADDR;
|
||||
apt->shared_font_mem->GetLinearHeapPhysicalOffset() + Memory::LINEAR_HEAP_VADDR;
|
||||
if (!apt->shared_font_relocated) {
|
||||
BCFNT::RelocateSharedFont(apt->shared_font_mem, target_address);
|
||||
apt->shared_font_relocated = true;
|
||||
|
|
|
@ -50,7 +50,7 @@ void HTTP_C::Initialize(Kernel::HLERequestContext& ctx) {
|
|||
u32 pid = rp.PopPID();
|
||||
shared_memory = rp.PopObject<Kernel::SharedMemory>();
|
||||
if (shared_memory) {
|
||||
shared_memory->name = "HTTP_C:shared_memory";
|
||||
shared_memory->SetName("HTTP_C:shared_memory");
|
||||
}
|
||||
|
||||
LOG_WARNING(Service_HTTP, "(STUBBED) called, shared memory size: {} pid: {}", shmem_size, pid);
|
||||
|
|
|
@ -240,7 +240,7 @@ void IR_USER::InitializeIrNopShared(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
|
||||
shared_memory->name = "IR_USER: shared memory";
|
||||
shared_memory->SetName("IR_USER: shared memory");
|
||||
|
||||
receive_buffer = std::make_unique<BufferManager>(shared_memory, 0x10, 0x20,
|
||||
recv_buff_packet_count, recv_buff_size);
|
||||
|
|
|
@ -40,7 +40,7 @@ struct MIC_U::Impl {
|
|||
shared_memory = rp.PopObject<Kernel::SharedMemory>();
|
||||
|
||||
if (shared_memory) {
|
||||
shared_memory->name = "MIC_U:shared_memory";
|
||||
shared_memory->SetName("MIC_U:shared_memory");
|
||||
}
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
|
|
|
@ -724,7 +724,7 @@ void NWM_UDS::InitializeWithVersion(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
initialized = true;
|
||||
|
||||
ASSERT_MSG(recv_buffer_memory->size == sharedmem_size, "Invalid shared memory size.");
|
||||
ASSERT_MSG(recv_buffer_memory->GetSize() == sharedmem_size, "Invalid shared memory size.");
|
||||
|
||||
if (auto room_member = Network::GetRoomMember().lock()) {
|
||||
wifi_packet_received = room_member->BindOnWifiPacketReceived(OnWifiPacketReceived);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue