|
|
|
@ -4,7 +4,9 @@
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "irq.h"
|
|
|
|
|
#include "mpconfigport.h"
|
|
|
|
|
#include "supervise.h"
|
|
|
|
|
|
|
|
|
|
#include "SEGGER_SYSVIEW.h"
|
|
|
|
|
#include "SEGGER_SYSVIEW_Conf.h"
|
|
|
|
@ -50,12 +52,6 @@ typedef struct {
|
|
|
|
|
|
|
|
|
|
extern uint32_t SystemCoreClock;
|
|
|
|
|
|
|
|
|
|
static inline uint32_t is_mode_unprivileged(void) {
|
|
|
|
|
uint32_t r0;
|
|
|
|
|
__asm__ volatile("mrs %0, control" : "=r"(r0));
|
|
|
|
|
return r0 & 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t svc_get_dwt_cyccnt() {
|
|
|
|
|
if (is_mode_unprivileged()) {
|
|
|
|
|
__asm__ __volatile__("svc %0" ::"i"(SVC_GET_DWT_CYCCNT));
|
|
|
|
|