Compare commits
2 Commits
f37242efa7
...
6e2a7a12fe
Author | SHA1 | Date | |
---|---|---|---|
6e2a7a12fe | |||
2bde14a398 |
@ -35,7 +35,7 @@ foreach(FILE ${LIB_SOURCES})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_library(wrap STATIC ${LIB_SOURCES} ../env/${BOARD_BASE}/bsp_write.c ../env/${BOARD_BASE}/bsp_read.c)
|
||||
add_library(wrap STATIC ${LIB_SOURCES} ../env/${BOARD}/bsp_write.c ../env/${BOARD}/bsp_read.c)
|
||||
target_include_directories(wrap PUBLIC ../include)
|
||||
target_link_options(wrap INTERFACE ${WRAP_ARGS})
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
/* See LICENSE of license details. */
|
||||
|
||||
#include "weak_under_alias.h"
|
||||
//#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#if defined(SEMIHOSTING)
|
||||
#include "semihosting.h"
|
||||
#endif
|
||||
@ -17,19 +16,17 @@ extern volatile uint32_t fromhost;
|
||||
#endif
|
||||
|
||||
void write_hex(int fd, uint32_t hex);
|
||||
extern void __libc_fini_array(void);
|
||||
|
||||
void __wrap_exit(int code) {
|
||||
|
||||
// volatile uint32_t* leds = (uint32_t*) (GPIO_BASE_ADDR + GPIO_OUT_OFFSET);
|
||||
#ifndef HAVE_NO_INIT_FINI
|
||||
__libc_fini_array();
|
||||
#endif
|
||||
const char message[] = "\nProgam has exited with code:";
|
||||
//*leds = (~(code));
|
||||
write(STDERR_FILENO, message, sizeof(message) - 1);
|
||||
write_hex(STDERR_FILENO, code);
|
||||
write(STDERR_FILENO, "\n", 1);
|
||||
write(STDERR_FILENO, "\n", 1);
|
||||
// tohost = (code << 1) + 1; // here used to stop simulation
|
||||
write(STDERR_FILENO, "\x04", 1);
|
||||
|
||||
tohost = (code << 1) + 1;
|
||||
for (;;)
|
||||
;
|
||||
}
|
||||
|
Reference in New Issue
Block a user