diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2014-06-23 18:26:58 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2014-06-23 18:26:58 +0100 |
| commit | 7ba48975d342ef4d9251097f24be0db328f36f7d (patch) | |
| tree | 08b67d12fe2ea9fea0dea3ce05827e66a7d25a29 /util/cache-utils.c | |
| parent | 9f862687eaf7335deb8955e1c25e1d36b9b3c90c (diff) | |
| parent | a84ac4cbbb4f4705305189ef007a8432b0b9f718 (diff) | |
| download | focaccia-qemu-7ba48975d342ef4d9251097f24be0db328f36f7d.tar.gz focaccia-qemu-7ba48975d342ef4d9251097f24be0db328f36f7d.zip | |
Merge remote-tracking branch 'remotes/rth/tcg-ppc-merge-1' into staging
* remotes/rth/tcg-ppc-merge-1: (25 commits) tcg-ppc: Use the return address as a base pointer tcg-ppc: Merge cache-utils into the backend qemu/osdep: Remove the need for qemu_init_auxval tcg-ppc: Rename the tcg/ppc64 backend tcg-ppc: Remove the backend tcg-ppc64: Merge ppc32 shifts tcg-ppc64: Support mulsh_i32 tcg-ppc64: Merge ppc32 register usage tcg-ppc64: Merge ppc32 qemu_ld/st tcg-ppc64: Merge ppc32 brcond2, setcond2, muluh tcg-ppc64: Begin merging ppc32 with ppc64 tcg-ppc64: Fix sub2 implementation tcg-ppc64: Merge 32-bit ABIs into the prologue / frame code tcg-ppc64: Adjust tcg_out_call for ELFv2 tcg-ppc64: Support the ppc64 elfv2 ABI tcg-ppc64: Use the correct test in tcg_out_call tcg-ppc64: Better parameterize the stack frame tcg-ppc64: Fix TCG_TARGET_CALL_STACK_OFFSET tcg-ppc64: Move call macros out of tcg-target.h tcg-ppc64: Make TCG_AREG0 and TCG_REG_CALL_STACK enum constants ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/cache-utils.c')
| -rw-r--r-- | util/cache-utils.c | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/util/cache-utils.c b/util/cache-utils.c deleted file mode 100644 index 047003008b..0000000000 --- a/util/cache-utils.c +++ /dev/null @@ -1,86 +0,0 @@ -#include "qemu-common.h" -#include "qemu/cache-utils.h" - -#if defined(_ARCH_PPC) -struct qemu_cache_conf qemu_cache_conf = { - .dcache_bsize = 16, - .icache_bsize = 16 -}; - -#if defined _AIX -#include <sys/systemcfg.h> - -void qemu_cache_utils_init(void) -{ - qemu_cache_conf.icache_bsize = _system_configuration.icache_line; - qemu_cache_conf.dcache_bsize = _system_configuration.dcache_line; -} - -#elif defined __linux__ -#include "qemu/osdep.h" -#include "elf.h" - -void qemu_cache_utils_init(void) -{ - unsigned long dsize = qemu_getauxval(AT_DCACHEBSIZE); - unsigned long isize = qemu_getauxval(AT_ICACHEBSIZE); - - if (dsize == 0 || isize == 0) { - if (dsize == 0) { - fprintf(stderr, "getauxval AT_DCACHEBSIZE failed\n"); - } - if (isize == 0) { - fprintf(stderr, "getauxval AT_ICACHEBSIZE failed\n"); - } - exit(1); - - } - qemu_cache_conf.dcache_bsize = dsize; - qemu_cache_conf.icache_bsize = isize; -} - -#elif defined __APPLE__ -#include <stdio.h> -#include <sys/types.h> -#include <sys/sysctl.h> - -void qemu_cache_utils_init(void) -{ - size_t len; - unsigned cacheline; - int name[2] = { CTL_HW, HW_CACHELINE }; - - len = sizeof(cacheline); - if (sysctl(name, 2, &cacheline, &len, NULL, 0)) { - perror("sysctl CTL_HW HW_CACHELINE failed"); - } else { - qemu_cache_conf.dcache_bsize = cacheline; - qemu_cache_conf.icache_bsize = cacheline; - } -} - -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/types.h> -#include <sys/sysctl.h> - -void qemu_cache_utils_init(void) -{ - size_t len = 4; - unsigned cacheline; - - if (sysctlbyname ("machdep.cacheline_size", &cacheline, &len, NULL, 0)) { - fprintf(stderr, "sysctlbyname machdep.cacheline_size failed: %s\n", - strerror(errno)); - exit(1); - } - - qemu_cache_conf.dcache_bsize = cacheline; - qemu_cache_conf.icache_bsize = cacheline; -} -#endif - -#endif /* _ARCH_PPC */ |