This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit cf0e644a88f63e53e82d1daf68b638449a783983 Author: yinshengkai <yinsheng...@xiaomi.com> AuthorDate: Sun Apr 7 17:52:59 2024 +0800 note: supports specifying the section where the noteram buffer is located Signed-off-by: yinshengkai <yinsheng...@xiaomi.com> --- drivers/note/Kconfig | 5 +++++ drivers/note/Make.defs | 4 ++++ drivers/note/noteram_driver.c | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) 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 = {