Modified payload_aes_busy to include some sleep statements

This commit is contained in:
2020-01-07 17:35:08 -05:00
parent b590cd65c8
commit cde3ad8bbe
3 changed files with 10 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ typedef int (*BOOTROM_FUNC)();
#define ADDR_CLOCK_GATE 0x100009d4c
#define ADDR_SYSTEM_TIME 0x10000B0E0
#define ADDR_TIME_HAS_ELAPSED 0x10000B04F
#define ADDR_TASK_SLEEP 0x10000ADF0
#else
#error "Unsupported checkm8 platform"

View File

@@ -7,4 +7,10 @@
#define SYSTEM_TIME ((BOOTROM_FUNC) ADDR_SYSTEM_TIME)
#define TIME_HAS_ELAPSED ((BOOTROM_FUNC) ADDR_TIME_HAS_ELAPSED)
PAYLOAD_SECTION
void task_sleep(unsigned int usec)
{
((BOOTROM_FUNC) ADDR_TASK_SLEEP)(usec);
}
#endif //CHECKM8_TOOL_BRFUNC_TIMING_H

View File

@@ -1,5 +1,6 @@
#include "util.h"
#include "brfunc_aes.h"
#include "brfunc_timing.h"
TEXT_SECTION
@@ -12,10 +13,12 @@ int _start(void *src, void *dst, void *key, int rep)
src_data[j] = ((unsigned char *) src)[j];
}
task_sleep(100);
for(i = 0; i < rep; i++)
{
if(i % 2 == 0) aes_hw_crypto_cmd(16, src_data, dst, 16, 0, key, 0);
else aes_hw_crypto_cmd(16, dst, src_data, 16, 0, key, 0);
task_sleep(15);
}
return 0;