mm/shm: Initialize shm_info_s at the definition place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
dfb9a763a7
commit
cf2538c277
@ -95,22 +95,6 @@ struct group_shm_s
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: shm_initialize
|
||||
*
|
||||
* Description:
|
||||
* Perform one time, start-up initialization of the shared memory logic.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void shm_initialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: shm_group_initialize
|
||||
*
|
||||
|
@ -43,33 +43,15 @@
|
||||
|
||||
/* State of the all shared memory */
|
||||
|
||||
struct shm_info_s g_shminfo;
|
||||
struct shm_info_s g_shminfo =
|
||||
{
|
||||
SEM_INITIALIZER(1)
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: shm_initialize
|
||||
*
|
||||
* Description:
|
||||
* Perform one time, start-up initialization of the shared memory logic.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void shm_initialize(void)
|
||||
{
|
||||
/* Initialize the shared memory region list */
|
||||
|
||||
nxsem_init(&g_shminfo.si_sem, 0, 1);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: shm_group_initialize
|
||||
*
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/mm/iob.h>
|
||||
#include <nuttx/mm/mm.h>
|
||||
#include <nuttx/mm/shm.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/sched_note.h>
|
||||
#include <nuttx/syslog/syslog.h>
|
||||
@ -706,12 +705,6 @@ void nx_start(void)
|
||||
|
||||
/* Setup for Multi-Tasking ************************************************/
|
||||
|
||||
#ifdef CONFIG_MM_SHM
|
||||
/* Initialize shared memory support */
|
||||
|
||||
shm_initialize();
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BINFMT_DISABLE
|
||||
/* Initialize the binfmt system */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user