summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psx09
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-14 18:41:18 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-14 18:41:18 +0000
commit5abf63d983adbbd1c53e85f54123e99a57f86306 (patch)
treeb5f0fe51adc49833c05743699fd23fe5a1af7ccb /testsuites/psxtests/psx09
parent2008-12-14 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-5abf63d983adbbd1c53e85f54123e99a57f86306.tar.bz2
2008-12-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* psx05/init.c, psx07/init.c, psx09/init.c, psx11/init.c, psx12/init.c: Run all tests successfully with maxixum number of priorities as 16 instead of 256. This was done by temporarily modifying the score priority.h maximum. This allowed testing of all API code to ensure that it worked properly with a reduced number of priorities. Most modifications were to switch from hard-coded maximum to using the API provided methods to determine maximum number of priority levels.
Diffstat (limited to 'testsuites/psxtests/psx09')
-rw-r--r--testsuites/psxtests/psx09/init.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/testsuites/psxtests/psx09/init.c b/testsuites/psxtests/psx09/init.c
index e931866fee..c3454c2984 100644
--- a/testsuites/psxtests/psx09/init.c
+++ b/testsuites/psxtests/psx09/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -13,6 +13,10 @@
#include "system.h"
#include <errno.h>
+int HIGH_PRIORITY;
+int MEDIUM_PRIORITY;
+int LOW_PRIORITY;
+
void print_schedparam(
char *prefix,
struct sched_param *schedparam
@@ -70,8 +74,8 @@ void *POSIX_Init(
schedparam.ss_initial_budget.tv_sec = 0;
schedparam.ss_initial_budget.tv_nsec = 250000000; /* 1/4 second */
- schedparam.sched_priority = 200;
- schedparam.ss_low_priority = 100;
+ schedparam.sched_priority = sched_get_priority_max(SCHED_SPORADIC);
+ schedparam.ss_low_priority = sched_get_priority_max(SCHED_SPORADIC) - 2;
puts( "Init: pthread_setschedparam - SUCCESSFUL (sporadic server)" );
status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
@@ -111,9 +115,9 @@ void *POSIX_Init(
schedparam.ss_initial_budget.tv_sec = 0;
schedparam.ss_initial_budget.tv_nsec = 250000000; /* 1/4 second */
-#define HIGH_PRIORITY 150
-#define MEDIUM_PRIORITY 131
-#define LOW_PRIORITY 100
+ HIGH_PRIORITY = sched_get_priority_max( SCHED_SPORADIC );
+ MEDIUM_PRIORITY = sched_get_priority_max( SCHED_SPORADIC ) - 2;
+ LOW_PRIORITY = sched_get_priority_max( SCHED_SPORADIC ) - 4;
schedparam.sched_priority = HIGH_PRIORITY;
schedparam.ss_low_priority = LOW_PRIORITY;