aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ps2/asyncfio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/ps2/asyncfio.cpp')
-rw-r--r--backends/platform/ps2/asyncfio.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/backends/platform/ps2/asyncfio.cpp b/backends/platform/ps2/asyncfio.cpp
index 5c5230465d..f16efffbd9 100644
--- a/backends/platform/ps2/asyncfio.cpp
+++ b/backends/platform/ps2/asyncfio.cpp
@@ -58,6 +58,17 @@ int AsyncFio::open(const char *name, int ioMode) {
return res;
}
+int AsyncFio::open(const char *name, int ioMode, int mode) {
+ WaitSema(_ioSema);
+ checkSync();
+ int res;
+ fileXioOpen(name, ioMode, mode);
+ fileXioWaitAsync(FXIO_WAIT, &res);
+ SignalSema(_ioSema);
+ // dbg_printf("FIO: open ext(%s, %d, %d) => %d", name, ioMode, mode, res);
+ return res;
+}
+
void AsyncFio::close(int handle) {
WaitSema(_ioSema);
checkSync();
@@ -95,6 +106,15 @@ void AsyncFio::write(int fd, const void *src, unsigned int len) {
SignalSema(_ioSema);
}
+void AsyncFio::remove(const char *path) {
+ int res;
+ WaitSema(_ioSema);
+ checkSync();
+ fileXioRemove(path);
+ fileXioWaitAsync(FXIO_WAIT, &res);
+ SignalSema(_ioSema);
+}
+
int AsyncFio::seek(int fd, int offset, int whence) {
int res;
WaitSema(_ioSema);
@@ -149,6 +169,16 @@ void AsyncFio::dclose(int fd) {
SignalSema(_ioSema);
}
+int AsyncFio::chdir(const char *name) {
+ int res;
+ WaitSema(_ioSema);
+ checkSync();
+ fileXioChdir(name);
+ fileXioWaitAsync(FXIO_WAIT, &res);
+ SignalSema(_ioSema);
+ return res;
+}
+
int AsyncFio::mount(const char *mountpoint, const char *mountstring, int flag) {
int res;
WaitSema(_ioSema);