mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-01-14 00:49:40 -05:00
b602de145c
PoC of how a syscall could look like.
36 lines
505 B
C
36 lines
505 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,
|
|
PRELOAD_STORE,
|
|
PRELOAD_DELETE,
|
|
MGMT_APP_REGISTER,
|
|
MGMT_APP_UNREGISTER,
|
|
};
|
|
|
|
int syscall(syscall_t *ctx);
|
|
|
|
#endif
|