sdk-core
v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Toggle main menu visibility
Loading...
Searching...
No Matches
scache.h
Go to the documentation of this file.
1
5
#ifndef _SCACHE_H
6
#define _SCACHE_H 1
7
8
#ifdef BUILDING_IEEE1394_DISK
9
#define BLOCK_SIZE 16384
10
#else
11
#define BLOCK_SIZE (4 * 1024)
12
#endif
13
14
#ifndef BUILDING_USBHDFSD
15
// number of cache slots (1 slot = block)
16
#define CACHE_SIZE 32
17
18
// when the flushCounter reaches FLUSH_TRIGGER then flushSectors is called
19
// #define FLUSH_TRIGGER 16
20
21
typedef
struct
_cache_record
22
{
23
unsigned
int
sector;
24
int
tax;
25
char
writeDirty;
26
} cache_record;
27
28
typedef
struct
_cache_set
29
{
30
#if !defined(BUILDING_IEEE1394_DISK) && !defined(BUILDING_USBHDFSD)
31
struct
block_device *bd;
32
#else
33
struct
SBP2Device *dev;
34
#endif
35
unsigned
int
sectorSize;
36
unsigned
int
indexLimit;
37
unsigned
char
*sectorBuf;
// = NULL; // sector content - the cache buffer
38
cache_record rec[CACHE_SIZE];
// cache info record
39
40
// statistical infos
41
unsigned
int
cacheAccess;
42
unsigned
int
cacheHits;
43
unsigned
int
writeFlag;
44
// unsigned int flushCounter;
45
46
// unsigned int cacheDumpCounter = 0;
47
} cache_set;
48
#endif
/* BUILDING_USBHDFSD */
49
#if defined(BUILDING_USBHDFSD)
50
extern
cache_set *scache_init(mass_dev *dev,
int
sectorSize);
51
#elif defined(BUILDING_IEEE1394_DISK)
52
extern
cache_set *scache_init(
struct
SBP2Device
*dev,
int
sectorSize);
53
#else
54
extern
cache_set *scache_init(
struct
block_device
*bd);
55
#endif
56
57
extern
void
scache_close(cache_set *cache);
58
extern
void
scache_kill(cache_set *cache);
// dlanor: added for disconnection events (flush impossible)
59
#if 0
60
extern
int
scache_allocSector(cache_set *cache,
unsigned
int
sector,
void
**buf);
61
#endif
62
extern
int
scache_readSector(cache_set *cache,
unsigned
int
sector,
void
**buf);
63
extern
int
scache_writeSector(cache_set *cache,
unsigned
int
sector);
64
extern
int
scache_flushSectors(cache_set *cache);
65
#ifdef BUILDING_USBHDFSD
66
extern
void
scache_invalidate(cache_set *cache,
unsigned
int
sector,
int
count
);
67
#endif
/* BUILDING_USBHDFSD */
68
69
extern
void
scache_getStat(cache_set *cache,
unsigned
int
*access,
unsigned
int
*hits);
70
71
#endif
SBP2Device
Definition
sbp2_disk.h:132
_cache_record
Definition
usbhdfsd.h:43
_cache_set
Definition
usbhdfsd.h:50
block_device
Definition
bdm.h:23
count
u32 count
start sector of fragmented bd/file
Definition
usbhdfsd-common.h:1
core
usbhdfsd
src
vfat
include
scache.h
Generated by
1.18.0