diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-07-23 16:05:13 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-07-23 16:05:13 +0000 |
commit | 6e8632f3a2e1ffb9d42a78aa78c268577aebe579 (patch) | |
tree | 38037e5a2556de40e3621fa9698e9b09dcba7f17 | |
parent | 2008-07-23 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | ada-examples-6e8632f3a2e1ffb9d42a78aa78c268577aebe579.tar.bz2 |
2008-07-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* empty.c, task_priority.adb: Switch to 150/151. Clean up output.
-rw-r--r-- | task_priority/ChangeLog | 4 | ||||
-rw-r--r-- | task_priority/empty.c | 2 | ||||
-rw-r--r-- | task_priority/task_priority.adb | 26 |
3 files changed, 21 insertions, 11 deletions
diff --git a/task_priority/ChangeLog b/task_priority/ChangeLog index fccd5ac..cce5b54 100644 --- a/task_priority/ChangeLog +++ b/task_priority/ChangeLog @@ -1,3 +1,7 @@ +2008-07-23 Joel Sherrill <joel.sherrill@oarcorp.com> + + * empty.c, task_priority.adb: Switch to 150/151. Clean up output. + 2008-02-06 Joel Sherrill <joel.sherrill@oarcorp.com> * ChangeLog, Makefile, empty.c, task_priority.adb: New files. diff --git a/task_priority/empty.c b/task_priority/empty.c index b5413c2..a64c828 100644 --- a/task_priority/empty.c +++ b/task_priority/empty.c @@ -5,7 +5,7 @@ int getPriority() { #if defined(__rtems__) - printk( "ID=0x%08x\n", _Thread_Executing->Object.id ); + printk( "ID=0x%08x ", _Thread_Executing->Object.id ); return (int)_Thread_Executing->current_priority; #endif diff --git a/task_priority/task_priority.adb b/task_priority/task_priority.adb index c4c5d64..33fcd29 100644 --- a/task_priority/task_priority.adb +++ b/task_priority/task_priority.adb @@ -2,12 +2,16 @@ -- Demonstrate Task Priority -- -- ---High: 17 ---HighNative: ID=0x0B010004 --- 238 ---Low: 16 ---LowNative: ID=0x0B010003 --- 239 +-- Expected Output: +-- High: 151 +-- HighNative: ID=0x0B010004 104 +-- Low: 150 +-- LowNative: ID=0x0B010003 105 +-- High - Waking up +-- High - Waking up +-- .... +-- +-- $Id$ with Text_IO; use Text_IO; @@ -21,16 +25,16 @@ procedure Task_Priority is function getPriority return Interfaces.C.int; pragma Import (C, getPriority, "getPriority"); begin - Put_Line (Interfaces.C.int'Image (getPriority)); + Put (Interfaces.C.int'Image (getPriority)); end Put_Priority; - -- I think 16 > 17 to Ada + -- I think 151 > 150 to Ada task Low_Task is - pragma Priority(16); + pragma Priority(150); end Low_Task; task High_Task is - pragma Priority(17); + pragma Priority(151); end High_Task; task body High_Task is @@ -38,6 +42,7 @@ procedure Task_Priority is Put_Line ( "High: " & System.Any_Priority'Image (Get_Priority)); Put ( "HighNative: " ); Put_Priority; + New_Line; loop delay 1.0; Put_Line ("High - Waking up"); @@ -51,6 +56,7 @@ procedure Task_Priority is Put_Line ( "Low: " & System.Any_Priority'Image (Get_Priority)); Put ( "LowNative: " ); Put_Priority; + New_Line; delay 0.1; loop empty; |