first version of working cmake

This commit is contained in:
2024-12-20 14:27:45 +01:00
parent 32b9cc78b4
commit f419b1a3e6
6 changed files with 115 additions and 34 deletions

View File

@ -1,3 +1,7 @@
#cmake_minimum_required(VERSION 3.12)
project(iss)
message(STATUS " here in iss")
# Create library for ISS board support
add_library(board_iss STATIC
init.c

38
env/iss/write.c vendored Normal file
View File

@ -0,0 +1,38 @@
/* See LICENSE of license details. */
#include <errno.h>
#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>
#include "platform.h"
#include "stub.h"
#include "weak_under_alias.h"
#if defined(SEMIHOSTING)
#include "semihosting.h"
#endif
ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
const uint8_t *current = (const uint8_t *)ptr;
#if defined(SEMIHOSTING)
if (isatty(fd)) {
for (size_t jj = 0; jj < len; jj++) {
sh_writec(current[jj]);
}
return len;
} else {
sh_write(current, fd);
return len;
}
// return len;
#endif
if (isatty(fd)) {
for (size_t jj = 0; jj < len; jj++) {
*((uint32_t *)0xFFFF0000) = current[jj];
}
return len;
}
return _stub(EBADF);
}
weak_under_alias(write);