ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
libmc.c File Reference
#include <tamtypes.h>
#include <kernel.h>
#include <sifrpc.h>
#include <string.h>
#include "libmc.h"
+ Include dependency graph for libmc.c:

Go to the source code of this file.

Data Structures

struct  mcNameParam_t
 
struct  libmc_PageReadAlignData
 

Macros

#define RSIZE   2048
 

Enumerations

enum  MC_RPCCMD_NUMBERS {
  MC_RPCCMD_INIT = 0x00 ,
  MC_RPCCMD_GET_INFO ,
  MC_RPCCMD_OPEN ,
  MC_RPCCMD_CLOSE ,
  MC_RPCCMD_SEEK ,
  MC_RPCCMD_READ ,
  MC_RPCCMD_WRITE ,
  MC_RPCCMD_FLUSH ,
  MC_RPCCMD_CH_DIR ,
  MC_RPCCMD_GET_DIR ,
  MC_RPCCMD_SET_INFO ,
  MC_RPCCMD_DELETE ,
  MC_RPCCMD_FORMAT ,
  MC_RPCCMD_UNFORMAT ,
  MC_RPCCMD_GET_ENT ,
  MC_RPCCMD_CHG_PRITY ,
  MC_RPCCMD_CHECK_BLOCK ,
  MC_RPCCMD_ERASE_BLOCK = 0x0E ,
  MC_RPCCMD_READ_PAGE ,
  MC_RPCCMD_WRITE_PAGE
}
 

Functions

static void mcGetInfoApdx (void *info)
 
static void mcReadFixAlign (void *data_raw)
 
static void mcStoreDir (void *arg)
 
int mcInit (int type)
 
int mcGetInfo (int port, int slot, int *type, int *free, int *format)
 
int mcOpen (int port, int slot, const char *name, int mode)
 
int mcClose (int fd)
 
int mcSeek (int fd, int offset, int origin)
 
int mcRead (int fd, void *buffer, int size)
 
int mcWrite (int fd, const void *buffer, int size)
 
int mcFlush (int fd)
 
int mcMkDir (int port, int slot, const char *name)
 
int mcChdir (int port, int slot, const char *newDir, char *currentDir)
 
int mcGetDir (int port, int slot, const char *name, unsigned mode, int maxent, sceMcTblGetDir *table)
 
int mcSetFileInfo (int port, int slot, const char *name, const sceMcTblGetDir *info, unsigned flags)
 
int mcDelete (int port, int slot, const char *name)
 
int mcFormat (int port, int slot)
 
int mcUnformat (int port, int slot)
 
int mcGetEntSpace (int port, int slot, const char *path)
 
int mcRename (int port, int slot, const char *oldName, const char *newName)
 
int mcEraseBlock (int port, int slot, int block, int mode)
 
static void libmc_ReadAlignFunction (struct libmc_PageReadAlignData *data)
 
int mcReadPage (int port, int slot, unsigned int page, void *buffer)
 
int mcWritePage (int port, int slot, int page, const void *buffer)
 
int mcChangeThreadPriority (int level)
 
int mcSync (int mode, int *cmd, int *result)
 
int mcReset (void)
 

Variables

static const int mcRpcCmd [2][17]
 
static mcNameParam_t g_nameParam
 
static mcDescParam_t g_descParam
 
int _iop_reboot_count
 
static SifRpcClientData_t g_cdata
 
union {
   s32   result
 
   mcRpcStat_t   rpcStat
 
