1
0
Fork 0
forked from len0rd/rockbox

Hotswap code shuffling: Fix yellow. Simplify some target function access. Keep fat lock access from compiling for Ondios - think of a nicer way later.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16637 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2008-03-12 11:08:41 +00:00
parent 06a5299aff
commit e37044ff1d
6 changed files with 12 additions and 22 deletions

View file

@ -104,7 +104,7 @@ int disk_mount_all(void)
int mounted; int mounted;
int i; int i;
#if defined(HAVE_MMC) || defined(HAVE_HOTSWAP) #ifdef HAVE_HOTSWAP
card_enable_monitoring(false); card_enable_monitoring(false);
#endif #endif

View file

@ -203,7 +203,7 @@ static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE];
static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE]; static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE];
static struct mutex cache_mutex NOCACHEBSS_ATTR; static struct mutex cache_mutex NOCACHEBSS_ATTR;
#ifdef HAVE_HOTSWAP #if defined(HAVE_HOTSWAP) && !defined(HAVE_MMC) /* A better condition ?? */
void fat_lock(void) void fat_lock(void)
{ {
mutex_lock(&cache_mutex); mutex_lock(&cache_mutex);

View file

@ -40,8 +40,10 @@ typedef struct
} tCardInfo; } tCardInfo;
#ifdef TARGET_TREE #ifdef TARGET_TREE
bool card_detect(void); #include "hotswap-target.h"
tCardInfo *card_get_info(int card_no); #define card_detect card_detect_target
#define card_get_info card_get_info_target
#define card_enable_monitoring card_enable_monitoring_target
#else /* HAVE_MMC */ #else /* HAVE_MMC */
#include "ata_mmc.h" #include "ata_mmc.h"
#define card_detect mmc_detect #define card_detect mmc_detect

View file

@ -18,10 +18,10 @@
****************************************************************************/ ****************************************************************************/
#include <stdbool.h> #include <stdbool.h>
#include "config.h" #include "config.h"
#ifdef TARGET_TREE #ifdef HAVE_MMC
#include "hotswap-target.h"
#else
#include "ata_mmc.h" #include "ata_mmc.h"
#else
#include "hotswap.h"
#endif #endif
/* helper function to extract n (<=32) bits from an arbitrary position. /* helper function to extract n (<=32) bits from an arbitrary position.
@ -44,15 +44,3 @@ unsigned long card_extract_bits(
return result; return result;
} }
#ifdef TARGET_TREE
bool card_detect(void)
{
return card_detect_target();
}
tCardInfo *card_get_info(int card_no)
{
return card_get_info_target(card_no);
}
#endif

View file

@ -17,7 +17,7 @@
* *
****************************************************************************/ ****************************************************************************/
#include "fat.h" #include "fat.h"
#include "hotswap-target.h" #include "hotswap.h"
#include "ata-target.h" #include "ata-target.h"
#include "ata_idle_notify.h" #include "ata_idle_notify.h"
#include "system.h" #include "system.h"
@ -1147,7 +1147,7 @@ void ata_enable(bool on)
} }
#ifdef HAVE_HOTSWAP #ifdef HAVE_HOTSWAP
void card_enable_monitoring(bool on) void card_enable_monitoring_target(bool on)
{ {
if (on) if (on)
{ {

View file

@ -20,7 +20,6 @@
#define HOTSWAP_TARGET_H #define HOTSWAP_TARGET_H
#include "inttypes.h" #include "inttypes.h"
#include "hotswap.h"
typedef struct typedef struct
{ {
@ -41,5 +40,6 @@ typedef struct
tCardInfo *card_get_info_target(int card_no); tCardInfo *card_get_info_target(int card_no);
bool card_detect_target(void); bool card_detect_target(void);
void card_enable_monitoring_target(bool on);
#endif #endif