posix: internal: make priority / policy transforms available

Two functions can be used with relative ease to convert between
Zephyr and POSIX priorities and policies. Namely,

uint32_t zephyr_to_posix_priority(int32_t z_prio, int *policy)
int32_t posix_to_zephyr_priority(uint32_t priority, int policy)

These are not necessarily public API, but they helped with the
POSIX Philosophers Sample, which is in a subsequent commit.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This commit is contained in:
Christopher Friedt 2024-01-14 11:20:22 -05:00 committed by Chris Friedt
parent cf14d4f1fd
commit e357ba835d

View file

@ -102,4 +102,7 @@ struct posix_thread *to_posix_thread(pthread_t pth);
/* get and possibly initialize a posix_mutex */
struct k_mutex *to_posix_mutex(pthread_mutex_t *mu);
int posix_to_zephyr_priority(int priority, int policy);
int zephyr_to_posix_priority(int priority, int *policy);
#endif