IDE interrupt based driver
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m36s

This commit is contained in:
2026-03-14 16:40:03 +01:00
parent 217179c9a0
commit 3c10b76b3f
19 changed files with 199 additions and 195 deletions

View File

@@ -34,7 +34,7 @@ static int fat1_diskio_read (struct fatfs_ctx* ctx, uint32_t sector, uint8_t* bu
spin_lock (&back_device->lock, &fd);
ret = device_op (back_device, XDRV_GET_SECTOR_SIZE, ctx->proc, ctx->rctx, &sector_size);
ret = device_op (back_device, XDRV_GET_SECTOR_SIZE, ctx->proc, ctx->rctx, &fd, &sector_size);
if (ret < 0) {
spin_unlock (&back_device->lock, fd);
return 0;
@@ -43,8 +43,8 @@ static int fat1_diskio_read (struct fatfs_ctx* ctx, uint32_t sector, uint8_t* bu
vfs_translate (sector, sector_count, FAT_SECTOR_SIZE, sector_size, &phys_sector,
&phys_sector_count);
ret = device_op (back_device, XDRV_READ, ctx->proc, ctx->rctx, &phys_sector, &phys_sector_count,
buffer);
ret = device_op (back_device, XDRV_READ, ctx->proc, ctx->rctx, &fd, &phys_sector,
&phys_sector_count, buffer);
if (ret < 0) {
spin_unlock (&back_device->lock, fd);
return 0;
@@ -73,7 +73,7 @@ static int fat1_diskio_write (struct fatfs_ctx* ctx, uint32_t sector, uint8_t* b
spin_lock (&back_device->lock, &fd);
ret = device_op (back_device, XDRV_GET_SECTOR_SIZE, ctx->proc, ctx->rctx, &sector_size);
ret = device_op (back_device, XDRV_GET_SECTOR_SIZE, ctx->proc, ctx->rctx, &fd, &sector_size);
if (ret < 0) {
spin_unlock (&back_device->lock, fd);
return 0;
@@ -82,8 +82,8 @@ static int fat1_diskio_write (struct fatfs_ctx* ctx, uint32_t sector, uint8_t* b
vfs_translate (sector, sector_count, FAT_SECTOR_SIZE, sector_size, &phys_sector,
&phys_sector_count);
ret = device_op (back_device, XDRV_WRITE, ctx->proc, ctx->rctx, &phys_sector, &phys_sector_count,
buffer);
ret = device_op (back_device, XDRV_WRITE, ctx->proc, ctx->rctx, &fd, &phys_sector,
&phys_sector_count, buffer);
if (ret < 0) {
spin_unlock (&back_device->lock, fd);
return 0;
@@ -137,7 +137,7 @@ int fatfs16_format (struct vfs_volume* volume, struct proc* proc, struct resched
fatfs_ctx->rctx = rctx;
spin_lock (&back_device->lock, &fd);
device_op (back_device, XDRV_GET_SIZE, proc, rctx, &total_size);
device_op (back_device, XDRV_GET_SIZE, proc, rctx, &fd, &total_size);
spin_unlock (&back_device->lock, fd);
size_t sectors = div_align_up (total_size, FAT_SECTOR_SIZE);
@@ -155,7 +155,7 @@ int fatfs32_format (struct vfs_volume* volume, struct proc* proc, struct resched
fatfs_ctx->rctx = rctx;
spin_lock (&back_device->lock, &fd);
device_op (back_device, XDRV_GET_SIZE, proc, rctx, &total_size);
device_op (back_device, XDRV_GET_SIZE, proc, rctx, &fd, &total_size);
spin_unlock (&back_device->lock, fd);
size_t sectors = div_align_up (total_size, FAT_SECTOR_SIZE);