added to the bootrom libraries
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#define ADDR_EVENT_NEW 0x10000aed4
|
||||
#define ADDR_EVENT_NOTIFY 0x10000aee8
|
||||
#define ADDR_EVENT_WAIT 0x10000af3c
|
||||
#define ADDR_EVENT_TRY 0x10000af7c
|
||||
|
||||
/* Heap */
|
||||
#define ADDR_CALC_CHKSUM 0x10000ee20
|
||||
|
||||
24
c8_remote/include/bootrom_type.h
Normal file
24
c8_remote/include/bootrom_type.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef CHECKM8_TOOL_BOOTROM_TYPE_H
|
||||
#define CHECKM8_TOOL_BOOTROM_TYPE_H
|
||||
|
||||
struct event
|
||||
{
|
||||
unsigned long long dat0;
|
||||
unsigned long long dat1;
|
||||
unsigned long long dat2;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct aes_sw_bernstein_data
|
||||
{
|
||||
double t[16][256];
|
||||
double tsq[16][256];
|
||||
double tnum[16][256];
|
||||
|
||||
unsigned long long count;
|
||||
double ttotal;
|
||||
|
||||
struct event ev_data;
|
||||
struct event ev_done;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif //CHECKM8_TOOL_BOOTROM_TYPE_H
|
||||
@@ -2,6 +2,7 @@
|
||||
#define CHECKM8_TOOL_BOOTROM_FUNC_H
|
||||
|
||||
#include "bootrom_addr.h"
|
||||
#include "bootrom_type.h"
|
||||
#include "dev_util.h"
|
||||
|
||||
/* Crypto */
|
||||
@@ -65,21 +66,26 @@ static inline void task_free(void *task)
|
||||
((BOOTROM_FUNC_V) ADDR_TASK_FREE)(task);
|
||||
}
|
||||
|
||||
static inline void event_new(void *dst, int flags, int state)
|
||||
static inline void event_new(struct event *dst, int flags, int state)
|
||||
{
|
||||
((BOOTROM_FUNC_V) ADDR_EVENT_NEW)(dst, flags, state);
|
||||
}
|
||||
|
||||
static inline void event_notify(void *ev)
|
||||
static inline void event_notify(struct event *ev)
|
||||
{
|
||||
((BOOTROM_FUNC_V) ADDR_EVENT_NOTIFY)(ev);
|
||||
}
|
||||
|
||||
static inline void event_wait(void *ev)
|
||||
static inline void event_wait(struct event *ev)
|
||||
{
|
||||
((BOOTROM_FUNC_V) ADDR_EVENT_WAIT)(ev);
|
||||
}
|
||||
|
||||
static inline int event_try(struct event *ev, int timeout)
|
||||
{
|
||||
return ((BOOTROM_FUNC_I) ADDR_EVENT_TRY)(ev, timeout);
|
||||
}
|
||||
|
||||
/* Heap */
|
||||
static inline void calc_chksum(unsigned long long *dst, unsigned long long *src,
|
||||
int len, unsigned long long *cookie)
|
||||
|
||||
@@ -48,13 +48,13 @@ static inline void clean_inv_l1_setway(unsigned int set, unsigned int way)
|
||||
}
|
||||
|
||||
PAYLOAD_SECTION
|
||||
static inline void inv_l1_va(unsigned long long *addr)
|
||||
static inline void inv_va(void *addr)
|
||||
{
|
||||
__asm__ volatile ("dc ivac, %0"::"r" (addr));
|
||||
}
|
||||
|
||||
PAYLOAD_SECTION
|
||||
static inline void clean_inv_l1_va(unsigned long long *addr)
|
||||
static inline void clean_inv_va(void *addr)
|
||||
{
|
||||
__asm__ volatile ("dc ivac, %0"::"r" (addr));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user