提交 5fe21034 编写于 作者: E Emilio G. Cota 提交者: Paolo Bonzini

cacheinfo: add i/d cache_linesize_log

Signed-off-by: NEmilio G. Cota <cota@braap.org>
Message-Id: <20180910232752.31565-2-cota@braap.org>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 87a09cdc
......@@ -570,6 +570,8 @@ extern uintptr_t qemu_real_host_page_size;
extern intptr_t qemu_real_host_page_mask;
extern int qemu_icache_linesize;
extern int qemu_icache_linesize_log;
extern int qemu_dcache_linesize;
extern int qemu_dcache_linesize_log;
#endif
......@@ -7,9 +7,12 @@
*/
#include "qemu/osdep.h"
#include "qemu/host-utils.h"
int qemu_icache_linesize = 0;
int qemu_icache_linesize_log;
int qemu_dcache_linesize = 0;
int qemu_dcache_linesize_log;
/*
* Operating system specific detection mechanisms.
......@@ -172,6 +175,11 @@ static void __attribute__((constructor)) init_cache_info(void)
arch_cache_info(&isize, &dsize);
fallback_cache_info(&isize, &dsize);
assert((isize & (isize - 1)) == 0);
assert((dsize & (dsize - 1)) == 0);
qemu_icache_linesize = isize;
qemu_icache_linesize_log = ctz32(isize);
qemu_dcache_linesize = dsize;
qemu_dcache_linesize_log = ctz32(dsize);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册