1
0
Fork 0
forked from len0rd/rockbox

Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now with shared variables in DRAM (it seems swp(b) is at least partially broken on all PP or I'm doing something very wrong here :\). For core-shared data use SHAREDBSS/DATA_ATTR. NOCACHEBSS/DATA_ATTR is available whether or not single core is forced for static peripheral-DMA buffer allocation without use of the UNCACHED_ADDR macro in code and is likely useful on a non-PP target with a data cache (although not actually enabled in config.h and the .lds's in this commit).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16981 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2008-04-06 04:34:57 +00:00
parent be698f086d
commit 05099149f1
40 changed files with 323 additions and 126 deletions

View file

@ -30,10 +30,10 @@ static size_t bufsize;
static unsigned char* mallocbuf;
/* libmpeg2 allocator */
static off_t mpeg2_mem_ptr NOCACHEBSS_ATTR;
static size_t mpeg2_bufsize NOCACHEBSS_ATTR;
static unsigned char *mpeg2_mallocbuf NOCACHEBSS_ATTR;
static unsigned char *mpeg2_bufallocbuf NOCACHEBSS_ATTR;
static off_t mpeg2_mem_ptr SHAREDBSS_ATTR;
static size_t mpeg2_bufsize SHAREDBSS_ATTR;
static unsigned char *mpeg2_mallocbuf SHAREDBSS_ATTR;
static unsigned char *mpeg2_bufallocbuf SHAREDBSS_ATTR;
#if defined(DEBUG) || defined(SIMULATOR)
const char * mpeg_get_reason_str(int reason)

View file

@ -44,8 +44,8 @@ static size_t audio_stack_size; /* Keep gcc happy and init */
#ifndef SIMULATOR
static uint32_t codec_stack_copy[AUDIO_STACKSIZE / sizeof(uint32_t)];
#endif
static struct event_queue audio_str_queue NOCACHEBSS_ATTR;
static struct queue_sender_list audio_str_queue_send NOCACHEBSS_ATTR;
static struct event_queue audio_str_queue SHAREDBSS_ATTR;
static struct queue_sender_list audio_str_queue_send SHAREDBSS_ATTR;
struct stream audio_str IBSS_ATTR;
/* libmad related definitions */

View file

