diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/mpegplayer/alloc.c | 8 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/audio_thread.c | 4 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/disk_buf.c | 10 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/disk_buf.h | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/mpeg_parser.c | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/stream_mgr.c | 6 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/stream_mgr.h | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/video_out_rockbox.c | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/video_thread.c | 4 | ||||
-rw-r--r-- | apps/plugins/plugin.lds | 47 |
10 files changed, 63 insertions, 24 deletions
diff --git a/apps/plugins/mpegplayer/alloc.c b/apps/plugins/mpegplayer/alloc.c index f6661d4632..7ad8644e59 100644 --- a/apps/plugins/mpegplayer/alloc.c +++ b/apps/plugins/mpegplayer/alloc.c | |||
@@ -30,10 +30,10 @@ static size_t bufsize; | |||
30 | static unsigned char* mallocbuf; | 30 | static unsigned char* mallocbuf; |
31 | 31 | ||
32 | /* libmpeg2 allocator */ | 32 | /* libmpeg2 allocator */ |
33 | static off_t mpeg2_mem_ptr NOCACHEBSS_ATTR; | 33 | static off_t mpeg2_mem_ptr SHAREDBSS_ATTR; |
34 | static size_t mpeg2_bufsize NOCACHEBSS_ATTR; | 34 | static size_t mpeg2_bufsize SHAREDBSS_ATTR; |
35 | static unsigned char *mpeg2_mallocbuf NOCACHEBSS_ATTR; | 35 | static unsigned char *mpeg2_mallocbuf SHAREDBSS_ATTR; |
36 | static unsigned char *mpeg2_bufallocbuf NOCACHEBSS_ATTR; | 36 | static unsigned char *mpeg2_bufallocbuf SHAREDBSS_ATTR; |
37 | 37 | ||
38 | #if defined(DEBUG) || defined(SIMULATOR) | 38 | #if defined(DEBUG) || defined(SIMULATOR) |
39 | const char * mpeg_get_reason_str(int reason) | 39 | const char * mpeg_get_reason_str(int reason) |
diff --git a/apps/plugins/mpegplayer/audio_thread.c b/apps/plugins/mpegplayer/audio_thread.c index 7d2f849a44..1fcd1424ff 100644 --- a/apps/plugins/mpegplayer/audio_thread.c +++ b/apps/plugins/mpegplayer/audio_thread.c | |||
@@ -44,8 +44,8 @@ static size_t audio_stack_size; /* Keep gcc happy and init */ | |||
44 | #ifndef SIMULATOR | 44 | #ifndef SIMULATOR |
45 | static uint32_t codec_stack_copy[AUDIO_STACKSIZE / sizeof(uint32_t)]; | 45 | static uint32_t codec_stack_copy[AUDIO_STACKSIZE / sizeof(uint32_t)]; |
46 | #endif | 46 | #endif |
47 | static struct event_queue audio_str_queue NOCACHEBSS_ATTR; | 47 | static struct event_queue audio_str_queue SHAREDBSS_ATTR; |
48 | static struct queue_sender_list audio_str_queue_send NOCACHEBSS_ATTR; | 48 | static struct queue_sender_list audio_str_queue_send SHAREDBSS_ATTR; |
49 | struct stream audio_str IBSS_ATTR; | 49 | struct stream audio_str IBSS_ATTR; |
50 | 50 | ||
51 | /* libmad related definitions */ | 51 | /* libmad related definitions */ |
diff --git a/apps/plugins/mpegplayer/disk_buf.c b/apps/plugins/mpegplayer/disk_buf.c index 289918fc63..46a060221d 100644 --- a/apps/plugins/mpegplayer/disk_buf.c +++ b/apps/plugins/mpegplayer/disk_buf.c | |||
@@ -21,12 +21,12 @@ | |||
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "mpegplayer.h" | 22 | #include "mpegplayer.h" |
23 | 23 | ||
24 | static struct mutex disk_buf_mtx NOCACHEBSS_ATTR; | 24 | static struct mutex disk_buf_mtx SHAREDBSS_ATTR; |
25 | static struct event_queue disk_buf_queue NOCACHEBSS_ATTR; | 25 | static struct event_queue disk_buf_queue SHAREDBSS_ATTR; |
26 | static struct queue_sender_list disk_buf_queue_send NOCACHEBSS_ATTR; | 26 | static struct queue_sender_list disk_buf_queue_send SHAREDBSS_ATTR; |
27 | static uint32_t disk_buf_stack[DEFAULT_STACK_SIZE*2/sizeof(uint32_t)]; | 27 | static uint32_t disk_buf_stack[DEFAULT_STACK_SIZE*2/sizeof(uint32_t)]; |
28 | 28 | ||
29 | struct disk_buf disk_buf NOCACHEBSS_ATTR; | 29 | struct disk_buf disk_buf SHAREDBSS_ATTR; |
30 | static struct list_item nf_list; | 30 | static struct list_item nf_list; |
31 | 31 | ||
32 | static inline void disk_buf_lock(void) | 32 | static inline void disk_buf_lock(void) |
@@ -566,7 +566,7 @@ static int disk_buf_probe(off_t start, size_t length, | |||
566 | { | 566 | { |
567 | if (disk_buf.cache[page] != tag) | 567 | if (disk_buf.cache[page] != tag) |
568 | { | 568 | { |
569 | static struct dbuf_range rng NOCACHEBSS_ATTR; | 569 | static struct dbuf_range rng IBSS_ATTR; |
570 | DEBUGF("disk_buf: cache miss\n"); | 570 | DEBUGF("disk_buf: cache miss\n"); |
571 | rng.tag_start = tag; | 571 | rng.tag_start = tag; |
572 | rng.tag_end = tag_end; | 572 | rng.tag_end = tag_end; |
diff --git a/apps/plugins/mpegplayer/disk_buf.h b/apps/plugins/mpegplayer/disk_buf.h index 79c3328535..04b4675768 100644 --- a/apps/plugins/mpegplayer/disk_buf.h +++ b/apps/plugins/mpegplayer/disk_buf.h | |||
@@ -84,7 +84,7 @@ struct disk_buf | |||
84 | bool need_seek; /* Need to seek because a read was not contiguous */ | 84 | bool need_seek; /* Need to seek because a read was not contiguous */ |
85 | }; | 85 | }; |
86 | 86 | ||
87 | extern struct disk_buf disk_buf NOCACHEBSS_ATTR; | 87 | extern struct disk_buf disk_buf SHAREDBSS_ATTR; |
88 | 88 | ||
89 | static inline bool disk_buf_is_data_ready(struct stream_hdr *sh, | 89 | static inline bool disk_buf_is_data_ready(struct stream_hdr *sh, |
90 | ssize_t margin) | 90 | ssize_t margin) |
diff --git a/apps/plugins/mpegplayer/mpeg_parser.c b/apps/plugins/mpegplayer/mpeg_parser.c index cd54e84452..617b7fe9f9 100644 --- a/apps/plugins/mpegplayer/mpeg_parser.c +++ b/apps/plugins/mpegplayer/mpeg_parser.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "plugin.h" | 21 | #include "plugin.h" |
22 | #include "mpegplayer.h" | 22 | #include "mpegplayer.h" |
23 | 23 | ||
24 | struct stream_parser str_parser NOCACHEBSS_ATTR; | 24 | struct stream_parser str_parser SHAREDBSS_ATTR; |
25 | 25 | ||
26 | static void parser_init_state(void) | 26 | static void parser_init_state(void) |
27 | { | 27 | { |
diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c index 778ed0df83..24e820b0af 100644 --- a/apps/plugins/mpegplayer/stream_mgr.c +++ b/apps/plugins/mpegplayer/stream_mgr.c | |||
@@ -27,11 +27,11 @@ | |||
27 | GREY_INFO_STRUCT_IRAM | 27 | GREY_INFO_STRUCT_IRAM |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | static struct event_queue stream_mgr_queue NOCACHEBSS_ATTR; | 30 | static struct event_queue stream_mgr_queue SHAREDBSS_ATTR; |
31 | static struct queue_sender_list stream_mgr_queue_send NOCACHEBSS_ATTR; | 31 | static struct queue_sender_list stream_mgr_queue_send SHAREDBSS_ATTR; |
32 | static uint32_t stream_mgr_thread_stack[DEFAULT_STACK_SIZE*2/sizeof(uint32_t)]; | 32 | static uint32_t stream_mgr_thread_stack[DEFAULT_STACK_SIZE*2/sizeof(uint32_t)]; |
33 | 33 | ||
34 | struct stream_mgr stream_mgr NOCACHEBSS_ATTR; | 34 | struct stream_mgr stream_mgr SHAREDBSS_ATTR; |
35 | 35 | ||
36 | /* Forward decs */ | 36 | /* Forward decs */ |
37 | static int stream_on_close(void); | 37 | static int stream_on_close(void); |
diff --git a/apps/plugins/mpegplayer/stream_mgr.h b/apps/plugins/mpegplayer/stream_mgr.h index 339af17182..f577e5c2ce 100644 --- a/apps/plugins/mpegplayer/stream_mgr.h +++ b/apps/plugins/mpegplayer/stream_mgr.h | |||
@@ -44,7 +44,7 @@ struct stream_mgr | |||
44 | } parms; | 44 | } parms; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | extern struct stream_mgr stream_mgr NOCACHEBSS_ATTR; | 47 | extern struct stream_mgr stream_mgr SHAREDBSS_ATTR; |
48 | 48 | ||
49 | struct stream_window | 49 | struct stream_window |
50 | { | 50 | { |
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c index c8245cc1bf..547768887a 100644 --- a/apps/plugins/mpegplayer/video_out_rockbox.c +++ b/apps/plugins/mpegplayer/video_out_rockbox.c | |||
@@ -52,7 +52,7 @@ static struct vo_data vo; | |||
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | #if NUM_CORES > 1 | 54 | #if NUM_CORES > 1 |
55 | static struct mutex vo_mtx NOCACHEBSS_ATTR; | 55 | static struct mutex vo_mtx SHAREDBSS_ATTR; |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | static inline void video_lock_init(void) | 58 | static inline void video_lock_init(void) |
diff --git a/apps/plugins/mpegplayer/video_thread.c b/apps/plugins/mpegplayer/video_thread.c index d16eb771b0..6e7c9aea15 100644 --- a/apps/plugins/mpegplayer/video_thread.c +++ b/apps/plugins/mpegplayer/video_thread.c | |||
@@ -54,8 +54,8 @@ struct video_thread_data | |||
54 | so maybe we can reduce it. */ | 54 | so maybe we can reduce it. */ |
55 | #define VIDEO_STACKSIZE (4*1024) | 55 | #define VIDEO_STACKSIZE (4*1024) |
56 | static uint32_t video_stack[VIDEO_STACKSIZE / sizeof(uint32_t)] IBSS_ATTR; | 56 | static uint32_t video_stack[VIDEO_STACKSIZE / sizeof(uint32_t)] IBSS_ATTR; |
57 | static struct event_queue video_str_queue NOCACHEBSS_ATTR; | 57 | static struct event_queue video_str_queue SHAREDBSS_ATTR; |
58 | static struct queue_sender_list video_str_queue_send NOCACHEBSS_ATTR; | 58 | static struct queue_sender_list video_str_queue_send SHAREDBSS_ATTR; |
59 | struct stream video_str IBSS_ATTR; | 59 | struct stream video_str IBSS_ATTR; |
60 | 60 | ||
61 | static void draw_fps(struct video_thread_data *td) | 61 | static void draw_fps(struct video_thread_data *td) |
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds index 9659412730..8699ca1c25 100644 --- a/apps/plugins/plugin.lds +++ b/apps/plugins/plugin.lds | |||
@@ -16,6 +16,20 @@ OUTPUT_FORMAT(elf32-sh) | |||
16 | #define STUBOFFSET 0 | 16 | #define STUBOFFSET 0 |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #if defined(CPU_PP) | ||
20 | #ifdef CPU_PP502x | ||
21 | #define NOCACHE_BASE 0x10000000 | ||
22 | #else | ||
23 | #define NOCACHE_BASE 0x28000000 | ||
24 | #endif /* CPU_* */ | ||
25 | #define CACHEALIGN_SIZE 16 | ||
26 | #endif /* CPU_PP */ | ||
27 | |||
28 | #ifndef NOCACHE_BASE | ||
29 | /* Default to no offset if target doesn't define this */ | ||
30 | #define NOCACHE_BASE 0x00000000 | ||
31 | #endif | ||
32 | |||
19 | #if CONFIG_CPU==S3C2440 | 33 | #if CONFIG_CPU==S3C2440 |
20 | #include "s3c2440.h" | 34 | #include "s3c2440.h" |
21 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE | 35 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE |
@@ -119,10 +133,20 @@ SECTIONS | |||
119 | .data : | 133 | .data : |
120 | { | 134 | { |
121 | *(.data*) | 135 | *(.data*) |
136 | } > PLUGIN_RAM | ||
137 | |||
138 | #if NOCACHE_BASE != 0 | ||
139 | .ncdata . + NOCACHE_BASE : | ||
140 | { | ||
141 | . = ALIGN(CACHEALIGN_SIZE); | ||
142 | *(.ncdata*) | ||
143 | . = ALIGN(CACHEALIGN_SIZE); | ||
144 | } AT> PLUGIN_RAM | ||
145 | #endif | ||
146 | |||
122 | #if defined(IRAMSIZE) | 147 | #if defined(IRAMSIZE) |
123 | iramcopy = .; | 148 | iramcopy = . - NOCACHE_BASE; |
124 | #endif | 149 | #endif |
125 | } > PLUGIN_RAM | ||
126 | 150 | ||
127 | /DISCARD/ : | 151 | /DISCARD/ : |
128 | { | 152 | { |
@@ -139,6 +163,7 @@ SECTIONS | |||
139 | iramend = .; | 163 | iramend = .; |
140 | } > PLUGIN_IRAM | 164 | } > PLUGIN_IRAM |
141 | 165 | ||
166 | |||
142 | .ibss (NOLOAD) : | 167 | .ibss (NOLOAD) : |
143 | { | 168 | { |
144 | iedata = .; | 169 | iedata = .; |
@@ -150,13 +175,27 @@ SECTIONS | |||
150 | 175 | ||
151 | .bss (NOLOAD) : | 176 | .bss (NOLOAD) : |
152 | { | 177 | { |
153 | plugin_bss_start = .; | 178 | plugin_bss_start = .; |
154 | *(.bss*) | 179 | *(.bss*) |
155 | *(COMMON) | 180 | *(COMMON) |
156 | . = ALIGN(0x4); | 181 | . = ALIGN(0x4); |
182 | } > PLUGIN_RAM | ||
183 | |||
184 | #if NOCACHE_BASE != 0 | ||
185 | .ncbss . + NOCACHE_BASE (NOLOAD) : | ||
186 | { | ||
187 | . = ALIGN(CACHEALIGN_SIZE); | ||
188 | *(.ncbss*) | ||
189 | . = ALIGN(CACHEALIGN_SIZE); | ||
190 | } AT> PLUGIN_RAM | ||
191 | #endif | ||
192 | |||
193 | /* Restore . */ | ||
194 | .pluginend . - NOCACHE_BASE : | ||
195 | { | ||
157 | _plugin_end_addr = .; | 196 | _plugin_end_addr = .; |
158 | plugin_end_addr = .; | 197 | plugin_end_addr = .; |
159 | } > PLUGIN_RAM | 198 | } |
160 | 199 | ||
161 | /* Special trick to avoid a linker error when no other sections are | 200 | /* Special trick to avoid a linker error when no other sections are |
162 | left after garbage collection (plugin not for this platform) */ | 201 | left after garbage collection (plugin not for this platform) */ |