Add Kconfig option, user can specify the location of g_iob_buffer
Signed-off-by: luojun1 <luojun1@xiaomi.com>
This commit is contained in:
parent
4e62772be5
commit
bee9dcc73a
@ -46,6 +46,14 @@ config IOB_ALIGNMENT
|
||||
The member io_head of all I/O buffers is aligned to the value
|
||||
specified by this configuration.
|
||||
|
||||
config IOB_SECTION
|
||||
string "The section where iob buffer is located"
|
||||
default ".bss"
|
||||
depends on !ARCH_SIM
|
||||
---help---
|
||||
The section where iob buffer is located.
|
||||
The section must be zero-initialized on system boot.
|
||||
|
||||
config IOB_NCHAINS
|
||||
int "Number of pre-allocated I/O buffer chain heads"
|
||||
default 0 if !NET_READAHEAD
|
||||
|
@ -42,6 +42,14 @@
|
||||
#define IOB_BUFFER_SIZE (IOB_ALIGN_SIZE * CONFIG_IOB_NBUFFERS + \
|
||||
CONFIG_IOB_ALIGNMENT - 1)
|
||||
|
||||
/* Improve Flexibility */
|
||||
|
||||
#ifdef CONFIG_IOB_SECTION
|
||||
# define IOB_SECTION locate_data(CONFIG_IOB_SECTION)
|
||||
#else
|
||||
# define IOB_SECTION
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@ -51,7 +59,7 @@
|
||||
* to the CONFIG_IOB_ALIGNMENT memory boundary.
|
||||
*/
|
||||
|
||||
static uint8_t g_iob_buffer[IOB_BUFFER_SIZE];
|
||||
static uint8_t g_iob_buffer[IOB_BUFFER_SIZE] IOB_SECTION;
|
||||
|
||||
#if CONFIG_IOB_NCHAINS > 0
|
||||
/* This is a pool of pre-allocated iob_qentry_s buffers */
|
||||
|
Loading…
x
Reference in New Issue
Block a user