Merge pull request #150 from bucanero/patch-1

Add sceIoDevctl structure to get free disk space
This commit is contained in:
Francisco Javier Trujillo Mata
2023-09-19 16:12:18 +02:00
committed by GitHub
3 changed files with 38 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ IMPOSE_OBJS = sceImpose_0000.o sceImpose_0001.o sceImpose_0002.o sceImpose_0003.
libpspuserincludedir = @PSPSDK_INCLUDEDIR@
libpspuserinclude_HEADERS = \
pspiofilemgr.h \
pspiofilemgr_devctl.h \
pspiofilemgr_dirent.h \
pspiofilemgr_fcntl.h \
pspiofilemgr_stat.h \

View File

@@ -17,6 +17,7 @@
#include <pspiofilemgr_fcntl.h>
#include <pspiofilemgr_stat.h>
#include <pspiofilemgr_dirent.h>
#include <pspiofilemgr_devctl.h>
/** @defgroup FileIO File IO Library
* This module contains the imports for the kernel's IO routines.

View File

@@ -0,0 +1,36 @@
/*
* PSP Software Development Kit - https://github.com/pspdev
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspiofilemgr_devctl.h - File attributes and directory entries.
*
*/
#ifndef PSPIOFILEMGR_DEVCTL_H
#define PSPIOFILEMGR_DEVCTL_H
#include <psptypes.h>
/* This sceIoDevctl command gets the device capacity. */
#define SCE_PR_GETDEV 0x02425818
/* This structure stores the device capacity using SCE_PR_GETDEV in sceIoDevctl */
typedef struct SceDevInf {
/* max logical cluster x unit */
uint32_t maxClusters;
/* number of empty clusters */
uint32_t freeClusters;
/* cluster of empty logical block */
uint32_t maxSectors;
/* bytes x logical sector */
int32_t sectorSize;
/* sector x cluster */
int32_t sectorCount;
} SceDevInf;
typedef struct SceDevctlCmd {
SceDevInf *dev_inf;
} SceDevctlCmd;
#endif /* PSPIOFILEMGR_DEVCTL_H */