fygue: fix typo

This commit is contained in:
Yann MAGNIN 2025-04-12 14:45:38 +02:00
parent 7ff93e79f0
commit 07b04138ec
No known key found for this signature in database
GPG key ID: D82629D933EADC59
17 changed files with 74 additions and 79 deletions

View file

@ -13,9 +13,9 @@ int close(int fd)
int rc = 0;
if(d->type->close == NULL)
goto end;
/* Fugue's close primitive can flush pending IO write operation. So, we
/* Fugue's close primitive can flush pending IO write operations. So, we
* are in the same situation than the write() primitive: force-sync
* Fygue's descriptor to ensure data intergrity */
* Fygue's descriptor to ensure data integrity */
rc = d->type->close(d->data);
if (fs_descriptor_is_fugue(d))
fs_fygue_sync();

View file

@ -51,8 +51,7 @@ struct _fat_bpb
*
* notes
* Fugue use the special sector0 to fetch critical flash information
* (total logical sector count and number of hidden sector). Then, based
* on fecthed information, Fugue select an hardcoded FAT configuration
* (total logical sector count and number of hidden sector).
*
* return
* -1 unable to load the sector0
@ -89,8 +88,8 @@ static int _fygue_fat_sector0(struct fygue_fat *fat)
/* _fygue_fat_configure() - configure the FAT information
*
* notes
* the objectif is to find the first FAT address and the reserved root
* cluster (at the end of FATs since we only have to handle FAT12/16)
* Find the first FAT address and the reserved root cluster (at the end
* of FATs since we only have to handle FAT12/16)
*
* note that for FAT12/16 two special cluster entry are added, this is
* why we have a manual offset to calculate the number of sector per

View file

@ -34,7 +34,7 @@ static int _get_block_nb(struct fygue_fat *fat, int cluster)
// Public
//---
/* fygue_fat_file_stat(): directory-specific stat primitive */
/* fygue_fat_file_stat(): stat primitive */
int fygue_fat_file_stat(
struct fygue_fat *fat,
struct fygue_fat_file *file,

View file

@ -29,15 +29,11 @@ struct _bfile_cluster_metadata
*
* notes
* - assume that fcluster is not NULL
* - try using P1 information first then, P2 if this greedy-read fail
* - to ensure that the provided bfile metadata is valid we will perform
* some test (also performed by Casio). First, ensure that the
* fcluster "kind" is valid (only 0x88, 0x22 or 0x11 are known and
* used) and then ensure that the "constant" part is also valid
* some test (also performed by Casio).
*
* todo : ensure checksum
* todo : ensure ecc handling (?)
* todo : try P1 then P2
*
* return
* -1 if the provided `fcluster` is not NULL
@ -93,10 +89,10 @@ static int _fygue_flash_cluster_convert(
) {
return -5;
}
// on the fxcp400, have only some flash sector with the constants used
// in other device. Internally, on the fxcp400, Casio only perform
// a check an CRC that is performed on the whole cluster
// TODO: CRC check
// The fxcp400 has only some flash sectors with the constants used
// by other devices. Internally, on the fxcp400, Casio only performs
// a CRC check that is performed on the whole target cluster
// TODO: CRC check ?
#if 0
if (
memcmp(&(bfile_meta->constant), _constant1, 0x18) != 0 &&
@ -114,7 +110,7 @@ static int _fygue_flash_cluster_convert(
/* _fygue_flash_cluster_meta(): special metadata cluster handling
*
* notes:
* metadata cluster are the last flash cluster of a flash sector it does
* metadata clusters are the last flash cluster of a flash sector it does
* not have Bfile information. Generate a fake flash cluster with a
* special custom kind to allow quick identification */
static int _fygue_flash_cluster_meta(
@ -142,13 +138,14 @@ static int _fygue_flash_cluster_meta(
/* _fygue_flash_cluster_details(): special flash sector details handling
*
* notes:
* flash sector details is a particular flash cluster that contains
* flash sector details are a particular flash cluster that contains
* critical versioning information needed to rebuild Casio's flash
* mapping.
* However, this particular flash cluster are not represented in the
* same way between machines. For example, the G35EII that use flash
* sector of 64ko merge the details sector inside the metadata cluster to
* keep some space which is not the case with the FXCP400 or CG50 that
*
* However, this particular flash cluster is not represented in the
* same way between machines. For example, the G35EII that uses a flash
* sector of 64ko merges the details sector inside the metadata cluster
* to keep some space which is not the case with the FXCP400 or CG50 that
* use 128ko flash sector and which the first cluster should be a details
* one type.
*
@ -199,7 +196,7 @@ static int _fygue_flash_cluster_details(
*
* notes
* flash cluster data (0x11 or 0x88) are handled in the same way between
* all device */
* all devices */
static int _fygue_flash_cluster_data(
struct fygue_flash *flash,
struct fygue_flash_cluster *fcluster,
@ -300,8 +297,8 @@ int fygue_flash_cluster_get(
*
* notes
* generate flash cluster geometry information. Note that we handle
* sector as a full 32 entry table, which differ from logical cluster ID
* that ignore the last entry which contain meta information
* sectors as a full 32/16 entry table, which differs from logical
* cluster ID that ignores the last entry which contains meta information.
*
* returns
* -1 if the provided address is not valid

View file

@ -15,13 +15,13 @@
/* fygue_flash_cmap_update() - update the cluster redirection map
*
* notes
* Since Casio use its own methods to handle flash sector and cluster we
* Since Casio uses its own methods to handle flash sector and cluster we
* need to rebuild the translation page between "logical cluster"
* (lcluster) and "flash cluster" (fcluster).
*
* Casio do not erase systematicaly each sector when they become
* outdated, instead, they use a `age` mechanism which indicate "when"
* the cluster has been created a keep the more recent one
* Casio does not erase systematically each sector when they become
* outdated, instead, they use a `version` mechanism which indicates
* "when" the cluster has been created to keep the more recent one.
*
* return
* -1 if the provided information is not valid
@ -144,16 +144,16 @@ int fygue_flash_cmap_lsector_get_addr(
/* fygue_flash_cmap_init() - initialize fcluster translation
*
* notes:
* Casio have its own flash handling layer that hook Fugue primitives to
* control how/when the hardware will perform IO operation
* Casio has its own flash handling layer that hooks Fugue primitives to
* control how/when the hardware will perform IO operations
* (read,write,erase). This because the Flash used in recent devices use
* sector of 128ko which imply, when you want to update one byte of
* sector of 128ko which implies, when you want to update one byte of
* memory, you need to:
* - copy the whole page in RAM
* - perform the modification
* - write the new page information
*
* So, todo
* todo: docs
*
* returns:
* -1 if the sector 0 is not found

View file

@ -99,7 +99,7 @@ static int fygue_gfdi_file_close(struct fygue_descriptor *desc)
}
//---
// Gint File Descriptor Interface (gfdi) for file
// Gint File Descriptor Interface (gfdi) for directory
//---
/* fygue_dir_write(): write directory (EISDIR) */

View file

@ -6,7 +6,7 @@
// Internals
//---
/* realloc a prepare the internal table */
/* realloc and prepare the internal table */
static int _fygue_dir_open_table_realloc(struct fygue_dir *dir)
{
void *tmp;

View file

@ -5,7 +5,7 @@
/* fygue_dir_read(): directory read implementation
*
* notes
* - assume that the directory have read permission */
* - assume that the directory has read permission */
ssize_t fygue_dir_read(
struct fygue_fsinfo *fsinfo,
struct fygue_dir *dir,

View file

@ -2,7 +2,7 @@
#include <string.h>
#include "fygue.h"
/* fygue_file_close(): close directory */
/* fygue_file_close(): close file */
int fygue_file_close(
struct fygue_fsinfo *fsinfo,
struct fygue_file *file

View file

@ -1,6 +1,6 @@
#include "fygue.h"
/* fygue_file_write(): write directory (EISDIR) */
/* fygue_file_write(): write file (EROFS) */
ssize_t fygue_file_write(
struct fygue_fsinfo *fsinfo,
struct fygue_file *file,

View file

@ -15,7 +15,7 @@ static struct fygue_fsinfo *__fygue_fsinfo = NULL;
/* fygue_mount() - mount (if needed) and return the filesystem information
*
* notes
* - assume that this global is const after initialisation */
* - assume that `__fygue_fsinfo` is const after initialisation */
int fygue_mount(struct fygue_fsinfo **fsinfo)
{
if (fsinfo == NULL)

View file

@ -14,8 +14,7 @@
*
* notes
* - assume that path is clean
* - automatically mount the filesystem if needed
* - the saved pathname will not be saved in stat */
* - automatically mount the filesystem if needed */
int fygue_open_resolve(
char const * const path,
struct fygue_descriptor *desc
@ -59,7 +58,7 @@ int fygue_open(char const *path, int flags, GUNUSED mode_t mode)
if ((exists < 0 && (!(flags & O_CREAT) || (flags & O_DIRECTORY))))
FYGUE_RET_ERRNO(ENOENT);
/* if opening fails and the previous check as not returned an error,
/* if opening fails and the previous check has not returned an error,
* it is certainly because of a creation request. We are a read-only
* file-system, so, fail */
if (exists < 0)

View file

@ -10,8 +10,8 @@ int open(char const *path, int flags, ...)
mode_t mode = va_arg(args, int);
va_end(args);
/* Standard open() use Fugue filesystem if a write operation
* is requested, otherwise use the Fygue filesystem */
/* Standard open() uses Fugue filesystem if a write operation
* is requested, otherwise uses the Fygue filesystem */
int rc = -1;
if ((flags & O_WRONLY) || (flags & O_RDWR)) {
rc = fugue_open(path, flags, mode);

View file

@ -3,8 +3,8 @@
int stat(char const * restrict path, struct stat * restrict statbuf)
{
/* Standard stat() is also provided by Fugue, but rely on Casio's
* syscall which do not provide all of the information and request
* a world-switch (internally) to works */
/* Standard stat() is also provided by Fugue, but relies on Casio's
* syscall which does not provide all of the information and requests
* a world-switch (internally) to work */
return fygue_stat(path, statbuf);
}

View file

@ -12,8 +12,8 @@ ssize_t write(int fd, const void *buf, size_t size)
/* No write function: discard the contents but show no error */
if(d->type->write == NULL)
return 0;
/* A special synchronisation must be performed to ensure that all
* Fygue's descriptor meta information are valid */
/* A special synchronization must be performed to ensure that all
* Fygue's descriptor meta information is valid */
size = d->type->write(d->data, buf, size);
if (fs_descriptor_is_fugue(d))
fs_fygue_sync();