summaryrefslogtreecommitdiff
path: root/big-little/include/virt_helpers.h
blob: 1388e35908a6463386a824ccc9eac54626162e20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
 * Copyright (c) 2012, 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, 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_ */