@ -21,12 +21,12 @@
#include "plugin.h"
#include "mpegplayer.h"
static struct mutex disk_buf_mtx NOCACHEBSS_ATTR;
static struct event_queue disk_buf_queue NOCACHEBSS_ATTR;
static struct queue_sender_list disk_buf_queue_send NOCACHEBSS_ATTR;
static struct mutex disk_buf_mtx SHAREDBSS_ATTR;
static struct event_queue disk_buf_queue SHAREDBSS_ATTR;
static struct queue_sender_list disk_buf_queue_send SHAREDBSS_ATTR;
static uint32_t disk_buf_stack[DEFAULT_STACK_SIZE*2/sizeof(uint32_t)];
struct disk_buf disk_buf NOCACHEBSS_ATTR;
struct disk_buf disk_buf SHAREDBSS_ATTR;
static struct list_item nf_list;
static inline void disk_buf_lock(void)
@ -566,7 +566,7 @@ static int disk_buf_probe(off_t start, size_t length,
{
if (disk_buf.cache[page] != tag)
{
static struct dbuf_range rng NOCACHEBSS_ATTR;
static struct dbuf_range rng IBSS_ATTR;
DEBUGF("disk_buf: cache miss\n");
rng.tag_start = tag;
rng.tag_end = tag_end;

View file

@ -84,7 +84,7 @@ struct disk_buf
bool need_seek; /* Need to seek because a read was not contiguous */
};
extern struct disk_buf disk_buf NOCACHEBSS_ATTR;
extern struct disk_buf disk_buf SHAREDBSS_ATTR;
static inline bool disk_buf_is_data_ready(struct stream_hdr *sh,
ssize_t margin)

View file

@ -21,7 +21,7 @@
#include "plugin.h"
#include "mpegplayer.h"
struct stream_parser str_parser NOCACHEBSS_ATTR;
struct stream_parser str_parser SHAREDBSS_ATTR;
static void parser_init_state(void)
{

View file

@ -27,11 +27,11 @@
GREY_INFO_STRUCT_IRAM
#endif
static struct event_queue stream_mgr_queue NOCACHEBSS_ATTR;
static struct queue_sender_list stream_mgr_queue_send NOCACHEBSS_ATTR;
static struct event_queue stream_mgr_queue SHAREDBSS_ATTR;
static struct queue_sender_list stream_mgr_queue_send SHAREDBSS_ATTR;
static uint32_t stream_mgr_thread_stack[DEFAULT_STACK_SIZE*2/sizeof(uint32_t)];
struct stream_mgr stream_mgr NOCACHEBSS_ATTR;
struct stream_mgr stream_mgr SHAREDBSS_ATTR;
/* Forward decs */
static int stream_on_close(void);

View file

@ -44,7 +44,7 @@ struct stream_mgr
} parms;
};
extern struct stream_mgr stream_mgr NOCACHEBSS_ATTR;
extern struct stream_mgr stream_mgr SHAREDBSS_ATTR;
struct stream_window
{

View file

@ -52,7 +52,7 @@ static struct vo_data vo;
#endif
#if NUM_CORES > 1
static struct mutex vo_mtx NOCACHEBSS_ATTR;
static struct mutex vo_mtx SHAREDBSS_ATTR;
#endif
static inline void video_lock_init(void)

View file

@ -54,8 +54,8 @@ struct video_thread_data
so maybe we can reduce it. */
#define VIDEO_STACKSIZE (4*1024)
static uint32_t video_stack[VIDEO_STACKSIZE / sizeof(uint32_t)] IBSS_ATTR;
static struct event_queue video_str_queue NOCACHEBSS_ATTR;
static struct queue_sender_list video_str_queue_send NOCACHEBSS_ATTR;
static struct event_queue video_str_queue SHAREDBSS_ATTR;
static struct queue_sender_list video_str_queue_send SHAREDBSS_ATTR;
struct stream video_str IBSS_ATTR;
static void draw_fps(struct video_thread_data *td)

View file

@ -16,6 +16,20 @@ OUTPUT_FORMAT(elf32-sh)
#define STUBOFFSET 0
#endif
#if defined(CPU_PP)
#ifdef CPU_PP502x
#define NOCACHE_BASE 0x10000000
#else
#define NOCACHE_BASE 0x28000000
#endif /* CPU_* */
#define CACHEALIGN_SIZE 16
#endif /* CPU_PP */
#ifndef NOCACHE_BASE
/* Default to no offset if target doesn't define this */
#define NOCACHE_BASE 0x00000000
#endif
#if CONFIG_CPU==S3C2440
#include "s3c2440.h"
#define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
@ -119,11 +133,21 @@ SECTIONS
.data :
{
*(.data*)
#if defined(IRAMSIZE)
iramcopy = .;
#endif
} > PLUGIN_RAM
#if NOCACHE_BASE != 0
.ncdata . + NOCACHE_BASE :
{
. = ALIGN(CACHEALIGN_SIZE);
*(.ncdata*)
. = ALIGN(CACHEALIGN_SIZE);
} AT> PLUGIN_RAM
#endif
#if defined(IRAMSIZE)
iramcopy = . - NOCACHE_BASE;
#endif
/DISCARD/ :
{
*(.eh_frame)
@ -139,6 +163,7 @@ SECTIONS
iramend = .;
} > PLUGIN_IRAM
.ibss (NOLOAD) :
{
iedata = .;
@ -150,13 +175,27 @@ SECTIONS
.bss (NOLOAD) :
{
plugin_bss_start = .;
plugin_bss_start = .;
*(.bss*)
*(COMMON)
. = ALIGN(0x4);
} > PLUGIN_RAM
#if NOCACHE_BASE != 0
.ncbss . + NOCACHE_BASE (NOLOAD) :
{
. = ALIGN(CACHEALIGN_SIZE);
*(.ncbss*)
. = ALIGN(CACHEALIGN_SIZE);
} AT> PLUGIN_RAM
#endif
/* Restore . */
.pluginend . - NOCACHE_BASE :
{
_plugin_end_addr = .;
plugin_end_addr = .;
} > PLUGIN_RAM
}
/* Special trick to avoid a linker error when no other sections are
left after garbage collection (plugin not for this platform) */