Skip to content

Commit

Permalink
📝🐎💚🔥reach100% coverage, performance boost, deleted redundant code and…
Browse files Browse the repository at this point in the history
… prepare for formal verification
  • Loading branch information
EDI-Systems committed Jun 7, 2018
1 parent 2323e11 commit 00f7be3
Show file tree
Hide file tree
Showing 12 changed files with 1,210 additions and 239 deletions.
Binary file modified Documents/M5P1_Light-Weight-RTOS-User-Manual.pdf
Binary file not shown.
Binary file modified Documents/M5P1_轻量级实时操作系统使用说明书.pdf
Binary file not shown.
471 changes: 470 additions & 1 deletion MProkaron/Benchmark/test.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion MProkaron/Benchmark/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description: The configuration file for testing program.
******************************************************************************/

/* Config Includes ***********************************************************/
#include "Platform/test_STM32F767IG_RVM.h"
#include "Platform/test_STM32F767IG.h"
/* End Config Includes *******************************************************/

/* End Of File ***************************************************************/
Expand Down
41 changes: 36 additions & 5 deletions MProkaron/Include/Kernel/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Description : The header file for the kernel.

/* Word sizes settings */
#define RMP_WORD_SIZE (((ptr_t)1)<<RMP_WORD_ORDER)
#define RMP_WORD_MASK (~(((ptr_t)(-1))<<(RMP_WORD_ORDER-1)))
#define RMP_WORD_MASK (~(((ptr_t)(-1))<<RMP_WORD_ORDER))
#define RMP_BITMAP_SIZE ((RMP_MAX_PREEMPT_PRIO-1)/RMP_WORD_SIZE+1)
#define RMP_ALLBITS ((ptr_t)(-1))

Expand Down Expand Up @@ -137,6 +137,28 @@ do \
} \
} \
while(0)

/* Coverage switch - not to be enabled in most cases; user should not touch this */
/* #define RMP_COVERAGE */

/* Test marker macro */
#ifdef RMP_COVERAGE
#define RMP_COVERAGE_LINES (6144)
#define RMP_COVERAGE_MARKER() \
do \
{ \
RMP_Coverage[__LINE__]++; \
RMP_Coverage[0]=RMP_Coverage[__LINE__]; \
} \
while(0)
#else
#define RMP_COVERAGE_MARKER() \
do \
{ \
\
} \
while(0)
#endif
/*****************************************************************************/
/* __KERNEL_H_DEFS__ */
#endif
Expand Down Expand Up @@ -222,6 +244,7 @@ struct RMP_Mem_Tail
/* The memory control block structure */
struct RMP_Mem
{
/* This is maintained to perform introspection on the system. Not actually useful */
struct RMP_List Alloc;
ptr_t FLI_Num;
ptr_t Start;
Expand Down Expand Up @@ -255,13 +278,15 @@ struct RMP_Mem
/* If the header is not used in the public mode */
#ifndef __HDR_PUBLIC_MEMBERS__
/*****************************************************************************/
#ifdef RMP_COVERAGE
/* For coverage use only */
static volatile ptr_t RMP_Coverage[RMP_COVERAGE_LINES];
#endif
/* The scheduler bitmap */
static volatile ptr_t RMP_Bitmap[RMP_BITMAP_SIZE];
static volatile struct RMP_List RMP_Run[RMP_MAX_PREEMPT_PRIO];
static volatile struct RMP_List RMP_Delay;

/* The timestamp value */
static volatile ptr_t RMP_Tick;
/* Scheduler lock */
static volatile ptr_t RMP_Sched_Lock_Cnt;
static volatile ptr_t RMP_Sched_Locked;
Expand Down Expand Up @@ -316,6 +341,8 @@ static void RMP_Progbar_Prog(cnt_t Coord_X, cnt_t Coord_Y, cnt_t Length, cnt_t W
#endif

/*****************************************************************************/
/* The current tick counter value - can be read by the application to determine their time */
__EXTERN__ volatile ptr_t RMP_Tick;
/* The current thread - the pointer itself is volatile but not its contents */
__EXTERN__ struct RMP_Thd* volatile RMP_Cur_Thd;
__EXTERN__ volatile ptr_t RMP_Cur_SP;
Expand Down Expand Up @@ -452,16 +479,20 @@ __EXTERN__ ptr_t RMP_CRC16(const u8* Data, ptr_t Length);
EXTERN void RMP_Start_Hook(void);
EXTERN void RMP_Save_Ctx(void);
EXTERN void RMP_Load_Ctx(void);
EXTERN void RMP_Sched_Hook(void);
EXTERN void RMP_Tick_Hook(ptr_t Ticks);
#else
__EXTERN__ void RMP_Start_Hook(void);
__EXTERN__ void RMP_Save_Ctx(void);
__EXTERN__ void RMP_Load_Ctx(void);
__EXTERN__ void RMP_Tick_Hook(ptr_t Ticks);
#endif

EXTERN void RMP_Init_Hook(void);
EXTERN void RMP_Init_Idle(void);

/* Coverage test */
#ifdef RMP_COVERAGE
__EXTERN__ void RMP_Print_Coverage(void);
#endif
/*****************************************************************************/
/* Undefine "__EXTERN__" to avoid redefinition */
#undef __EXTERN__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Description: The configuration file for STM32F767IG.
#include "stm32f7xx_hal.h"
/* The maximum number of preemption priority levels in the system.
* This parameter must be divisible by the word length - 32 is usually sufficient */
#define RMP_MAX_PREEMPT_PRIO 32
#define RMP_MAX_PREEMPT_PRIO 64
/* The maximum number of slices allowed */
#define RMP_MAX_SLICES 100000
/* The maximum number of semaphore counts allowed */
Expand Down
2 changes: 1 addition & 1 deletion MProkaron/Include/Platform/CortexM/platform_cmx_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description: The configuration file for Cortex-M HAL.
******************************************************************************/

/* Config Includes ***********************************************************/
#include "Platform/CortexM/Chips/STM32F103RE/platform_STM32F103RE.h"
#include "Platform/CortexM/Chips/STM32F767IG/platform_STM32F767IG.h"
/* End Config Includes *******************************************************/

/* End Of File ***************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion MProkaron/Include/Platform/RMP_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description : The platform specific types for RMP.
******************************************************************************/

/* Platform Includes *********************************************************/
#include "Platform/CortexM_RVM/platform_cmx_RVM.h"
#include "Platform/CortexM/platform_cmx.h"
/* End Platform Includes *****************************************************/

/* End Of File ***************************************************************/
Expand Down
Loading

0 comments on commit 00f7be3

Please sign in to comment.