5#ifdef OPENOCD_SEMIHOSTING
10inline void snrt_exit_default(
int exit_code) {
11 exit_code = snrt_global_all_to_all_reduction(exit_code);
12#ifdef OPENOCD_SEMIHOSTING
13 if (snrt_global_core_idx() == 0) __ocd_semihost_exit(exit_code);
15 if (snrt_global_core_idx() == 0)
16 *(snrt_exit_code_destination()) = (exit_code << 1) | 1;
19#ifndef SNRT_CRT0_ALTERNATE_EXIT
20inline void snrt_exit(
int exit_code) { snrt_exit_default(exit_code); }
25inline uint32_t snrt_cls_base_addr() {
26 extern volatile uint32_t __cdata_start, __cdata_end;
27 extern volatile uint32_t __cbss_start, __cbss_end;
28 uint32_t cdata_size = ((uint32_t)&__cdata_end) - ((uint32_t)&__cdata_start);
29 uint32_t cbss_size = ((uint32_t)&__cbss_end) - ((uint32_t)&__cbss_start);
30 uint32_t l1_end_addr = SNRT_TCDM_START_ADDR +
31 snrt_cluster_idx() * SNRT_CLUSTER_OFFSET +
33 return l1_end_addr - cdata_size - cbss_size;