My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions | Variables
tzhyp_global.h File Reference
#include <sw_types.h>
#include <system_context.h>
#include <tzhyp_config.h>
#include <nsk_boot.h>
#include <sw_board.h>
#include <sw_mcore.h>

Go to the source code of this file.

Functions

int tzhyp_guest_init (void)
 Initialize guests. More...
 
int tzhyp_schedevent_init (void)
 Trustzone hypervisor schedule event initialization. More...
 
void tzhyp_schedule_guest (void)
 Hypervisor scheduler does the job of scheduling between multiple guest OS. More...
 
void tzhyp_device_context_init (void)
 Hypervisor device context initialization. More...
 
void tzhyp_device_switch (struct system_context *, struct system_context *)
 Hypervisor device switching between cur and next. More...
 
int nsk_load (struct nsk_boot_info *)
 Loads the non-secure kernel by getting the boot info. More...
 

Variables

struct system_context ns_world [MAX_CORES *GUESTS_NO]
 Non secure task contexts. More...
 
struct system_context s_world [1]
 Common Secure context. More...
 
struct system_contextns_sys_current
 Non secure and Secure context pointers. More...
 
struct system_contexts_sys_current
 
u32 ns_preempt_flag
 Non secure preempt flag. More...
 
u32 ns_switch_flag
 NS switch flag to indicate TLB flush. More...
 
u32 tzhyp_nsadmin_start
 
u32 tzhyp_nsadmin_end
 
u32 kernel_start
 
u32 kernel_end
 
u32 kernel_2_start
 
u32 kernel_2_end
 
u32 initrd_image_start
 
u32 initrd_image_end
 

Function Documentation

int nsk_load ( struct nsk_boot_info ni)

Loads the non-secure kernel by getting the boot info.

Parameters
niboot info structure
Returns
void tzhyp_device_context_init ( void  )

Hypervisor device context initialization.

void tzhyp_device_switch ( struct system_context cur,
struct system_context next 
)

Hypervisor device switching between cur and next.

Parameters
cur
next
int tzhyp_guest_init ( void  )

Initialize guests.

Returns
int tzhyp_schedevent_init ( void  )

Trustzone hypervisor schedule event initialization.

Returns
void tzhyp_schedule_guest ( void  )

Hypervisor scheduler does the job of scheduling between multiple guest OS.

CPU context switching to a new guest OS For every guest OS there is a cpu register context meant for NS world. Secure world is common across all guest OS. CPU register context involves both core registers and system registers(eg. cp15). a. The sytem register context of the 'current' guest OS(NS world) is saved and the same is restored with that of the 'next' guest OS to be scheduled. b. Saving and restoring of core registers(NS world) is handled by the monitor fiq handler entry and exit path. So we just need to adjust he context pointers so that the right core register context gets restored during exit from the exception.

Variable Documentation

u32 initrd_image_end
u32 initrd_image_start
u32 kernel_2_end
u32 kernel_2_start
u32 kernel_end
u32 kernel_start
u32 ns_preempt_flag

Non secure preempt flag.

u32 ns_switch_flag

NS switch flag to indicate TLB flush.

struct system_context* ns_sys_current

Non secure and Secure context pointers.

struct system_context ns_world[MAX_CORES *GUESTS_NO]

Non secure task contexts.

Non secure task contexts.

struct system_context* s_sys_current
struct system_context s_world[1]

Common Secure context.

Common Secure context.

u32 tzhyp_nsadmin_end
u32 tzhyp_nsadmin_start