Skip to content

Commit

Permalink
Merge pull request #676 from uyjulian/partial_revert_625
Browse files Browse the repository at this point in the history
[NFC] Partially revert changes that return 0
  • Loading branch information
uyjulian authored Nov 9, 2024
2 parents 69689a7 + ae43d05 commit 50072a4
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 82 deletions.
57 changes: 31 additions & 26 deletions iop/dev9/dev9/src/ps2dev9.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ static int expbay_init(int sema_attr);

extern struct irx_export_table _exp_dev9;

static int dev9x_dummy(void)
{
return 0;
}

static int dev9x_devctl(iop_file_t *f, const char *name, int cmd, void *args, unsigned int arglen, void *buf, unsigned int buflen)
{
(void)f;
Expand All @@ -148,33 +153,33 @@ static int dev9x_devctl(iop_file_t *f, const char *name, int cmd, void *args, un

static iop_device_ops_t dev9x_ops =
{
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
&dev9x_devctl,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
(void *)&dev9x_dummy,
};

static iop_device_t dev9x_device =
Expand Down
29 changes: 17 additions & 12 deletions iop/fs/romdrv/src/romdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static struct RomFileSlot fileSlots[ROMDRV_MAX_FILES];

/* Function prototypes */
static int init(void);
static int romUnsupported(void);
static int romInit(iop_device_t *device);
static int romOpen(iop_file_t *fd, const char *path, int mode);
static int romClose(iop_file_t *);
Expand All @@ -53,23 +54,22 @@ static struct RomdirFileStat *GetFileStatFromImage(const struct RomImg *ImageSta

static iop_device_ops_t ops = {
&romInit,
NOT_SUPPORTED,
NOT_SUPPORTED,
(void *)&romUnsupported,
(void *)&romUnsupported,
&romOpen,
&romClose,
&romRead,
&romWrite,
&romLseek,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED
};
(void *)&romUnsupported,
(void *)&romUnsupported,
(void *)&romUnsupported,
(void *)&romUnsupported,
(void *)&romUnsupported,
(void *)&romUnsupported,
(void *)&romUnsupported,
(void *)&romUnsupported,
(void *)&romUnsupported};

static iop_device_t DeviceOps = {
"rom",
Expand Down Expand Up @@ -110,6 +110,11 @@ static int init(void)
return 0;
}

static int romUnsupported(void)
{
return 0;
}

static int romInit(iop_device_t *device)
{
(void)device;
Expand Down
48 changes: 24 additions & 24 deletions iop/hdd/fsck/src/fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,10 +896,10 @@ static void FsckThread(void *arg)
}

// 0x0000264c
//static int FsckUnsupported(void)
//{
// return 0;
//}
static int FsckUnsupported(void)
{
return 0;
}

// 0x00000340
static int fsckCheckBitmap(pfs_mount_t *mount, void *buffer)
Expand Down Expand Up @@ -1218,32 +1218,32 @@ static int FsckIoctl2(iomanX_iop_file_t *fd, int cmd, void *arg, unsigned int ar
}

static iomanX_iop_device_ops_t FsckDeviceOps = {
NOT_SUPPORTED,
NOT_SUPPORTED,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
NULL,
&FsckOpen,
&FsckClose,
NULL,
NULL,
NULL,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
(void *)&FsckUnsupported,
&FsckIoctl2};

static iomanX_iop_device_t FsckDevice = {
Expand Down
45 changes: 25 additions & 20 deletions iop/hdd/fssk/src/fssk.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,11 @@ static void FsskThread(pfs_mount_t *mount)
SetEventFlag(fsskEventFlagID, 1);
}

static int FsskUnsupported(void)
{
return 0;
}

static int FsskOpen(iomanX_iop_file_t *fd, const char *name, int flags, int mode)
{
int blockfd, result;
Expand Down Expand Up @@ -716,32 +721,32 @@ static int FsskIoctl2(iomanX_iop_file_t *fd, int cmd, void *arg, unsigned int ar
}

static iomanX_iop_device_ops_t FsskDeviceOps = {
NOT_SUPPORTED,
NOT_SUPPORTED,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
NULL,
&FsskOpen,
&FsskClose,
NULL,
NULL,
NULL,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
NOT_SUPPORTED,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
(void *)&FsskUnsupported,
&FsskIoctl2};

static iomanX_iop_device_t FsskDevice = {
Expand Down

0 comments on commit 50072a4

Please sign in to comment.