From d51e5983357593981e604b05ad3826f2496f4a6b Mon Sep 17 00:00:00 2001 From: Boris Gjenero Date: Tue, 29 Nov 2011 00:42:27 +0000 Subject: FS#12412 : Delete old buffer allocation code which has been replaced by core_alloc, and move buffer setup code to core_alloc.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31088 a1c6a512-1295-4272-9138-f99709370657 --- firmware/core_alloc.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'firmware/core_alloc.c') diff --git a/firmware/core_alloc.c b/firmware/core_alloc.c index 21dd1319dd..34ed48b39f 100644 --- a/firmware/core_alloc.c +++ b/firmware/core_alloc.c @@ -1,21 +1,44 @@ +#include "config.h" #include +#include "system.h" #include "core_alloc.h" #include "buflib.h" -#include "buffer.h" /* not static so it can be discovered by core_get_data() */ struct buflib_context core_ctx; +/* defined in linker script */ +#if (CONFIG_PLATFORM & PLATFORM_NATIVE) +#if defined(IPOD_VIDEO) && !defined(BOOTLOADER) +extern unsigned char *audiobufend_lds[]; +unsigned char *audiobufend; +#else /* !IPOD_VIDEO */ +extern unsigned char audiobufend[]; +#endif +/* defined in linker script */ +extern unsigned char audiobuffer[]; +#else /* PLATFORM_HOSTED */ +unsigned char audiobuffer[(MEMORYSIZE*1024-256)*1024]; +unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer); +extern unsigned char *audiobufend; +#endif + /* debug test alloc */ static int test_alloc; void core_allocator_init(void) { - buffer_init(); - size_t size; - void *start = buffer_get_buffer(&size); - buflib_init(&core_ctx, start, size); - buffer_release_buffer(size); + unsigned char *start = ALIGN_UP(audiobuffer, sizeof(intptr_t)); + +#if defined(IPOD_VIDEO) && !defined(BOOTLOADER) && !defined(SIMULATOR) + audiobufend=(unsigned char *)audiobufend_lds; + if(MEMORYSIZE==64 && probed_ramsize!=64) + { + audiobufend -= (32<<20); + } +#endif + + buflib_init(&core_ctx, start, audiobufend - start); test_alloc = core_alloc("test", 112); } -- cgit v1.2.3