Go to the documentation of this file.
32 #ifndef __CVMX_ASM_H__
33 #define __CVMX_ASM_H__
38 #define CVMX_SYNC asm volatile ("sync" : : : "memory")
40 #define CVMX_SYNCW_STR "syncw\nsyncw\n"
44 #define CVMX_SYNCIO asm volatile ("nop")
46 #define CVMX_SYNCIOBDMA asm volatile ("synciobdma" : : : "memory")
49 #define CVMX_SYNCIOALL asm volatile ("nop")
58 #define CVMX_SYNCW asm volatile ("syncw\n\tsyncw" : : : "memory")
64 #define CVMX_SYNCWS CVMX_SYNCW
65 #define CVMX_SYNCS CVMX_SYNC
66 #define CVMX_SYNCWS_STR CVMX_SYNCW_STR
73 #define CVMX_SYNCIO asm volatile ("nop")
75 #define CVMX_SYNCIOBDMA asm volatile ("sync" : : : "memory")
78 #define CVMX_SYNCIOALL asm volatile ("nop")
80 #define CVMX_SYNCW asm volatile ("sync" : : : "memory")
81 #define CVMX_SYNCWS CVMX_SYNCW
82 #define CVMX_SYNCS CVMX_SYNC
83 #define CVMX_SYNCWS_STR CVMX_SYNCW_STR
93 #define CVMX_PREPARE_FOR_STORE(address, offset) \
94 asm volatile ("pref 30, " CVMX_TMP_STR(offset) "(%[rbase])" : : \
95 [rbase] "d" (address))
101 #define CVMX_DONT_WRITE_BACK(address, offset) \
102 asm volatile ("pref 29, " CVMX_TMP_STR(offset) "(%[rbase])" : : \
103 [rbase] "d" (address))
106 #define CVMX_ICACHE_INVALIDATE \
107 { CVMX_SYNC; asm volatile ("synci 0($0)" : : ); }
110 #define CVMX_ICACHE_INVALIDATE2 \
111 { CVMX_SYNC; asm volatile ("cache 0, 0($0)" : : ); }
114 #define CVMX_DCACHE_INVALIDATE \
115 { CVMX_SYNC; asm volatile ("cache 9, 0($0)" : : ); }
117 #define CVMX_CACHE(op, address, offset) \
118 asm volatile ("cache " CVMX_TMP_STR(op) ", " CVMX_TMP_STR(offset) "(%[rbase])" \
119 : : [rbase] "d" (address) )
121 #define CVMX_CACHE_LCKL2(address, offset) CVMX_CACHE(31, address, offset)
123 #define CVMX_CACHE_WBIL2(address, offset) CVMX_CACHE(23, address, offset)
125 #define CVMX_CACHE_WBIL2I(address, offset) CVMX_CACHE(3, address, offset)
127 #define CVMX_CACHE_LTGL2I(address, offset) CVMX_CACHE(7, address, offset)
129 #define CVMX_POP(result, input) \
130 asm ("pop %[rd],%[rs]" : [rd] "=d" (result) : [rs] "d" (input))
131 #define CVMX_DPOP(result, input) \
132 asm ("dpop %[rd],%[rs]" : [rd] "=d" (result) : [rs] "d" (input))
135 #define CVMX_RDHWR(result, regstr) \
136 asm volatile ("rdhwr %[rt],$" CVMX_TMP_STR(regstr) : [rt] "=d" (result))
137 #define CVMX_RDHWRNV(result, regstr) \
138 asm ("rdhwr %[rt],$" CVMX_TMP_STR(regstr) : [rt] "=d" (result))