https://gcc.gnu.org/g:49d6d3e2a9a265d77973e9e315e88e6d7f354180
commit r16-6615-g49d6d3e2a9a265d77973e9e315e88e6d7f354180 Author: Piotr Trojanek <[email protected]> Date: Thu Dec 4 00:48:43 2025 +0100 ada: Restore previous mapping for Ada to Win32 task priorities This patch restores previous mapping of Ada to Win32 task priorities used when no pragma Task_Dispatching_Policy (FIFO_Within_Priorities) is present (except for wrong mapping to values that can only be used for processes with REALTIME_PRIORITY_CLASS). The new mapping is consistent with the one used when that pragma is present and provides distinct values for priorities in range of Default_Priority +/- 2. gcc/ada/ChangeLog: * libgnat/system-mingw.ads (Underlying_Priorities): Restore previous mapping with distinct values around Default_Priority. Diff: --- gcc/ada/libgnat/system-mingw.ads | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/gcc/ada/libgnat/system-mingw.ads b/gcc/ada/libgnat/system-mingw.ads index d0df352e4809..5516b627d4a5 100644 --- a/gcc/ada/libgnat/system-mingw.ads +++ b/gcc/ada/libgnat/system-mingw.ads @@ -191,16 +191,15 @@ private -- pragma Task_Dispatching_Policy (FIFO_Within_Priorities). Underlying_Priorities : constant Priorities_Mapping := - (Priority'First => -15, -- Thread_Priority_Idle - 1 .. 6 => -2, -- Thread_Priority_Lowest - 7 .. 12 => -1, -- Thread_Priority_Below_Normal - 13 .. 14 => 0, -- Thread_Priority_Normal - Default_Priority => 0, -- Thread_Priority_Normal - 16 .. 18 => 0, -- Thread_Priority_Normal - 19 .. 24 => 1, -- Thread_Priority_Above_Normal - 25 .. 29 => 2, -- Thread_Priority_Highest - Priority'Last => 2, -- Thread_Priority_Highest - Interrupt_Priority => 15); -- Thread_Priority_Time_Critical + (Priority'First .. + Default_Priority - 3 => -15, -- Thread_Priority_Idle + Default_Priority - 2 => -2, -- Thread_Priority_Lowest + Default_Priority - 1 => -1, -- Thread_Priority_Below_Normal + Default_Priority => 0, -- Thread_Priority_Normal + Default_Priority + 1 => 1, -- Thread_Priority_Above_Normal + Default_Priority + 2 .. + Priority'Last => 2, -- Thread_Priority_Highest + Interrupt_Priority => 15); -- Thread_Priority_Time_Critical -- The non FIFO mapping preserves the standard 31 priorities of the Ada -- model, but maps them using compression onto the 7 priority levels -- available in NT when pragma Task_Dispatching_Policy is unspecified.
