early-access version 1648

main
pineappleEA 2021-05-02 10:35:36 +02:00
parent 60c88a3cf8
commit a7ef96dee2
4 changed files with 6 additions and 42 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access
=============
This is the source code for early-access 1647.
This is the source code for early-access 1648.
## Legal Notice

View File

@ -117,10 +117,6 @@ void InitializeSlabResourceCounts() {
}
}
size_t CalculateSlabHeapGapSize() {
return KernelSlabHeapGapsSize;
}
size_t CalculateTotalSlabHeapSize() {
size_t size = 0;
@ -136,7 +132,7 @@ size_t CalculateTotalSlabHeapSize() {
#undef ADD_SLAB_SIZE
// Add the reserved size.
size += CalculateSlabHeapGapSize();
size += KernelSlabHeapGapsSize;
return size;
}
@ -158,7 +154,7 @@ void InitializeSlabHeaps(Core::System& system, KMemoryLayout& memory_layout) {
}
// 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;
for (size_t i = 0; i < slab_gaps.size(); i++) {
// Note: This is an off-by-one error from Nintendo's intention, because GenerateRandomRange

View File

@ -102,7 +102,7 @@ struct KernelCore::Impl {
next_user_process_id = KProcess::ProcessIDMin;
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]) {
suspend_threads[core_id]->Close();
suspend_threads[core_id] = nullptr;
@ -211,7 +211,7 @@ struct KernelCore::Impl {
}
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());
ASSERT(KThread::InitializeHighPriorityThread(system, suspend_threads[core_id], {}, {},
core_id)
@ -953,7 +953,7 @@ void KernelCore::Suspend(bool in_suspention) {
{
KScopedSchedulerLock lock(*this);
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]->SetWaitReasonForDebugging(
ThreadWaitReasonForDebugging::Suspended);

View File

@ -141,38 +141,6 @@ enum class ResourceLimitValueType {
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
/// Set the process heap to a given Size. It can both extend and shrink the heap.