uses htif in iss setting

This commit is contained in:
Eyck Jentzsch 2025-03-14 11:44:03 +01:00
parent b9b8c51957
commit f21ea46bef

View File

@ -4,6 +4,7 @@
#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdint.h>
#include "platform.h"
#include "stub.h"
@ -12,6 +13,8 @@
#include "semihosting.h"
#endif
extern uint32_t tohost;
ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
const uint8_t *current = (const uint8_t *)ptr;
#if defined(SEMIHOSTING)
@ -25,6 +28,14 @@ ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
return len;
}
// return len;
#elif defined(BOARD_iss)
volatile uint64_t payload[4];
payload[0]= 64;
payload[1]= 0;
payload[2]= (uintptr_t)ptr;
payload[3]= len;
tohost = (uint32_t)payload;
return len;
#endif
if (isatty(fd)) {
for (size_t jj = 0; jj < len; jj++) {
@ -38,7 +49,7 @@ ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
uart_write(uart, '\r');
}
#elif defined(BOARD_iss)
*((uint32_t *)0xFFFF0000) = current[jj];
// *((uint32_t *)0xFFFF0000) = current[jj];
#elif defined(BOARD_TGCP)
// TODO: implement
#else