uses htif in iss setting
This commit is contained in:
parent
b9b8c51957
commit
f21ea46bef
@ -4,6 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "stub.h"
|
#include "stub.h"
|
||||||
@ -12,6 +13,8 @@
|
|||||||
#include "semihosting.h"
|
#include "semihosting.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern uint32_t tohost;
|
||||||
|
|
||||||
ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
|
ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
|
||||||
const uint8_t *current = (const uint8_t *)ptr;
|
const uint8_t *current = (const uint8_t *)ptr;
|
||||||
#if defined(SEMIHOSTING)
|
#if defined(SEMIHOSTING)
|
||||||
@ -25,6 +28,14 @@ ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
|
|||||||
return len;
|
return 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
|
#endif
|
||||||
if (isatty(fd)) {
|
if (isatty(fd)) {
|
||||||
for (size_t jj = 0; jj < len; jj++) {
|
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');
|
uart_write(uart, '\r');
|
||||||
}
|
}
|
||||||
#elif defined(BOARD_iss)
|
#elif defined(BOARD_iss)
|
||||||
*((uint32_t *)0xFFFF0000) = current[jj];
|
// *((uint32_t *)0xFFFF0000) = current[jj];
|
||||||
#elif defined(BOARD_TGCP)
|
#elif defined(BOARD_TGCP)
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user