Skip to content

Commit

Permalink
Add execution monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
dehanj authored and mchack-work committed Jun 26, 2023
1 parent 92a091c commit 43ef5ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion signer/app.bin.sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
93c8e7fba755f78d3827464408e04af3525ff28ebc8885b9065de83648bd0bc66ec9342348c08060cfb7c64bca0ec7836008c19a6e10190667e027b3802cd04f app.bin
6ae41e056313045a15c5cf71cb75aadd689956220bf6480f62aab8409df3ee08a897bbc828c55191f7cfa7fc876e5fb97efe6df03a55f56c49331e61d3e55022 app.bin
16 changes: 13 additions & 3 deletions signer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
#include "app_proto.h"

// clang-format off
static volatile uint32_t *cdi = (volatile uint32_t *)TK1_MMIO_TK1_CDI_FIRST;
static volatile uint32_t *led = (volatile uint32_t *)TK1_MMIO_TK1_LED;
static volatile uint32_t *touch = (volatile uint32_t *)TK1_MMIO_TOUCH_STATUS;
static volatile uint32_t *cdi = (volatile uint32_t *)TK1_MMIO_TK1_CDI_FIRST;
static volatile uint32_t *led = (volatile uint32_t *)TK1_MMIO_TK1_LED;
static volatile uint32_t *touch = (volatile uint32_t *)TK1_MMIO_TOUCH_STATUS;
static volatile uint32_t *cpu_mon_ctrl = (volatile uint32_t *) TK1_MMIO_TK1_CPU_MON_CTRL;
static volatile uint32_t *cpu_mon_first = (volatile uint32_t *) TK1_MMIO_TK1_CPU_MON_FIRST;
static volatile uint32_t *cpu_mon_last = (volatile uint32_t *) TK1_MMIO_TK1_CPU_MON_LAST;
static volatile uint32_t *app_addr = (volatile uint32_t *) TK1_MMIO_TK1_APP_ADDR;
static volatile uint32_t *app_size = (volatile uint32_t *) TK1_MMIO_TK1_APP_SIZE;

#define LED_BLACK 0
#define LED_RED (1 << TK1_MMIO_TK1_LED_R_BIT)
Expand Down Expand Up @@ -59,6 +64,11 @@ int main(void)
uint8_t in;
uint32_t local_cdi[8];

// Use Execution Monitor on RAM after app
*cpu_mon_first = *app_addr + *app_size;
*cpu_mon_last = TK1_RAM_BASE + TK1_RAM_SIZE;
*cpu_mon_ctrl = 1;

qemu_puts("Hello! &stack is on: ");
qemu_putinthex((uint32_t)&stack);
qemu_lf();
Expand Down

0 comments on commit 43ef5ee

Please sign in to comment.