   u8   buffer [RSIZE]
 
g_rdata
 
static int * g_pType = NULL
 
static int * g_pFree = NULL
 
static int * g_pFormat = NULL
 
static int endParameter [48]
 
static char curDir [1024]
 
static sceMcTblGetDir g_fileInfoBuff
 
static int g_mclibInited = 0
 
static unsigned int g_currentCmd = 0
 
static int g_mcType = MC_TYPE_MC
 
static struct libmc_PageReadAlignData libmc_ReadPageAlignData
 

Detailed Description

Function defenitions for mclib.

Definition in file libmc.c.

Macro Definition Documentation

◆ RSIZE

#define RSIZE   2048

rpc receive data buffer

Definition at line 134 of file libmc.c.

Enumeration Type Documentation

◆ MC_RPCCMD_NUMBERS

rpc command function numbers

Enumerator
MC_RPCCMD_INIT 
MC_RPCCMD_GET_INFO 
MC_RPCCMD_OPEN 
MC_RPCCMD_CLOSE 
MC_RPCCMD_SEEK 
MC_RPCCMD_READ 
MC_RPCCMD_WRITE 
MC_RPCCMD_FLUSH 
MC_RPCCMD_CH_DIR 
MC_RPCCMD_GET_DIR 
MC_RPCCMD_SET_INFO 
MC_RPCCMD_DELETE 
MC_RPCCMD_FORMAT 
MC_RPCCMD_UNFORMAT 
MC_RPCCMD_GET_ENT 
MC_RPCCMD_CHG_PRITY 
MC_RPCCMD_CHECK_BLOCK 
MC_RPCCMD_ERASE_BLOCK 
MC_RPCCMD_READ_PAGE 
MC_RPCCMD_WRITE_PAGE 

Definition at line 30 of file libmc.c.

30  {
31  MC_RPCCMD_INIT = 0x00,
48  MC_RPCCMD_ERASE_BLOCK = 0x0E,
51 };
@ MC_RPCCMD_OPEN
Definition: libmc.c:33
@ MC_RPCCMD_WRITE
Definition: libmc.c:37
@ MC_RPCCMD_GET_INFO
Definition: libmc.c:32
@ MC_RPCCMD_FORMAT
Definition: libmc.c:43
@ MC_RPCCMD_CH_DIR
Definition: libmc.c:39
@ MC_RPCCMD_UNFORMAT
Definition: libmc.c:44
@ MC_RPCCMD_READ_PAGE
Definition: libmc.c:49
@ MC_RPCCMD_GET_DIR
Definition: libmc.c:40
@ MC_RPCCMD_GET_ENT
Definition: libmc.c:45
@ MC_RPCCMD_SET_INFO
Definition: libmc.c:41
@ MC_RPCCMD_FLUSH
Definition: libmc.c:38
@ MC_RPCCMD_CHECK_BLOCK
Definition: libmc.c:47
@ MC_RPCCMD_INIT
Definition: libmc.c:31
@ MC_RPCCMD_CHG_PRITY
Definition: libmc.c:46
@ MC_RPCCMD_READ
Definition: libmc.c:36
@ MC_RPCCMD_ERASE_BLOCK
Definition: libmc.c:48
@ MC_RPCCMD_SEEK
Definition: libmc.c:35
@ MC_RPCCMD_WRITE_PAGE
Definition: libmc.c:50
@ MC_RPCCMD_CLOSE
Definition: libmc.c:34
@ MC_RPCCMD_DELETE
Definition: libmc.c:42

Function Documentation

◆ libmc_ReadAlignFunction()

static void libmc_ReadAlignFunction ( struct libmc_PageReadAlignData data)
static

Definition at line 780 of file libmc.c.

780  {
781  unsigned int misaligned;
782 
783  if((misaligned=(unsigned int)data->dest1&0xF)!=0){
784  memcpy(UNCACHED_SEG(data->dest1), UNCACHED_SEG(data->data1), 16-misaligned);
785  memcpy(UNCACHED_SEG((unsigned int)data->dest1+(16-misaligned)), UNCACHED_SEG((unsigned int)data->data1+(16-misaligned)+0x1F0), misaligned);
786  }
787 }
#define UNCACHED_SEG(x)
Definition: kernel.h:35
u32 data
Definition: libmouse.c:36

References data, and UNCACHED_SEG.

Referenced by mcReadPage().

◆ mcChangeThreadPriority()

int mcChangeThreadPriority ( int  level)

change mcserv thread priority (I don't think this is implemented properly) Note: rom0:MCSERV does not support this. mcSync returns: 0 if ok < 0 if error

Parameters
levelthread priority
Returns
0 = success; -1 = error

Definition at line 843 of file libmc.c.

844 {
845  int ret;
846 
847  // check lib is inited
849  return -1;
850  // check nothing else is processing
852  return g_currentCmd;
853 
854  // set global variables
855 // *(u32*)mcCmd.name = level;
856 
857  // call sif function
859  return ret;
861  return ret;
862 }
static mcDescParam_t g_descParam
Definition: libmc.c:120
static int g_mclibInited
Definition: libmc.c:151
static const int mcRpcCmd[2][17]
Definition: libmc.c:56
static SifRpcClientData_t g_cdata
Definition: libmc.c:131
static int g_mcType
Definition: libmc.c:157
static union @26 g_rdata
static unsigned int g_currentCmd
Definition: libmc.c:154
#define MC_TYPE_MC
Definition: libmc.h:195
@ MC_FUNC_NONE
Definition: libmc.h:66
@ MC_FUNC_CHG_PRITY
Definition: libmc.h:83
#define SIF_RPC_M_NOWAIT
Definition: sifrpc.h:24
int SifCallRpc(SifRpcClientData_t *client, int rpc_number, int mode, void *send, int ssize, void *receive, int rsize, SifRpcEndFunc_t end_function, void *end_param)
#define NULL
Definition: tamtypes.h:91

References g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_FUNC_CHG_PRITY, MC_FUNC_NONE, MC_RPCCMD_CHG_PRITY, MC_TYPE_MC, mcRpcCmd, NULL, SIF_RPC_M_NOWAIT, and SifCallRpc().

◆ mcChdir()

int mcChdir ( int  port,
int  slot,
const char *  newDir,
char *  currentDir 
)

change current dir (can also get current dir) mcSync returns: 0 if ok < 0 if error

Parameters
portport number
slotslot number
newDirnew dir to change to
currentDirbuffer to get current dir (use 0 if not needed)
Returns
0 = successful; < 0 = error

Definition at line 541 of file libmc.c.

542 {
543  int ret;
544 
545  // check mc lib is inited
546  if(!g_mclibInited)
547  return -1;
548  // check nothing else is processing
550  return g_currentCmd;
551 
552  // set global variables
556  strncpy(g_nameParam.name, newDir, 1023);
557  g_nameParam.name[1023] = 0;
558  SifWriteBackDCache(curDir, 1024);
559 
560  // send sif command
562  return ret;
564  return ret;
565 }
static mcNameParam_t g_nameParam
Definition: libmc.c:115
static char curDir[1024]
Definition: libmc.c:146
static void mcStoreDir(void *arg)
Definition: libmc.c:219
@ MC_FUNC_CH_DIR
Definition: libmc.h:75
s32 slot
Definition: libpad.c:176
s32 port
Definition: libpad.c:176
void SifWriteBackDCache(void *ptr, int size)
void(* SifRpcEndFunc_t)(void *end_param)
Definition: sifrpc.h:33
int port
Definition: libmc.c:104
char name[1024]
Definition: libmc.c:112
char * curdir
Definition: libmc.c:110
int slot
Definition: libmc.c:105

References mcNameParam_t::curdir, curDir, g_cdata, g_currentCmd, g_mclibInited, g_mcType, g_nameParam, g_rdata, MC_FUNC_CH_DIR, MC_FUNC_NONE, MC_RPCCMD_CH_DIR, mcRpcCmd, mcStoreDir(), mcNameParam_t::name, mcNameParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), SifWriteBackDCache(), mcNameParam_t::slot, and slot.

◆ mcClose()

int mcClose ( int  fd)

close an open file on memcard mcSync returns: 0 if closed successfully < 0 = error

Parameters
fdfile descriptor of open file
Returns
0 successful; < 0 = error

Definition at line 403 of file libmc.c.

404 {
405  int ret;
406 
407  // check mc lib is inited
408  if(!g_mclibInited)
409  return -1;
410  // check nothing else is processing
412  return g_currentCmd;
413 
414  // set global variables
415  g_descParam.fd = fd;
416 
417  // send sif command
419  return ret;
421  return ret;
422 }
@ MC_FUNC_CLOSE
Definition: libmc.h:69

References mcDescParam_t::fd, g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_FUNC_CLOSE, MC_FUNC_NONE, MC_RPCCMD_CLOSE, mcRpcCmd, NULL, SIF_RPC_M_NOWAIT, and SifCallRpc().

◆ mcDelete()

int mcDelete ( int  port,
int  slot,
const char *  name 
)

delete file mcSync returns: 0 if deleted successfully < 0 if error

Parameters
portport number to delete from
slotslot number to delete from
namefilename to delete
Returns
0 = successful; < 0 = error

Definition at line 624 of file libmc.c.

625 {
626  int ret;
627 
628  // check lib is inited
629  if(!g_mclibInited)
630  return -1;
631  // check nothing else is processing
633  return g_currentCmd;
634 
635  // set global variables
638  g_nameParam.flags = 0;
639  strncpy(g_nameParam.name, name, 1023);
640  g_nameParam.name[1023] = 0;
641 
642  // call delete function
644  return ret;
646  return ret;
647 }
@ MC_FUNC_DELETE
Definition: libmc.h:78
int flags
Definition: libmc.c:106

References mcNameParam_t::flags, g_cdata, g_currentCmd, g_mclibInited, g_mcType, g_nameParam, g_rdata, MC_FUNC_DELETE, MC_FUNC_NONE, MC_RPCCMD_DELETE, mcRpcCmd, mcNameParam_t::name, NULL, mcNameParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), mcNameParam_t::slot, and slot.

