Use STORAGE_NEEDS_BOUNCE_BUFFER instead of STORAGE_NEEDS_ALIGN

Enable its use in the jz47xx MIPS targets.

(accidently committed g#3249 before making these changes)

Change-Id: I1791946f632901f0c7a94b04b009671aa0d71717
This commit is contained in:
Solomon Peachy 2021-03-27 15:02:18 -04:00
parent c96dc1c886
commit 961ffa61dd
2 changed files with 4 additions and 3 deletions

View File

@ -266,7 +266,7 @@ static struct bpb
} fat_bpbs[NUM_VOLUMES]; /* mounted partition info */
#ifdef STORAGE_WANTS_ALIGN
#ifdef STORAGE_NEEDS_BOUNCE_BUFFER
#define FAT_BOUNCE_SECTORS 10
static uint8_t fat_bounce_buffers[NUM_VOLUMES][SECTOR_SIZE*FAT_BOUNCE_SECTORS] STORAGE_ALIGN_ATTR;
#define FAT_BOUNCE_BUFFER(bpb) \
@ -2393,7 +2393,7 @@ static long transfer(struct bpb *fat_bpb, unsigned long start, long count,
else
{
void* xferbuf = buf;
#ifdef STORAGE_WANTS_ALIGN
#ifdef STORAGE_NEEDS_BOUNCE_BUFFER
int remain = count;
int xferred = 0;
int aligned = 1;
@ -2407,7 +2407,7 @@ static long transfer(struct bpb *fat_bpb, unsigned long start, long count,
#endif
rc = storage_read_sectors(IF_MD(fat_bpb->drive,)
start + fat_bpb->startsector, count, xferbuf);
#ifdef STORAGE_WANTS_ALIGN
#ifdef STORAGE_NEEDS_BOUNCE_BUFFER
if(rc < 0)
break;
if(LIKELY(aligned))

View File

@ -38,6 +38,7 @@
#define NEED_GENERIC_BYTESWAPS
#define STORAGE_WANTS_ALIGN
#define STORAGE_NEEDS_BOUNCE_BUFFER
/* This one returns the old status */
static inline int set_interrupt_status(int status, int mask)