UbixOS  2.0
fat_table.c File Reference
#include <string.h>
#include "fat_defs.h"
#include "fat_access.h"
#include "fat_table.h"
Include dependency graph for fat_table.c:

Go to the source code of this file.

Macros

#define FAT16_GET_16BIT_WORD(pbuf, location)   ( GET_16BIT_WORD(pbuf->ptr, location) )
 
#define FAT16_SET_16BIT_WORD(pbuf, location, value)   { SET_16BIT_WORD(pbuf->ptr, location, value); pbuf->dirty = 1; }
 
#define FAT32_GET_32BIT_WORD(pbuf, location)   ( GET_32BIT_WORD(pbuf->ptr, location) )
 
#define FAT32_SET_32BIT_WORD(pbuf, location, value)   { SET_32BIT_WORD(pbuf->ptr, location, value); pbuf->dirty = 1; }
 

Functions

uint32 fatfs_count_free_clusters (struct fatfs *fs)
 
int fatfs_fat_add_cluster_to_chain (struct fatfs *fs, uint32 start_cluster, uint32 newEntry)
 
void fatfs_fat_init (struct fatfs *fs)
 
int fatfs_fat_purge (struct fatfs *fs)
 
int fatfs_fat_set_cluster (struct fatfs *fs, uint32 cluster, uint32 next_cluster)
 
int fatfs_find_blank_cluster (struct fatfs *fs, uint32 start_cluster, uint32 *free_cluster)
 
uint32 fatfs_find_next_cluster (struct fatfs *fs, uint32 current_cluster)
 
int fatfs_free_cluster_chain (struct fatfs *fs, uint32 start_cluster)
 
void fatfs_set_fs_info_next_free_cluster (struct fatfs *fs, uint32 newValue)
 

Macro Definition Documentation

◆ FAT16_GET_16BIT_WORD

#define FAT16_GET_16BIT_WORD (   pbuf,
  location 
)    ( GET_16BIT_WORD(pbuf->ptr, location) )

Definition at line 54 of file fat_table.c.

◆ FAT16_SET_16BIT_WORD

#define FAT16_SET_16BIT_WORD (   pbuf,
  location,
  value 
)    { SET_16BIT_WORD(pbuf->ptr, location, value); pbuf->dirty = 1; }

Definition at line 55 of file fat_table.c.

◆ FAT32_GET_32BIT_WORD

#define FAT32_GET_32BIT_WORD (   pbuf,
  location 
)    ( GET_32BIT_WORD(pbuf->ptr, location) )

Definition at line 52 of file fat_table.c.

◆ FAT32_SET_32BIT_WORD

#define FAT32_SET_32BIT_WORD (   pbuf,
  location,
  value 
)    { SET_32BIT_WORD(pbuf->ptr, location, value); pbuf->dirty = 1; }

Definition at line 53 of file fat_table.c.

Function Documentation

◆ fatfs_count_free_clusters()

uint32 fatfs_count_free_clusters ( struct fatfs fs)

Definition at line 445 of file fat_table.c.

◆ fatfs_fat_add_cluster_to_chain()

int fatfs_fat_add_cluster_to_chain ( struct fatfs fs,
uint32  start_cluster,
uint32  newEntry 
)

Definition at line 414 of file fat_table.c.

References FAT32_LAST_CLUSTER, fatfs_fat_set_cluster(), and fatfs_find_next_cluster().

Here is the call graph for this function:

◆ fatfs_fat_init()

void fatfs_fat_init ( struct fatfs fs)

Definition at line 60 of file fat_table.c.

References FAT32_INVALID_CLUSTER, FAT_BUFFERS, memset(), and NULL.

Referenced by fatfs_format_fat16(), fatfs_format_fat32(), and fatfs_init().

Here is the call graph for this function:

◆ fatfs_fat_purge()

int fatfs_fat_purge ( struct fatfs fs)

Definition at line 179 of file fat_table.c.

References fat_buffer::dirty.

◆ fatfs_fat_set_cluster()

int fatfs_fat_set_cluster ( struct fatfs fs,
uint32  cluster,
uint32  next_cluster 
)

◆ fatfs_find_blank_cluster()

int fatfs_find_blank_cluster ( struct fatfs fs,
uint32  start_cluster,
uint32 free_cluster 
)

Definition at line 288 of file fat_table.c.

References FAT_TYPE_16.

Referenced by fatfs_add_free_space(), and fatfs_allocate_free_space().

◆ fatfs_find_next_cluster()

uint32 fatfs_find_next_cluster ( struct fatfs fs,
uint32  current_cluster 
)

◆ fatfs_free_cluster_chain()

int fatfs_free_cluster_chain ( struct fatfs fs,
uint32  start_cluster 
)

Definition at line 389 of file fat_table.c.

References FAT32_LAST_CLUSTER, fatfs_fat_set_cluster(), and fatfs_find_next_cluster().

Here is the call graph for this function:

◆ fatfs_set_fs_info_next_free_cluster()

void fatfs_set_fs_info_next_free_cluster ( struct fatfs fs,
uint32  newValue 
)

Definition at line 260 of file fat_table.c.

References FAT_TYPE_16.

Referenced by fatfs_add_free_space(), and fatfs_allocate_free_space().