mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 05:15:08 +01:00
Use Vector for Kernel Handles + Remove Redundant Includes
This commit is contained in:
parent
20559c5dca
commit
2764bd7c96
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
#include "skyline/loader/loader.h"
|
#include "skyline/loader/loader.h"
|
||||||
#include "skyline/common.h"
|
#include "skyline/common.h"
|
||||||
#include "skyline/os.h"
|
#include "skyline/os.h"
|
||||||
|
@ -3,12 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <queue>
|
|
||||||
#include <oboe/Oboe.h>
|
|
||||||
|
|
||||||
#include <kernel/types/KEvent.h>
|
|
||||||
#include <audio/track.h>
|
#include <audio/track.h>
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
namespace skyline::audio {
|
namespace skyline::audio {
|
||||||
/**
|
/**
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <common.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "adpcm_decoder.h"
|
#include "adpcm_decoder.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <span>
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
|
||||||
namespace skyline::audio {
|
namespace skyline::audio {
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <span>
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
|
||||||
namespace skyline::audio {
|
namespace skyline::audio {
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <common.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "resampler.h"
|
#include "resampler.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <span>
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
|
||||||
namespace skyline::audio {
|
namespace skyline::audio {
|
||||||
|
@ -19,7 +19,7 @@ namespace skyline::audio {
|
|||||||
|
|
||||||
bool AudioTrack::ContainsBuffer(u64 tag) {
|
bool AudioTrack::ContainsBuffer(u64 tag) {
|
||||||
// Iterate from front of queue as we don't want released samples
|
// Iterate from front of queue as we don't want released samples
|
||||||
for (auto identifier = identifiers.crbegin(); identifier != identifiers.crend(); ++identifier) {
|
for (auto identifier = identifiers.crbegin(); identifier != identifiers.crend(); identifier++) {
|
||||||
if (identifier->released)
|
if (identifier->released)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -3,10 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <span>
|
|
||||||
#include <queue>
|
|
||||||
#include <kernel/types/KEvent.h>
|
#include <kernel/types/KEvent.h>
|
||||||
#include <common.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
namespace skyline::audio {
|
namespace skyline::audio {
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
#include <functional>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -106,6 +107,7 @@ namespace skyline {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The value aligned up to the next multiple
|
* @return The value aligned up to the next multiple
|
||||||
|
* @note The multiple needs to be a power of 2
|
||||||
*/
|
*/
|
||||||
template<typename TypeVal, typename TypeMul>
|
template<typename TypeVal, typename TypeMul>
|
||||||
constexpr inline TypeVal AlignUp(TypeVal value, TypeMul multiple) {
|
constexpr inline TypeVal AlignUp(TypeVal value, TypeMul multiple) {
|
||||||
@ -115,6 +117,7 @@ namespace skyline {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The value aligned down to the previous multiple
|
* @return The value aligned down to the previous multiple
|
||||||
|
* @note The multiple needs to be a power of 2
|
||||||
*/
|
*/
|
||||||
template<typename TypeVal, typename TypeMul>
|
template<typename TypeVal, typename TypeMul>
|
||||||
constexpr inline TypeVal AlignDown(TypeVal value, TypeMul multiple) {
|
constexpr inline TypeVal AlignDown(TypeVal value, TypeMul multiple) {
|
||||||
@ -178,7 +181,7 @@ namespace skyline {
|
|||||||
if (hexString.size() != Size * 2)
|
if (hexString.size() != Size * 2)
|
||||||
throw exception("Invalid size");
|
throw exception("Invalid size");
|
||||||
std::array<u8, Size> result;
|
std::array<u8, Size> result;
|
||||||
for (size_t i{}; i < Size; ++i) {
|
for (size_t i{}; i < Size; i++) {
|
||||||
size_t hexStrIndex{i * 2};
|
size_t hexStrIndex{i * 2};
|
||||||
result[i] = (HexDigitToByte(hexString[hexStrIndex]) << 4) | HexDigitToByte(hexString[hexStrIndex + 1]);
|
result[i] = (HexDigitToByte(hexString[hexStrIndex]) << 4) | HexDigitToByte(hexString[hexStrIndex + 1]);
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <span>
|
|
||||||
#include <mbedtls/cipher.h>
|
#include <mbedtls/cipher.h>
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
#include <vfs/os_filesystem.h>
|
#include <vfs/os_filesystem.h>
|
||||||
#include "key_store.h"
|
#include "key_store.h"
|
||||||
|
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <vfs/backing.h>
|
#include <vfs/backing.h>
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
namespace skyline::crypto {
|
namespace skyline::crypto {
|
||||||
/**
|
/**
|
||||||
|
@ -3,16 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <queue>
|
|
||||||
#include <android/native_window.h>
|
#include <android/native_window.h>
|
||||||
#include <kernel/ipc.h>
|
|
||||||
#include <kernel/types/KEvent.h>
|
#include <kernel/types/KEvent.h>
|
||||||
#include <services/nvdrv/devices/nvmap.h>
|
#include <services/nvdrv/devices/nvmap.h>
|
||||||
#include "gpu/texture.h"
|
|
||||||
#include "gpu/memory_manager.h"
|
#include "gpu/memory_manager.h"
|
||||||
#include "gpu/gpfifo.h"
|
#include "gpu/gpfifo.h"
|
||||||
#include "gpu/syncpoint.h"
|
#include "gpu/syncpoint.h"
|
||||||
#include "gpu/engines/engine.h"
|
|
||||||
#include "gpu/engines/maxwell_3d.h"
|
#include "gpu/engines/maxwell_3d.h"
|
||||||
|
|
||||||
namespace skyline::gpu {
|
namespace skyline::gpu {
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <common.h>
|
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
namespace skyline {
|
namespace skyline {
|
||||||
@ -179,4 +177,4 @@ namespace skyline {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <gpu.h>
|
#include <gpu.h>
|
||||||
#include <gpu/syncpoint.h>
|
|
||||||
#include "maxwell_3d.h"
|
#include "maxwell_3d.h"
|
||||||
|
|
||||||
namespace skyline::gpu::engine {
|
namespace skyline::gpu::engine {
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <common.h>
|
|
||||||
#include <gpu/texture.h>
|
#include <gpu/texture.h>
|
||||||
#include <gpu/macro_interpreter.h>
|
#include <gpu/macro_interpreter.h>
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
@ -561,7 +559,7 @@ namespace skyline {
|
|||||||
static_assert(sizeof(Registers) == (constant::Maxwell3DRegisterCounter * sizeof(u32)));
|
static_assert(sizeof(Registers) == (constant::Maxwell3DRegisterCounter * sizeof(u32)));
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
Registers registers{}; //!< The maxwell 3D register space
|
Registers registers{}; //!< The Maxwell 3D register space
|
||||||
Registers shadowRegisters{}; //!< The shadow registers, their function is controlled by the 'shadowRamControl' register
|
Registers shadowRegisters{}; //!< The shadow registers, their function is controlled by the 'shadowRamControl' register
|
||||||
|
|
||||||
std::array<u32, 0x10000> macroCode{}; //!< This is used to store GPU macros, the 256kb size is from Ryujinx
|
std::array<u32, 0x10000> macroCode{}; //!< This is used to store GPU macros, the 256kb size is from Ryujinx
|
||||||
@ -576,4 +574,4 @@ namespace skyline {
|
|||||||
void CallMethod(MethodParams params);
|
void CallMethod(MethodParams params);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include "engines/engine.h"
|
#include "engines/engine.h"
|
||||||
#include "engines/gpfifo.h"
|
#include "engines/gpfifo.h"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include "engines/maxwell_3d.h"
|
#include "engines/maxwell_3d.h"
|
||||||
#include "memory_manager.h"
|
#include "memory_manager.h"
|
||||||
#include "macro_interpreter.h"
|
#include "macro_interpreter.h"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include "syncpoint.h"
|
#include "syncpoint.h"
|
||||||
|
|
||||||
namespace skyline::gpu {
|
namespace skyline::gpu {
|
||||||
|
@ -24,8 +24,8 @@ namespace skyline {
|
|||||||
std::function<void()> callback;
|
std::function<void()> callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
Mutex waiterLock{}; //!< Locks insertions and deletions of waiters
|
Mutex waiterLock; //!< Locks insertions and deletions of waiters
|
||||||
std::map<u64, Waiter> waiterMap{};
|
std::map<u64, Waiter> waiterMap;
|
||||||
u64 nextWaiterId{1};
|
u64 nextWaiterId{1};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
|
||||||
namespace skyline {
|
namespace skyline {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <input.h>
|
|
||||||
#include "touch.h"
|
#include "touch.h"
|
||||||
|
|
||||||
namespace skyline::input {
|
namespace skyline::input {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include "shared_mem.h"
|
#include "shared_mem.h"
|
||||||
|
|
||||||
namespace skyline::input {
|
namespace skyline::input {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
|
||||||
namespace skyline {
|
namespace skyline {
|
||||||
|
@ -56,7 +56,7 @@ namespace skyline::kernel {
|
|||||||
if (chunk->address <= address && (chunk->address + chunk->size) > address)
|
if (chunk->address <= address && (chunk->address + chunk->size) > address)
|
||||||
chunk = chunkList.erase(chunk);
|
chunk = chunkList.erase(chunk);
|
||||||
else
|
else
|
||||||
++chunk;
|
chunk++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ namespace skyline::kernel {
|
|||||||
if (block->address > endAddress)
|
if (block->address > endAddress)
|
||||||
block = chunk->blockList.erase(block);
|
block = chunk->blockList.erase(block);
|
||||||
else
|
else
|
||||||
++block;
|
block++;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto end = std::prev(chunk->blockList.end());
|
auto end = std::prev(chunk->blockList.end());
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <forward_list>
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include "types/KObject.h"
|
|
||||||
|
|
||||||
namespace skyline {
|
namespace skyline {
|
||||||
namespace memory {
|
namespace memory {
|
||||||
|
@ -114,7 +114,6 @@ namespace skyline::kernel::svc {
|
|||||||
auto object = state.process->GetMemoryObject(source);
|
auto object = state.process->GetMemoryObject(source);
|
||||||
if (!object)
|
if (!object)
|
||||||
throw exception("svcMapMemory: Cannot find memory object in handle table for address 0x{:X}", source);
|
throw exception("svcMapMemory: Cannot find memory object in handle table for address 0x{:X}", source);
|
||||||
|
|
||||||
object->item->UpdatePermission(source, size, {false, false, false});
|
object->item->UpdatePermission(source, size, {false, false, false});
|
||||||
|
|
||||||
state.logger->Debug("svcMapMemory: Mapped range 0x{:X} - 0x{:X} to 0x{:X} - 0x{:X} (Size: 0x{:X} bytes)", source, source + size, destination, destination + size, size);
|
state.logger->Debug("svcMapMemory: Mapped range 0x{:X} - 0x{:X} to 0x{:X} - 0x{:X} (Size: 0x{:X} bytes)", source, source + size, destination, destination + size, size);
|
||||||
@ -376,7 +375,7 @@ namespace skyline::kernel::svc {
|
|||||||
void CloseHandle(DeviceState &state) {
|
void CloseHandle(DeviceState &state) {
|
||||||
auto handle = static_cast<KHandle>(state.ctx->registers.w0);
|
auto handle = static_cast<KHandle>(state.ctx->registers.w0);
|
||||||
try {
|
try {
|
||||||
state.process->handles.erase(handle);
|
state.process->DeleteHandle(handle);
|
||||||
state.logger->Debug("svcCloseHandle: Closing handle: 0x{:X}", handle);
|
state.logger->Debug("svcCloseHandle: Closing handle: 0x{:X}", handle);
|
||||||
state.ctx->registers.w0 = Result{};
|
state.ctx->registers.w0 = Result{};
|
||||||
} catch (const std::exception &) {
|
} catch (const std::exception &) {
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include "ipc.h"
|
|
||||||
|
|
||||||
namespace skyline {
|
namespace skyline {
|
||||||
namespace constant::infoState {
|
namespace constant::infoState {
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <asm/unistd.h>
|
#include <asm/unistd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
|
#include <nce.h>
|
||||||
#include "KPrivateMemory.h"
|
#include "KPrivateMemory.h"
|
||||||
#include "KProcess.h"
|
#include "KProcess.h"
|
||||||
|
|
||||||
|
@ -165,8 +165,8 @@ namespace skyline::kernel::type {
|
|||||||
if (size <= PAGE_SIZE) {
|
if (size <= PAGE_SIZE) {
|
||||||
std::vector<u8> buffer(size);
|
std::vector<u8> buffer(size);
|
||||||
|
|
||||||
state.process->ReadMemory(buffer.data(), source, size);
|
ReadMemory(buffer.data(), source, size);
|
||||||
state.process->WriteMemory(buffer.data(), destination, size);
|
WriteMemory(buffer.data(), destination, size);
|
||||||
} else {
|
} else {
|
||||||
Registers fregs{
|
Registers fregs{
|
||||||
.x0 = source,
|
.x0 = source,
|
||||||
@ -180,20 +180,21 @@ namespace skyline::kernel::type {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::optional<KProcess::HandleOut<KMemory>> KProcess::GetMemoryObject(u64 address) {
|
std::optional<KProcess::HandleOut<KMemory>> KProcess::GetMemoryObject(u64 address) {
|
||||||
for (auto&[handle, object] : state.process->handles) {
|
for (KHandle index{}; index < handles.size(); index++) {
|
||||||
|
auto& object = handles[index];
|
||||||
switch (object->objectType) {
|
switch (object->objectType) {
|
||||||
case type::KType::KPrivateMemory:
|
case type::KType::KPrivateMemory:
|
||||||
case type::KType::KSharedMemory:
|
case type::KType::KSharedMemory:
|
||||||
case type::KType::KTransferMemory: {
|
case type::KType::KTransferMemory: {
|
||||||
auto mem = std::static_pointer_cast<type::KMemory>(object);
|
auto mem = std::static_pointer_cast<type::KMemory>(object);
|
||||||
if (mem->IsInside(address))
|
if (mem->IsInside(address))
|
||||||
return std::make_optional<KProcess::HandleOut<KMemory>>({mem, handle});
|
return std::make_optional<KProcess::HandleOut<KMemory>>({mem, constant::BaseHandleIndex + index});
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +214,7 @@ namespace skyline::kernel::type {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::shared_ptr<WaitStatus> status;
|
std::shared_ptr<WaitStatus> status;
|
||||||
for (auto it = mtxWaiters.begin();; ++it) {
|
for (auto it = mtxWaiters.begin();; it++) {
|
||||||
if (it != mtxWaiters.end() && (*it)->priority >= state.thread->priority)
|
if (it != mtxWaiters.end() && (*it)->priority >= state.thread->priority)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -227,7 +228,7 @@ namespace skyline::kernel::type {
|
|||||||
lock.lock();
|
lock.lock();
|
||||||
status->flag = false;
|
status->flag = false;
|
||||||
|
|
||||||
for (auto it = mtxWaiters.begin(); it != mtxWaiters.end(); ++it) {
|
for (auto it = mtxWaiters.begin(); it != mtxWaiters.end(); it++) {
|
||||||
if ((*it)->handle == state.thread->handle) {
|
if ((*it)->handle == state.thread->handle) {
|
||||||
mtxWaiters.erase(it);
|
mtxWaiters.erase(it);
|
||||||
break;
|
break;
|
||||||
@ -270,7 +271,7 @@ namespace skyline::kernel::type {
|
|||||||
auto &condWaiters = conditionals[conditionalAddress];
|
auto &condWaiters = conditionals[conditionalAddress];
|
||||||
|
|
||||||
std::shared_ptr<WaitStatus> status;
|
std::shared_ptr<WaitStatus> status;
|
||||||
for (auto it = condWaiters.begin();; ++it) {
|
for (auto it = condWaiters.begin();; it++) {
|
||||||
if (it != condWaiters.end() && (*it)->priority >= state.thread->priority)
|
if (it != condWaiters.end() && (*it)->priority >= state.thread->priority)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -294,7 +295,7 @@ namespace skyline::kernel::type {
|
|||||||
else
|
else
|
||||||
status->flag = false;
|
status->flag = false;
|
||||||
|
|
||||||
for (auto it = condWaiters.begin(); it != condWaiters.end(); ++it) {
|
for (auto it = condWaiters.begin(); it != condWaiters.end(); it++) {
|
||||||
if ((*it)->handle == state.thread->handle) {
|
if ((*it)->handle == state.thread->handle) {
|
||||||
condWaiters.erase(it);
|
condWaiters.erase(it);
|
||||||
break;
|
break;
|
||||||
@ -339,7 +340,7 @@ namespace skyline::kernel::type {
|
|||||||
auto &mtxWaiters = mutexes[thread->mutexAddress];
|
auto &mtxWaiters = mutexes[thread->mutexAddress];
|
||||||
std::shared_ptr<WaitStatus> status;
|
std::shared_ptr<WaitStatus> status;
|
||||||
|
|
||||||
for (auto it = mtxWaiters.begin();; ++it) {
|
for (auto it = mtxWaiters.begin();; it++) {
|
||||||
if (it != mtxWaiters.end() && (*it)->priority >= thread->priority)
|
if (it != mtxWaiters.end() && (*it)->priority >= thread->priority)
|
||||||
continue;
|
continue;
|
||||||
status = std::make_shared<WaitStatus>(thread->priority, thread->handle);
|
status = std::make_shared<WaitStatus>(thread->priority, thread->handle);
|
||||||
@ -352,7 +353,7 @@ namespace skyline::kernel::type {
|
|||||||
mtxLock.lock();
|
mtxLock.lock();
|
||||||
status->flag = false;
|
status->flag = false;
|
||||||
|
|
||||||
for (auto it = mtxWaiters.begin(); it != mtxWaiters.end(); ++it) {
|
for (auto it = mtxWaiters.begin(); it != mtxWaiters.end(); it++) {
|
||||||
if ((*it)->handle == thread->handle) {
|
if ((*it)->handle == thread->handle) {
|
||||||
mtxWaiters.erase(it);
|
mtxWaiters.erase(it);
|
||||||
break;
|
break;
|
||||||
|
@ -4,11 +4,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <kernel/memory.h>
|
|
||||||
#include "KThread.h"
|
#include "KThread.h"
|
||||||
#include "KPrivateMemory.h"
|
#include "KPrivateMemory.h"
|
||||||
#include "KTransferMemory.h"
|
#include "KTransferMemory.h"
|
||||||
#include "KSharedMemory.h"
|
|
||||||
#include "KSession.h"
|
#include "KSession.h"
|
||||||
#include "KEvent.h"
|
#include "KEvent.h"
|
||||||
|
|
||||||
@ -26,6 +24,8 @@ namespace skyline {
|
|||||||
*/
|
*/
|
||||||
class KProcess : public KSyncObject {
|
class KProcess : public KSyncObject {
|
||||||
private:
|
private:
|
||||||
|
KHandle handleIndex = constant::BaseHandleIndex; //!< This is used to keep track of what to map as an handle
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This class holds a single TLS page's status
|
* @brief This class holds a single TLS page's status
|
||||||
* @details tls_page_t holds the status of a single TLS page (A page is 4096 bytes on ARMv8).
|
* @details tls_page_t holds the status of a single TLS page (A page is 4096 bytes on ARMv8).
|
||||||
@ -110,10 +110,9 @@ namespace skyline {
|
|||||||
WaitStatus(u8 priority, KHandle handle, u64 mutexAddress) : priority(priority), handle(handle), mutexAddress(mutexAddress) {}
|
WaitStatus(u8 priority, KHandle handle, u64 mutexAddress) : priority(priority), handle(handle), mutexAddress(mutexAddress) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
KHandle handleIndex = constant::BaseHandleIndex; //!< This is used to keep track of what to map as an handle
|
|
||||||
pid_t pid; //!< The PID of the process or TGID of the threads
|
pid_t pid; //!< The PID of the process or TGID of the threads
|
||||||
int memFd; //!< The file descriptor to the memory of the process
|
int memFd; //!< The file descriptor to the memory of the process
|
||||||
std::unordered_map<KHandle, std::shared_ptr<KObject>> handles; //!< A mapping from a handle_t to it's corresponding KObject which is the actual underlying object
|
std::vector<std::shared_ptr<KObject>> handles; //!< A vector of KObject which corresponds to the handle
|
||||||
std::unordered_map<pid_t, std::shared_ptr<KThread>> threads; //!< A mapping from a PID to it's corresponding KThread object
|
std::unordered_map<pid_t, std::shared_ptr<KThread>> threads; //!< A mapping from a PID to it's corresponding KThread object
|
||||||
std::unordered_map<u64, std::vector<std::shared_ptr<WaitStatus>>> mutexes; //!< A map from a mutex's address to a vector of Mutex objects for threads waiting on it
|
std::unordered_map<u64, std::vector<std::shared_ptr<WaitStatus>>> mutexes; //!< A map from a mutex's address to a vector of Mutex objects for threads waiting on it
|
||||||
std::unordered_map<u64, std::list<std::shared_ptr<WaitStatus>>> conditionals; //!< A map from a conditional variable's address to a vector of threads waiting on it
|
std::unordered_map<u64, std::list<std::shared_ptr<WaitStatus>>> conditionals; //!< A map from a conditional variable's address to a vector of threads waiting on it
|
||||||
@ -285,7 +284,7 @@ namespace skyline {
|
|||||||
item = std::make_shared<objectClass>(state, handleIndex, args...);
|
item = std::make_shared<objectClass>(state, handleIndex, args...);
|
||||||
else
|
else
|
||||||
item = std::make_shared<objectClass>(state, args...);
|
item = std::make_shared<objectClass>(state, args...);
|
||||||
handles[handleIndex] = std::static_pointer_cast<KObject>(item);
|
handles.push_back(std::static_pointer_cast<KObject>(item));
|
||||||
return {item, handleIndex++};
|
return {item, handleIndex++};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,7 +295,7 @@ namespace skyline {
|
|||||||
*/
|
*/
|
||||||
template<typename objectClass>
|
template<typename objectClass>
|
||||||
KHandle InsertItem(std::shared_ptr<objectClass> &item) {
|
KHandle InsertItem(std::shared_ptr<objectClass> &item) {
|
||||||
handles[handleIndex] = std::static_pointer_cast<KObject>(item);
|
handles.push_back(std::static_pointer_cast<KObject>(item));
|
||||||
return handleIndex++;
|
return handleIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,13 +325,15 @@ namespace skyline {
|
|||||||
else
|
else
|
||||||
throw exception("KProcess::GetHandle couldn't determine object type");
|
throw exception("KProcess::GetHandle couldn't determine object type");
|
||||||
try {
|
try {
|
||||||
auto item = handles.at(handle);
|
auto& item = handles.at(handle - constant::BaseHandleIndex);
|
||||||
if (item->objectType == objectType)
|
if (item != nullptr && item->objectType == objectType)
|
||||||
return std::static_pointer_cast<objectClass>(item);
|
return std::static_pointer_cast<objectClass>(item);
|
||||||
|
else if (item == nullptr)
|
||||||
|
throw exception("GetHandle was called with a deleted handle: 0x{:X}", handle);
|
||||||
else
|
else
|
||||||
throw exception("Tried to get kernel object (0x{:X}) with different type: {} when object is {}", handle, objectType, item->objectType);
|
throw exception("Tried to get kernel object (0x{:X}) with different type: {} when object is {}", handle, objectType, item->objectType);
|
||||||
} catch (std::out_of_range) {
|
} catch (std::out_of_range) {
|
||||||
throw exception("GetHandle was called with invalid handle: 0x{:X}", handle);
|
throw exception("GetHandle was called with an invalid handle: 0x{:X}", handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,7 +349,7 @@ namespace skyline {
|
|||||||
* @param handle The handle to delete
|
* @param handle The handle to delete
|
||||||
*/
|
*/
|
||||||
inline void DeleteHandle(KHandle handle) {
|
inline void DeleteHandle(KHandle handle) {
|
||||||
handles.erase(handle);
|
handles.at(handle - constant::BaseHandleIndex) = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,10 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include "KSyncObject.h"
|
#include "KSyncObject.h"
|
||||||
|
|
||||||
|
namespace skyline::service {
|
||||||
|
class BaseService;
|
||||||
|
}
|
||||||
|
|
||||||
namespace skyline::kernel::type {
|
namespace skyline::kernel::type {
|
||||||
/**
|
/**
|
||||||
* @brief KService holds a reference to a service, this is equivalent to KClientSession
|
* @brief KService holds a reference to a service, this is equivalent to KClientSession
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <asm/unistd.h>
|
#include <asm/unistd.h>
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
|
#include <nce.h>
|
||||||
#include "KSharedMemory.h"
|
#include "KSharedMemory.h"
|
||||||
#include "KProcess.h"
|
#include "KProcess.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include "KObject.h"
|
#include "KObject.h"
|
||||||
|
|
||||||
namespace skyline::kernel::type {
|
namespace skyline::kernel::type {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vfs/backing.h>
|
|
||||||
#include <vfs/nacp.h>
|
#include <vfs/nacp.h>
|
||||||
#include "executable.h"
|
#include "executable.h"
|
||||||
|
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include <vfs/nca.h>
|
#include <vfs/nca.h>
|
||||||
#include <crypto/key_store.h>
|
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
|
|
||||||
namespace skyline::loader {
|
namespace skyline::loader {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
|
|
||||||
namespace skyline::loader {
|
namespace skyline::loader {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
|
|
||||||
namespace skyline::loader {
|
namespace skyline::loader {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include <vfs/nca.h>
|
#include <vfs/nca.h>
|
||||||
#include <vfs/rom_filesystem.h>
|
#include <vfs/rom_filesystem.h>
|
||||||
#include <vfs/partition_filesystem.h>
|
#include <vfs/partition_filesystem.h>
|
||||||
|
@ -3,12 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <syslog.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <vector>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include "common.h"
|
|
||||||
#include "kernel/types/KSharedMemory.h"
|
#include "kernel/types/KSharedMemory.h"
|
||||||
|
|
||||||
namespace skyline {
|
namespace skyline {
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "loader/nso.h"
|
#include "loader/nso.h"
|
||||||
#include "loader/nca.h"
|
#include "loader/nca.h"
|
||||||
#include "loader/nsp.h"
|
#include "loader/nsp.h"
|
||||||
|
#include "nce.h"
|
||||||
#include "nce/guest.h"
|
#include "nce/guest.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <thread>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "loader/loader.h"
|
#include "loader/loader.h"
|
||||||
#include "kernel/ipc.h"
|
#include "kernel/ipc.h"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include "IManagerForApplication.h"
|
#include "IManagerForApplication.h"
|
||||||
#include "IProfile.h"
|
#include "IProfile.h"
|
||||||
#include "IAccountServiceForApplication.h"
|
#include "IAccountServiceForApplication.h"
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline {
|
namespace skyline {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::account {
|
namespace skyline::service::account {
|
||||||
@ -14,4 +13,4 @@ namespace skyline::service::account {
|
|||||||
public:
|
public:
|
||||||
IManagerForApplication(const DeviceState &state, ServiceManager &manager);
|
IManagerForApplication(const DeviceState &state, ServiceManager &manager);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include "IProfile.h"
|
#include "IProfile.h"
|
||||||
|
|
||||||
namespace skyline::service::account {
|
namespace skyline::service::account {
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "IAccountServiceForApplication.h"
|
#include "IAccountServiceForApplication.h"
|
||||||
#include <services/base_service.h>
|
|
||||||
|
|
||||||
namespace skyline::service::account {
|
namespace skyline::service::account {
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <kernel/types/KEvent.h>
|
#include <kernel/types/KEvent.h>
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <kernel/types/KEvent.h>
|
#include <kernel/types/KEvent.h>
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <kernel/types/KEvent.h>
|
#include <kernel/types/KEvent.h>
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
@ -33,7 +32,7 @@ namespace skyline::service::am {
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::shared_ptr<type::KEvent> messageEvent; //!< The event signalled when there is a message available
|
std::shared_ptr<type::KEvent> messageEvent; //!< The event signalled when there is a message available
|
||||||
std::queue<Message> messageQueue;
|
std::queue<Message> messageQueue; //!< A queue of all the messages that the program is yet to consume
|
||||||
|
|
||||||
enum class FocusState : u8 {
|
enum class FocusState : u8 {
|
||||||
InFocus = 1, //!< The application is in foreground
|
InFocus = 1, //!< The application is in foreground
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <os.h>
|
#include <kernel/types/KProcess.h>
|
||||||
#include <services/hosbinder/GraphicBufferProducer.h>
|
#include <services/hosbinder/GraphicBufferProducer.h>
|
||||||
#include "ISelfController.h"
|
#include "ISelfController.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include "IStorage.h"
|
#include "IStorage.h"
|
||||||
#include "IStorageAccessor.h"
|
#include "IStorageAccessor.h"
|
||||||
|
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::am {
|
namespace skyline::service::am {
|
||||||
namespace result {
|
namespace result {
|
||||||
constexpr Result OutOfBounds(128, 503);
|
constexpr Result OutOfBounds(128, 503);
|
||||||
}
|
}
|
||||||
|
|
||||||
class IStorage;
|
class IStorage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::aocsrv {
|
namespace skyline::service::aocsrv {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::apm {
|
namespace skyline::service::apm {
|
||||||
|
@ -10,7 +10,7 @@ namespace skyline::service::apm {
|
|||||||
auto mode = request.Pop<u32>();
|
auto mode = request.Pop<u32>();
|
||||||
auto config = request.Pop<u32>();
|
auto config = request.Pop<u32>();
|
||||||
performanceConfig.at(mode) = config;
|
performanceConfig.at(mode) = config;
|
||||||
state.logger->Info("SetPerformanceConfiguration called with 0x{:X} ({})", config, mode ? "Docked" : "Handheld");
|
state.logger->Info("Performance configuration set to 0x{:X} ({})", config, mode ? "Docked" : "Handheld");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::apm {
|
namespace skyline::service::apm {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::audio {
|
namespace skyline::service::audio {
|
||||||
|
@ -19,13 +19,13 @@ namespace skyline::service::audio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result IAudioOut::StartAudioOut(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
Result IAudioOut::StartAudioOut(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
state.logger->Debug("IAudioOut: Start playback");
|
state.logger->Debug("Start playback");
|
||||||
track->Start();
|
track->Start();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
Result IAudioOut::StopAudioOut(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
Result IAudioOut::StopAudioOut(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
state.logger->Debug("IAudioOut: Stop playback");
|
state.logger->Debug("Stop playback");
|
||||||
track->Stop();
|
track->Stop();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@ namespace skyline::service::audio {
|
|||||||
} &data{request.inputBuf.at(0).as<Data>()};
|
} &data{request.inputBuf.at(0).as<Data>()};
|
||||||
auto tag = request.Pop<u64>();
|
auto tag = request.Pop<u64>();
|
||||||
|
|
||||||
state.logger->Debug("IAudioOut: Appending buffer with address: 0x{:X}, size: 0x{:X}", data.sampleBufferPtr, data.sampleSize);
|
state.logger->Debug("Appending buffer with address: 0x{:X}, size: 0x{:X}", data.sampleBufferPtr, data.sampleSize);
|
||||||
|
|
||||||
if (sampleRate != constant::SampleRate) {
|
if (sampleRate != constant::SampleRate) {
|
||||||
auto resampledBuffer = resampler.ResampleBuffer(span(state.process->GetPointer<i16>(data.sampleBufferPtr), data.sampleSize / sizeof(i16)), static_cast<double>(sampleRate) / constant::SampleRate, channelCount);
|
auto resampledBuffer = resampler.ResampleBuffer(span(state.process->GetPointer<i16>(data.sampleBufferPtr), data.sampleSize / sizeof(i16)), static_cast<double>(sampleRate) / constant::SampleRate, channelCount);
|
||||||
@ -54,7 +54,7 @@ namespace skyline::service::audio {
|
|||||||
|
|
||||||
Result IAudioOut::RegisterBufferEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
Result IAudioOut::RegisterBufferEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
auto handle{state.process->InsertItem(releaseEvent)};
|
auto handle{state.process->InsertItem(releaseEvent)};
|
||||||
state.logger->Debug("IAudioOut: Buffer Release Event Handle: 0x{:X}", handle);
|
state.logger->Debug("Buffer Release Event Handle: 0x{:X}", handle);
|
||||||
response.copyHandles.push_back(handle);
|
response.copyHandles.push_back(handle);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <kernel/types/KEvent.h>
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
#include <audio/resampler.h>
|
#include <audio/resampler.h>
|
||||||
#include <audio.h>
|
#include <audio.h>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <kernel/types/KEvent.h>
|
#include <kernel/types/KEvent.h>
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline {
|
namespace skyline {
|
||||||
|
@ -173,7 +173,7 @@ namespace skyline::service::audio::IAudioRenderer {
|
|||||||
|
|
||||||
Result IAudioRenderer::QuerySystemEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
Result IAudioRenderer::QuerySystemEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
auto handle{state.process->InsertItem(systemEvent)};
|
auto handle{state.process->InsertItem(systemEvent)};
|
||||||
state.logger->Debug("Audren System Event Handle: 0x{:X}", handle);
|
state.logger->Debug("System Event Handle: 0x{:X}", handle);
|
||||||
response.copyHandles.push_back(handle);
|
response.copyHandles.push_back(handle);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <kernel/types/KEvent.h>
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
#include <audio.h>
|
#include <audio.h>
|
||||||
#include "memory_pool.h"
|
#include "memory_pool.h"
|
||||||
|
@ -3,11 +3,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <audio/resampler.h>
|
#include <audio/resampler.h>
|
||||||
#include <audio/adpcm_decoder.h>
|
#include <audio/adpcm_decoder.h>
|
||||||
#include <audio.h>
|
#include <audio.h>
|
||||||
#include <common.h>
|
|
||||||
|
|
||||||
namespace skyline::service::audio::IAudioRenderer {
|
namespace skyline::service::audio::IAudioRenderer {
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include "IAudioRenderer/IAudioRenderer.h"
|
#include "IAudioRenderer/IAudioRenderer.h"
|
||||||
#include "IAudioDevice.h"
|
#include "IAudioDevice.h"
|
||||||
#include "IAudioRendererManager.h"
|
#include "IAudioRendererManager.h"
|
||||||
@ -51,7 +50,6 @@ namespace skyline::service::audio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
i64 splitterWorkSize{};
|
i64 splitterWorkSize{};
|
||||||
|
|
||||||
if (revisionInfo.SplitterSupported()) {
|
if (revisionInfo.SplitterSupported()) {
|
||||||
splitterWorkSize += params.splitterDestinationDataCount * 0xE0 + params.splitterCount * 0x20;
|
splitterWorkSize += params.splitterDestinationDataCount * 0xE0 + params.splitterCount * 0x20;
|
||||||
|
|
||||||
@ -63,7 +61,6 @@ namespace skyline::service::audio {
|
|||||||
|
|
||||||
if (params.performanceManagerCount > 0) {
|
if (params.performanceManagerCount > 0) {
|
||||||
i64 performanceMetricsBufferSize{};
|
i64 performanceMetricsBufferSize{};
|
||||||
|
|
||||||
if (revisionInfo.UsesPerformanceMetricDataFormatV2()) {
|
if (revisionInfo.UsesPerformanceMetricDataFormatV2()) {
|
||||||
performanceMetricsBufferSize = (params.voiceCount + params.effectCount + totalMixCount + params.sinkCount) + 0x990;
|
performanceMetricsBufferSize = (params.voiceCount + params.effectCount + totalMixCount + params.sinkCount) + 0x990;
|
||||||
} else {
|
} else {
|
||||||
@ -81,7 +78,7 @@ namespace skyline::service::audio {
|
|||||||
|
|
||||||
size = util::AlignUp(size, 0x1000);
|
size = util::AlignUp(size, 0x1000);
|
||||||
|
|
||||||
state.logger->Debug("IAudioRendererManager: Work buffer size: 0x{:X}", size);
|
state.logger->Debug("Work buffer size: 0x{:X}", size);
|
||||||
response.Push<i64>(size);
|
response.Push<i64>(size);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::audio {
|
namespace skyline::service::audio {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
|
#include <cxxabi.h>
|
||||||
#include "base_service.h"
|
#include "base_service.h"
|
||||||
|
|
||||||
namespace skyline::service {
|
namespace skyline::service {
|
||||||
|
@ -3,10 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
#include <cxxabi.h>
|
|
||||||
#include <kernel/ipc.h>
|
#include <kernel/ipc.h>
|
||||||
#include <common.h>
|
|
||||||
|
|
||||||
#define SFUNC(id, Class, Function) std::pair<u32, std::pair<std::function<Result(Class*, type::KSession &, ipc::IpcRequest &, ipc::IpcResponse &)>, std::string_view>>{id, {&Class::Function, #Function}}
|
#define SFUNC(id, Class, Function) std::pair<u32, std::pair<std::function<Result(Class*, type::KSession &, ipc::IpcRequest &, ipc::IpcResponse &)>, std::string_view>>{id, {&Class::Function, #Function}}
|
||||||
#define SFUNC_BASE(id, Class, BaseClass, Function) std::pair<u32, std::pair<std::function<Result(Class*, type::KSession &, ipc::IpcRequest &, ipc::IpcResponse &)>, std::string_view>>{id, {&CallBaseFunction<Class, BaseClass, decltype(&BaseClass::Function), &BaseClass::Function>, #Function}}
|
#define SFUNC_BASE(id, Class, BaseClass, Function) std::pair<u32, std::pair<std::function<Result(Class*, type::KSession &, ipc::IpcRequest &, ipc::IpcResponse &)>, std::string_view>>{id, {&CallBaseFunction<Class, BaseClass, decltype(&BaseClass::Function), &BaseClass::Function>, #Function}}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include <services/nvdrv/devices/nvhost_syncpoint.h>
|
#include <services/nvdrv/devices/nvhost_syncpoint.h>
|
||||||
|
|
||||||
namespace skyline::service::nvdrv {
|
namespace skyline::service::nvdrv {
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <os.h>
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include "parcel.h"
|
#include "parcel.h"
|
||||||
|
|
||||||
namespace skyline::service {
|
namespace skyline::service {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include <kernel/ipc.h>
|
#include <kernel/ipc.h>
|
||||||
|
|
||||||
namespace skyline::service {
|
namespace skyline::service {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::fatalsrv {
|
namespace skyline::service::fatalsrv {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::friends {
|
namespace skyline::service::friends {
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <kernel/types/KEvent.h>
|
#include <kernel/types/KEvent.h>
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::friends {
|
namespace skyline::service::friends {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::friends {
|
namespace skyline::service::friends {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include "results.h"
|
#include "results.h"
|
||||||
#include "IFile.h"
|
#include "IFile.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
#include <vfs/backing.h>
|
#include <vfs/backing.h>
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include <vfs/filesystem.h>
|
|
||||||
#include "results.h"
|
#include "results.h"
|
||||||
#include "IFile.h"
|
#include "IFile.h"
|
||||||
#include "IFileSystem.h"
|
#include "IFileSystem.h"
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vfs/filesystem.h>
|
#include <vfs/filesystem.h>
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::fssrv {
|
namespace skyline::service::fssrv {
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
|
||||||
#include <services/account/IAccountServiceForApplication.h>
|
#include <services/account/IAccountServiceForApplication.h>
|
||||||
#include "IFileSystem.h"
|
#include "IFileSystem.h"
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include "results.h"
|
#include "results.h"
|
||||||
#include "IStorage.h"
|
#include "IStorage.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
#include <vfs/backing.h>
|
#include <vfs/backing.h>
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::hid {
|
namespace skyline::service::hid {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <input.h>
|
#include <input.h>
|
||||||
|
#include <kernel/types/KProcess.h>
|
||||||
#include "IAppletResource.h"
|
#include "IAppletResource.h"
|
||||||
|
|
||||||
namespace skyline::service::hid {
|
namespace skyline::service::hid {
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
|
||||||
namespace skyline::service::hid {
|
namespace skyline::service::hid {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
|
#include <os.h>
|
||||||
#include <input.h>
|
#include <input.h>
|
||||||
#include "IHidServer.h"
|
#include "IHidServer.h"
|
||||||
#include "IActiveVibrationDeviceList.h"
|
#include "IActiveVibrationDeviceList.h"
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/base_service.h>
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
#include "IAppletResource.h"
|
#include "IAppletResource.h"
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||||
|
|
||||||
#include <gpu.h>
|
#include <gpu.h>
|
||||||
#include <os.h>
|
|
||||||
#include <kernel/types/KProcess.h>
|
|
||||||
#include <services/nvdrv/driver.h>
|
#include <services/nvdrv/driver.h>
|
||||||
#include <services/common/fence.h>
|
#include <services/common/fence.h>
|
||||||
#include <gpu/format.h>
|
#include <gpu/format.h>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user