VirtualBox

source: vbox/trunk/src/recompiler/cache-utils.h@ 49539

最後變更 在這個檔案從49539是 42601,由 vboxsync 提交於 12 年 前

REM: Initial changes to make it work (seemingly) with MinGW-w64.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.1 KB
 
1#ifndef QEMU_CACHE_UTILS_H
2#define QEMU_CACHE_UTILS_H
3
4#if defined(_ARCH_PPC)
5struct qemu_cache_conf {
6 unsigned long dcache_bsize;
7 unsigned long icache_bsize;
8};
9
10extern struct qemu_cache_conf qemu_cache_conf;
11
12extern void qemu_cache_utils_init(char **envp);
13
14/* mildly adjusted code from tcg-dyngen.c */
15static inline void flush_icache_range(uintptr_t start, uintptr_t stop)
16{
17 unsigned long p, start1, stop1;
18 unsigned long dsize = qemu_cache_conf.dcache_bsize;
19 unsigned long isize = qemu_cache_conf.icache_bsize;
20
21 start1 = start & ~(dsize - 1);
22 stop1 = (stop + dsize - 1) & ~(dsize - 1);
23 for (p = start1; p < stop1; p += dsize) {
24 asm volatile ("dcbst 0,%0" : : "r"(p) : "memory");
25 }
26 asm volatile ("sync" : : : "memory");
27
28 start &= start & ~(isize - 1);
29 stop1 = (stop + isize - 1) & ~(isize - 1);
30 for (p = start1; p < stop1; p += isize) {
31 asm volatile ("icbi 0,%0" : : "r"(p) : "memory");
32 }
33 asm volatile ("sync" : : : "memory");
34 asm volatile ("isync" : : : "memory");
35}
36
37#else
38#define qemu_cache_utils_init(envp) do { (void) (envp); } while (0)
39#endif
40
41#endif /* QEMU_CACHE_UTILS_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette