iPod Classic CE-ATA Support (Part 1 of 4: Cacheline align some statically allocated sector buffers)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29444 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sparmann 2011-02-27 22:44:30 +00:00
parent b25f17200f
commit 751303c2ac
5 changed files with 12 additions and 10 deletions

View file

@ -39,7 +39,7 @@
*/
struct filedesc {
unsigned char cache[SECTOR_SIZE];
unsigned char cache[SECTOR_SIZE] CACHEALIGN_ATTR;
int cacheoffset; /* invariant: 0 <= cacheoffset <= SECTOR_SIZE */
long fileoffset;
long size;
@ -49,9 +49,9 @@ struct filedesc {
bool write;
bool dirty;
bool trunc;
};
} CACHEALIGN_ATTR;
static struct filedesc openfiles[MAX_OPEN_FILES];
static struct filedesc openfiles[MAX_OPEN_FILES] CACHEALIGN_ATTR;
static int flush_cache(int fd);

View file

@ -211,7 +211,7 @@ struct fat_cache_entry
#endif
};
static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE];
static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE] CACHEALIGN_ATTR;
static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE];
static struct mutex cache_mutex SHAREDBSS_ATTR;

View file

@ -25,6 +25,7 @@
#include <stdbool.h>
#include "mv.h" /* for volume definitions */
#include "config.h"
#include "system.h"
/* This value can be overwritten by a target in config-[target].h, but
that behaviour is still experimental */
@ -81,17 +82,17 @@ struct fat_file
struct fat_dir
{
unsigned char sectorcache[SECTOR_SIZE] CACHEALIGN_ATTR;
unsigned int entry;
unsigned int entrycount;
long sector;
struct fat_file file;
unsigned char sectorcache[SECTOR_SIZE];
/* There are 2-bytes per characters. We don't want to bother too much, as LFN entries are
* at much 255 characters longs, that's at most 20 LFN entries. Each entry hold at most
* 13 characters, that a total of 260 characters. So we keep a buffer of that size.
* Keep coherent with fat.c code. */
unsigned char longname[260 * 2];
};
} CACHEALIGN_ATTR;
#ifdef HAVE_HOTSWAP
extern void fat_lock(void);

View file

@ -31,6 +31,7 @@
#include <stdlib.h>
#include "inttypes.h"
#include "lcd.h"
#include "system.h"
#include "font.h"
#include "file.h"
#include "debug.h"
@ -76,11 +77,11 @@ extern struct font sysfont;
/* structure filled in by font_load */
static struct font font_ui;
/* static buffer allocation structures */
static unsigned char main_buf[MAX_FONT_SIZE];
static unsigned char main_buf[MAX_FONT_SIZE] CACHEALIGN_ATTR;
#ifdef HAVE_REMOTE_LCD
#define REMOTE_FONT_SIZE 10000
static struct font remote_font_ui;
static unsigned char remote_buf[REMOTE_FONT_SIZE];
static unsigned char remote_buf[REMOTE_FONT_SIZE] CACHEALIGN_ATTR;
#endif
/* system font table, in order of FONT_xxx definition */

View file

@ -57,9 +57,9 @@ struct dirent_uncached {
#ifndef DIR_DEFINED
typedef struct {
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
struct fat_dir fatdir CACHEALIGN_ATTR;
bool busy;
long startcluster;
struct fat_dir fatdir;
struct dirent_uncached theent;
#ifdef HAVE_MULTIVOLUME
int volumecounter; /* running counter for faked volume entries */
@ -69,7 +69,7 @@ typedef struct {
void *dir; /* actually a DIR* dir */
char *name;
#endif
} DIR_UNCACHED;
} DIR_UNCACHED CACHEALIGN_ATTR;
#endif