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 <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#include "skyline/loader/loader.h"
|
||||
#include "skyline/common.h"
|
||||
#include "skyline/os.h"
|
||||
|
@ -3,12 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <queue>
|
||||
#include <oboe/Oboe.h>
|
||||
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <audio/track.h>
|
||||
#include "common.h"
|
||||
|
||||
namespace skyline::audio {
|
||||
/**
|
||||
|
@ -1,8 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <array>
|
||||
#include <common.h>
|
||||
#include "common.h"
|
||||
#include "adpcm_decoder.h"
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <common.h>
|
||||
|
||||
namespace skyline::audio {
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <span>
|
||||
#include <common.h>
|
||||
|
||||
namespace skyline::audio {
|
||||
|
@ -1,8 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <array>
|
||||
#include <common.h>
|
||||
#include "common.h"
|
||||
#include "resampler.h"
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <common.h>
|
||||
|
||||
namespace skyline::audio {
|
||||
|
@ -19,7 +19,7 @@ namespace skyline::audio {
|
||||
|
||||
bool AudioTrack::ContainsBuffer(u64 tag) {
|
||||
// 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)
|
||||
return false;
|
||||
|
||||
|
@ -3,10 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <queue>
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <common.h>
|
||||
#include "common.h"
|
||||
|
||||
namespace skyline::audio {
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <mutex>
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
@ -106,6 +107,7 @@ namespace skyline {
|
||||
|
||||
/**
|
||||
* @return The value aligned up to the next multiple
|
||||
* @note The multiple needs to be a power of 2
|
||||
*/
|
||||
template<typename TypeVal, typename TypeMul>
|
||||
constexpr inline TypeVal AlignUp(TypeVal value, TypeMul multiple) {
|
||||
@ -115,6 +117,7 @@ namespace skyline {
|
||||
|
||||
/**
|
||||
* @return The value aligned down to the previous multiple
|
||||
* @note The multiple needs to be a power of 2
|
||||
*/
|
||||
template<typename TypeVal, typename TypeMul>
|
||||
constexpr inline TypeVal AlignDown(TypeVal value, TypeMul multiple) {
|
||||
@ -178,7 +181,7 @@ namespace skyline {
|
||||
if (hexString.size() != Size * 2)
|
||||
throw exception("Invalid size");
|
||||
std::array<u8, Size> result;
|
||||
for (size_t i{}; i < Size; ++i) {
|
||||
for (size_t i{}; i < Size; i++) {
|
||||
size_t hexStrIndex{i * 2};
|
||||
result[i] = (HexDigitToByte(hexString[hexStrIndex]) << 4) | HexDigitToByte(hexString[hexStrIndex + 1]);
|
||||
}
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <span>
|
||||
#include <mbedtls/cipher.h>
|
||||
#include <common.h>
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <functional>
|
||||
#include <vfs/os_filesystem.h>
|
||||
#include "key_store.h"
|
||||
|
||||
|
@ -3,9 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <vfs/backing.h>
|
||||
#include "common.h"
|
||||
|
||||
namespace skyline::crypto {
|
||||
/**
|
||||
|
@ -3,16 +3,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <queue>
|
||||
#include <android/native_window.h>
|
||||
#include <kernel/ipc.h>
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <services/nvdrv/devices/nvmap.h>
|
||||
#include "gpu/texture.h"
|
||||
#include "gpu/memory_manager.h"
|
||||
#include "gpu/gpfifo.h"
|
||||
#include "gpu/syncpoint.h"
|
||||
#include "gpu/engines/engine.h"
|
||||
#include "gpu/engines/maxwell_3d.h"
|
||||
|
||||
namespace skyline::gpu {
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <common.h>
|
||||
#include "engine.h"
|
||||
|
||||
namespace skyline {
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <gpu.h>
|
||||
#include <gpu/syncpoint.h>
|
||||
#include "maxwell_3d.h"
|
||||
|
||||
namespace skyline::gpu::engine {
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <common.h>
|
||||
#include <gpu/texture.h>
|
||||
#include <gpu/macro_interpreter.h>
|
||||
#include "engine.h"
|
||||
@ -561,7 +559,7 @@ namespace skyline {
|
||||
static_assert(sizeof(Registers) == (constant::Maxwell3DRegisterCounter * sizeof(u32)));
|
||||
#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
|
||||
|
||||
std::array<u32, 0x10000> macroCode{}; //!< This is used to store GPU macros, the 256kb size is from Ryujinx
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include <queue>
|
||||
#include "engines/engine.h"
|
||||
#include "engines/gpfifo.h"
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include "engines/maxwell_3d.h"
|
||||
#include "memory_manager.h"
|
||||
#include "macro_interpreter.h"
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <common.h>
|
||||
#include "syncpoint.h"
|
||||
|
||||
namespace skyline::gpu {
|
||||
|
@ -24,8 +24,8 @@ namespace skyline {
|
||||
std::function<void()> callback;
|
||||
};
|
||||
|
||||
Mutex waiterLock{}; //!< Locks insertions and deletions of waiters
|
||||
std::map<u64, Waiter> waiterMap{};
|
||||
Mutex waiterLock; //!< Locks insertions and deletions of waiters
|
||||
std::map<u64, Waiter> waiterMap;
|
||||
u64 nextWaiterId{1};
|
||||
|
||||
public:
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <common.h>
|
||||
|
||||
namespace skyline {
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <input.h>
|
||||
#include "touch.h"
|
||||
|
||||
namespace skyline::input {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include "shared_mem.h"
|
||||
|
||||
namespace skyline::input {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <common.h>
|
||||
|
||||
namespace skyline {
|
||||
|
@ -56,7 +56,7 @@ namespace skyline::kernel {
|
||||
if (chunk->address <= address && (chunk->address + chunk->size) > address)
|
||||
chunk = chunkList.erase(chunk);
|
||||
else
|
||||
++chunk;
|
||||
chunk++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ namespace skyline::kernel {
|
||||
if (block->address > endAddress)
|
||||
block = chunk->blockList.erase(block);
|
||||
else
|
||||
++block;
|
||||
block++;
|
||||
}
|
||||
|
||||
auto end = std::prev(chunk->blockList.end());
|
||||
|
@ -3,9 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <forward_list>
|
||||
#include <common.h>
|
||||
#include "types/KObject.h"
|
||||
|
||||
namespace skyline {
|
||||
namespace memory {
|
||||
|
@ -114,7 +114,6 @@ namespace skyline::kernel::svc {
|
||||
auto object = state.process->GetMemoryObject(source);
|
||||
if (!object)
|
||||
throw exception("svcMapMemory: Cannot find memory object in handle table for address 0x{:X}", source);
|
||||
|
||||
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);
|
||||
@ -376,7 +375,7 @@ namespace skyline::kernel::svc {
|
||||
void CloseHandle(DeviceState &state) {
|
||||
auto handle = static_cast<KHandle>(state.ctx->registers.w0);
|
||||
try {
|
||||
state.process->handles.erase(handle);
|
||||
state.process->DeleteHandle(handle);
|
||||
state.logger->Debug("svcCloseHandle: Closing handle: 0x{:X}", handle);
|
||||
state.ctx->registers.w0 = Result{};
|
||||
} catch (const std::exception &) {
|
||||
|
@ -4,7 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include "ipc.h"
|
||||
|
||||
namespace skyline {
|
||||
namespace constant::infoState {
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <asm/unistd.h>
|
||||
#include <unistd.h>
|
||||
#include <os.h>
|
||||
#include <nce.h>
|
||||
#include "KPrivateMemory.h"
|
||||
#include "KProcess.h"
|
||||
|
||||
|
@ -165,8 +165,8 @@ namespace skyline::kernel::type {
|
||||
if (size <= PAGE_SIZE) {
|
||||
std::vector<u8> buffer(size);
|
||||
|
||||
state.process->ReadMemory(buffer.data(), source, size);
|
||||
state.process->WriteMemory(buffer.data(), destination, size);
|
||||
ReadMemory(buffer.data(), source, size);
|
||||
WriteMemory(buffer.data(), destination, size);
|
||||
} else {
|
||||
Registers fregs{
|
||||
.x0 = source,
|
||||
@ -180,20 +180,21 @@ namespace skyline::kernel::type {
|
||||
}
|
||||
|
||||
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) {
|
||||
case type::KType::KPrivateMemory:
|
||||
case type::KType::KSharedMemory:
|
||||
case type::KType::KTransferMemory: {
|
||||
auto mem = std::static_pointer_cast<type::KMemory>(object);
|
||||
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:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
@ -213,7 +214,7 @@ namespace skyline::kernel::type {
|
||||
return false;
|
||||
|
||||
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)
|
||||
continue;
|
||||
|
||||
@ -227,7 +228,7 @@ namespace skyline::kernel::type {
|
||||
lock.lock();
|
||||
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) {
|
||||
mtxWaiters.erase(it);
|
||||
break;
|
||||
@ -270,7 +271,7 @@ namespace skyline::kernel::type {
|
||||
auto &condWaiters = conditionals[conditionalAddress];
|
||||
|
||||
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)
|
||||
continue;
|
||||
|
||||
@ -294,7 +295,7 @@ namespace skyline::kernel::type {
|
||||
else
|
||||
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) {
|
||||
condWaiters.erase(it);
|
||||
break;
|
||||
@ -339,7 +340,7 @@ namespace skyline::kernel::type {
|
||||
auto &mtxWaiters = mutexes[thread->mutexAddress];
|
||||
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)
|
||||
continue;
|
||||
status = std::make_shared<WaitStatus>(thread->priority, thread->handle);
|
||||
@ -352,7 +353,7 @@ namespace skyline::kernel::type {
|
||||
mtxLock.lock();
|
||||
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) {
|
||||
mtxWaiters.erase(it);
|
||||
break;
|
||||
|
@ -4,11 +4,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <kernel/memory.h>
|
||||
#include "KThread.h"
|
||||
#include "KPrivateMemory.h"
|
||||
#include "KTransferMemory.h"
|
||||
#include "KSharedMemory.h"
|
||||
#include "KSession.h"
|
||||
#include "KEvent.h"
|
||||
|
||||
@ -26,6 +24,8 @@ namespace skyline {
|
||||
*/
|
||||
class KProcess : public KSyncObject {
|
||||
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
|
||||
* @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) {}
|
||||
};
|
||||
|
||||
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
|
||||
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<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
|
||||
@ -285,7 +284,7 @@ namespace skyline {
|
||||
item = std::make_shared<objectClass>(state, handleIndex, args...);
|
||||
else
|
||||
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++};
|
||||
}
|
||||
|
||||
@ -296,7 +295,7 @@ namespace skyline {
|
||||
*/
|
||||
template<typename objectClass>
|
||||
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++;
|
||||
}
|
||||
|
||||
@ -326,13 +325,15 @@ namespace skyline {
|
||||
else
|
||||
throw exception("KProcess::GetHandle couldn't determine object type");
|
||||
try {
|
||||
auto item = handles.at(handle);
|
||||
if (item->objectType == objectType)
|
||||
auto& item = handles.at(handle - constant::BaseHandleIndex);
|
||||
if (item != nullptr && item->objectType == objectType)
|
||||
return std::static_pointer_cast<objectClass>(item);
|
||||
else if (item == nullptr)
|
||||
throw exception("GetHandle was called with a deleted handle: 0x{:X}", handle);
|
||||
else
|
||||
throw exception("Tried to get kernel object (0x{:X}) with different type: {} when object is {}", handle, objectType, item->objectType);
|
||||
} 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
|
||||
*/
|
||||
inline void DeleteHandle(KHandle handle) {
|
||||
handles.erase(handle);
|
||||
handles.at(handle - constant::BaseHandleIndex) = nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,10 +3,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include <services/base_service.h>
|
||||
#include "KSyncObject.h"
|
||||
|
||||
namespace skyline::service {
|
||||
class BaseService;
|
||||
}
|
||||
|
||||
namespace skyline::kernel::type {
|
||||
/**
|
||||
* @brief KService holds a reference to a service, this is equivalent to KClientSession
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <unistd.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <os.h>
|
||||
#include <nce.h>
|
||||
#include "KSharedMemory.h"
|
||||
#include "KProcess.h"
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include "KObject.h"
|
||||
|
||||
namespace skyline::kernel::type {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vfs/backing.h>
|
||||
#include <vfs/nacp.h>
|
||||
#include "executable.h"
|
||||
|
||||
|
@ -3,9 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include <vfs/nca.h>
|
||||
#include <crypto/key_store.h>
|
||||
#include "loader.h"
|
||||
|
||||
namespace skyline::loader {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include "loader.h"
|
||||
|
||||
namespace skyline::loader {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include "loader.h"
|
||||
|
||||
namespace skyline::loader {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include <vfs/nca.h>
|
||||
#include <vfs/rom_filesystem.h>
|
||||
#include <vfs/partition_filesystem.h>
|
||||
|
@ -3,12 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <syslog.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include "common.h"
|
||||
#include "kernel/types/KSharedMemory.h"
|
||||
|
||||
namespace skyline {
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "loader/nso.h"
|
||||
#include "loader/nca.h"
|
||||
#include "loader/nsp.h"
|
||||
#include "nce.h"
|
||||
#include "nce/guest.h"
|
||||
#include "os.h"
|
||||
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <thread>
|
||||
#include <sys/mman.h>
|
||||
#include "common.h"
|
||||
#include "loader/loader.h"
|
||||
#include "kernel/ipc.h"
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include "IManagerForApplication.h"
|
||||
#include "IProfile.h"
|
||||
#include "IAccountServiceForApplication.h"
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::account {
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include "IProfile.h"
|
||||
|
||||
namespace skyline::service::account {
|
||||
|
@ -4,7 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "IAccountServiceForApplication.h"
|
||||
#include <services/base_service.h>
|
||||
|
||||
namespace skyline::service::account {
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -4,7 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -4,7 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
#include <queue>
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
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::queue<Message> messageQueue;
|
||||
std::queue<Message> messageQueue; //!< A queue of all the messages that the program is yet to consume
|
||||
|
||||
enum class FocusState : u8 {
|
||||
InFocus = 1, //!< The application is in foreground
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// 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 "ISelfController.h"
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include "IStorage.h"
|
||||
#include "IStorageAccessor.h"
|
||||
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::am {
|
||||
namespace result {
|
||||
constexpr Result OutOfBounds(128, 503);
|
||||
}
|
||||
|
||||
class IStorage;
|
||||
|
||||
/**
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::aocsrv {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::apm {
|
||||
|
@ -10,7 +10,7 @@ namespace skyline::service::apm {
|
||||
auto mode = request.Pop<u32>();
|
||||
auto config = request.Pop<u32>();
|
||||
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 {};
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::apm {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::audio {
|
||||
|
@ -19,13 +19,13 @@ namespace skyline::service::audio {
|
||||
}
|
||||
|
||||
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();
|
||||
return {};
|
||||
}
|
||||
|
||||
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();
|
||||
return {};
|
||||
}
|
||||
@ -40,7 +40,7 @@ namespace skyline::service::audio {
|
||||
} &data{request.inputBuf.at(0).as<Data>()};
|
||||
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) {
|
||||
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) {
|
||||
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);
|
||||
return {};
|
||||
}
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
#include <audio/resampler.h>
|
||||
#include <audio.h>
|
||||
|
@ -4,7 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline {
|
||||
|
@ -173,7 +173,7 @@ namespace skyline::service::audio::IAudioRenderer {
|
||||
|
||||
Result IAudioRenderer::QuerySystemEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||
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);
|
||||
return {};
|
||||
}
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
#include <audio.h>
|
||||
#include "memory_pool.h"
|
||||
|
@ -3,11 +3,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <audio/resampler.h>
|
||||
#include <audio/adpcm_decoder.h>
|
||||
#include <audio.h>
|
||||
#include <common.h>
|
||||
|
||||
namespace skyline::service::audio::IAudioRenderer {
|
||||
/**
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include "IAudioRenderer/IAudioRenderer.h"
|
||||
#include "IAudioDevice.h"
|
||||
#include "IAudioRendererManager.h"
|
||||
@ -51,7 +50,6 @@ namespace skyline::service::audio {
|
||||
}
|
||||
|
||||
i64 splitterWorkSize{};
|
||||
|
||||
if (revisionInfo.SplitterSupported()) {
|
||||
splitterWorkSize += params.splitterDestinationDataCount * 0xE0 + params.splitterCount * 0x20;
|
||||
|
||||
@ -63,7 +61,6 @@ namespace skyline::service::audio {
|
||||
|
||||
if (params.performanceManagerCount > 0) {
|
||||
i64 performanceMetricsBufferSize{};
|
||||
|
||||
if (revisionInfo.UsesPerformanceMetricDataFormatV2()) {
|
||||
performanceMetricsBufferSize = (params.voiceCount + params.effectCount + totalMixCount + params.sinkCount) + 0x990;
|
||||
} else {
|
||||
@ -81,7 +78,7 @@ namespace skyline::service::audio {
|
||||
|
||||
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);
|
||||
return {};
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::audio {
|
||||
|
@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <cxxabi.h>
|
||||
#include "base_service.h"
|
||||
|
||||
namespace skyline::service {
|
||||
|
@ -3,10 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <cxxabi.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_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
|
||||
|
||||
#include <common.h>
|
||||
#include <services/nvdrv/devices/nvhost_syncpoint.h>
|
||||
|
||||
namespace skyline::service::nvdrv {
|
||||
|
@ -1,8 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <os.h>
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include "parcel.h"
|
||||
|
||||
namespace skyline::service {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common.h>
|
||||
#include <kernel/ipc.h>
|
||||
|
||||
namespace skyline::service {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::fatalsrv {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::friends {
|
||||
|
@ -4,7 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <kernel/types/KEvent.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::friends {
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::friends {
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include "results.h"
|
||||
#include "IFile.h"
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
#include <vfs/backing.h>
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include <vfs/filesystem.h>
|
||||
#include "results.h"
|
||||
#include "IFile.h"
|
||||
#include "IFileSystem.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <vfs/filesystem.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::fssrv {
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
#include <services/account/IAccountServiceForApplication.h>
|
||||
#include "IFileSystem.h"
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include "results.h"
|
||||
#include "IStorage.h"
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
#include <vfs/backing.h>
|
||||
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::hid {
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <input.h>
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include "IAppletResource.h"
|
||||
|
||||
namespace skyline::service::hid {
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
|
||||
namespace skyline::service::hid {
|
||||
|
@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <os.h>
|
||||
#include <input.h>
|
||||
#include "IHidServer.h"
|
||||
#include "IActiveVibrationDeviceList.h"
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <services/base_service.h>
|
||||
#include <services/serviceman.h>
|
||||
#include "IAppletResource.h"
|
||||
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include <gpu.h>
|
||||
#include <os.h>
|
||||
#include <kernel/types/KProcess.h>
|
||||
#include <services/nvdrv/driver.h>
|
||||
#include <services/common/fence.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