Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions arch/sim/src/sim/sim_head.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,7 @@ static void allsyms_relocate(void)
****************************************************************************/

#ifdef CONFIG_SIM_ASAN
const char *__asan_default_suppressions(void)
{
return "interceptor_via_lib:libasan.so";
}

const char *__asan_default_options(void)
noprofile_function const char *__asan_default_options(void)
{
return "abort_on_error=1"
" alloc_dealloc_mismatch=0"
Expand All @@ -124,7 +119,7 @@ const char *__asan_default_options(void)
" detect_stack_use_after_return=0";
}

const char *__lsan_default_options(void)
noprofile_function const char *__lsan_default_options(void)
{
/* The fast-unwind implementation of leak-sanitizer will obtain the
* current stack top/bottom and frame address(Stack Pointer) for
Expand All @@ -146,7 +141,7 @@ const char *__lsan_default_options(void)
#endif

#ifdef CONFIG_SIM_UBSAN
const char *__ubsan_default_options(void)
noprofile_function const char *__ubsan_default_options(void)
{
#ifdef CONFIG_SIM_UBSAN_DUMMY
return "";
Expand Down
8 changes: 5 additions & 3 deletions arch/sim/src/sim/sim_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ void up_idle(void)
#ifdef CONFIG_PM
static enum pm_state_e state = PM_NORMAL;
enum pm_state_e newstate;
#endif
irqstate_t flags;

/* Fake some power management stuff for testing purposes */

flags = enter_critical_section();
sched_lock();

#ifdef CONFIG_PM
/* Fake some power management stuff for testing purposes */

newstate = pm_checkstate(PM_IDLE_DOMAIN);
if (newstate != state)
{
Expand All @@ -83,8 +85,8 @@ void up_idle(void)

#ifdef CONFIG_PM
pm_changestate(PM_IDLE_DOMAIN, PM_RESTORE);
#endif

sched_unlock();
leave_critical_section(flags);
#endif
}
2 changes: 1 addition & 1 deletion arch/sim/src/sim/sim_sectionheap.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void *up_dataheap_memalign(size_t align, size_t size)
if (g_dataheap == NULL)
{
g_dataheap = mm_initialize("dataheap",
host_allocheap(SIM_HEAP_SIZE, true),
host_allocheap(SIM_HEAP_SIZE, false),
SIM_HEAP_SIZE);
}

Expand Down
31 changes: 27 additions & 4 deletions arch/sim/src/sim/sim_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,29 @@ static struct uart_dev_s g_tty3_dev =
****************************************************************************/

#if defined(USE_DEVCONSOLE) || CONFIG_SIM_UART_NUMBER > 0
/****************************************************************************
* Name: uart_nputs
*
* Description:
* Loop to write data to the UART until all the data is sent
*
****************************************************************************/

static void uart_nputs(int fd, const char *buf, size_t size)
{
while (size > 0)
{
int ret = host_uart_puts(fd, buf, size);
if (ret < 0)
{
continue;
}

buf += ret;
size -= ret;
}
}

/****************************************************************************
* Name: tty_setup
*
Expand Down Expand Up @@ -617,7 +640,7 @@ static void tty_send(struct uart_dev_s *dev, int ch)
struct tty_priv_s *priv = dev->priv;
char c = ch;

host_uart_puts(dev->isconsole ? 1 : priv->fd, &c, 1);
uart_nputs(dev->isconsole ? 1 : priv->fd, &c, 1);
}

/****************************************************************************
Expand Down Expand Up @@ -757,12 +780,12 @@ void up_nputs(const char *str, size_t len)
#ifdef USE_DEVCONSOLE
if (str[len - 1] == '\n')
{
host_uart_puts(1, str, len - 1);
host_uart_puts(1, "\r\n", 2);
uart_nputs(1, str, len - 1);
uart_nputs(1, "\r\n", 2);
}
else
{
host_uart_puts(1, str, len);
uart_nputs(1, str, len);
}
#endif
}
Expand Down
13 changes: 13 additions & 0 deletions include/nuttx/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@

# define noinstrument_function __attribute__((no_instrument_function))

/* The no_profile_instrument_function attribute on functions is used to
* inform the compiler that it should not process any profile feedback
* based optimization code instrumentation.
*/

# define noprofile_function __attribute__((no_profile_instrument_function))

/* The nooptimiziation_function attribute no optimize */

# define nooptimiziation_function __attribute__((optimize(0)))
Expand Down Expand Up @@ -585,6 +592,7 @@
# define inline_function inline
# define noinline_function
# define noinstrument_function
# define noprofile_function
# define nooptimiziation_function
# define nosanitize_address
# define nosanitize_undefined
Expand Down Expand Up @@ -731,6 +739,7 @@
# define inline_function inline
# define noinline_function
# define noinstrument_function
# define noprofile_function
# define nooptimiziation_function
# define nosanitize_address
# define nosanitize_undefined
Expand Down Expand Up @@ -845,6 +854,7 @@
# define inline_function inline
# define noinline_function
# define noinstrument_function
# define noprofile_function
# define nooptimiziation_function
# define nosanitize_address
# define nosanitize_undefined
Expand Down Expand Up @@ -938,6 +948,7 @@
# define inline_function __forceinline
# define noinline_function
# define noinstrument_function
# define noprofile_function
# define nooptimiziation_function
# define nosanitize_address
# define nosanitize_undefined
Expand Down Expand Up @@ -1021,6 +1032,7 @@
# define inline_function __attribute__((always_inline)) inline
# define noinline_function __attribute__((noinline))
# define noinstrument_function
# define noprofile_function
# define nooptimiziation_function __attribute__((optimize(0)))
# define nosanitize_address
# define nosanitize_undefined
Expand Down Expand Up @@ -1089,6 +1101,7 @@
# define inline_function
# define noinline_function
# define noinstrument_function
# define noprofile_function
# define nooptimiziation_function
# define nosanitize_address
# define nosanitize_undefined
Expand Down