diff --git a/drivers/note/Kconfig b/drivers/note/Kconfig index 8119904df1..d9f8ebf3cb 100644 --- a/drivers/note/Kconfig +++ b/drivers/note/Kconfig @@ -71,6 +71,11 @@ config DRIVERS_NOTERAM_BUFSIZE ---help--- The size of the in-memory, circular instrumentation buffer (in bytes). +config DRIVERS_NOTERAM_SECTION + string "Note RAM section" + ---help--- + Enable section information. + config DRIVERS_NOTERAM_DEFAULT_NOOVERWRITE bool "Disable overwrite by default" default n diff --git a/drivers/note/Make.defs b/drivers/note/Make.defs index 3878ff4ef7..e76fc35b6d 100644 --- a/drivers/note/Make.defs +++ b/drivers/note/Make.defs @@ -53,5 +53,9 @@ ifeq ($(CONFIG_DRIVERS_NOTERPMSG),y) CSRCS += noterpmsg_driver.c endif +ifneq ($(CONFIG_DRIVERS_NOTERAM_SECTION),"") + CFLAGS += ${DEFINE_PREFIX}DRIVERS_NOTERAM_SECTION=CONFIG_DRIVERS_NOTERAM_SECTION +endif + DEPPATH += --dep-path note VPATH += :note diff --git a/drivers/note/noteram_driver.c b/drivers/note/noteram_driver.c index c90d2483f3..8118ccc2ac 100644 --- a/drivers/note/noteram_driver.c +++ b/drivers/note/noteram_driver.c @@ -133,7 +133,11 @@ static const struct file_operations g_noteram_fops = noteram_ioctl, /* ioctl */ }; -static uint8_t g_ramnote_buffer[CONFIG_DRIVERS_NOTERAM_BUFSIZE]; +static +#ifdef DRIVERS_NOTERAM_SECTION +locate_data(DRIVERS_NOTERAM_SECTION) +#endif +uint8_t g_ramnote_buffer[CONFIG_DRIVERS_NOTERAM_BUFSIZE]; static const struct note_driver_ops_s g_noteram_ops = {