Reapply "Merge remote-tracking branch 'upstream/canary_experimental' into canary_experimental"

This reverts commit fd3484f48753d2690d28a8cdd08f6b26f7c31336.
This commit is contained in:
The-Little-Wolf 2025-01-17 15:02:10 -08:00
parent 4d19245c4a
commit 5de1f23228
4 changed files with 41 additions and 2 deletions

View File

@ -410,6 +410,15 @@ struct ThreadPriority {
static const int32_t kAboveNormal = 1; static const int32_t kAboveNormal = 1;
static const int32_t kHighest = 2; static const int32_t kHighest = 2;
}; };
#else
struct ThreadPriority {
static const int32_t kLowest = 1;
static const int32_t kBelowNormal = 8;
static const int32_t kNormal = 16;
static const int32_t kAboveNormal = 24;
static const int32_t kHighest = 32;
};
#endif
// Models a Win32-like thread object. // Models a Win32-like thread object.
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85).aspx // https://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85).aspx

View File

@ -27,6 +27,8 @@
#include <ctime> #include <ctime>
#include <memory> #include <memory>
#include "logging.h"
#if XE_PLATFORM_ANDROID #if XE_PLATFORM_ANDROID
#include <dlfcn.h> #include <dlfcn.h>
@ -660,8 +662,18 @@ class PosixCondition<Thread> : public PosixConditionBase {
WaitStarted(); WaitStarted();
sched_param param{}; sched_param param{};
param.sched_priority = new_priority; param.sched_priority = new_priority;
if (pthread_setschedparam(thread_, SCHED_FIFO, &param) != 0) int res = pthread_setschedparam(thread_, SCHED_FIFO, &param);
assert_always(); if (res != 0) {
switch (res) {
case EPERM:
XELOGW("Permission denied while setting priority");
break;
case EINVAL:
assert_always();
default:
XELOGW("Unknown error while setting priority");
}
}
} }
void QueueUserCallback(std::function<void()> callback) { void QueueUserCallback(std::function<void()> callback) {

View File

@ -1373,6 +1373,12 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
return X_STATUS_NOT_FOUND; return X_STATUS_NOT_FOUND;
} }
if (!module->is_executable()) {
kernel_state_->UnloadUserModule(module, false);
XELOGE("Failed to load user module {}", path);
return X_STATUS_NOT_SUPPORTED;
}
X_RESULT result = kernel_state_->ApplyTitleUpdate(module); X_RESULT result = kernel_state_->ApplyTitleUpdate(module);
if (XFAILED(result)) { if (XFAILED(result)) {
XELOGE("Failed to apply title update! Cannot run module {}", path); XELOGE("Failed to apply title update! Cannot run module {}", path);

View File

@ -799,6 +799,18 @@ dword_result_t XamUserGetUserFlagsFromXUID_entry(qword_t xuid) {
} }
DECLARE_XAM_EXPORT1(XamUserGetUserFlagsFromXUID, kUserProfiles, kImplemented); DECLARE_XAM_EXPORT1(XamUserGetUserFlagsFromXUID, kUserProfiles, kImplemented);
dword_result_t XamUserGetOnlineLanguageFromXUID_entry(qword_t xuid) {
/* Notes:
- Calls XamUserGetUserFlagsFromXUID and returns (ulonglong)(cached_flag <<
0x20) >> 0x39 & 0x1f;
- XamUserGetMembershipTierFromXUID and XamUserGetOnlineCountryFromXUID also
call it
- Removed in metro
*/
return cvars::user_language;
}
DECLARE_XAM_EXPORT1(XamUserGetOnlineLanguageFromXUID, kUserProfiles, kStub);
constexpr uint8_t kStatsMaxAmount = 64; constexpr uint8_t kStatsMaxAmount = 64;
struct X_STATS_DETAILS { struct X_STATS_DETAILS {