diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/kernel/svc/svc_info.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc/svc_process.cpp | 15 | ||||
| -rw-r--r-- | src/core/hle/service/nvnflinger/binder.h | 2 | 
3 files changed, 23 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc/svc_info.cpp b/src/core/hle/kernel/svc/svc_info.cpp index a66d633f8..26eb1ce92 100644 --- a/src/core/hle/kernel/svc/svc_info.cpp +++ b/src/core/hle/kernel/svc/svc_info.cpp @@ -174,9 +174,15 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle          R_SUCCEED();      case InfoType::InitialProcessIdRange: -        LOG_WARNING(Kernel_SVC, -                    "(STUBBED) Attempted to query privileged process id bounds, returned 0"); -        *result = 0; +        R_UNLESS(handle == 0, ResultInvalidHandle); +        R_UNLESS(info_sub_id <= 1, ResultInvalidCombination); + +        // Return the valid range for initial process IDs +        if (info_sub_id == 0) { +            *result = 1;       // Minimum initial process ID +        } else { +            *result = 0x50;    // Maximum initial process ID +        }          R_SUCCEED();      case InfoType::ThreadTickCount: { diff --git a/src/core/hle/kernel/svc/svc_process.cpp b/src/core/hle/kernel/svc/svc_process.cpp index 5c3e8829f..acd1864da 100644 --- a/src/core/hle/kernel/svc/svc_process.cpp +++ b/src/core/hle/kernel/svc/svc_process.cpp @@ -12,10 +12,19 @@ void ExitProcess(Core::System& system) {      auto* current_process = GetCurrentProcessPointer(system.Kernel());      LOG_INFO(Kernel_SVC, "Process {} exiting", current_process->GetProcessId()); -    ASSERT_MSG(current_process->GetState() == KProcess::State::Running, -               "Process has already exited"); -    system.Exit(); +    // Check if process is in a valid state for exit +    if (current_process->GetState() != KProcess::State::Running) { +        LOG_WARNING(Kernel_SVC, "Process {} already exiting or in invalid state", current_process->GetProcessId()); +        return; +    } + +    // Ensure clean shutdown +    try { +        system.Exit(); +    } catch (const std::exception& e) { +        LOG_ERROR(Kernel_SVC, "Error during process exit: {}", e.what()); +    }  }  /// Gets the ID of the specified process or a specified thread's owning process. diff --git a/src/core/hle/service/nvnflinger/binder.h b/src/core/hle/service/nvnflinger/binder.h index f9f326e3b..6928a81ec 100644 --- a/src/core/hle/service/nvnflinger/binder.h +++ b/src/core/hle/service/nvnflinger/binder.h @@ -1,11 +1,13 @@  // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project  // SPDX-FileCopyrightText: Copyright 2014 The Android Open Source Project +// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project  // SPDX-License-Identifier: GPL-3.0-or-later  // Parts of this implementation were based on:  // https://cs.android.com/android/platform/superproject/+/android-5.1.1_r38:frameworks/native/include/binder/IBinder.h  #pragma once +#include <atomic>  #include <span>  #include "common/common_types.h"  | 
