From 6481405e5c6feb265efbea9549f7a1107f08de08 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 24 May 1996 14:16:24 +0000 Subject: added use of sporadic server scheduling parameters --- c/src/tests/psxtests/psxhdrs/pthread11.c | 10 ++++++++++ c/src/tests/psxtests/psxhdrs/pthread17.c | 3 +++ c/src/tests/psxtests/psxhdrs/pthread22.c | 14 ++++++++++++++ c/src/tests/psxtests/psxhdrs/sched01.c | 11 +++++++++++ c/src/tests/psxtests/psxhdrs/sched03.c | 14 ++++++++++++++ c/src/tests/psxtests/psxhdrs/sched06.c | 3 +++ c/src/tests/psxtests/psxhdrs/sched07.c | 3 +++ testsuites/psxtests/psxhdrs/pthread11.c | 10 ++++++++++ testsuites/psxtests/psxhdrs/pthread17.c | 3 +++ testsuites/psxtests/psxhdrs/pthread22.c | 14 ++++++++++++++ testsuites/psxtests/psxhdrs/sched01.c | 11 +++++++++++ testsuites/psxtests/psxhdrs/sched03.c | 14 ++++++++++++++ testsuites/psxtests/psxhdrs/sched06.c | 3 +++ testsuites/psxtests/psxhdrs/sched07.c | 3 +++ 14 files changed, 116 insertions(+) diff --git a/c/src/tests/psxtests/psxhdrs/pthread11.c b/c/src/tests/psxtests/psxhdrs/pthread11.c index 521ff7616d..38de2d1c71 100644 --- a/c/src/tests/psxtests/psxhdrs/pthread11.c +++ b/c/src/tests/psxtests/psxhdrs/pthread11.c @@ -31,12 +31,22 @@ void test( void ) policy = SCHED_OTHER; policy = SCHED_FIFO; policy = SCHED_RR; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif /* * really should use sched_get_priority_min() and sched_get_priority_max() */ param.sched_priority = 0; +#ifdef _POSIX_SPORADIC_SERVER + param.ss_low_priority = 0; + param.ss_replenish_period.tv_sec = 0; + param.ss_replenish_period.tv_nsec = 0; + param.ss_initial_budget.tv_sec = 0; + param.ss_initial_budget.tv_nsec = 0; +#endif result = pthread_setschedparam( thread, policy, ¶m ); } diff --git a/c/src/tests/psxtests/psxhdrs/pthread17.c b/c/src/tests/psxtests/psxhdrs/pthread17.c index 88f1c95e0c..0e7f4ed6ee 100644 --- a/c/src/tests/psxtests/psxhdrs/pthread17.c +++ b/c/src/tests/psxtests/psxhdrs/pthread17.c @@ -28,6 +28,9 @@ void test( void ) policy = SCHED_FIFO; policy = SCHED_RR; policy = SCHED_OTHER; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif result = pthread_attr_setschedpolicy( &attr, policy ); } diff --git a/c/src/tests/psxtests/psxhdrs/pthread22.c b/c/src/tests/psxtests/psxhdrs/pthread22.c index e36936f9f9..767ba550a6 100644 --- a/c/src/tests/psxtests/psxhdrs/pthread22.c +++ b/c/src/tests/psxtests/psxhdrs/pthread22.c @@ -29,8 +29,22 @@ void test( void ) policy = SCHED_OTHER; policy = SCHED_FIFO; policy = SCHED_RR; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif + + /* + * really should use sched_get_priority_min() and sched_get_priority_max() + */ param.sched_priority = 0; +#ifdef _POSIX_SPORADIC_SERVER + param.ss_low_priority = 0; + param.ss_replenish_period.tv_sec = 0; + param.ss_replenish_period.tv_nsec = 0; + param.ss_initial_budget.tv_sec = 0; + param.ss_initial_budget.tv_nsec = 0; +#endif result = pthread_setschedparam( thread, policy, ¶m ); } diff --git a/c/src/tests/psxtests/psxhdrs/sched01.c b/c/src/tests/psxtests/psxhdrs/sched01.c index 56695ade58..5b2bc0b76f 100644 --- a/c/src/tests/psxtests/psxhdrs/sched01.c +++ b/c/src/tests/psxtests/psxhdrs/sched01.c @@ -27,7 +27,18 @@ void test( void ) pid = 0; + /* + * really should use sched_get_priority_min() and sched_get_priority_max() + */ + param.sched_priority = 0; +#ifdef _POSIX_SPORADIC_SERVER + param.ss_low_priority = 0; + param.ss_replenish_period.tv_sec = 0; + param.ss_replenish_period.tv_nsec = 0; + param.ss_initial_budget.tv_sec = 0; + param.ss_initial_budget.tv_nsec = 0; +#endif result = sched_setparam( pid, ¶m ); } diff --git a/c/src/tests/psxtests/psxhdrs/sched03.c b/c/src/tests/psxtests/psxhdrs/sched03.c index d2fcdc9cf7..b140a0052d 100644 --- a/c/src/tests/psxtests/psxhdrs/sched03.c +++ b/c/src/tests/psxtests/psxhdrs/sched03.c @@ -31,8 +31,22 @@ void test( void ) policy = SCHED_RR; policy = SCHED_FIFO; policy = SCHED_OTHER; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif + + /* + * really should use sched_get_priority_min() and sched_get_priority_max() + */ param.sched_priority = 0; +#ifdef _POSIX_SPORADIC_SERVER + param.ss_low_priority = 0; + param.ss_replenish_period.tv_sec = 0; + param.ss_replenish_period.tv_nsec = 0; + param.ss_initial_budget.tv_sec = 0; + param.ss_initial_budget.tv_nsec = 0; +#endif result = sched_setscheduler( pid, policy, ¶m ); } diff --git a/c/src/tests/psxtests/psxhdrs/sched06.c b/c/src/tests/psxtests/psxhdrs/sched06.c index 9a82d1d409..49eaa43f4d 100644 --- a/c/src/tests/psxtests/psxhdrs/sched06.c +++ b/c/src/tests/psxtests/psxhdrs/sched06.c @@ -27,6 +27,9 @@ void test( void ) policy = SCHED_RR; policy = SCHED_FIFO; policy = SCHED_OTHER; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif result = sched_get_priority_max( policy ); } diff --git a/c/src/tests/psxtests/psxhdrs/sched07.c b/c/src/tests/psxtests/psxhdrs/sched07.c index 58cb1aab9f..767cb30a86 100644 --- a/c/src/tests/psxtests/psxhdrs/sched07.c +++ b/c/src/tests/psxtests/psxhdrs/sched07.c @@ -27,6 +27,9 @@ void test( void ) policy = SCHED_RR; policy = SCHED_FIFO; policy = SCHED_OTHER; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif result = sched_get_priority_min( policy ); } diff --git a/testsuites/psxtests/psxhdrs/pthread11.c b/testsuites/psxtests/psxhdrs/pthread11.c index 521ff7616d..38de2d1c71 100644 --- a/testsuites/psxtests/psxhdrs/pthread11.c +++ b/testsuites/psxtests/psxhdrs/pthread11.c @@ -31,12 +31,22 @@ void test( void ) policy = SCHED_OTHER; policy = SCHED_FIFO; policy = SCHED_RR; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif /* * really should use sched_get_priority_min() and sched_get_priority_max() */ param.sched_priority = 0; +#ifdef _POSIX_SPORADIC_SERVER + param.ss_low_priority = 0; + param.ss_replenish_period.tv_sec = 0; + param.ss_replenish_period.tv_nsec = 0; + param.ss_initial_budget.tv_sec = 0; + param.ss_initial_budget.tv_nsec = 0; +#endif result = pthread_setschedparam( thread, policy, ¶m ); } diff --git a/testsuites/psxtests/psxhdrs/pthread17.c b/testsuites/psxtests/psxhdrs/pthread17.c index 88f1c95e0c..0e7f4ed6ee 100644 --- a/testsuites/psxtests/psxhdrs/pthread17.c +++ b/testsuites/psxtests/psxhdrs/pthread17.c @@ -28,6 +28,9 @@ void test( void ) policy = SCHED_FIFO; policy = SCHED_RR; policy = SCHED_OTHER; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif result = pthread_attr_setschedpolicy( &attr, policy ); } diff --git a/testsuites/psxtests/psxhdrs/pthread22.c b/testsuites/psxtests/psxhdrs/pthread22.c index e36936f9f9..767ba550a6 100644 --- a/testsuites/psxtests/psxhdrs/pthread22.c +++ b/testsuites/psxtests/psxhdrs/pthread22.c @@ -29,8 +29,22 @@ void test( void ) policy = SCHED_OTHER; policy = SCHED_FIFO; policy = SCHED_RR; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif + + /* + * really should use sched_get_priority_min() and sched_get_priority_max() + */ param.sched_priority = 0; +#ifdef _POSIX_SPORADIC_SERVER + param.ss_low_priority = 0; + param.ss_replenish_period.tv_sec = 0; + param.ss_replenish_period.tv_nsec = 0; + param.ss_initial_budget.tv_sec = 0; + param.ss_initial_budget.tv_nsec = 0; +#endif result = pthread_setschedparam( thread, policy, ¶m ); } diff --git a/testsuites/psxtests/psxhdrs/sched01.c b/testsuites/psxtests/psxhdrs/sched01.c index 56695ade58..5b2bc0b76f 100644 --- a/testsuites/psxtests/psxhdrs/sched01.c +++ b/testsuites/psxtests/psxhdrs/sched01.c @@ -27,7 +27,18 @@ void test( void ) pid = 0; + /* + * really should use sched_get_priority_min() and sched_get_priority_max() + */ + param.sched_priority = 0; +#ifdef _POSIX_SPORADIC_SERVER + param.ss_low_priority = 0; + param.ss_replenish_period.tv_sec = 0; + param.ss_replenish_period.tv_nsec = 0; + param.ss_initial_budget.tv_sec = 0; + param.ss_initial_budget.tv_nsec = 0; +#endif result = sched_setparam( pid, ¶m ); } diff --git a/testsuites/psxtests/psxhdrs/sched03.c b/testsuites/psxtests/psxhdrs/sched03.c index d2fcdc9cf7..b140a0052d 100644 --- a/testsuites/psxtests/psxhdrs/sched03.c +++ b/testsuites/psxtests/psxhdrs/sched03.c @@ -31,8 +31,22 @@ void test( void ) policy = SCHED_RR; policy = SCHED_FIFO; policy = SCHED_OTHER; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif + + /* + * really should use sched_get_priority_min() and sched_get_priority_max() + */ param.sched_priority = 0; +#ifdef _POSIX_SPORADIC_SERVER + param.ss_low_priority = 0; + param.ss_replenish_period.tv_sec = 0; + param.ss_replenish_period.tv_nsec = 0; + param.ss_initial_budget.tv_sec = 0; + param.ss_initial_budget.tv_nsec = 0; +#endif result = sched_setscheduler( pid, policy, ¶m ); } diff --git a/testsuites/psxtests/psxhdrs/sched06.c b/testsuites/psxtests/psxhdrs/sched06.c index 9a82d1d409..49eaa43f4d 100644 --- a/testsuites/psxtests/psxhdrs/sched06.c +++ b/testsuites/psxtests/psxhdrs/sched06.c @@ -27,6 +27,9 @@ void test( void ) policy = SCHED_RR; policy = SCHED_FIFO; policy = SCHED_OTHER; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif result = sched_get_priority_max( policy ); } diff --git a/testsuites/psxtests/psxhdrs/sched07.c b/testsuites/psxtests/psxhdrs/sched07.c index 58cb1aab9f..767cb30a86 100644 --- a/testsuites/psxtests/psxhdrs/sched07.c +++ b/testsuites/psxtests/psxhdrs/sched07.c @@ -27,6 +27,9 @@ void test( void ) policy = SCHED_RR; policy = SCHED_FIFO; policy = SCHED_OTHER; +#ifdef _POSIX_SPORADIC_SERVER + policy = SCHED_SPORADIC; +#endif result = sched_get_priority_min( policy ); } -- cgit v1.2.3