提交 e4ee916d 编写于 作者: J Juergen Lock 提交者: malc

Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.

New version after malc's comments.  (Added error handling.)

Submitted by: Andreas Tobler <andreast@fgznet.ch>
Signed-off-by: NJuergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Nmalc <av1474@comtv.ru>
上级 584771e6
......@@ -57,6 +57,27 @@ static void ppc_init_cacheline_sizes(void)
}
#endif
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <stdio.h>
#include <sys/types.h>
#include <sys/sysctl.h>
static void ppc_init_cacheline_sizes(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
#ifdef __linux__
void qemu_cache_utils_init(char **envp)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册