Merged in dagar/nuttx/pr-stm32f7_dtcm_profcs (pull request #875)

STM32F7 DTCM add procfs register

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Daniel Agar
2019-05-25 19:57:26 +00:00
committed by Gregory Nutt
parent 035842b3ed
commit 642c0f8df6
2 changed files with 40 additions and 3 deletions
+12
View File
@@ -133,6 +133,18 @@ EXTERN struct mm_heap_s g_dtcm_heap;
} }
#endif #endif
/****************************************************************************
* Name: dtcm_procfs_register
*
* Description:
* Register the DTCM procfs file system entry
*
****************************************************************************/
#ifdef CONFIG_STM32F7_DTCM_PROCFS
int dtcm_procfs_register(void);
#endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* HAVE_DTCM_HEAP */ #endif /* HAVE_DTCM_HEAP */
#endif /* __ARCH_ARM_SRC_STM32F7_STM32_DTCM_H */ #endif /* __ARCH_ARM_SRC_STM32F7_STM32_DTCM_H */
+28 -3
View File
@@ -69,7 +69,8 @@
#include "stm32_dtcm.h" #include "stm32_dtcm.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_STM32F7_DTCM_PROCFS)
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
@@ -120,7 +121,7 @@ static int dtcm_stat(FAR const char *relpath, FAR struct stat *buf);
* with any compiler. * with any compiler.
*/ */
const struct procfs_operations dtcm_procfsoperations = static const struct procfs_operations dtcm_procfsoperations =
{ {
dtcm_open, /* open */ dtcm_open, /* open */
dtcm_close, /* close */ dtcm_close, /* close */
@@ -134,6 +135,12 @@ const struct procfs_operations dtcm_procfsoperations =
dtcm_stat /* stat */ dtcm_stat /* stat */
}; };
static const struct procfs_entry_s g_procfs_dtcm =
{
"dtcm",
&dtcm_procfsoperations
};
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
@@ -320,4 +327,22 @@ static int dtcm_stat(const char *relpath, struct stat *buf)
return OK; return OK;
} }
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */ /****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: dtcm_procfs_register
*
* Description:
* Register the DTCM procfs file system entry
*
****************************************************************************/
int dtcm_procfs_register(void)
{
return procfs_register(&g_procfs_dtcm);
}
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS &&
* CONFIG_FS_PROCFS_REGISTER && CONFIG_STM32F7_DTCM_PROCFS */