memory: pass sof context to platform_init_memmap

Changes platform_init_memmap function's argument list to take
sof context. It will be needed to add memory map pointer into
sof context.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2020-01-08 09:20:13 +01:00 committed by Liam Girdwood
parent b332bee751
commit 3f53d59e7b
10 changed files with 22 additions and 10 deletions

View File

@ -47,7 +47,7 @@ int master_core_init(int argc, char *argv[], struct sof *sof)
/* initialise system services */
trace_point(TRACE_BOOT_SYS_HEAP);
platform_init_memmap();
platform_init_memmap(sof);
init_heap(sof);
interrupt_init();

View File

@ -14,7 +14,9 @@
#if !defined(__ASSEMBLER__) && !defined(LINKER)
void platform_init_memmap(void);
struct sof;
void platform_init_memmap(struct sof *sof);
static inline void *platform_shared_get(void *ptr, int bytes)
{

View File

@ -7,6 +7,7 @@
#include <sof/common.h>
#include <sof/lib/alloc.h>
#include <sof/lib/memory.h>
#include <sof/sof.h>
#include <ipc/topology.h>
/* Heap blocks for system runtime */
@ -88,7 +89,7 @@ struct mm memmap = {
HEAP_RUNTIME_SIZE + HEAP_BUFFER_SIZE,},
};
void platform_init_memmap(void)
void platform_init_memmap(struct sof *sof)
{
/* memmap has been initialized statically as a part of .data */
}

View File

@ -14,7 +14,9 @@
#if !defined(__ASSEMBLER__) && !defined(LINKER)
void platform_init_memmap(void);
struct sof;
void platform_init_memmap(struct sof *sof);
static inline void *platform_shared_get(void *ptr, int bytes)
{

View File

@ -7,6 +7,7 @@
#include <sof/common.h>
#include <sof/lib/alloc.h>
#include <sof/lib/memory.h>
#include <sof/sof.h>
#include <ipc/topology.h>
/* Heap blocks for system runtime */
@ -88,7 +89,7 @@ struct mm memmap = {
HEAP_RUNTIME_SIZE + HEAP_BUFFER_SIZE,},
};
void platform_init_memmap(void)
void platform_init_memmap(struct sof *sof)
{
/* memmap has been initialized statically as a part of .data */
}

View File

@ -173,7 +173,9 @@
#if !defined(__ASSEMBLER__) && !defined(LINKER)
void platform_init_memmap(void);
struct sof;
void platform_init_memmap(struct sof *sof);
static inline void *platform_shared_get(void *ptr, int bytes)
{

View File

@ -8,6 +8,7 @@
#include <sof/lib/alloc.h>
#include <sof/lib/memory.h>
#include <sof/platform.h>
#include <sof/sof.h>
#include <ipc/topology.h>
/* Heap blocks for system runtime */
@ -91,7 +92,7 @@ struct mm memmap = {
HEAP_RUNTIME_SIZE + HEAP_BUFFER_SIZE,},
};
void platform_init_memmap(void)
void platform_init_memmap(struct sof *sof)
{
/* memmap has been initialized statically as a part of .data */
}

View File

@ -66,6 +66,8 @@
#if !defined(__ASSEMBLER__) && !defined(LINKER)
struct sof;
#define SRAM_ALIAS_BASE 0x9E000000
#define SRAM_ALIAS_MASK 0xFF000000
#define SRAM_ALIAS_OFFSET 0x20000000
@ -108,7 +110,7 @@ static inline void *platform_rfree_prepare(void *ptr)
return is_uncached(ptr) ? uncache_to_cache(ptr) : ptr;
}
void platform_init_memmap(void);
void platform_init_memmap(struct sof *sof);
#endif

View File

@ -11,6 +11,7 @@
#include <sof/lib/cpu.h>
#include <sof/lib/memory.h>
#include <sof/platform.h>
#include <sof/sof.h>
#include <ipc/topology.h>
#include <stdint.h>
@ -105,7 +106,7 @@ static struct block_map lp_buf_heap_map[] = {
struct mm memmap;
void platform_init_memmap(void)
void platform_init_memmap(struct sof *sof)
{
int i;

View File

@ -217,7 +217,7 @@ static struct test_case test_cases[] = {
static int setup(void **state)
{
sof = malloc(sizeof(struct sof));
platform_init_memmap();
platform_init_memmap(sof);
init_heap(sof);
return 0;