My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions | Variables
mem_mng.c File Reference
#include <sw_types.h>
#include <mem_mng.h>
#include <sw_mem_functions.h>
#include <uart.h>
#include <mmap.h>

Macros

#define BASE   0
 
#define ROOF   1
 
#define ALIGN(x, y, z)   ((pa_t)(x + ((y - 1) * z)) & ~(y - 1))
 

Functions

void sw_meminfo_init (struct mem_info *info, struct mem_info *p)
 Initializes the address space in secure world by allocating and mapping the required pages. More...
 
va_t sw_page_alloc (u32 size, struct mem_info *info)
 Allocates physical pages for the required size. More...
 
int sw_page_free (va_t vir_addr, u32 size, struct mem_info *info)
 Frees the pages. More...
 

Variables

struct mem_info sw_mem_info
 

Macro Definition Documentation

#define ALIGN (   x,
  y,
 
)    ((pa_t)(x + ((y - 1) * z)) & ~(y - 1))
#define BASE   0
#define ROOF   1

Function Documentation

void sw_meminfo_init ( struct mem_info info,
struct mem_info p 
)

Initializes the address space in secure world by allocating and mapping the required pages.

Returns
Returns the address of the secure world page table
va_t sw_page_alloc ( u32  size,
struct mem_info info 
)

Allocates physical pages for the required size.

Parameters
sizeSize of the memory to be allocated
Returns
Returns the address of the memory allocated
int sw_page_free ( va_t  vir_addr,
u32  size,
struct mem_info info 
)

Frees the pages.

Parameters
phy_addrstart address of the pages to be freed
sizeSize of the memory to be freed
Returns
Returns zero on success

Variable Documentation

struct mem_info sw_mem_info