2022-09-19 08:51:11 +02:00
|
|
|
/*
|
2024-09-06 12:46:18 +02:00
|
|
|
* Copyright (C) 2022-2024 - Tillitis AB
|
2022-09-19 08:51:11 +02:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LIB_H
|
|
|
|
#define LIB_H
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2024-09-06 13:00:47 +02:00
|
|
|
#ifdef QEMU_CONSOLE
|
2023-03-21 14:11:08 +01:00
|
|
|
void htif_putc(char ch);
|
2024-09-06 13:00:47 +02:00
|
|
|
void htif_lf(void);
|
2022-12-02 15:09:10 +01:00
|
|
|
void htif_puthex(uint8_t c);
|
|
|
|
void htif_putinthex(const uint32_t n);
|
2023-03-21 14:11:08 +01:00
|
|
|
void htif_puts(const char *s);
|
2023-03-16 14:07:21 +01:00
|
|
|
void htif_hexdump(void *buf, int len);
|
2024-09-06 12:46:18 +02:00
|
|
|
#else
|
|
|
|
#define htif_putc(ch)
|
2024-09-06 13:00:47 +02:00
|
|
|
#define htif_lf(void)
|
2024-09-06 12:46:18 +02:00
|
|
|
#define htif_puthex(c)
|
|
|
|
#define htif_putinthex(n)
|
|
|
|
#define htif_puts(s)
|
|
|
|
#define htif_hexdump(buf, len)
|
|
|
|
#endif /* QEMU_CONSOLE */
|
2023-02-27 17:50:14 +01:00
|
|
|
|
2022-09-19 08:51:11 +02:00
|
|
|
void *memset(void *dest, int c, unsigned n);
|
2023-02-27 17:00:23 +01:00
|
|
|
void memcpy_s(void *dest, size_t destsize, const void *src, size_t n);
|
|
|
|
void wordcpy_s(void *dest, size_t destsize, const void *src, size_t n);
|
2023-03-21 14:11:08 +01:00
|
|
|
int memeq(void *dest, const void *src, size_t n);
|
2024-02-02 14:20:21 +01:00
|
|
|
void secure_wipe(void *v, size_t n);
|
2022-09-19 08:51:11 +02:00
|
|
|
#endif
|