diff options
Diffstat (limited to 'big-little/secure_world/secure_world.h')
-rw-r--r-- | big-little/secure_world/secure_world.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/big-little/secure_world/secure_world.h b/big-little/secure_world/secure_world.h new file mode 100644 index 0000000..b01766f --- /dev/null +++ b/big-little/secure_world/secure_world.h @@ -0,0 +1,84 @@ +/* + * $Copyright: + * ---------------------------------------------------------------- + * This confidential and proprietary software may be used only as + * authorised by a licensing agreement from ARM Limited + * (C) COPYRIGHT 2008-2011 ARM Limited + * ALL RIGHTS RESERVED + * The entire notice above must be reproduced on all authorised + * copies and copies may only be made to the extent permitted + * by a licensing agreement from ARM Limited. + * ---------------------------------------------------------------- + * File: secure_world.h + * ---------------------------------------------------------------- + * $ + */ + +#ifndef __SECURE_WORLD_H__ +#define __SECURE_WORLD_H__ + +#include "hyp_types.h" +#include "virt_helpers.h" +#include "events.h" +#include "misc.h" +#include "gic_registers.h" +#include "hyp_vmmap.h" + +/* Definitions for creating a 4K page table entry */ +#define PAGE_SHIFT 12 +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1)) +#define PAGE_ALIGN(x) (x & PAGE_MASK) + +#define MB_SHIFT 20 +#define MB_SIZE (1UL << MB_SHIFT) +#define MB_MASK (~(MB_SIZE-1)) +#define MB_ALIGN(x) (x & MB_MASK) + +#define SP_L1_BASE_SHIFT 10 +#define SP_L1_BASE_MASK (~((1UL << SP_L1_BASE_SHIFT) - 1)) + +/* Definitions for first level small page descriptors */ +#define SMALL_PAGE (1 << 0) +#define SMALL_PAGE_NS (1 << 3) + +/* Definitions for second level small page descriptors */ +#define SP_XN (1 << 0) +#define SP_SBO (1 << 1) +#define SP_BUFFERABLE (1 << 2) +#define SP_CACHEABLE (1 << 3) +#define SP_AP0 (1 << 4) +#define SP_AP1 (1 << 5) +#define SP_AP2 (1 << 9) +#define SP_TEX0 (1 << 6) +#define SP_TEX1 (1 << 7) +#define SP_TEX2 (1 << 8) +#define SP_SHARED (1 << 10) +#define SP_GLOBAL (1 << 11) + +typedef struct sec_stack { + unsigned stack[STACK_SIZE]; +} sec_stack; + +typedef struct sec_context { + unsigned sctlr; + unsigned actlr; + unsigned cpacr; + unsigned nsacr; + unsigned scr; + unsigned vbar; + unsigned mvbar; + unsigned cntfrq; + unsigned cci_sar; + unsigned vgic_icdisr0; + unsigned vgic_iccpmr; +} sec_context; + +extern void enable_caches(void); +extern void secure_context_restore(void); +extern void secure_context_save(unsigned); +#if SYSBENCH +extern void setup_reset_handler(unsigned); +#endif + +#endif /* __SECURE_WORLD_H__ */ |