STM32: CCM procfs is no longer a part of the 'base' procfs entries and can now only be supported via run time registration with CONFIG_FS_PROCFS_REGISTER=y

This commit is contained in:
Gregory Nutt 2015-12-01 14:55:05 -06:00
parent 7037f13c2d
commit 548ba1640f
3 changed files with 45 additions and 10 deletions

View File

@ -2448,7 +2448,7 @@ config STM32_CCMEXCLUDE
config STM32_CCM_PROCFS
bool "CCM PROCFS support"
default n
depends on STM32_CCMEXCLUDE && FS_PROCFS
depends on !DISABLE_MOUNTPOINT && FS_PROCFS && FS_PROCFS_REGISTER
---help---
Select to build in support for /proc/ccm. Reading from /proc/ccm
will provide statistics about CCM memory use similar to what you

View File

@ -131,6 +131,18 @@ EXTERN struct mm_heap_s g_ccm_heap;
}
#endif
/****************************************************************************
* Name: ccm_register
*
* Description:
* Register the CCM procfs file system entry
*
****************************************************************************/
#ifdef CONFIG_STM32_CCM_PROCFS
int ccm_register(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* HAVE_CCM_HEAP */
#endif /* __ARCH_ARM_SRC_STM32_STM32_CCM_H */

View File

@ -64,19 +64,18 @@
#include "stm32_ccm.h"
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS)
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS) && \
defined(CONFIG_FS_PROCFS_REGISTER) && defined(CONFIG_STM32_CCM_PROCFS)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define CCM_LINELEN 64
/****************************************************************************
* Private Types
****************************************************************************/
/* This enumeration identifies all of the thread attributes that can be
* accessed via the procfs file system.
*/
/* This structure describes one open "file" */
@ -101,10 +100,6 @@ static int ccm_dup(FAR const struct file *oldp,
FAR struct file *newp);
static int ccm_stat(FAR const char *relpath, FAR struct stat *buf);
/****************************************************************************
* Private Variables
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
@ -128,6 +123,16 @@ const struct procfs_operations ccm_procfsoperations =
ccm_stat /* stat */
};
/****************************************************************************
* Private Data
****************************************************************************/
const struct procfs_file_s g_procfs_ccm =
{
"ccm",
&ccm_procfsoperations
},
/****************************************************************************
* Private Functions
****************************************************************************/
@ -314,4 +319,22 @@ static int ccm_stat(const char *relpath, struct stat *buf)
return OK;
}
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: ccm_register
*
* Description:
* Register the CCM procfs file system entry
*
****************************************************************************/
int ccm_register(void)
{
return procfs_register(&g_procfs_ccm);
}
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS &&
* CONFIG_FS_PROCFS_REGISTER && CONFIG_STM32_CCM_PROCFS */