This source file includes following definitions.
- enable_vac
- disable_vac
- hw_flush_vac_context_entry
- sw_flush_vac_context_entry
- hw_flush_vac_segment_entry
- sw_flush_vac_segment_entry
- hw_flush_vac_page_entry
- sw_flush_vac_page_entry
1 #ifndef _SPARC_VAC_OPS_H
2 #define _SPARC_VAC_OPS_H
3
4
5
6
7
8
9
10 extern unsigned long *trapbase;
11 extern char end, etext, edata;
12
13 extern void flush_vac_context(void);
14 extern void flush_vac_segment(unsigned int foo_segment);
15 extern void flush_vac_page(unsigned int foo_addr);
16
17 extern int vac_do_hw_vac_flushes, vac_size, vac_linesize;
18 extern int vac_entries_per_context, vac_entries_per_segment;
19 extern int vac_entries_per_page;
20
21
22
23
24
25 extern __inline__ int enable_vac(void)
26 {
27 int success=0;
28
29 __asm__ __volatile__("lduba [%1] 2, %0\n\t"
30 "or %0, 0x10, %0\n\t"
31 "stba %0, [%1] 2\n\t"
32 "or %%g0, %%g0, %0" :
33 "=r" (success) :
34 "r" ((unsigned int) 0x40000000),
35 "0" (success));
36 return success;
37 }
38
39
40
41
42
43 extern __inline__ int disable_vac(void)
44 {
45 int success=0;
46
47 __asm__ __volatile__("lduba [%1] 0x2, %0\n\t"
48 "xor %0, 0x10, %0\n\t"
49 "stba %0, [%1] 0x2\n\t"
50 "or %%g0, %%g0, %0" :
51 "=r" (success) :
52 "r" (0x40000000),
53 "0" (success));
54 return success;
55 }
56
57
58
59 extern __inline__ void hw_flush_vac_context_entry(char* addr)
60 {
61 __asm__ __volatile__("sta %%g0, [%0] 0x7" : : "r" (addr));
62 }
63
64 extern __inline__ void sw_flush_vac_context_entry(char* addr)
65 {
66 __asm__ __volatile__("sta %%g0, [%0] 0xe" : : "r" (addr));
67 }
68
69 extern __inline__ void hw_flush_vac_segment_entry(char* addr)
70 {
71 __asm__ __volatile__("sta %%g0, [%0] 0x5" : : "r" (addr));
72 }
73
74 extern __inline__ void sw_flush_vac_segment_entry(char* addr)
75 {
76 __asm__ __volatile__("sta %%g0, [%0] 0xc" : : "r" (addr));
77 }
78
79 extern __inline__ void hw_flush_vac_page_entry(unsigned long* addr)
80 {
81 __asm__ __volatile__("sta %%g0, [%0] 0x6" : : "r" (addr));
82 }
83
84 extern __inline__ void sw_flush_vac_page_entry(unsigned long* addr)
85 {
86 __asm__ __volatile__("sta %%g0, [%0] 0xd" : : "r" (addr));
87 }
88
89 #endif