summaryrefslogtreecommitdiff
path: root/firmware/export/disk.h
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-11-02 09:41:26 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-11-02 13:50:53 -0400
commita8c52b1bfb8fd4333cffc6a1d9eff830bd35dba5 (patch)
treedd705ebe8cb88a7cce98ee97a9f83342a5492c80 /firmware/export/disk.h
parent209aeff5b147e051a8841f64e64f5d0c04646349 (diff)
downloadrockbox-a8c52b1bfb8fd4333cffc6a1d9eff830bd35dba5.tar.gz
rockbox-a8c52b1bfb8fd4333cffc6a1d9eff830bd35dba5.zip
disk: Support a non-fixed (logical) SECTOR_SIZE
This allows a single build to support ATA drives with (eg) 512B and 4K logical sector sizes. This is needed because ATA drives are user- replaceable and we don't know what could get plugged in. * Add disk_get_log_sector_size() API (no-op for non-ATA storage) * Mostly a no-op if MAX_LOG_SECTOR_SIZE is not enabled * Sanity-check that storage's logical sector size is not larger than what we're built for NOTE: Other layers (eg ATA, FAT, etc) still need to be made aware of this. Change-Id: Id6183ef0573cb0778fa9a91302e600c3e710eebd
Diffstat (limited to 'firmware/export/disk.h')
-rw-r--r--firmware/export/disk.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/export/disk.h b/firmware/export/disk.h
index a19e011170..4f11438b1b 100644
--- a/firmware/export/disk.h
+++ b/firmware/export/disk.h
@@ -47,10 +47,12 @@ int disk_mount(int drive);
47int disk_unmount_all(void); 47int disk_unmount_all(void);
48int disk_unmount(int drive); 48int disk_unmount(int drive);
49 49
50/* The number of 512-byte sectors in a "logical" sector. Needed for ipod 5.5G */ 50/* Used when the drive's logical sector size is smaller than the sector size used by the partition table and filesystem. Notably needed for ipod 5.5G/6G. */
51#ifdef MAX_LOG_SECTOR_SIZE 51#ifdef MAX_LOG_SECTOR_SIZE
52int disk_get_sector_multiplier(IF_MD_NONVOID(int drive)); 52int disk_get_sector_multiplier(IF_MD_NONVOID(int drive));
53#endif 53#endif
54/* The size of the drive's smallest addressible unit */
55int disk_get_log_sector_size(IF_MD_NONVOID(int drive));
54 56
55bool disk_present(IF_MD_NONVOID(int drive)); 57bool disk_present(IF_MD_NONVOID(int drive));
56 58