| struct qemu_cache_conf qemu_cache_conf = { |
| #include <sys/systemcfg.h> |
| static void ppc_init_cacheline_sizes(void) |
| qemu_cache_conf.icache_bsize = _system_configuration.icache_line; |
| qemu_cache_conf.dcache_bsize = _system_configuration.dcache_line; |
| #define QEMU_AT_DCACHEBSIZE 19 |
| #define QEMU_AT_ICACHEBSIZE 20 |
| static void ppc_init_cacheline_sizes(char **envp) |
| for (auxv = (unsigned long *) envp; *auxv != QEMU_AT_NULL; auxv += 2) { |
| case QEMU_AT_DCACHEBSIZE: qemu_cache_conf.dcache_bsize = auxv[1]; break; |
| case QEMU_AT_ICACHEBSIZE: qemu_cache_conf.icache_bsize = auxv[1]; break; |
| static void ppc_init_cacheline_sizes(void) |
| int name[2] = { CTL_HW, HW_CACHELINE }; |
| if (sysctl(name, 2, &cacheline, &len, NULL, 0)) { |
| perror("sysctl CTL_HW HW_CACHELINE failed"); |
| qemu_cache_conf.dcache_bsize = cacheline; |
| qemu_cache_conf.icache_bsize = cacheline; |
| void qemu_cache_utils_init(char **envp) |
| ppc_init_cacheline_sizes(envp); |
| void qemu_cache_utils_init(char **envp) |
| ppc_init_cacheline_sizes(); |