18 #define SE3_ALIGN_16 __declspec(align(0x10)) 19 #elif defined(__GNUC__) 20 #define SE3_ALIGN_16 __attribute__((aligned(0x10))) 26 uint64_t se3c0_time_get();
27 void se3c0_time_set(uint64_t t);
28 void se3c0_time_inc();
30 const uint8_t se3_hello[SE3_HELLO_SIZE];
32 #define SE3_BMAP_MAKE(n) ((uint32_t)(0xFFFFFFFF >> (32 - (n)))) 67 size_t first_free_pos;
74 uint8_t data[SE3_SERIAL_SIZE];
86 uint32_t cmdtok[SE3_COMM_N - 1];
97 uint32_t cmdtok[SE3_COMM_N - 1];
101 typedef uint16_t(*
se3_cmd_func)(uint16_t,
const uint8_t*, uint16_t*, uint8_t*);
120 extern uint8_t se3_comm_request_buffer[SE3_COMM_N*SE3_COMM_BLOCK];
121 extern uint8_t se3_comm_response_buffer[SE3_COMM_N*SE3_COMM_BLOCK];
This file contains defines and functions common for L0 and L1.
L0 globals structure.
Definition: se3c0.h:104
uint8_t * req_hdr
received header buffer
Definition: se3c0.h:52
uint32_t sector
active sector number
Definition: se3c0.h:63
uint32_t resp_bmap
map of sent response blocks
Definition: se3c0.h:56
uint32_t blocks[SE3_COMM_N]
map of blocks
Definition: se3c0.h:44
struct SE3_FLASH_INFO_ SE3_FLASH_INFO
Flash management structure.
uint32_t magic_bmap
bit map of written magic sectors
Definition: se3c0.h:41
bool magic_ready
magic written flag
Definition: se3c0.h:40
serial number data and state
Definition: se3c0.h:73
struct SE3_COMM_STATUS_ SE3_COMM_STATUS
structure holding host-device communication status and buffers
uint8_t * resp_hdr
buffer for header to be sent
Definition: se3c0.h:58
struct SE3_SERIAL_ SE3_SERIAL
serial number data and state
bool written
Indicates whether the serial number has been set (by FACTORY_INIT)
Definition: se3c0.h:75
uint16_t(* se3_cmd_func)(uint16_t, const uint8_t *, uint16_t *, uint8_t *)
Definition: se3c0.h:101
struct se3c0_req_header_ se3c0_req_header
decoded request header
uint8_t * req_data
received data buffer
Definition: se3c0.h:51
uint8_t * resp_data
buffer for data to be sent
Definition: se3c0.h:57
volatile bool resp_ready
response ready flag
Definition: se3c0.h:55
uint64_t now
current UNIX time in seconds
Definition: se3c0.h:116
Flash management structure.
Definition: se3c0.h:62
struct SE3_L0_GLOBALS_ SE3_L0_GLOBALS
L0 globals structure.
bool now_initialized
time was initialized
Definition: se3c0.h:117
struct se3c0_resp_header_ se3c0_resp_header
response header to be encoded
uint32_t req_bmap
map of received request blocks
Definition: se3c0.h:50
volatile bool req_ready
request ready flag
Definition: se3c0.h:49
structure holding host-device communication status and buffers
Definition: se3c0.h:38
uint32_t block_guess
guess for next block that will be accessed
Definition: se3c0.h:45
bool locked
prevent magic initialization
Definition: se3c0.h:46