mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Refine how to specify iob and ramlog data section
1.Remove the default value(.bss) 2.Remove !ARCH_SIM dependence Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
9bc47ecdce
commit
130b196876
@@ -250,8 +250,6 @@ if RAMLOG_SYSLOG
|
||||
|
||||
config RAMLOG_BUFFER_SECTION
|
||||
string "The section where ramlog buffer is located"
|
||||
default ".bss"
|
||||
depends on !ARCH_SIM
|
||||
---help---
|
||||
The section where ramlog buffer is located.
|
||||
The section shall not be initialized on system boot.
|
||||
|
||||
@@ -36,6 +36,10 @@ endif
|
||||
|
||||
ifeq ($(CONFIG_RAMLOG),y)
|
||||
CSRCS += ramlog.c
|
||||
|
||||
ifneq ($(CONFIG_RAMLOG_BUFFER_SECTION),"")
|
||||
CFLAGS += ${shell $(DEFINE) "$(CC)" RAMLOG_BUFFER_SECTION=CONFIG_RAMLOG_BUFFER_SECTION}
|
||||
endif
|
||||
endif
|
||||
|
||||
############################################################################
|
||||
|
||||
@@ -124,11 +124,12 @@ static const struct file_operations g_ramlogfops =
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_RAMLOG_SYSLOG
|
||||
# ifdef RAMLOG_BUFFER_SECTION
|
||||
static char g_sysbuffer[CONFIG_RAMLOG_BUFSIZE]
|
||||
#ifdef CONFIG_RAMLOG_BUFFER_SECTION
|
||||
locate_data(CONFIG_RAMLOG_BUFFER_SECTION)
|
||||
#endif
|
||||
;
|
||||
locate_data(RAMLOG_BUFFER_SECTION);
|
||||
# else
|
||||
static char g_sysbuffer[CONFIG_RAMLOG_BUFSIZE];
|
||||
# endif
|
||||
|
||||
/* This is the device structure for the console or syslogging function. It
|
||||
* must be statically initialized because the RAMLOG ramlog_putc function
|
||||
@@ -137,15 +138,15 @@ static char g_sysbuffer[CONFIG_RAMLOG_BUFSIZE]
|
||||
|
||||
static struct ramlog_dev_s g_sysdev =
|
||||
{
|
||||
#ifndef CONFIG_RAMLOG_NONBLOCKING
|
||||
# ifndef CONFIG_RAMLOG_NONBLOCKING
|
||||
0, /* rl_nwaiters */
|
||||
#endif
|
||||
# endif
|
||||
CONFIG_RAMLOG_BUFSIZE, /* rl_head */
|
||||
CONFIG_RAMLOG_BUFSIZE, /* rl_tail */
|
||||
SEM_INITIALIZER(1), /* rl_exclsem */
|
||||
#ifndef CONFIG_RAMLOG_NONBLOCKING
|
||||
# ifndef CONFIG_RAMLOG_NONBLOCKING
|
||||
SEM_INITIALIZER(0), /* rl_waitsem */
|
||||
#endif
|
||||
# endif
|
||||
CONFIG_RAMLOG_BUFSIZE, /* rl_bufsize */
|
||||
g_sysbuffer /* rl_buffer */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user