2020-08-07 16:56:45 -07:00
|
|
|
/**************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Copyright (c) Microsoft Corporation. All rights reserved. */
|
|
|
|
/* */
|
|
|
|
/* This software is licensed under the Microsoft Software License */
|
|
|
|
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
|
|
|
|
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
|
|
|
|
/* and in the root directory of this software. */
|
|
|
|
/* */
|
|
|
|
/**************************************************************************/
|
|
|
|
|
|
|
|
|
2020-09-30 15:42:41 -07:00
|
|
|
/**************************************************************************/
|
|
|
|
/**************************************************************************/
|
2021-06-02 06:45:05 +00:00
|
|
|
/** */
|
|
|
|
/** POSIX wrapper for THREADX */
|
2020-09-30 15:42:41 -07:00
|
|
|
/** */
|
|
|
|
/** */
|
|
|
|
/** */
|
|
|
|
/**************************************************************************/
|
|
|
|
/**************************************************************************/
|
2020-08-07 16:56:45 -07:00
|
|
|
|
2021-06-02 06:45:05 +00:00
|
|
|
/* Include necessary system files. */
|
|
|
|
|
|
|
|
#include "tx_api.h" /* Threadx API */
|
|
|
|
#include "pthread.h" /* Posix API */
|
|
|
|
#include "px_int.h" /* Posix helper functions */
|
2020-08-07 16:56:45 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-30 15:42:41 -07:00
|
|
|
/**************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* FUNCTION RELEASE */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* sched_get_priority_max PORTABLE C */
|
2021-07-28 07:24:02 +00:00
|
|
|
/* 6.1.7 */
|
2020-08-07 16:56:45 -07:00
|
|
|
/* AUTHOR */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* William E. Lamie, Microsoft Corporation */
|
2020-08-07 16:56:45 -07:00
|
|
|
/* */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* DESCRIPTION */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* This routine returns the higest priority available in the system */
|
|
|
|
/* Note that in POSIX higher number indicates a higher priority */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* */
|
|
|
|
/* INPUT */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* policy */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* */
|
|
|
|
/* OUTPUT */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* Maximum Priority If successful */
|
|
|
|
/* ERROR If policy not implemented */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* */
|
|
|
|
/* CALLS */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* CALLED BY */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* Application Code */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* */
|
|
|
|
/* RELEASE HISTORY */
|
|
|
|
/* */
|
2020-08-07 16:56:45 -07:00
|
|
|
/* DATE NAME DESCRIPTION */
|
|
|
|
/* */
|
2021-07-28 07:24:02 +00:00
|
|
|
/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
|
2020-08-07 16:56:45 -07:00
|
|
|
/* */
|
|
|
|
/**************************************************************************/
|
2021-06-02 06:45:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
INT sched_get_priority_max(INT policy)
|
2020-08-07 16:56:45 -07:00
|
|
|
{
|
2021-06-02 06:45:05 +00:00
|
|
|
if (policy==SCHED_FIFO || policy==SCHED_RR )
|
|
|
|
return SCHED_PRIO_MAX;
|
|
|
|
else
|
|
|
|
return ERROR;
|
2020-08-07 16:56:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-02 06:45:05 +00:00
|
|
|
|
2020-09-30 15:42:41 -07:00
|
|
|
/**************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* FUNCTION RELEASE */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* sched_get_priority_min PORTABLE C */
|
2021-07-28 07:24:02 +00:00
|
|
|
/* 6.1.7 */
|
2020-08-07 16:56:45 -07:00
|
|
|
/* AUTHOR */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* William E. Lamie, Microsoft Corporation */
|
2020-08-07 16:56:45 -07:00
|
|
|
/* */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* DESCRIPTION */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* This routine returns the lowest priority available in the system */
|
|
|
|
/* Note that in POSIX higher number indicates a higher priority */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* */
|
|
|
|
/* INPUT */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* policy */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* */
|
|
|
|
/* OUTPUT */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* Minimum Priority If successful */
|
|
|
|
/* ERROR If policy not implemented */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* */
|
|
|
|
/* CALLS */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* CALLED BY */
|
|
|
|
/* */
|
2021-06-02 06:45:05 +00:00
|
|
|
/* Application Code */
|
2020-09-30 15:42:41 -07:00
|
|
|
/* */
|
|
|
|
/* RELEASE HISTORY */
|
|
|
|
/* */
|
2020-08-07 16:56:45 -07:00
|
|
|
/* DATE NAME DESCRIPTION */
|
|
|
|
/* */
|
2021-07-28 07:24:02 +00:00
|
|
|
/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
|
2020-08-07 16:56:45 -07:00
|
|
|
/* */
|
|
|
|
/**************************************************************************/
|
2021-06-02 06:45:05 +00:00
|
|
|
INT sched_get_priority_min(INT policy)
|
2020-08-07 16:56:45 -07:00
|
|
|
{
|
2021-06-02 06:45:05 +00:00
|
|
|
if (policy==SCHED_FIFO || policy==SCHED_RR )
|
|
|
|
return SCHED_PRIO_MIN;
|
|
|
|
else
|
|
|
|
return ERROR;
|
2020-08-07 16:56:45 -07:00
|
|
|
}
|