git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@16899 27425a3e-05d8-49a3-a47f-9c15f0e5edd8

This commit is contained in:
Giovanni Di Sirio 2025-01-16 15:27:42 +00:00
parent 014cf9d314
commit 5f5ffc9709
17 changed files with 77 additions and 174 deletions

View File

@ -87,14 +87,14 @@
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>test/lib</name>
<name>test/oslib</name>
<type>2</type>
<locationURI>CHIBIOS/test/lib</locationURI>
<locationURI>CHIBIOS/test/oslib</locationURI>
</link>
<link>
<name>test/mfs</name>
<name>test/rt</name>
<type>2</type>
<locationURI>CHIBIOS/test/mfs</locationURI>
<locationURI>CHIBIOS/test/rt</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -34,20 +34,5 @@
<type>2</type>
<locationURI>CHIBIOS/os</locationURI>
</link>
<link>
<name>test</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>test/oslib</name>
<type>2</type>
<locationURI>CHIBIOS/test/oslib</locationURI>
</link>
<link>
<name>test/rt</name>
<type>2</type>
<locationURI>CHIBIOS/test/rt</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -34,20 +34,5 @@
<type>2</type>
<locationURI>CHIBIOS/os</locationURI>
</link>
<link>
<name>test</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>test/oslib</name>
<type>2</type>
<locationURI>CHIBIOS/test/oslib</locationURI>
</link>
<link>
<name>test/rt</name>
<type>2</type>
<locationURI>CHIBIOS/test/rt</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -118,9 +118,9 @@ include $(CHIBIOS)/os/vfs/vfs.mk
# Auto-build files in ./source recursively.
include $(CHIBIOS)/tools/mk/autobuild.mk
# Other files (optional).
include $(CHIBIOS)/os/test/test.mk
include $(CHIBIOS)/test/rt/rt_test.mk
include $(CHIBIOS)/test/oslib/oslib_test.mk
#include $(CHIBIOS)/os/test/test.mk
#include $(CHIBIOS)/test/rt/rt_test.mk
#include $(CHIBIOS)/test/oslib/oslib_test.mk
# Define linker script file here
LDSCRIPT= ./STM32G474xE_SB.ld

View File

@ -34,20 +34,5 @@
<type>2</type>
<locationURI>CHIBIOS/os</locationURI>
</link>
<link>
<name>test</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>test/oslib</name>
<type>2</type>
<locationURI>CHIBIOS/test/oslib</locationURI>
</link>
<link>
<name>test/rt</name>
<type>2</type>
<locationURI>CHIBIOS/test/rt</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -39,20 +39,5 @@
<type>2</type>
<locationURI>CHIBIOS/os</locationURI>
</link>
<link>
<name>test</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>test/oslib</name>
<type>2</type>
<locationURI>CHIBIOS/test/oslib</locationURI>
</link>
<link>
<name>test/rt</name>
<type>2</type>
<locationURI>CHIBIOS/test/rt</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -39,20 +39,5 @@
<type>2</type>
<locationURI>CHIBIOS/os</locationURI>
</link>
<link>
<name>test</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>test/oslib</name>
<type>2</type>
<locationURI>CHIBIOS/test/oslib</locationURI>
</link>
<link>
<name>test/rt</name>
<type>2</type>
<locationURI>CHIBIOS/test/rt</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -227,17 +227,17 @@
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="0.365230168.523175374">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.365230168.523175374.1281863608">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.365230168">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.365230168.523175374.18049993">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.365230168">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.365230168.523175374">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

View File

@ -86,20 +86,5 @@
<type>2</type>
<locationURI>CHIBIOS/os</locationURI>
</link>
<link>
<name>test</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>test/lib</name>
<type>2</type>
<locationURI>CHIBIOS/test/lib</locationURI>
</link>
<link>
<name>test/mfs</name>
<type>2</type>
<locationURI>CHIBIOS/test/mfs</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -227,13 +227,13 @@
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="0.365230168.523175374.1281863608">
<scannerConfigBuildInfo instanceId="0.365230168">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.365230168.523175374.18049993">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.365230168">
<scannerConfigBuildInfo instanceId="0.365230168.523175374.1281863608">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.365230168.523175374">

View File

@ -86,20 +86,5 @@
<type>2</type>
<locationURI>CHIBIOS/os</locationURI>
</link>
<link>
<name>test</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>test/lib</name>
<type>2</type>
<locationURI>CHIBIOS/test/lib</locationURI>
</link>
<link>
<name>test/mfs</name>
<type>2</type>
<locationURI>CHIBIOS/test/mfs</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -143,41 +143,41 @@
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="0.1093754934.532782958.134374917">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1666172521">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1746620542.146052967">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1927962071">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.366574680">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.69471493">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1317617301">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.532782958">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1746620542">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1834762588">
<scannerConfigBuildInfo instanceId="0.1093754934.1666172521">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.237698851">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.532782958.134374917">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1746620542">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1317617301">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1927962071">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.69471493">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.1834762588">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1093754934.366574680">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

View File