◆ mcEraseBlock()

int mcEraseBlock ( int  port,
int  slot,
int  block,
int  mode 
)

Erases a block on the memory card. Note: rom0:XMCSERV does not support this. mcSync returns: 0 if ok < 0 if error

Parameters
portport number
slotslot number
blockBlock number of the block to be erased.
modeMode: -1 to inhibit ECC recalculation of the erased block's pages (useful if sceMcWritePage is used to fill in its contents later on), 0 for normal operation.
Returns
0 = success; -1 = error

Definition at line 746 of file libmc.c.

746  {
747  int result;
748 
749  // check lib is inited
751  return -1;
752  // check nothing else is processing
754  return g_currentCmd;
755 
758  g_descParam.offset=block;
760 
763  }
764 
765  return result;
766 }
s32 result
Definition: libmc.c:136
#define MC_TYPE_XMC
Definition: libmc.h:196
@ MC_FUNC_ERASE_BLOCK
Definition: libmc.h:84
s32 mode
Definition: rpc_client.c:15

◆ mcFlush()

int mcFlush ( int  fd)

flush file cache to memcard mcSync returns: 0 if ok < 0 if error

Parameters
fdfile descriptor
Returns
0 = successful; < 0 = error

Definition at line 511 of file libmc.c.

512 {
513  int ret;
514 
515  // check mc lib is inited
516  if(!g_mclibInited)
517  return -1;
518  // check nothing else is processing
520  return g_currentCmd;
521 
522  // set global variables
523  g_descParam.fd = fd;
524 
525  // send sif command
527  return ret;
529  return ret;
530 }
@ MC_FUNC_FLUSH
Definition: libmc.h:73

References mcDescParam_t::fd, g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_FUNC_FLUSH, MC_FUNC_NONE, MC_RPCCMD_FLUSH, mcRpcCmd, NULL, SIF_RPC_M_NOWAIT, and SifCallRpc().

◆ mcFormat()

int mcFormat ( int  port,
int  slot 
)

format memory card mcSync returns: 0 if ok < 0 if error

Parameters
portport number
slotslot number
Returns
0 = success; -1 = error

Definition at line 649 of file libmc.c.

650 {
651  int ret;
652 
653  // check lib is inited
654  if(!g_mclibInited)
655  return -1;
656  // check nothing else is processing
658  return g_currentCmd;
659 
660  // set global variables
663 
664  // call format function
666  return ret;
668  return ret;
669 }
@ MC_FUNC_FORMAT
Definition: libmc.h:79

References g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_FUNC_FORMAT, MC_FUNC_NONE, MC_RPCCMD_FORMAT, mcRpcCmd, NULL, mcDescParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), mcDescParam_t::slot, and slot.

◆ mcGetDir()

int mcGetDir ( int  port,
int  slot,
const char *  name,
unsigned  mode,
int  maxent,
sceMcTblGetDir table 
)

get memcard filelist mcSync result: 0 or more = number of file entries obtained (success) -2 = unformatted card -4 = dirname error

Parameters
portport number of memcard
slotslot number of memcard
namefilename to search for (can use wildcard and relative dirs)
modemode: 0 = first call, otherwise = followup call
maxextmaximum number of entries to be written to filetable in 1 call
tablemc table array
Returns
0 = successful; < 0 = error

Definition at line 567 of file libmc.c.

568 {
569  int ret;
570 
571  // check mc lib is inited
572  if(!g_mclibInited)
573  return -1;
574  // check nothing else is processing
576  return g_currentCmd;
577 
578  // set global variables
582  g_nameParam.maxent = maxent;
583  g_nameParam.mcT = table;
584  strncpy(g_nameParam.name, name, 1023);
585  g_nameParam.name[1023] = 0;
586  SifWriteBackDCache(table, maxent * sizeof(sceMcTblGetDir));
587 
588  // send sif command
590  return ret;
592  return ret;
593 }
@ MC_FUNC_GET_DIR
Definition: libmc.h:76
int maxent
Definition: libmc.c:107
sceMcTblGetDir * mcT
Definition: libmc.c:109

References mcNameParam_t::flags, g_cdata, g_currentCmd, g_mclibInited, g_mcType, g_nameParam, g_rdata, mcNameParam_t::maxent, MC_FUNC_GET_DIR, MC_FUNC_NONE, MC_RPCCMD_GET_DIR, mcRpcCmd, mcNameParam_t::mcT, mode, mcNameParam_t::name, NULL, mcNameParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), SifWriteBackDCache(), mcNameParam_t::slot, and slot.

Referenced by main().

◆ mcGetEntSpace()

int mcGetEntSpace ( int  port,
int  slot,
const char *  path 
)

get free space info mcSync returns: 0 or more = number of free entries (success) < 0 if error

Parameters
portport number
slotslot number
pathpath to be checked
Returns
0 or more = number of empty entries; -1 = error

Definition at line 693 of file libmc.c.

