From dc7534bdb2a784ae9d5c9089237935ff405c3525 Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Fri, 28 Jan 2005 21:32:16 +0000 Subject: preparations for hotswapping MMC git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5701 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/disk.c | 97 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 70 insertions(+), 27 deletions(-) (limited to 'firmware/common/disk.c') diff --git a/firmware/common/disk.c b/firmware/common/disk.c index 923dffbe46..fd6de55ddb 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c @@ -23,6 +23,8 @@ #ifdef HAVE_MMC #include "ata_mmc.h" #endif +#include "file.h" /* for release_dirs() */ +#include "dir.h" /* for release_files() */ #include "disk.h" /* Partition table entry layout: @@ -44,6 +46,7 @@ ((long)array[pos+2] << 16 ) | ((long)array[pos+3] << 24 )) static struct partinfo part[8]; /* space for 4 partitions on 2 drives */ +static int vol_drive[NUM_VOLUMES]; /* mounted to which drive (-1 if none) */ struct partinfo* disk_init(IF_MV_NONVOID(int drive)) { @@ -95,46 +98,86 @@ struct partinfo* disk_partinfo(int partition) int disk_mount_all(void) { - struct partinfo* pinfo; - int i,j; - int mounted = 0; - bool found; - int drives = 1; + int mounted; + int i; + + fat_init(); /* reset all mounted partitions */ + for (i=0; i