summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/common/file.c6
-rw-r--r--firmware/drivers/fat.c2
-rw-r--r--firmware/export/fat.h5
-rw-r--r--firmware/font.c5
-rw-r--r--firmware/include/dir_uncached.h4
5 files changed, 12 insertions, 10 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 3477c10061..bc4a90a485 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -39,7 +39,7 @@
39*/ 39*/
40 40
41struct filedesc { 41struct filedesc {
42 unsigned char cache[SECTOR_SIZE]; 42 unsigned char cache[SECTOR_SIZE] CACHEALIGN_ATTR;
43 int cacheoffset; /* invariant: 0 <= cacheoffset <= SECTOR_SIZE */ 43 int cacheoffset; /* invariant: 0 <= cacheoffset <= SECTOR_SIZE */
44 long fileoffset; 44 long fileoffset;
45 long size; 45 long size;
@@ -49,9 +49,9 @@ struct filedesc {
49 bool write; 49 bool write;
50 bool dirty; 50 bool dirty;
51 bool trunc; 51 bool trunc;
52}; 52} CACHEALIGN_ATTR;
53 53
54static struct filedesc openfiles[MAX_OPEN_FILES]; 54static struct filedesc openfiles[MAX_OPEN_FILES] CACHEALIGN_ATTR;
55 55
56static int flush_cache(int fd); 56static int flush_cache(int fd);
57 57
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index f055f4b170..63f4151792 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -211,7 +211,7 @@ struct fat_cache_entry
211#endif 211#endif
212}; 212};
213 213
214static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE]; 214static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE] CACHEALIGN_ATTR;
215static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE]; 215static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE];
216static struct mutex cache_mutex SHAREDBSS_ATTR; 216static struct mutex cache_mutex SHAREDBSS_ATTR;
217 217
diff --git a/firmware/export/fat.h b/firmware/export/fat.h
index 36beda711d..38ce6ee74d 100644
--- a/firmware/export/fat.h
+++ b/firmware/export/fat.h
@@ -25,6 +25,7 @@
25#include <stdbool.h> 25#include <stdbool.h>
26#include "mv.h" /* for volume definitions */ 26#include "mv.h" /* for volume definitions */
27#include "config.h" 27#include "config.h"
28#include "system.h"
28 29
29/* This value can be overwritten by a target in config-[target].h, but 30/* This value can be overwritten by a target in config-[target].h, but
30 that behaviour is still experimental */ 31 that behaviour is still experimental */
@@ -81,17 +82,17 @@ struct fat_file
81 82
82struct fat_dir 83struct fat_dir
83{ 84{
85 unsigned char sectorcache[SECTOR_SIZE] CACHEALIGN_ATTR;
84 unsigned int entry; 86 unsigned int entry;
85 unsigned int entrycount; 87 unsigned int entrycount;
86 long sector; 88 long sector;
87 struct fat_file file; 89 struct fat_file file;
88 unsigned char sectorcache[SECTOR_SIZE];
89 /* There are 2-bytes per characters. We don't want to bother too much, as LFN entries are 90 /* There are 2-bytes per characters. We don't want to bother too much, as LFN entries are
90 * at much 255 characters longs, that's at most 20 LFN entries. Each entry hold at most 91 * at much 255 characters longs, that's at most 20 LFN entries. Each entry hold at most
91 * 13 characters, that a total of 260 characters. So we keep a buffer of that size. 92 * 13 characters, that a total of 260 characters. So we keep a buffer of that size.
92 * Keep coherent with fat.c code. */ 93 * Keep coherent with fat.c code. */
93 unsigned char longname[260 * 2]; 94 unsigned char longname[260 * 2];
94}; 95} CACHEALIGN_ATTR;
95 96
96#ifdef HAVE_HOTSWAP 97#ifdef HAVE_HOTSWAP
97extern void fat_lock(void); 98extern void fat_lock(void);
diff --git a/firmware/font.c b/firmware/font.c
index 8538ef9490..45ddef3afe 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -31,6 +31,7 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include "inttypes.h" 32#include "inttypes.h"
33#include "lcd.h" 33#include "lcd.h"
34#include "system.h"
34#include "font.h" 35#include "font.h"
35#include "file.h" 36#include "file.h"
36#include "debug.h" 37#include "debug.h"
@@ -76,11 +77,11 @@ extern struct font sysfont;
76/* structure filled in by font_load */ 77/* structure filled in by font_load */
77static struct font font_ui; 78static struct font font_ui;
78/* static buffer allocation structures */ 79/* static buffer allocation structures */
79static unsigned char main_buf[MAX_FONT_SIZE]; 80static unsigned char main_buf[MAX_FONT_SIZE] CACHEALIGN_ATTR;
80#ifdef HAVE_REMOTE_LCD 81#ifdef HAVE_REMOTE_LCD
81#define REMOTE_FONT_SIZE 10000 82#define REMOTE_FONT_SIZE 10000
82static struct font remote_font_ui; 83static struct font remote_font_ui;
83static unsigned char remote_buf[REMOTE_FONT_SIZE]; 84static unsigned char remote_buf[REMOTE_FONT_SIZE] CACHEALIGN_ATTR;
84#endif 85#endif
85 86
86/* system font table, in order of FONT_xxx definition */ 87/* system font table, in order of FONT_xxx definition */
diff --git a/firmware/include/dir_uncached.h b/firmware/include/dir_uncached.h
index c2c7d67505..19bed9af5d 100644
--- a/firmware/include/dir_uncached.h
+++ b/firmware/include/dir_uncached.h
@@ -57,9 +57,9 @@ struct dirent_uncached {
57#ifndef DIR_DEFINED 57#ifndef DIR_DEFINED
58typedef struct { 58typedef struct {
59#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 59#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
60 struct fat_dir fatdir CACHEALIGN_ATTR;
60 bool busy; 61 bool busy;
61 long startcluster; 62 long startcluster;
62 struct fat_dir fatdir;
63 struct dirent_uncached theent; 63 struct dirent_uncached theent;
64#ifdef HAVE_MULTIVOLUME 64#ifdef HAVE_MULTIVOLUME
65 int volumecounter; /* running counter for faked volume entries */ 65 int volumecounter; /* running counter for faked volume entries */
@@ -69,7 +69,7 @@ typedef struct {
69 void *dir; /* actually a DIR* dir */ 69 void *dir; /* actually a DIR* dir */
70 char *name; 70 char *name;
71#endif 71#endif
72} DIR_UNCACHED; 72} DIR_UNCACHED CACHEALIGN_ATTR;
73#endif 73#endif
74 74
75 75