694 {
695  int ret;
696 
697  // check lib is inited
699  return -1;
700  // check nothing else is processing
702  return g_currentCmd;
703 
704  // set global variables
707  strncpy(g_nameParam.name, path, 1023);
708  g_nameParam.name[1023] = 0;
709 
710  // call sif function
712  return ret;
714  return ret;
715 }
@ MC_FUNC_GET_ENT
Definition: libmc.h:81

References g_cdata, g_currentCmd, g_mclibInited, g_mcType, g_nameParam, g_rdata, MC_FUNC_GET_ENT, MC_FUNC_NONE, MC_RPCCMD_GET_ENT, MC_TYPE_MC, mcRpcCmd, mcNameParam_t::name, NULL, mcNameParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), mcNameParam_t::slot, and slot.

◆ mcGetInfo()

int mcGetInfo ( int  port,
int  slot,
int *  type,
int *  free,
int *  format 
)

get memcard state mcSync result: 0 = same card as last getInfo call -1 = formatted card inserted since last getInfo call -2 = unformatted card inserted since last getInfo call < -2 = memcard access error (could be due to accessing psx memcard)

Parameters
portport number
slotslot number
typepointer to get memcard type
freepointer to get number of free clusters
formatpointer to get whether or not the card is formatted (Note: Originally, sceMcGetInfo didn't have a 5th argument for returning the format status. As this is emulated based on the return value of sceMcSync() when rom0:MCSERV is used, please keep track of the return value from sceMcSync instead!)
Returns
0 = successful; < 0 = error

Definition at line 336 of file libmc.c.

337 {
338  int ret;
339 
340  // check mc lib is inited
341  if(!g_mclibInited)
342  return -1;
343  // check nothing else is processing
345  return g_currentCmd;
346 
347  // set global variables
348  if(g_mcType == MC_TYPE_MC)
349  {
352  g_descParam.size = (type) ? 1 : 0;
353  g_descParam.offset = (free) ? 1 : 0;
354  g_descParam.origin = (format) ? 1 : 0;
356  }
357  else
358  {
361  g_descParam.size = (format) ? 1 : 0;
362  g_descParam.offset = (free) ? 1 : 0;
363  g_descParam.origin = (type) ? 1 : 0;
365  }
366  g_pType = type;
367  g_pFree = free;
368  g_pFormat = format;
370 
371  // send sif command
373  return ret;
375  return ret;
376 }
static int endParameter[48]
Definition: libmc.c:145
static void mcGetInfoApdx(void *info)
Definition: libmc.c:163
static int * g_pFree
Definition: libmc.c:142
static int * g_pFormat
Definition: libmc.c:143
static int * g_pType
Definition: libmc.c:141
@ MC_FUNC_GET_INFO
Definition: libmc.h:67

References endParameter, g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_pFormat, g_pFree, g_pType, g_rdata, MC_FUNC_GET_INFO, MC_FUNC_NONE, MC_RPCCMD_GET_INFO, MC_TYPE_MC, mcGetInfoApdx(), mcRpcCmd, mcDescParam_t::offset, mcDescParam_t::origin, mcDescParam_t::param, mcDescParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), SifWriteBackDCache(), mcDescParam_t::size, mcDescParam_t::slot, and slot.

Referenced by main().

◆ mcGetInfoApdx()

static void mcGetInfoApdx ( void *  info)
static

function that gets called when mcGetInfo ends and interrupts are disabled

Definition at line 163 of file libmc.c.

164 {
167 
168  // older MCSERV doesnt support retrieving whether card is formatted
169  // so if a card is present, determine whether its formatted based on the return value from MCSERV
170  if(g_mcType == MC_TYPE_MC)
171  {
172  if(g_pType != NULL)
173  *g_pType = ptr->type;
174 
175  if(g_pFree != NULL)
176  *g_pFree = ptr->free;
177 
178  if(g_pFormat != NULL)
179  *g_pFormat = (ptr->type == MC_TYPE_NONE || g_rdata.result == -2) ? 0 : 1;
180  } else {
181  if(g_pType != NULL)
182  *g_pType = ptrNew->type;
183 
184  if(g_pFree != NULL)
185  *g_pFree = ptrNew->free;
186 
187  if(g_pFormat != NULL)
188  *g_pFormat = ptrNew->formatted;
189  }
190 }
jpgData * info
Definition: camera-test.c:14
#define MC_TYPE_NONE
Definition: libmc.h:44

References mcEndParam2_t::formatted, mcEndParam_t::free, mcEndParam2_t::free, g_mcType, g_pFormat, g_pFree, g_pType, g_rdata, info, MC_TYPE_MC, MC_TYPE_NONE, NULL, mcEndParam_t::type, mcEndParam2_t::type, and UNCACHED_SEG.

Referenced by mcGetInfo().

◆ mcInit()

int mcInit ( int  type)

init memcard lib

Parameters
typeMC_TYPE_MC = use MCSERV/MCMAN; MC_TYPE_XMC = use XMCSERV/XMCMAN
Returns
0 = successful; < 0 = error

Definition at line 230 of file libmc.c.

