syslog/ramlog: save ramlog to fixed section

we can reload ramlog after hot reboot.

Change-Id: Iee7c105a2358075302121d6bf0047bc54d07e9a6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2021-05-20 20:06:38 +08:00 committed by Gustavo Henrique Nihei
parent 4ae6862bbe
commit ec38d0ce98
2 changed files with 10 additions and 1 deletions

View File

@ -34,6 +34,14 @@ config RAMLOG
details as needed to support logging.
if RAMLOG
config RAMLOG_BUFFER_SECTION
string "The section where ramlog buffer is located"
default ".bss"
depends on RAMLOG_SYSLOG
---help---
The section where ramlog buffer is located, this section cannot
be initialized each time when the system boot.
config RAMLOG_BUFSIZE
int "RAMLOG buffer size"
default 1024

View File

@ -120,7 +120,8 @@ static const struct file_operations g_ramlogfops =
*/
#ifdef CONFIG_RAMLOG_SYSLOG
static char g_sysbuffer[CONFIG_RAMLOG_BUFSIZE];
static char g_sysbuffer[CONFIG_RAMLOG_BUFSIZE]
locate_data(CONFIG_RAMLOG_BUFFER_SECTION);
/* This is the device structure for the console or syslogging function. It
* must be statically initialized because the RAMLOG ramlog_putc function