diff --git a/nx/include/switch/devices/fs_dev.h b/nx/include/switch/devices/fs_dev.h index e2f08473..8ae40b9d 100644 --- a/nx/include/switch/devices/fs_dev.h +++ b/nx/include/switch/devices/fs_dev.h @@ -9,7 +9,15 @@ /// Initializes the FS driver. Result fsdevInit(void); -/// Enable/disable copy in fsdev_write +/// Enable/disable copy in fsdev_write. This is disabled by default. +/// If it is disabled, you will be unable to write from the following memory-regions(http://switchbrew.org/index.php?title=SVC#MemoryState): +/// MemoryType_Io +/// MemoryType_Normal +/// MemoryType_*SharedMemory +/// MemoryType_ThreadLocal +/// MemoryType_IpcBuffer3 +/// MemoryType_KernelStack (This is not mapped in userland anyway) +/// This same restriction applies with reading into the above memory, a file-read version of fsdevWriteSafe() is not available. void fsdevWriteSafe(bool enable); /// Exits the FS driver. diff --git a/nx/source/devices/fs_dev.c b/nx/source/devices/fs_dev.c index fa6e51e2..1cfc9d04 100644 --- a/nx/source/devices/fs_dev.c +++ b/nx/source/devices/fs_dev.c @@ -432,11 +432,11 @@ Result fsdevInit(void) /*! Enable/disable safe fsdev_write * * Safe fsdev_write is disabled by default. If it is disabled, you will be - * unable to write from read-only buffers. + * unable to write from certain memory-regions. * * @param[in] enable Whether to enable */ -void fsdevWriteSafe(bool enable)//TODO: Is this really needed? +void fsdevWriteSafe(bool enable) { if(enable) fsdev_devoptab.write_r = fsdev_write_safe;