231 {
232  int ret=0;
234  static int _rb_count = 0;
235 
236  if(_rb_count != _iop_reboot_count)
237  {
238  _rb_count = _iop_reboot_count;
239  mcReset();
240  }
241 
242  if(g_mclibInited)
243  return -1;
244 
245  SifInitRpc(0);
246 
247  // set which modules to use
248  g_mcType = type;
249 
250  // bind to mc rpc on iop
251  do
252  {
253  if((ret=SifBindRpc(&g_cdata, 0x80000400, 0)) < 0)
254  {
255  #ifdef MC_DEBUG
256  printf("libmc: bind error\n");
257  #endif
258 
259  return ret;
260  }
261  if(g_cdata.server == NULL)
262  nopdelay();
263  }
264  while (g_cdata.server == NULL);
265 
266  // for some reason calling this init sif function with 'mcserv' makes all other
267  // functions not work properly. although NOT calling it means that detecting
268  // whether or not cards are formatted doesnt seem to work :P
269  if(g_mcType == MC_TYPE_MC)
270  {
271 #ifdef MC_DEBUG
272  printf("libmc: using MCMAN & MCSERV\n");
273 
274 #endif
275  g_descParam.offset = -217;
276 
277  // call init function
278  if((ret = SifCallRpc(&g_cdata, mcRpcCmd[g_mcType][MC_RPCCMD_INIT], 0, &g_descParam, sizeof(g_descParam), &g_rdata, 4, NULL, NULL))>=0)
279  {
280  ret = g_rdata.result;
281  }
282  else{
283  // init error
284 #ifdef MC_DEBUG
285  printf("libmc: initialisation error\n");
286 #endif
287  g_mclibInited = 0;
288  return g_rdata.result - 100;
289  }
290  }
291  else if(g_mcType == MC_TYPE_XMC)
292  {
293 #ifdef MC_DEBUG
294  printf("libmc: using XMCMAN & XMCSERV\n");
295 #endif
296 
297  // call init function
298  if((ret = SifCallRpc(&g_cdata, mcRpcCmd[g_mcType][MC_RPCCMD_INIT], 0, &g_descParam, sizeof(g_descParam), &g_rdata, 12, NULL, NULL)) < 0)
299  {
300  // init error
301 #ifdef MC_DEBUG
302  printf("libmc: initialisation error\n");
303 #endif
304  g_mclibInited = 0;
305  return ret - 100;
306  }
307 
308  // check if old version of mcserv loaded
309  if(rpcStat->mcserv_version < 0x205)
310  {
311 #ifdef MC_DEBUG
312  printf("libmc: mcserv is too old (%x)\n", rpcStat->mcserv_version);
313 #endif
314  g_mclibInited = 0;
315  return -120;
316  }
317 
318  // check if old version of mcman loaded
319  if(rpcStat->mcman_version < 0x206)
320  {
321 #ifdef MC_DEBUG
322  printf("libmc: mcman is too old (%x)\n", rpcStat->mcman_version);
323 #endif
324  g_mclibInited = 0;
325  return -121;
326  }
327  ret = rpcStat->result;
328  }
329 
330  // successfully inited
331  g_mclibInited = 1;
332  g_currentCmd = 0;
333  return ret;
334 }
static void nopdelay(void)
Definition: kernel.h:141
int mcReset(void)
Definition: libmc.c:905
int _iop_reboot_count
mcRpcStat_t rpcStat
Definition: libmc.c:137
void SifInitRpc(int mode)
int SifBindRpc(SifRpcClientData_t *client, int rpc_number, int mode)
struct t_SifRpcServerData * server
Definition: sifrpc.h:142
u32 mcserv_version
Definition: libmc-common.h:133

References _iop_reboot_count, g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_RPCCMD_INIT, MC_TYPE_MC, MC_TYPE_XMC, mcRpcStat_t::mcman_version, mcReset(), mcRpcCmd, mcRpcStat_t::mcserv_version, nopdelay(), NULL, mcDescParam_t::offset, mcRpcStat_t::result, rpcStat, SifRpcClientData_t::server, SifBindRpc(), SifCallRpc(), SifInitRpc(), and UNCACHED_SEG.

Referenced by main().

◆ mcMkDir()

int mcMkDir ( int  port,
int  slot,
const char *  name 
)

create a dir mcSync returns: 0 if ok < 0 if error

Parameters
portport number
slotslot number
namedirectory name
Returns
0 = successful; < 0 = error

Definition at line 532 of file libmc.c.

533 {
534  int ret = mcOpen(port, slot, name, 0x40);
535 
536  if(ret != 0)
538  return ret;
539 }
int mcOpen(int port, int slot, const char *name, int mode)
Definition: libmc.c:378
@ MC_FUNC_MK_DIR
Definition: libmc.h:74

References g_currentCmd, MC_FUNC_MK_DIR, mcOpen(), port, and slot.

◆ mcOpen()

int mcOpen ( int  port,
int  slot,
const char *  name,
int  mode 
)

open a file on memcard mcSync returns: 0 or more = file descriptor (success) < 0 = error

Parameters
portport number
slotslot number
namefilename to open
modeopen file mode (O_RDWR, O_CREAT, etc)
Returns
0 = successful; < 0 = error

Definition at line 378 of file libmc.c.

379 {
380  int ret;
381 
382  // check mc lib is inited
383  if(!g_mclibInited)
384  return -1;
385  // check nothing else is processing
387  return g_currentCmd;
388 
389  // set global variables
393  strncpy(g_nameParam.name, name, 1023);
394  g_nameParam.name[1023] = 0;
395 
396  // send sif command
398  return ret;
400  return ret;
401 }
@ MC_FUNC_OPEN
Definition: libmc.h:68

References mcNameParam_t::flags, g_cdata, g_currentCmd, g_mclibInited, g_mcType, g_nameParam, g_rdata, MC_FUNC_NONE, MC_FUNC_OPEN, MC_RPCCMD_OPEN, mcRpcCmd, mode, mcNameParam_t::name, NULL, mcNameParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), mcNameParam_t::slot, and slot.

Referenced by mcMkDir().

◆ mcRead()

int mcRead ( int  fd,
void *  buffer,
int  size 
)

read from file on memcard mcSync returns: 0 or more = number of bytes read from memcard < 0 = error

Parameters
fdfile descriptor
bufferbuffer to read to
sizenumber of bytes to read
Returns
0 = successful; < 0 = error

Definition at line 447 of file libmc.c.

448 {
449  int ret;
450 
451  // check mc lib is inited
452  if(!g_mclibInited)
453  return -1;
454  // check nothing else is processing
456  return g_currentCmd;
457 
458  // set global variables
459  g_descParam.fd = fd;
460  g_descParam.size = size;
463  SifWriteBackDCache(buffer, size);
465 
466  // send sif command
468  return ret;
470  return ret;
471 }
u8 buffer[RSIZE]
Definition: libmc.c:138
static void mcReadFixAlign(void *data_raw)
Definition: libmc.c:195
@ MC_FUNC_READ
Definition: libmc.h:71

References mcDescParam_t::buffer, buffer, endParameter, mcDescParam_t::fd, g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_FUNC_NONE, MC_FUNC_READ, MC_RPCCMD_READ, mcReadFixAlign(), mcRpcCmd, mcDescParam_t::param, SIF_RPC_M_NOWAIT, SifCallRpc(), SifWriteBackDCache(), and mcDescParam_t::size.

