mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-15 15:44:23 -04:00
kern/test: add some scheduler tests (yields work correctly, all non-special priorities are cooperative/not pre-emptive
This commit is contained in:
parent
ad03be9a38
commit
1f8bf41f0b
8 changed files with 514 additions and 9 deletions
35
tests/TestSvc/source/util_common.hpp
Normal file
35
tests/TestSvc/source/util_common.hpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include "util_catch.hpp"
|
||||
|
||||
namespace ams::test {
|
||||
|
||||
static constexpr s32 NumCores = 4;
|
||||
static constexpr s32 DpcManagerNormalThreadPriority = 59;
|
||||
static constexpr s32 DpcManagerPreemptionThreadPriority = 63;
|
||||
|
||||
static constexpr s32 HighestTestPriority = 32;
|
||||
static constexpr s32 LowestTestPriority = svc::LowestThreadPriority;
|
||||
static_assert(HighestTestPriority < LowestTestPriority);
|
||||
|
||||
static constexpr TimeSpan PreemptionTimeSpan = TimeSpan::FromMilliSeconds(10);
|
||||
|
||||
constexpr inline bool IsPreemptionPriority(s32 core, s32 priority) {
|
||||
return priority == ((core == (NumCores - 1)) ? DpcManagerPreemptionThreadPriority : DpcManagerNormalThreadPriority);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue