Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

CMSIS v5 / RTOS v2 - on top of PAL R1.1 rel #61

Merged
merged 2 commits into from
Jun 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Source/PAL-Impl/Modules/RTOS/pal_rtos.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ palThreadID_t pal_osThreadGetId(void)
return result;
}

void* pal_osThreadGetLocalStore(void)
palThreadLocalStore_t* pal_osThreadGetLocalStore(void)
{
void* result;
palThreadLocalStore_t* result = NULL;

result = pal_plat_osThreadGetLocalStore();
return result;
}
Expand Down
3 changes: 3 additions & 0 deletions Source/PAL-Impl/Services-API/pal_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ extern "C" {
#define PAL_RTOS_64BIT_TICK_SUPPORTED false /* add pal support for asynchronous sockets */
#define PAL_UNIQUE_THREAD_PRIORITY (!defined(PAL_IGNORE_UNIQUE_THREAD_PRIORITY))/* if defined code skips the uniqueness priority check */

//! This define is used to determine the size of the initial random buffer (in bytes) held by PAL for random the algorithm.
#define PAL_INITIAL_RANDOM_SIZE 48

//! number of valid priorities limits the number of threads- if priorities are added this value should be increased
#define PAL_MAX_NUMBER_OF_THREADS 7

Expand Down
2 changes: 2 additions & 0 deletions Source/PAL-Impl/Services-API/pal_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ typedef enum {
PAL_ERR_RTOS_PRIORITY = PAL_ERR_RTOS_ERROR_BASE + 0x84,/*! PAL mapping of CMSIS error osErrorPriority : system cannot determine priority or thread has illegal priority.*/
PAL_ERR_RTOS_NO_MEMORY = PAL_ERR_RTOS_ERROR_BASE + 0x85,/*! PAL mapping of CMSIS error osErrorNoMemory : system is out of memory: it was impossible to allocate or reserve memory for the operation.*/
PAL_ERR_RTOS_VALUE = PAL_ERR_RTOS_ERROR_BASE + 0x86,/*! PAL mapping of CMSIS error osErrorValue : value of a parameter is out of range.*/
PAL_ERR_RTOS_TRNG_FAILED = PAL_ERR_RTOS_ERROR_BASE + 0x87, /*! True Random Number Failed */
PAL_ERR_RTOS_TASK = PAL_ERR_RTOS_ERROR_BASE + 0x88,/*! PAL mapping - Cannot kill own task. */
PAL_ERR_RTOS_OS = PAL_ERR_RTOS_ERROR_BASE + 0xFF,/*! PAL mapping of CMSIS error osErrorOS : unspecified RTOS error: run-time error but no other error message fits.*/
// network errors
PAL_ERR_SOCKET_ERROR_BASE = (-1 << PAL_ERR_MODULE_NET), /*! generic socket error */
Expand Down
2 changes: 2 additions & 0 deletions Source/PAL-Impl/Services-API/pal_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ extern "C" {
// PAL success value
#define PAL_SUCCESS 0

#define PAL_PRIVATE static

// maximum integer types
#define PAL_MAX_UINT8 0xFFU
#define PAL_MAX_UINT16 0xFFFFU
Expand Down
4 changes: 3 additions & 1 deletion Source/PAL-Impl/Services-API/pal_rtos.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ extern "C" {
#include "pal_macros.h"
#include "pal_types.h"

#define PRIORITY_INDEX_OFFSET 3

//! Wait forever define. used for Semaphores and Mutexes
#define PAL_RTOS_WAIT_FOREVER PAL_MAX_UINT32

Expand Down Expand Up @@ -143,7 +145,7 @@ palThreadID_t pal_osThreadGetId(void);

/*! Get the storage of current thread
* \return the storage of the current thread */
void* pal_osThreadGetLocalStore(void);
palThreadLocalStore_t* pal_osThreadGetLocalStore(void);

/*! Wait for a specified time period in milliseconds.
*
Expand Down
2 changes: 2 additions & 0 deletions Source/PAL-Impl/Services-API/pal_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ extern "C" {

#define PAL_SUCCESS 0
#define NULLPTR 0
#define PAL_INVALID_THREAD 0xFFFFFFFF


typedef int32_t palStatus_t;

Expand Down
6 changes: 3 additions & 3 deletions Source/Port/Platform-API/pal_plat_rtos.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ palStatus_t pal_plat_RTOSInitialize(void* opaqueContext);

/*! De-Initialize thread objects.
*/
void pal_plat_RTOSDestroy(void);
palStatus_t pal_plat_RTOSDestroy(void);

/*! Get the RTOS kernel system timer counter.
*
Expand All @@ -69,7 +69,7 @@ void pal_plat_RTOSDestroy(void);
* \note The required tick counter is the OS (platform) kernel system tick counter.
* \note This counter wraps around very often (for example, once every 42 sec for 100Mhz).
*/
uint32_t pal_plat_osKernelSysTick();
uint64_t pal_plat_osKernelSysTick(void);

/*! Get the RTOS kernel system timer counter.
*
Expand Down Expand Up @@ -132,7 +132,7 @@ palThreadID_t pal_plat_osThreadGetId();
/*! Get the storage of the current thread.
* \return The storage of the current thread.
*/
void* pal_plat_osThreadGetLocalStore();
palThreadLocalStore_t* pal_plat_osThreadGetLocalStore();

/*! Wait for a specified period of time in milliseconds.
*
Expand Down
Loading