tillitis-key/hw/application_fpga/fw/tk1/syscall.h
Daniel Jobson c6000e4e2a
storage: add erase command
Add an erase command to let the user have more control over the
allocated area. This will also be more familiar to embedded developers.
As a bonus it minimizes the logic needed in firmware, and in theory we
can now increase the current write limit of one sector.
2024-11-21 09:48:52 +01:00

37 lines
543 B
C

// Copyright (C) 2024 - Tillitis AB
// SPDX-License-Identifier: GPL-2.0-only
#ifndef SYSCALL_H
#define SYSCALL_H
#include "partition_table.h"
#include <stdint.h>
#include <stddef.h>
typedef struct {
uint8_t syscall_no;
uint32_t offset;
uint8_t *data;
size_t size;
uint32_t *ctx;
} syscall_t;
enum syscall_cmd {
BLAKE2S = 0,
ALLOC_AREA,
DEALLOC_AREA,
WRITE_DATA,
READ_DATA,
ERASE_DATA,
PRELOAD_STORE,
PRELOAD_STORE_FINALIZE,
PRELOAD_DELETE,
MGMT_APP_REGISTER,
MGMT_APP_UNREGISTER,
};
int syscall(syscall_t *ctx);
#endif