2020-04-19 23:04:05 +02:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2020-03-27 20:36:02 +01:00
|
|
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
|
|
|
|
2019-09-24 22:54:27 +02:00
|
|
|
#include "common.h"
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
#include "nce.h"
|
|
|
|
#include "gpu.h"
|
2020-01-02 21:19:34 +01:00
|
|
|
#include "audio.h"
|
2020-02-01 16:51:32 +01:00
|
|
|
#include <kernel/types/KThread.h>
|
2019-09-24 22:54:27 +02:00
|
|
|
#include <tinyxml2.h>
|
|
|
|
|
|
|
|
namespace skyline {
|
2019-12-26 19:10:29 +01:00
|
|
|
void Mutex::lock() {
|
2020-02-01 16:51:32 +01:00
|
|
|
while (true) {
|
|
|
|
for (int i = 0; i < 1000; ++i) {
|
|
|
|
if (!flag.test_and_set(std::memory_order_acquire))
|
|
|
|
return;
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2020-02-01 16:51:32 +01:00
|
|
|
asm volatile("yield");
|
|
|
|
}
|
|
|
|
sched_yield();
|
|
|
|
}
|
2019-12-26 19:10:29 +01:00
|
|
|
}
|
|
|
|
|
2020-01-11 05:52:25 +01:00
|
|
|
void GroupMutex::lock(Group group) {
|
|
|
|
auto none = Group::None;
|
2020-02-11 07:34:22 +01:00
|
|
|
constexpr u64 timeout = 100; // The timeout in ns
|
2020-04-17 23:19:19 +02:00
|
|
|
auto end = util::GetTimeNs() + timeout;
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2020-02-11 07:34:22 +01:00
|
|
|
while (true) {
|
|
|
|
if (next == group) {
|
|
|
|
if (flag == group) {
|
|
|
|
std::lock_guard lock(mtx);
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2020-02-11 07:34:22 +01:00
|
|
|
if (flag == group) {
|
|
|
|
auto groupT = group;
|
|
|
|
next.compare_exchange_strong(groupT, Group::None);
|
|
|
|
num++;
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2020-02-11 07:34:22 +01:00
|
|
|
return;
|
|
|
|
}
|
2020-02-15 10:38:17 +01:00
|
|
|
} else {
|
2020-02-11 07:34:22 +01:00
|
|
|
flag.compare_exchange_weak(none, group);
|
2020-02-15 10:38:17 +01:00
|
|
|
}
|
2020-04-17 23:19:19 +02:00
|
|
|
} else if (flag == group && (next == Group::None || util::GetTimeNs() >= end)) {
|
2020-02-11 07:34:22 +01:00
|
|
|
std::lock_guard lock(mtx);
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2020-02-11 07:34:22 +01:00
|
|
|
if (flag == group) {
|
|
|
|
num++;
|
|
|
|
return;
|
|
|
|
}
|
2020-02-15 10:38:17 +01:00
|
|
|
} else {
|
2020-02-11 07:34:22 +01:00
|
|
|
next.compare_exchange_weak(none, group);
|
2020-02-15 10:38:17 +01:00
|
|
|
}
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2020-02-11 07:34:22 +01:00
|
|
|
none = Group::None;
|
2020-02-05 19:37:45 +01:00
|
|
|
asm volatile("yield");
|
2020-02-01 16:51:32 +01:00
|
|
|
}
|
2020-01-11 05:52:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void GroupMutex::unlock() {
|
2020-02-11 07:34:22 +01:00
|
|
|
std::lock_guard lock(mtx);
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2020-01-11 05:52:25 +01:00
|
|
|
if (!--num)
|
2020-02-11 07:34:22 +01:00
|
|
|
flag.exchange(next);
|
2020-01-11 05:52:25 +01:00
|
|
|
}
|
|
|
|
|
2019-12-02 18:40:53 +01:00
|
|
|
Settings::Settings(const int preferenceFd) {
|
2019-09-24 22:54:27 +02:00
|
|
|
tinyxml2::XMLDocument pref;
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2019-12-02 18:40:53 +01:00
|
|
|
if (pref.LoadFile(fdopen(preferenceFd, "r")))
|
2019-09-24 22:54:27 +02:00
|
|
|
throw exception("TinyXML2 Error: " + std::string(pref.ErrorStr()));
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2019-09-24 22:54:27 +02:00
|
|
|
tinyxml2::XMLElement *elem = pref.LastChild()->FirstChild()->ToElement();
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2019-09-24 22:54:27 +02:00
|
|
|
while (elem) {
|
|
|
|
switch (elem->Value()[0]) {
|
|
|
|
case 's':
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
stringMap[elem->FindAttribute("name")->Value()] = elem->GetText();
|
2019-09-24 22:54:27 +02:00
|
|
|
break;
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2019-09-24 22:54:27 +02:00
|
|
|
case 'b':
|
2020-03-25 18:59:37 +01:00
|
|
|
boolMap[elem->FindAttribute("name")->Value()] = elem->FindAttribute("value")->BoolValue();
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
break;
|
2020-03-25 18:59:37 +01:00
|
|
|
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
case 'i':
|
2020-03-25 18:59:37 +01:00
|
|
|
intMap[elem->FindAttribute("name")->Value()] = elem->FindAttribute("value")->IntValue();
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
break;
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2019-09-24 22:54:27 +02:00
|
|
|
default:
|
2020-03-25 18:59:37 +01:00
|
|
|
syslog(LOG_ALERT, "Settings type is missing: %s for %s", elem->Value(), elem->FindAttribute("name")->Value());
|
2019-09-24 22:54:27 +02:00
|
|
|
break;
|
|
|
|
};
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2019-09-24 22:54:27 +02:00
|
|
|
if (elem->NextSibling())
|
|
|
|
elem = elem->NextSibling()->ToElement();
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
else
|
|
|
|
break;
|
2019-09-24 22:54:27 +02:00
|
|
|
}
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2019-09-24 22:54:27 +02:00
|
|
|
pref.Clear();
|
|
|
|
}
|
|
|
|
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
std::string Settings::GetString(const std::string &key) {
|
2019-09-24 22:54:27 +02:00
|
|
|
return stringMap.at(key);
|
|
|
|
}
|
|
|
|
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
bool Settings::GetBool(const std::string &key) {
|
2019-09-24 22:54:27 +02:00
|
|
|
return boolMap.at(key);
|
|
|
|
}
|
|
|
|
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
int Settings::GetInt(const std::string &key) {
|
|
|
|
return intMap.at(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Settings::List(const std::shared_ptr<Logger> &logger) {
|
|
|
|
for (auto &iter : stringMap)
|
|
|
|
logger->Info("Key: {}, Value: {}, Type: String", iter.first, GetString(iter.first));
|
2020-03-25 18:59:37 +01:00
|
|
|
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
for (auto &iter : boolMap)
|
|
|
|
logger->Info("Key: {}, Value: {}, Type: Bool", iter.first, GetBool(iter.first));
|
2019-09-24 22:54:27 +02:00
|
|
|
}
|
|
|
|
|
2019-12-02 18:40:53 +01:00
|
|
|
Logger::Logger(const int logFd, LogLevel configLevel) : configLevel(configLevel) {
|
|
|
|
logFile.__open(logFd, std::ios::app);
|
2019-09-24 22:54:27 +02:00
|
|
|
WriteHeader("Logging started");
|
|
|
|
}
|
|
|
|
|
|
|
|
Logger::~Logger() {
|
|
|
|
WriteHeader("Logging ended");
|
2020-04-17 23:19:19 +02:00
|
|
|
logFile.flush();
|
2019-09-24 22:54:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Logger::WriteHeader(const std::string &str) {
|
|
|
|
syslog(LOG_ALERT, "%s", str.c_str());
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2020-04-17 23:19:19 +02:00
|
|
|
std::lock_guard guard(mtx);
|
2019-09-24 22:54:27 +02:00
|
|
|
logFile << "0|" << str << "\n";
|
|
|
|
}
|
|
|
|
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
void Logger::Write(const LogLevel level, std::string str) {
|
|
|
|
syslog(levelSyslog[static_cast<u8>(level)], "%s", str.c_str());
|
2020-03-25 18:59:37 +01:00
|
|
|
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
for (auto &character : str)
|
|
|
|
if (character == '\n')
|
|
|
|
character = '\\';
|
2020-03-25 18:59:37 +01:00
|
|
|
|
2020-04-17 23:19:19 +02:00
|
|
|
std::lock_guard guard(mtx);
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
logFile << "1|" << levelStr[static_cast<u8>(level)] << "|" << str << "\n";
|
2019-09-24 22:54:27 +02:00
|
|
|
}
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
|
2020-01-07 03:36:08 +01:00
|
|
|
DeviceState::DeviceState(kernel::OS *os, std::shared_ptr<kernel::type::KProcess> &process, std::shared_ptr<JvmManager> jvmManager, std::shared_ptr<Settings> settings, std::shared_ptr<Logger> logger)
|
2020-04-17 23:19:19 +02:00
|
|
|
: os(os), jvm(std::move(jvmManager)), settings(std::move(settings)), logger(std::move(logger)), process(process) {
|
2019-12-02 18:40:53 +01:00
|
|
|
// We assign these later as they use the state in their constructor and we don't want null pointers
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
nce = std::move(std::make_shared<NCE>(*this));
|
2019-12-02 18:40:53 +01:00
|
|
|
gpu = std::move(std::make_shared<gpu::GPU>(*this));
|
2020-01-02 21:19:34 +01:00
|
|
|
audio = std::move(std::make_shared<audio::Audio>(*this));
|
Framebuffer and NativeActivity
What was added:
* Framebuffer
* NativeActivity
* NV Services
* IOCTL Handler
* NV Devices:
* * /dev/nvmap - 0xC0080101, 0xC0080103, 0xC0200104, 0xC0180105, 0xC00C0109, 0xC008010E
* * /dev/nvhost-as-gpu
* * /dev/nvhost-channel - 0x40044801, 0xC0104809, 0xC010480B, 0xC018480C, 0x4004480D, 0xC020481A, 0x40084714
* * /dev/nvhost-ctrl
* * /dev/nvhost-ctrl-gpu - 0x80044701, 0x80284702, 0xC0184706, 0xC0B04705, 0x80084714
* SVCs:
* * SetMemoryAttribute
* * CreateTransferMemory
* * ResetSignal
* * GetSystemTick
* Addition of Compact Logger
What was fixed:
* SVCs:
* * SetHeapSize
* * SetMemoryAttribute
* * QueryMemory
* A release build would not set CMAKE_BUILD_TYPE to "RELEASE"
* The logger code was simplified
2019-11-13 21:09:31 +01:00
|
|
|
}
|
2020-01-07 03:36:08 +01:00
|
|
|
|
2020-02-11 07:34:22 +01:00
|
|
|
thread_local std::shared_ptr<kernel::type::KThread> DeviceState::thread = nullptr;
|
|
|
|
thread_local ThreadContext *DeviceState::ctx = nullptr;
|
2019-09-24 22:54:27 +02:00
|
|
|
}
|