mirror of
https://github.com/pineappleEA/pineapple-src.git
synced 2024-11-25 11:28:26 -05:00
early-access version 1648
This commit is contained in:
parent
60c88a3cf8
commit
a7ef96dee2
@ -1,7 +1,7 @@
|
|||||||
yuzu emulator early access
|
yuzu emulator early access
|
||||||
=============
|
=============
|
||||||
|
|
||||||
This is the source code for early-access 1647.
|
This is the source code for early-access 1648.
|
||||||
|
|
||||||
## Legal Notice
|
## Legal Notice
|
||||||
|
|
||||||
|
@ -117,10 +117,6 @@ void InitializeSlabResourceCounts() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CalculateSlabHeapGapSize() {
|
|
||||||
return KernelSlabHeapGapsSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t CalculateTotalSlabHeapSize() {
|
size_t CalculateTotalSlabHeapSize() {
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
|
||||||
@ -136,7 +132,7 @@ size_t CalculateTotalSlabHeapSize() {
|
|||||||
#undef ADD_SLAB_SIZE
|
#undef ADD_SLAB_SIZE
|
||||||
|
|
||||||
// Add the reserved size.
|
// Add the reserved size.
|
||||||
size += CalculateSlabHeapGapSize();
|
size += KernelSlabHeapGapsSize;
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
@ -158,7 +154,7 @@ void InitializeSlabHeaps(Core::System& system, KMemoryLayout& memory_layout) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create an array to represent the gaps between the slabs.
|
// Create an array to represent the gaps between the slabs.
|
||||||
const size_t total_gap_size = CalculateSlabHeapGapSize();
|
const size_t total_gap_size = KernelSlabHeapGapsSize;
|
||||||
std::array<size_t, slab_types.size()> slab_gaps;
|
std::array<size_t, slab_types.size()> slab_gaps;
|
||||||
for (size_t i = 0; i < slab_gaps.size(); i++) {
|
for (size_t i = 0; i < slab_gaps.size(); i++) {
|
||||||
// Note: This is an off-by-one error from Nintendo's intention, because GenerateRandomRange
|
// Note: This is an off-by-one error from Nintendo's intention, because GenerateRandomRange
|
||||||
|
@ -102,7 +102,7 @@ struct KernelCore::Impl {
|
|||||||
next_user_process_id = KProcess::ProcessIDMin;
|
next_user_process_id = KProcess::ProcessIDMin;
|
||||||
next_thread_id = 1;
|
next_thread_id = 1;
|
||||||
|
|
||||||
for (s32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
|
for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
|
||||||
if (suspend_threads[core_id]) {
|
if (suspend_threads[core_id]) {
|
||||||
suspend_threads[core_id]->Close();
|
suspend_threads[core_id]->Close();
|
||||||
suspend_threads[core_id] = nullptr;
|
suspend_threads[core_id] = nullptr;
|
||||||
@ -211,7 +211,7 @@ struct KernelCore::Impl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InitializeSuspendThreads() {
|
void InitializeSuspendThreads() {
|
||||||
for (s32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
|
for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
|
||||||
suspend_threads[core_id] = KThread::Create(system.Kernel());
|
suspend_threads[core_id] = KThread::Create(system.Kernel());
|
||||||
ASSERT(KThread::InitializeHighPriorityThread(system, suspend_threads[core_id], {}, {},
|
ASSERT(KThread::InitializeHighPriorityThread(system, suspend_threads[core_id], {}, {},
|
||||||
core_id)
|
core_id)
|
||||||
@ -953,7 +953,7 @@ void KernelCore::Suspend(bool in_suspention) {
|
|||||||
{
|
{
|
||||||
KScopedSchedulerLock lock(*this);
|
KScopedSchedulerLock lock(*this);
|
||||||
const auto state = should_suspend ? ThreadState::Runnable : ThreadState::Waiting;
|
const auto state = should_suspend ? ThreadState::Runnable : ThreadState::Waiting;
|
||||||
for (s32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
|
for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
|
||||||
impl->suspend_threads[core_id]->SetState(state);
|
impl->suspend_threads[core_id]->SetState(state);
|
||||||
impl->suspend_threads[core_id]->SetWaitReasonForDebugging(
|
impl->suspend_threads[core_id]->SetWaitReasonForDebugging(
|
||||||
ThreadWaitReasonForDebugging::Suspended);
|
ThreadWaitReasonForDebugging::Suspended);
|
||||||
|
@ -141,38 +141,6 @@ enum class ResourceLimitValueType {
|
|||||||
PeakValue,
|
PeakValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
ResultVal<s64> RetrieveResourceLimitValue(Core::System& system, Handle resource_limit,
|
|
||||||
u32 resource_type, ResourceLimitValueType value_type) {
|
|
||||||
std::lock_guard lock{HLE::g_hle_lock};
|
|
||||||
const auto type = static_cast<LimitableResource>(resource_type);
|
|
||||||
if (!IsValidResourceType(type)) {
|
|
||||||
LOG_ERROR(Kernel_SVC, "Invalid resource limit type: '{}'", resource_type);
|
|
||||||
return ResultInvalidEnumValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto* const current_process = system.Kernel().CurrentProcess();
|
|
||||||
ASSERT(current_process != nullptr);
|
|
||||||
|
|
||||||
auto resource_limit_object =
|
|
||||||
current_process->GetHandleTable().GetObject<KResourceLimit>(resource_limit);
|
|
||||||
if (resource_limit_object.IsNull()) {
|
|
||||||
LOG_ERROR(Kernel_SVC, "Handle to non-existent resource limit instance used. Handle={:08X}",
|
|
||||||
resource_limit);
|
|
||||||
return ResultInvalidHandle;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (value_type) {
|
|
||||||
case ResourceLimitValueType::CurrentValue:
|
|
||||||
return MakeResult(resource_limit_object->GetCurrentValue(type));
|
|
||||||
case ResourceLimitValueType::LimitValue:
|
|
||||||
return MakeResult(resource_limit_object->GetLimitValue(type));
|
|
||||||
case ResourceLimitValueType::PeakValue:
|
|
||||||
return MakeResult(resource_limit_object->GetPeakValue(type));
|
|
||||||
default:
|
|
||||||
LOG_ERROR(Kernel_SVC, "Invalid resource value_type: '{}'", value_type);
|
|
||||||
return ResultInvalidEnumValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
/// Set the process heap to a given Size. It can both extend and shrink the heap.
|
/// Set the process heap to a given Size. It can both extend and shrink the heap.
|
||||||
|
Loading…
Reference in New Issue
Block a user