Skip to content

Commit

Permalink
Merge pull request #41 from KallistiOSUnchained/dcload_rewinddir
Browse files Browse the repository at this point in the history
Added rewinddir to dcload
  • Loading branch information
andressbarajas authored Nov 25, 2024
2 parents af1dac9 + e3ab80e commit 09bf2b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion kernel/arch/dreamcast/fs/fs_dcload.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,19 @@ static int dcload_fcntl(void *h, int cmd, va_list ap) {
return rv;
}

static int dcload_rewinddir(void *h) {
int rv = -1;
uint32_t hnd = (uint32_t)h;

spinlock_lock(&dcload_lock);

rv = dclsc(DCLOAD_REWINDDIR, hnd);

spinlock_unlock(&dcload_lock);

return rv;
}

/* Pull all that together */
static vfs_handler_t vh = {
/* Name handler */
Expand Down Expand Up @@ -439,7 +452,7 @@ static vfs_handler_t vh = {
NULL, /* tell64 */
NULL, /* total64 */
NULL, /* readlink */
NULL, /* rewinddir */
dcload_rewinddir,
NULL /* fstat */
};

Expand Down
1 change: 1 addition & 0 deletions kernel/arch/dreamcast/include/dc/fs_dcload.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ extern int dcload_type;
#define DCLOAD_READDIR 18
#define DCLOAD_GETHOSTINFO 19
#define DCLOAD_GDBPACKET 20
#define DCLOAD_REWINDDIR 21

/* dcload syscall function */
int dcloadsyscall(uint32_t syscall, ...);
Expand Down

0 comments on commit 09bf2b5

Please sign in to comment.