diff options
Diffstat (limited to 'big-little/include/virt_helpers.h')
-rw-r--r-- | big-little/include/virt_helpers.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/big-little/include/virt_helpers.h b/big-little/include/virt_helpers.h new file mode 100644 index 0000000..34e4d1c --- /dev/null +++ b/big-little/include/virt_helpers.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2011, ARM Limited. All rights reserved. + * + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: + * + * Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * + * Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and + * the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of ARM nor the names of its + * contributors may be used to endorse or promote products + * derived from this software without specific prior written + * permission. + */ + +#ifndef _VIRT_HELPERS_H_ +#define _VIRT_HELPERS_H_ + +#include "bakery.h" +#include "helpers.h" +#include "misc.h" + +/******************************************************* + * Export prototypes of the functions which will be used + * to save/restore the Non-secure context. + *******************************************************/ + +/* + * Misc functions + */ +extern unsigned read_sp(unsigned); +extern unsigned read_lr(unsigned); +extern unsigned num_secondaries(void); +extern unsigned *get_sp(unsigned, unsigned); + +extern void virt_dead(void); +extern void smc(unsigned, unsigned); +extern void dcisw(unsigned); +extern void dccsw(unsigned); +extern void dccisw(unsigned); +extern void write_sp(unsigned, unsigned); +extern void write_lr(unsigned, unsigned); + +/* + * V7 functions + */ +extern void disable_clean_inv_l1_dcache_v7(void); +extern void cache_maint_op(unsigned, unsigned); +extern unsigned get_loc(void); +extern void disable_coherency(void); +extern void disable_dcache(void); +extern void enable_coherency(void); +extern void enable_dcache(void); +extern void flush_to_loc(void); +extern void inv_tlb_all(void); +extern void inv_bpred_all(void); +extern void inv_tlb_mva(unsigned *); +extern void inv_icache_all(void); +extern void inv_icache_mva_pou(unsigned *); +extern void inv_dcache_mva_poc(unsigned *); +extern void cln_dcache_mva_poc(unsigned *); +extern void cln_dcache_mva_pou(unsigned *); + +/* + * GIC functions + */ +extern void save_gic_interface(unsigned int *pointer, + unsigned gic_interface_address); +extern int save_gic_distributor_private(unsigned int *pointer, + unsigned gic_distributor_address); +extern int save_gic_distributor_shared(unsigned int *pointer, + unsigned gic_distributor_address); +extern void restore_gic_interface(unsigned int *pointer, + unsigned gic_interface_address); +extern void restore_gic_distributor_private(unsigned int *pointer, + unsigned gic_distributor_address); +extern void restore_gic_distributor_shared(unsigned int *pointer, + unsigned gic_distributor_address); +extern void hyp_save(unsigned, unsigned); + +/* + * Tube functions + */ +#if TUBE +extern void write_trace(bakery_t *, unsigned, char *, unsigned long long, + unsigned long long, unsigned long long); +#else +#define write_trace(...) +#endif + +#endif /* _VIRT_HELPERS_H_ */ |