public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1853] ada: Adjust QNX Ada priorities to match QNX system priorities
@ 2023-06-15  8:02 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-06-15  8:02 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b36be75b29d7fc5c6ab3c48229f9521ae91c6a2c

commit r14-1853-gb36be75b29d7fc5c6ab3c48229f9521ae91c6a2c
Author: Johannes Kliemann <kliemann@adacore.com>
Date:   Fri May 12 13:21:22 2023 +0000

    ada: Adjust QNX Ada priorities to match QNX system priorities
    
    The Ada priority range of the QNX runtime started from 0, differing from
    the QNX system priorities range starting from 1. As this may cause
    confusion, especially if used in a mixed language environment, the Ada
    priority range now starts at 1.
    
    The default priority of Ada tasks as mandated is the middle of the
    priority range. On QNX this means the default priority of Ada tasks is
    30. This is much higher than the default QNX priority of 10 and may
    cause unexpected system interruptions when Ada tasks take a lot of CPU time.
    
    gcc/ada/
    
            * libgnarl/s-osinte__qnx.adb: Adjust priority conversion function.
            * libgnat/system-qnx-arm.ads: Adjust priority range and default
            priority.

Diff:
---
 gcc/ada/libgnarl/s-osinte__qnx.adb |  2 +-
 gcc/ada/libgnat/system-qnx-arm.ads | 14 ++++++--------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/gcc/ada/libgnarl/s-osinte__qnx.adb b/gcc/ada/libgnarl/s-osinte__qnx.adb
index bf08ecbf4dd..127d1795a35 100644
--- a/gcc/ada/libgnarl/s-osinte__qnx.adb
+++ b/gcc/ada/libgnarl/s-osinte__qnx.adb
@@ -87,7 +87,7 @@ package body System.OS_Interface is
      (Prio : System.Any_Priority) return Interfaces.C.int
    is
    begin
-      return Interfaces.C.int (Prio) + 1;
+      return Interfaces.C.int (Prio);
    end To_Target_Priority;
 
    -----------------
diff --git a/gcc/ada/libgnat/system-qnx-arm.ads b/gcc/ada/libgnat/system-qnx-arm.ads
index 344bd6168f3..1dd1a2228e9 100644
--- a/gcc/ada/libgnat/system-qnx-arm.ads
+++ b/gcc/ada/libgnat/system-qnx-arm.ads
@@ -95,22 +95,20 @@ package System is
 
    --  Priority-related Declarations (RM D.1)
 
-   --  System priority is Ada priority + 1, so lies in the range 1 .. 63.
-   --
    --  If the scheduling policy is SCHED_FIFO or SCHED_RR the runtime makes use
    --  of the entire range provided by the system.
    --
    --  If the scheduling policy is SCHED_OTHER the only valid system priority
    --  is 1 and other values are simply ignored.
 
-   Max_Priority           : constant Positive := 61;
-   Max_Interrupt_Priority : constant Positive := 62;
+   Max_Priority           : constant Positive := 62;
+   Max_Interrupt_Priority : constant Positive := 63;
 
-   subtype Any_Priority       is Integer      range  0 .. 62;
-   subtype Priority           is Any_Priority range  0 .. 61;
-   subtype Interrupt_Priority is Any_Priority range 62 .. 62;
+   subtype Any_Priority       is Integer      range  1 .. 63;
+   subtype Priority           is Any_Priority range  1 .. 62;
+   subtype Interrupt_Priority is Any_Priority range 63 .. 63;
 
-   Default_Priority : constant Priority := 30;
+   Default_Priority : constant Priority := 10;
 
 private

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-15  8:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15  8:02 [gcc r14-1853] ada: Adjust QNX Ada priorities to match QNX system priorities Marc Poulhi?s

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).