/[qemu]/qemu/dyngen.h
ViewVC logotype

Diff of /qemu/dyngen.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by bellard, Mon Jun 9 15:34:19 2003 UTC revision 1.2 by bellard, Sun Jun 15 19:45:20 2003 UTC
# Line 18  Line 18 
18   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   */   */
20    
21    int __op_param1, __op_param2, __op_param3;
22    int __op_jmp0, __op_jmp1;
23    
24    #ifdef __i386__
25    static inline void flush_icache_range(unsigned long start, unsigned long stop)
26    {
27    }
28    #endif
29    
30    #ifdef __s390__
31    static inline void flush_icache_range(unsigned long start, unsigned long stop)
32    {
33    }
34    #endif
35    
36    #ifdef __ia64__
37    static inline void flush_icache_range(unsigned long start, unsigned long stop)
38    {
39    }
40    #endif
41    
42    #ifdef __powerpc__
43    
44    #define MIN_CACHE_LINE_SIZE 8 /* conservative value */
45    
46    static void inline flush_icache_range(unsigned long start, unsigned long stop)
47    {
48        unsigned long p;
49    
50        p = start & ~(MIN_CACHE_LINE_SIZE - 1);
51        stop = (stop + MIN_CACHE_LINE_SIZE - 1) & ~(MIN_CACHE_LINE_SIZE - 1);
52        
53        for (p = start; p < stop; p += MIN_CACHE_LINE_SIZE) {
54            asm volatile ("dcbst 0,%0" : : "r"(p) : "memory");
55        }
56        asm volatile ("sync" : : : "memory");
57        for (p = start; p < stop; p += MIN_CACHE_LINE_SIZE) {
58            asm volatile ("icbi 0,%0" : : "r"(p) : "memory");
59        }
60        asm volatile ("sync" : : : "memory");
61        asm volatile ("isync" : : : "memory");
62    }
63    #endif
64    
65    #ifdef __alpha__
66    static inline void flush_icache_range(unsigned long start, unsigned long stop)
67    {
68        asm ("imb");
69    }
70    #endif
71    
72    #ifdef __sparc__
73    
74    static void inline flush_icache_range(unsigned long start, unsigned long stop)
75    {
76            unsigned long p;
77    
78            p = start & ~(8UL - 1UL);
79            stop = (stop + (8UL - 1UL)) & ~(8UL - 1UL);
80    
81            for (; p < stop; p += 8)
82                    __asm__ __volatile__("flush\t%0" : : "r" (p));
83    }
84    
85    #endif
86    
87    #ifdef __arm__
88    static inline void flush_icache_range(unsigned long start, unsigned long stop)
89    {
90        register unsigned long _beg __asm ("a1") = start;
91        register unsigned long _end __asm ("a2") = stop;
92        register unsigned long _flg __asm ("a3") = 0;
93        __asm __volatile__ ("swi 0x9f0002" : : "r" (_beg), "r" (_end), "r" (_flg));
94    }
95    #endif
96    
97  #ifdef __alpha__  #ifdef __alpha__
98    
99  register int gp asm("$29");  register int gp asm("$29");

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26