◆ mcReadFixAlign()

static void mcReadFixAlign ( void *  data_raw)
static

function that gets called when mcRead ends and interrupts are disabled

Definition at line 195 of file libmc.c.

196 {
197  mcEndParam_t *ptr = (mcEndParam_t*)UNCACHED_SEG(data_raw);
198  mcEndParam2_t *ptrNew = (mcEndParam2_t*)UNCACHED_SEG(data_raw);
199  u8 *dest;
200  int i;
201 
202  if(g_mcType == MC_TYPE_MC)
203  {
204  for(i = 0,dest = (u8*)ptr->dest1; i < ptr->size1; i++)
205  dest[i] = ptr->src1[i];
206  for(i = 0,dest = (u8*)ptr->dest2; i < ptr->size2; i++)
207  dest[i] = ptr->src2[i];
208  } else {
209  for(i = 0,dest = (u8*)ptrNew->dest1; i < ptrNew->size1; i++)
210  dest[i] = ptrNew->src1[i];
211  for(i = 0,dest = (u8*)ptrNew->dest2; i < ptrNew->size2; i++)
212  dest[i] = ptrNew->src2[i];
213  }
214 }
unsigned char u8
Definition: tamtypes.h:23

References mcEndParam_t::dest1, mcEndParam2_t::dest1, mcEndParam_t::dest2, mcEndParam2_t::dest2, g_mcType, MC_TYPE_MC, mcEndParam_t::size1, mcEndParam2_t::size1, mcEndParam_t::size2, mcEndParam2_t::size2, mcEndParam_t::src1, mcEndParam2_t::src1, mcEndParam_t::src2, mcEndParam2_t::src2, and UNCACHED_SEG.

Referenced by mcRead().

◆ mcReadPage()

int mcReadPage ( int  port,
int  slot,
unsigned int  page,
void *  buffer 
)

Reads a page from the memory card. Note: rom0:XMCSERV does not support this. mcSync returns: 0 if ok < 0 if error

Parameters
portport number
slotslot number
pagePage number of the page to be read.
bufferPointer to buffer that will contain the read data.
Returns
0 = success; -1 = error

Definition at line 789 of file libmc.c.

789  {
790  int result;
791 
792  // check lib is inited
794  return -1;
795  // check nothing else is processing
797  return g_currentCmd;
798 
799  g_descParam.fd=page;
804 
805  SifWriteBackDCache(buffer, 0x200);
806 
809  }
810 
811  return result;
812 }
static struct libmc_PageReadAlignData libmc_ReadPageAlignData
Definition: libmc.c:778
static void libmc_ReadAlignFunction(struct libmc_PageReadAlignData *data)
Definition: libmc.c:780
@ MC_FUNC_READ_PAGE
Definition: libmc.h:85

References mcDescParam_t::buffer, buffer, mcDescParam_t::fd, g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, libmc_ReadAlignFunction(), libmc_ReadPageAlignData, MC_FUNC_NONE, MC_FUNC_READ_PAGE, MC_RPCCMD_READ_PAGE, MC_TYPE_XMC, mcRpcCmd, mcDescParam_t::param, mcDescParam_t::port, port, result, SIF_RPC_M_NOWAIT, SifCallRpc(), SifWriteBackDCache(), mcDescParam_t::slot, slot, and UNCACHED_SEG.

◆ mcRename()

int mcRename ( int  port,
int  slot,
const char *  oldName,
const char *  newName 
)

rename file or dir on memcard Note: rom0:MCSERV does not support this. mcSync returns: 0 if ok < 0 if error

Parameters
portport number
slotslot number
oldNamename of file/dir to rename
newNamenew name to give to file/dir
Returns
1 = success; < 0 = error

Definition at line 717 of file libmc.c.

718 {
719  int ret;
720 
721  // check lib is inited
722  if((!g_mclibInited)||(g_mcType==MC_TYPE_MC)) //I don't think that the old MCSERV module supports this because the v1.00 and v1.01 OSDSYS doesn't seem to have the sceMcRename function at all and the sceMcRename function was only introduced with SCE PS2SDK v1.50. I see that it doesn't work with rom0:MCSERV either way...
723  return -1;
724  // check nothing else is processing
726  return g_currentCmd;
727 
728  // set global variables
731  g_nameParam.flags = 0x10;
733  strncpy(g_nameParam.name, oldName, 1023);
734  g_nameParam.name[1023] = 0;
735  strncpy((char*)g_fileInfoBuff.EntryName, newName, 31);
736  g_fileInfoBuff.EntryName[31] = 0;
737  FlushCache(0);
738 
739  // call sif function
741  return ret;
743  return ret;
744 }
void FlushCache(s32 operation)
static sceMcTblGetDir g_fileInfoBuff
Definition: libmc.c:147
@ MC_FUNC_RENAME
Definition: libmc.h:82
unsigned char EntryName[32]
Definition: libmc.h:145

References sceMcTblGetDir::EntryName, mcNameParam_t::flags, FlushCache(), g_cdata, g_currentCmd, g_fileInfoBuff, g_mclibInited, g_mcType, g_nameParam, g_rdata, MC_FUNC_NONE, MC_FUNC_RENAME, MC_RPCCMD_SET_INFO, MC_TYPE_MC, mcRpcCmd, mcNameParam_t::mcT, mcNameParam_t::name, NULL, mcNameParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), mcNameParam_t::slot, and slot.

◆ mcReset()

int mcReset ( void  )

Reset (force deinit) of library

Returns
0 = success

Definition at line 905 of file libmc.c.

906 {
907  g_mclibInited = 0;
908  g_cdata.server = NULL;
909  return 0;
910 }

References g_cdata, g_mclibInited, NULL, and SifRpcClientData_t::server.

Referenced by mcInit().

◆ mcSeek()

int mcSeek ( int  fd,
int  offset,
int  origin 
)

move memcard file pointer mcSync returns: 0 or more = offset of file pointer from start of file < 0 = error

Parameters
fdfile descriptor
offsetnumber of bytes from origin
origininitial position for offset
Returns
0 = successful; < 0 = error

Definition at line 424 of file libmc.c.

