Zephyr's POSIX API is moving toward using the standard nomenclature from IEEE 1003.1-2017 for as much as possible. In particular, we want to have consistent naming between Zephyr's POSIX API Kconfig options and the naming for POSIX Options and Option Groups. The Kconfig option CONFIG_PTHREAD_IPC has been (ab)used for a very long time for a variety of different purposes. However, the standard Option / feature test macro for POSIX Threads is, intuitively _POSIX_THREADS. There is a corresponding sysconf() key named _SC_POSIX_THREADS. Annoyingly, the POSIX Option Group that corresponds to the Option is POSIX_THREADS_BASE, which is a minor inconsistency in the standard. The _POSIX_THREADS Option already includes mutexes, condition variables, and thread-specific storage (keys). So with this change, we also deprecate the redundant Kconfig variables that do not have a corresponding match in the standard. - CONFIG_PTHREAD_IPC - CONFIG_PTHREAD - CONFIG_PTHREAD_COND - CONFIG_PTHREAD_MUTEX - CONFIG_PTHREAD_KEY Additionally, create Kconfig variables for those configurables which we are lacking: - CONFIG_POSIX_THREADS_EXT - CONFIG_POSIX_THREAD_ATTR_STACKSIZE - CONFIG_POSIX_THREAD_ATTR_STACKADDR - CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING - CONFIG_POSIX_THREAD_PRIO_INHERIT - CONFIG_POSIX_THREAD_PRIO_PROTECT - CONFIG_POSIX_THREAD_SAFE_FUNCTIONS Some Kconfig variables were renamed to more properly match the spec: - CONFIG_MAX_PTHREAD_COUNT -> CONFIG_POSIX_THREAD_THREADS_MAX - CONFIG_MAX_PTHREAD_KEY_COUNT -> CONFIG_POSIX_THREAD_KEYS_MAX Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
100 lines
1.4 KiB
C
100 lines
1.4 KiB
C
/*
|
|
* Copyright (c) 2018-2023 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include "pthread_sched.h"
|
|
|
|
#include <zephyr/kernel.h>
|
|
#include <zephyr/posix/sched.h>
|
|
|
|
/**
|
|
* @brief Get minimum priority value for a given policy
|
|
*
|
|
* See IEEE 1003.1
|
|
*/
|
|
int sched_get_priority_min(int policy)
|
|
{
|
|
return posix_sched_priority_min(policy);
|
|
}
|
|
|
|
/**
|
|
* @brief Get maximum priority value for a given policy
|
|
*
|
|
* See IEEE 1003.1
|
|
*/
|
|
int sched_get_priority_max(int policy)
|
|
{
|
|
return posix_sched_priority_max(policy);
|
|
}
|
|
|
|
/**
|
|
* @brief Get scheduling parameters
|
|
*
|
|
* See IEEE 1003.1
|
|
*/
|
|
int sched_getparam(pid_t pid, struct sched_param *param)
|
|
{
|
|
ARG_UNUSED(pid);
|
|
ARG_UNUSED(param);
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
}
|
|
|
|
/**
|
|
* @brief Get scheduling policy
|
|
*
|
|
* See IEEE 1003.1
|
|
*/
|
|
int sched_getscheduler(pid_t pid)
|
|
{
|
|
ARG_UNUSED(pid);
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
}
|
|
|
|
/**
|
|
* @brief Set scheduling parameters
|
|
*
|
|
* See IEEE 1003.1
|
|
*/
|
|
int sched_setparam(pid_t pid, const struct sched_param *param)
|
|
{
|
|
ARG_UNUSED(pid);
|
|
ARG_UNUSED(param);
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
}
|
|
|
|
/**
|
|
* @brief Set scheduling policy
|
|
*
|
|
* See IEEE 1003.1
|
|
*/
|
|
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param)
|
|
{
|
|
ARG_UNUSED(pid);
|
|
ARG_UNUSED(policy);
|
|
ARG_UNUSED(param);
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
}
|
|
|
|
int sched_rr_get_interval(pid_t pid, struct timespec *interval)
|
|
{
|
|
ARG_UNUSED(pid);
|
|
ARG_UNUSED(interval);
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
}
|