@ -86,20 +86,5 @@
<type>2</type>
<locationURI>CHIBIOS/os</locationURI>
</link>
<link>
<name>test</name>
<type>2</type>
<locationURI>CHIBIOS/test/mfs</locationURI>
</link>
<link>
<name>test/lib</name>
<type>2</type>
<locationURI>CHIBIOS/test/lib</locationURI>
</link>
<link>
<name>test/mfs</name>
<type>2</type>
<locationURI>CHIBIOS/test/mfs</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -12,6 +12,7 @@
<public>
<includes>
<include style="regular">oop_sequential_stream.h</include>
<include style="regular">hal.h</include>
</includes>
<configs>
<config name="DRV_CFG_CHFS_DIR_NODES_NUM" default="2">
@ -24,6 +25,17 @@
</config>
</configs>
<types>
<typedef name="chfs_config_t">
<brief>Type of a ChibiFS configuration structure.</brief>
<basetype ctype="struct chfs_config" />
</typedef><struct name="chfs_config">
<brief>Structure representing a ChibiFS configuration.</brief>
<fields>
<field name="blk" ctype="const BaseBlockDevice$I*">
<brief>Block device associated to this ChibiFS instance.</brief>
</field>
</fields>
</struct>
<class type="regular" name="vfs_chfs_driver" namespace="chfsdrv"
ancestorname="vfs_driver" descr="VFS ChibiFS driver">
<fields>
@ -39,13 +51,11 @@
<field name="path_cwd" ctype="char$I$N[VFS_CFG_PATHLEN_MAX + 1]">
<brief>Current working directory path.</brief>
</field>
<field name="scratch" ctype="char$I$N[VFS_CFG_PATHLEN_MAX + 1]">
<brief>Path scratch pad.</brief>
</field>
</fields>
<methods>
<objinit callsuper="true">
<param name="cfgp" ctype="const struct chfs_config *" dir="in"><![CDATA[Pointer to @p chfs_config configuration.]]></param>
<param name="cfgp" ctype="const chfs_config_t *" dir="in"><![CDATA[Pointer
to @p chfs_config_t configuration.]]></param>
<implementation><![CDATA[
self->cfgp = cfgp;
self->cwd = NULL;
@ -108,6 +118,7 @@ self->path_cwd[0] = '\0';]]></implementation>
</override>
</methods>
</class>
</types>
<variables>
<variable name="vfs_chfs_driver_static"

View File

@ -29,6 +29,7 @@
#if (VFS_CFG_ENABLE_DRV_CHFS == TRUE) || defined(__DOXYGEN__)
#include "oop_sequential_stream.h"
#include "hal.h"
/*===========================================================================*/
/* Module constants. */
@ -79,6 +80,21 @@
/* Module data structures and types. */
/*===========================================================================*/
/**
* @brief Type of a ChibiFS configuration structure.
*/
typedef struct chfs_config chfs_config_t;
/**
* @brief Structure representing a ChibiFS configuration.
*/
struct chfs_config {
/**
* @brief Block device associated to this ChibiFS instance.
*/
const BaseBlockDevice *blk;
};
/**
* @class vfs_chfs_driver_c
* @extends base_object_c, vfs_driver_c.
@ -136,10 +152,6 @@ struct vfs_chfs_driver {
* @brief Current working directory path.
*/
char path_cwd[VFS_CFG_PATHLEN_MAX + 1];
/**
* @brief Path scratch pad.
*/
char scratch[VFS_CFG_PATHLEN_MAX + 1];
};
/** @} */
@ -154,7 +166,7 @@ extern "C" {
#endif
/* Methods of vfs_chfs_driver_c.*/
void *__chfsdrv_objinit_impl(void *ip, const void *vmt,
const struct chfs_config *cfgp);
const chfs_config_t *cfgp);
void __chfsdrv_dispose_impl(void *ip);
msg_t __chfsdrv_setcwd_impl(void *ip, const char *path);
msg_t __chfsdrv_getcwd_impl(void *ip, char *buf, size_t size);
@ -192,14 +204,14 @@ extern "C" {
*
* @param[out] self Pointer to a @p vfs_chfs_driver_c instance to
* be initialized.
* @param[in] cfgp Pointer to @p chfs_config configuration.
* @param[in] cfgp Pointer to @p chfs_config_t configuration.
* @return Pointer to the initialized object.
*
* @objinit
*/
CC_FORCE_INLINE
static inline vfs_chfs_driver_c *chfsdrvObjectInit(vfs_chfs_driver_c *self,
const struct chfs_config *cfgp) {
const chfs_config_t *cfgp) {
extern const struct vfs_chfs_driver_vmt __vfs_chfs_driver_vmt;
return __chfsdrv_objinit_impl(self, &__vfs_chfs_driver_vmt, cfgp);

View File

@ -530,11 +530,11 @@ static vfs_chfs_file_node_c *chfsfileObjectInit(vfs_chfs_file_node_c *self,
* @param[out] ip Pointer to a @p vfs_chfs_driver_c instance to
* be initialized.
* @param[in] vmt VMT pointer for the new object.
* @param[in] cfgp Pointer to @p chfs_config configuration.
* @param[in] cfgp Pointer to @p chfs_config_t configuration.
* @return A new reference to the object.
*/
void *__chfsdrv_objinit_impl(void *ip, const void *vmt,
const struct chfs_config *cfgp) {
const chfs_config_t *cfgp) {
vfs_chfs_driver_c *self = (vfs_chfs_driver_c *)ip;
/* Initialization of the ancestors-defined parts.*/

View File

@ -100,7 +100,7 @@
#endif
/* TODO temporary */
#define VFS_CFG_ENABLE_DRV_CHFS TRUE
#define VFS_CFG_ENABLE_DRV_CHFS FALSE
#define DRV_CFG_CHFS_DIR_NODES_NUM 2
#define DRV_CFG_CHFS_FILE_NODES_NUM 1
#if VFS_CFG_ENABLE_DRV_CHFS == TRUE