425 {
426  int ret;
427 
428  // check mc lib is inited
429  if(!g_mclibInited)
430  return -1;
431  // check nothing else is processing
433  return g_currentCmd;
434 
435  // set global variables
436  g_descParam.fd = fd;
437  g_descParam.offset = offset;
438  g_descParam.origin = origin;
439 
440  // send sif command
442  return ret;
444  return ret;
445 }
@ MC_FUNC_SEEK
Definition: libmc.h:70

References mcDescParam_t::fd, g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_FUNC_NONE, MC_FUNC_SEEK, MC_RPCCMD_SEEK, mcRpcCmd, NULL, mcDescParam_t::offset, mcDescParam_t::origin, SIF_RPC_M_NOWAIT, and SifCallRpc().

◆ mcSetFileInfo()

int mcSetFileInfo ( int  port,
int  slot,
const char *  name,
const sceMcTblGetDir info,
unsigned  flags 
)

change file information mcSync returns: 0 if ok < 0 if error

Parameters
portport number
slotslot number
namefilename to access
infodata to be changed
flagsflags to show which data is valid
Returns
0 = successful; < 0 = error

Definition at line 595 of file libmc.c.

596 {
597  int ret;
598 
599  // check mc lib is inited
600  if(!g_mclibInited)
601  return -1;
602  // check nothing else is processing
604  return g_currentCmd;
605 
606  // set global variables
609  g_nameParam.flags = flags; // NOTE: this was ANDed with 7 so that u cant turn off copy protect! :)
611  memcpy(&g_fileInfoBuff, info, sizeof(sceMcTblGetDir));
612 
613  strncpy(g_nameParam.name, name, 1023);
614  g_nameParam.name[1023] = 0;
615  FlushCache(0);
616 
617  // send sif command
619  return ret;
621  return ret;
622 }
@ MC_FUNC_SET_INFO
Definition: libmc.h:77

References mcNameParam_t::flags, FlushCache(), g_cdata, g_currentCmd, g_fileInfoBuff, g_mclibInited, g_mcType, g_nameParam, g_rdata, info, MC_FUNC_NONE, MC_FUNC_SET_INFO, MC_RPCCMD_SET_INFO, mcRpcCmd, mcNameParam_t::mcT, mcNameParam_t::name, NULL, mcNameParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), mcNameParam_t::slot, and slot.

◆ mcStoreDir()

static void mcStoreDir ( void *  arg)
static

function that gets called when mcChDir ends and interrupts are disabled

Definition at line 219 of file libmc.c.

220 {
221  int len;
222  char *currentDir = UNCACHED_SEG(curDir);
223  len = strlen(currentDir);
224  if(len >= 1024)
225  len = strlen(currentDir+1023);
226  memcpy(arg, currentDir, len);
227  *(currentDir+len) = 0;
228 }

References curDir, and UNCACHED_SEG.

Referenced by mcChdir().

◆ mcSync()

int mcSync ( int  mode,
int *  cmd,
int *  result 
)

wait for mc functions to finish or check if they have finished yet

Parameters
modemode 0=wait till function finishes, 1=check function status
cmdpointer for storing the number of the currenlty processing function
resultpointer for storing result of function if it finishes
Returns
0 = function is still executing (mode=1); 1 = function has finished executing; -1 = no function registered

Definition at line 864 of file libmc.c.

865 {
866  int funcIsExecuting, i;
867 
868  // check if any functions are registered
870  return -1;
871 
872  // check if function is still processing
873  funcIsExecuting = SifCheckStatRpc(&g_cdata);
874 
875  // if mode = 0, wait for function to finish
876  if(mode == 0)
877  {
878  while(SifCheckStatRpc(&g_cdata))
879  {
880  for(i=0; i<100000; i++)
881  ;
882  }
883  // function has finished
884  funcIsExecuting = 0;
885  }
886 
887  // get the function that just finished
888  if(cmd)
889  *cmd = g_currentCmd;
890 
891  // if function is still processing, return 0
892  if(funcIsExecuting == 1)
893  return 0;
894 
895  // function has finished, so clear last command
896  g_currentCmd = 0;
897 
898  // get result
899  if(result)
900  *result = g_rdata.result;
901 
902  return 1;
903 }
int SifCheckStatRpc(SifRpcClientData_t *cd)

References g_cdata, g_currentCmd, g_rdata, MC_FUNC_NONE, mode, result, and SifCheckStatRpc().

Referenced by main().

◆ mcUnformat()

int mcUnformat ( int  port,
int  slot 
)

unformat memory card mcSync returns: 0 if ok < 0 if error

Parameters
portport number
slotslot number
Returns
0 = success; -1 = error

Definition at line 671 of file libmc.c.

672 {
673  int ret;
674 
675  // check lib is inited
676  if(!g_mclibInited)
677  return -1;
678  // check nothing else is processing
680  return g_currentCmd;
681 
682  // set global variables
685 
686  // call unformat function
688  return ret;
690  return ret;
691 }
@ MC_FUNC_UNFORMAT
Definition: libmc.h:80

References g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_FUNC_NONE, MC_FUNC_UNFORMAT, MC_RPCCMD_UNFORMAT, mcRpcCmd, NULL, mcDescParam_t::port, port, SIF_RPC_M_NOWAIT, SifCallRpc(), mcDescParam_t::slot, and slot.

◆ mcWrite()

int mcWrite ( int  fd,
const void *  buffer,
int  size 
)

write to file on memcard mcSync returns: 0 or more = number of bytes written to memcard < 0 = error

Parameters
fdfile descriptor
bufferto write from write
sizenumber of bytes to read
Returns
0 = successful; < 0 = error

Definition at line 473 of file libmc.c.

