|
ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <stdio.h>#include <tamtypes.h>#include <errno.h>#include <kernel.h>#include <string.h>#include <sifrpc.h>#include <loadfile.h>#include <iopheap.h>#include <malloc.h>#include "sys/fcntl.h"#include "sys/stat.h"#include "sys/ioctl.h"#include "libhdd.h"#include "fileXio_rpc.h"#include "io_common.h"
Include dependency graph for libhdd.c:Go to the source code of this file.
Macros | |
| #define | NEWLIB_PORT_AWARE |
| #define | PFS_ZONE_SIZE 8192 |
| #define | PFS_FRAGMENT_OPT 0x00002d66 |
| #define | PFS_FRAGMENT 0x00000000 |
| #define | _OMIT_SYSTEM_PARTITION |
Functions | |
| static void | hddUpdateInfo () |
| int | hddCheckPresent () |
| int | hddCheckFormatted () |
| int | hddFormat () |
| int | hddGetFilesystemList (t_hddFilesystem hddFs[], int maxEntries) |
| void | hddGetInfo (t_hddInfo *info) |
| int | hddMakeFilesystem (int fsSizeMB, char *name, int type) |
| int | hddRemoveFilesystem (t_hddFilesystem *fs) |
| int | hddExpandFilesystem (t_hddFilesystem *fs, int extraMB) |
Variables | |
| static int | pfsFormatArg [1] = { PFS_ZONE_SIZE } |
| static char * | sizesString [9] |
| static int | sizesMB [9] |
| static int | hddStatusCurrent = 0 |
| static u32 | hddSize |
| static u32 | hddFree |
| static u32 | hddMaxPartitionSize |
| int hddCheckFormatted | ( | ) |
Definition at line 90 of file libhdd.c.
References fileXioDevctl(), hddStatusCurrent, hddUpdateInfo(), HDIOC_STATUS, and NULL.
| int hddCheckPresent | ( | ) |
Definition at line 75 of file libhdd.c.
References fileXioDevctl(), hddStatusCurrent, hddUpdateInfo(), HDIOC_STATUS, and NULL.
| int hddExpandFilesystem | ( | t_hddFilesystem * | fs, |
| int | extraMB | ||
| ) |
Definition at line 473 of file libhdd.c.
References EFBIG, EINVAL, ENOSPC, t_hddFilesystem::filename, fileXioClose(), fileXioIoctl2(), fileXioOpen(), FIO_O_RDWR, hddMaxPartitionSize, hddStatusCurrent, hddUpdateInfo(), HIOCADDSUB, NULL, sizesMB, and sizesString.
| int hddFormat | ( | ) |
Definition at line 105 of file libhdd.c.
References fileXioFormat(), hddStatusCurrent, hddUpdateInfo(), NULL, and pfsFormatArg.
| int hddGetFilesystemList | ( | t_hddFilesystem | hddFs[], |
| int | maxEntries | ||
| ) |
Definition at line 135 of file libhdd.c.
References iox_stat_t::attr, ATTR_SUB_PARTITION, t_hddFilesystem::fileSystemGroup, fileXioClose(), fileXioDclose(), fileXioDevctl(), fileXioDopen(), fileXioDread(), fileXioIoctl2(), fileXioMount(), fileXioOpen(), fileXioUmount(), FIO_MT_RDONLY, FIO_O_RDONLY, t_hddFilesystem::formatted, t_hddFilesystem::freeSpace, FS_COMMON_PREFIX, FS_GROUP_APPLICATION, FS_GROUP_COMMON, FS_GROUP_SYSTEM, FS_TYPE_EMPTY, FS_TYPE_PFS, hddStatusCurrent, hddUpdateInfo(), HIOCGETSIZE, iox_stat_t::mode, iox_dirent_t::name, NULL, PDIOC_ZONEFREE, PDIOC_ZONESZ, iox_stat_t::private_0, t_hddFilesystem::size, and iox_dirent_t::stat.
| void hddGetInfo | ( | t_hddInfo * | info | ) |
Definition at line 253 of file libhdd.c.
References hddFree, hddMaxPartitionSize, hddSize, hddUpdateInfo(), and info.
| int hddMakeFilesystem | ( | int | fsSizeMB, |
| char * | name, | ||
| int | type | ||
| ) |
Definition at line 295 of file libhdd.c.
References EACCES, EFBIG, EINVAL, ENOSPC, fileXioClose(), fileXioFormat(), fileXioIoctl2(), fileXioOpen(), FIO_O_CREAT, FIO_O_RDONLY, FIO_O_RDWR, FS_GROUP_COMMON, FS_GROUP_SYSTEM, hddMaxPartitionSize, hddStatusCurrent, hddUpdateInfo(), HIOCADDSUB, NULL, pfsFormatArg, sizesMB, and sizesString.
| int hddRemoveFilesystem | ( | t_hddFilesystem * | fs | ) |
Definition at line 459 of file libhdd.c.
References t_hddFilesystem::filename, fileXioRemove(), hddStatusCurrent, and hddUpdateInfo().
|
static |
Definition at line 262 of file libhdd.c.
References fileXioDclose(), fileXioDevctl(), fileXioDopen(), fileXioDread(), FS_TYPE_EMPTY, hddFree, hddMaxPartitionSize, hddSize, hddStatusCurrent, HDIOC_MAXSECTOR, HDIOC_TOTALSECTOR, iox_stat_t::mode, NULL, iox_stat_t::size, and iox_dirent_t::stat.
Referenced by hddCheckFormatted(), hddCheckPresent(), hddExpandFilesystem(), hddFormat(), hddGetFilesystemList(), hddGetInfo(), hddMakeFilesystem(), and hddRemoveFilesystem().
|
static |
Definition at line 73 of file libhdd.c.
Referenced by hddGetInfo(), and hddUpdateInfo().
|
static |
Definition at line 73 of file libhdd.c.
Referenced by hddExpandFilesystem(), hddGetInfo(), hddMakeFilesystem(), and hddUpdateInfo().
|
static |
Definition at line 73 of file libhdd.c.
Referenced by hddGetInfo(), and hddUpdateInfo().
|
static |
Definition at line 72 of file libhdd.c.
Referenced by hddCheckFormatted(), hddCheckPresent(), hddExpandFilesystem(), hddFormat(), hddGetFilesystemList(), hddMakeFilesystem(), hddRemoveFilesystem(), and hddUpdateInfo().
|
static |
Definition at line 40 of file libhdd.c.
Referenced by hddFormat(), and hddMakeFilesystem().
|
static |
Definition at line 58 of file libhdd.c.
Referenced by hddExpandFilesystem(), and hddMakeFilesystem().
|
static |
Definition at line 46 of file libhdd.c.
Referenced by hddExpandFilesystem(), and hddMakeFilesystem().