474 {
475  int i, ret;
476 
477  // check mc lib is inited
478  if(!g_mclibInited)
479  return -1;
480  // check nothing else is processing
482  return g_currentCmd;
483 
484  // set global variables
485  g_descParam.fd = fd;
486  if(size < 17)
487  {
488  g_descParam.size = 0;
489  g_descParam.origin = size;
490  g_descParam.buffer = 0;
491  }
492  else
493  {
494  g_descParam.size = size - ( ((int)(buffer-1) & 0xFFFFFFF0) - (int)(buffer-16) );
495  g_descParam.origin = ( ((int)(buffer-1) & 0xFFFFFFF0) - (int)(buffer-16) );
496  g_descParam.buffer = (void*)((int)buffer + ( ((int)(buffer-1) & 0xFFFFFFF0) - (int)(buffer-16) ));
497  }
498  for(i=0; i<g_descParam.origin; i++)
499  {
500  g_descParam.data[i] = *(char*)(buffer+i);
501  }
502  FlushCache(0);
503 
504  // send sif command
506  return ret;
508  return ret;
509 }
@ MC_FUNC_WRITE
Definition: libmc.h:72

References mcDescParam_t::buffer, buffer, mcDescParam_t::data, mcDescParam_t::fd, FlushCache(), g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_FUNC_NONE, MC_FUNC_WRITE, MC_RPCCMD_WRITE, mcRpcCmd, NULL, mcDescParam_t::origin, SIF_RPC_M_NOWAIT, SifCallRpc(), and mcDescParam_t::size.

◆ mcWritePage()

int mcWritePage ( int  port,
int  slot,
int  page,
const void *  buffer 
)

Writes a page to the memory card. (The block which the page resides on must be erased first!) Note: rom0:XMCSERV does not support this. mcSync returns: 0 if ok < 0 if error

Parameters
portport number
slotslot number
pagePage number of the page to be written.
bufferPointer to buffer containing data to be written.
Returns
0 = success; -1 = error

Definition at line 814 of file libmc.c.

814  {
815  int result, misaligned;
816 
817  // check lib is inited
819  return -1;
820  // check nothing else is processing
822  return g_currentCmd;
823 
824  g_descParam.fd=page;
827  g_descParam.buffer=(void*)buffer;
828 
829  SifWriteBackDCache((void*)buffer, 512);
830 
831  if((misaligned=(unsigned int)buffer&0xF)!=0){
832  memcpy(g_descParam.data, buffer, 16-misaligned);
833  memcpy((void*)(g_descParam.data+(16-misaligned)), (void*)(buffer+(16-misaligned)+0x1F0), misaligned);
834  }
835 
838  }
839 
840  return result;
841 }
@ MC_FUNC_WRITE_PAGE
Definition: libmc.h:86

References mcDescParam_t::buffer, buffer, mcDescParam_t::data, mcDescParam_t::fd, g_cdata, g_currentCmd, g_descParam, g_mclibInited, g_mcType, g_rdata, MC_FUNC_NONE, MC_FUNC_WRITE_PAGE, MC_RPCCMD_WRITE_PAGE, MC_TYPE_XMC, mcRpcCmd, NULL, mcDescParam_t::port, port, result, SIF_RPC_M_NOWAIT, SifCallRpc(), SifWriteBackDCache(), mcDescParam_t::slot, and slot.

Variable Documentation

◆ _iop_reboot_count

int _iop_reboot_count
extern

external IOP reboot count

Referenced by mcInit().

◆ buffer

u8 buffer[RSIZE]

Definition at line 138 of file libmc.c.

Referenced by mcRead(), mcReadPage(), mcWrite(), and mcWritePage().

◆ curDir

char curDir[1024]
static

Definition at line 146 of file libmc.c.

Referenced by mcChdir(), and mcStoreDir().

◆ endParameter

int endParameter[48]
static

Definition at line 145 of file libmc.c.

Referenced by mcGetInfo(), and mcRead().

◆ g_cdata

◆ g_currentCmd

unsigned int g_currentCmd = 0
static

◆ g_descParam

mcDescParam_t g_descParam
static

file descriptor related mc command used by: mcInit, mcClose, mcSeek, mcRead, mcWrite, mcGetinfo, mcFormat, mcFlush, mcUnformat, mcChangeThreadPriority

Definition at line 120 of file libmc.c.

Referenced by mcChangeThreadPriority(), mcClose(), mcFlush(), mcFormat(), mcGetInfo(), mcInit(), mcRead(), mcReadPage(), mcSeek(), mcUnformat(), mcWrite(), and mcWritePage().

◆ g_fileInfoBuff

sceMcTblGetDir g_fileInfoBuff
static

Definition at line 147 of file libmc.c.

Referenced by mcRename(), and mcSetFileInfo().

◆ g_mclibInited

int g_mclibInited = 0
static

◆ g_mcType

◆ g_nameParam

mcNameParam_t g_nameParam
static

Definition at line 115 of file libmc.c.

Referenced by mcChdir(), mcDelete(), mcGetDir(), mcGetEntSpace(), mcOpen(), mcRename(), and mcSetFileInfo().

◆ g_pFormat

int* g_pFormat = NULL
static

Definition at line 143 of file libmc.c.

Referenced by mcGetInfo(), and mcGetInfoApdx().

◆ g_pFree

int* g_pFree = NULL
static

Definition at line 142 of file libmc.c.

Referenced by mcGetInfo(), and mcGetInfoApdx().

◆ g_pType

int* g_pType = NULL
static

Definition at line 141 of file libmc.c.

Referenced by mcGetInfo(), and mcGetInfoApdx().

◆ 

◆ libmc_ReadPageAlignData

struct libmc_PageReadAlignData libmc_ReadPageAlignData
static

Definition at line 746 of file libmc.c.

Referenced by mcReadPage().

◆ mcRpcCmd

const int mcRpcCmd[2][17]
static

rpc command function numbers mcRpcCmd[MC_TYPE_??][MC_RPCCMD_???]

Definition at line 56 of file libmc.c.

Referenced by mcChangeThreadPriority(), mcChdir(), mcClose(), mcDelete(), mcFlush(), mcFormat(), mcGetDir(), mcGetEntSpace(), mcGetInfo(), mcInit(), mcOpen(), mcRead(), mcReadPage(), mcRename(), mcSeek(), mcSetFileInfo(), mcUnformat(), mcWrite(), and mcWritePage().

◆ result

s32 result

Definition at line 136 of file libmc.c.

Referenced by mcReadPage(), mcSync(), and mcWritePage().

◆ rpcStat

mcRpcStat_t rpcStat

Definition at line 137 of file libmc.c.

Referenced by mcInit().