Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
abcd5da7
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
abcd5da7
编写于
8月 10, 2003
作者:
B
bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use bswap.h
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@351
c046a42c-6fe2-441c-8c8c-71466251a162
上级
97a847bc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
82 deletion
+8
-82
dyngen.c
dyngen.c
+5
-6
thunk.h
thunk.h
+1
-74
vlmkcow.c
vlmkcow.c
+2
-2
未找到文件。
dyngen.c
浏览文件 @
abcd5da7
...
...
@@ -25,7 +25,7 @@
#include <unistd.h>
#include <fcntl.h>
#include "config.h"
#include "config
-host
.h"
/* elf format definitions. We use these macros to test the CPU to
allow cross compilation (this tool must be ran on the build
...
...
@@ -108,8 +108,7 @@ typedef uint64_t host_ulong;
#define SHT_RELOC SHT_REL
#endif
#define NO_THUNK_TYPE_SIZE
#include "thunk.h"
#include "bswap.h"
enum
{
OUT_GEN_OP
,
...
...
@@ -648,7 +647,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
{
ElfW
(
Sym
)
*
sym
;
const
char
*
sym_name
,
*
p
;
target_u
long
val
;
unsigned
long
val
;
int
n
;
for
(
i
=
0
,
sym
=
symtab
;
i
<
nb_syms
;
i
++
,
sym
++
)
{
...
...
@@ -663,7 +662,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
if
(
!
ptr
)
error
(
"__op_labelN in invalid section"
);
offset
=
sym
->
st_value
;
val
=
*
(
target_u
long
*
)(
ptr
+
offset
);
val
=
*
(
unsigned
long
*
)(
ptr
+
offset
);
#ifdef ELF_USES_RELOCA
{
int
reloc_shndx
,
nb_relocs1
,
j
;
...
...
@@ -687,7 +686,7 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
if
(
val
>=
start_offset
&&
val
<
start_offset
+
copy_size
)
{
n
=
strtol
(
p
,
NULL
,
10
);
fprintf
(
outfile
,
" label_offsets[%d] = %d + (gen_code_ptr - gen_code_buf);
\n
"
,
n
,
val
-
start_offset
);
fprintf
(
outfile
,
" label_offsets[%d] = %
l
d + (gen_code_ptr - gen_code_buf);
\n
"
,
n
,
val
-
start_offset
);
}
}
}
...
...
thunk.h
浏览文件 @
abcd5da7
...
...
@@ -23,43 +23,7 @@
#include <inttypes.h>
#include "config.h"
#ifdef HAVE_BYTESWAP_H
#include <byteswap.h>
#else
#define bswap_16(x) \
({ \
uint16_t __x = (x); \
((uint16_t)( \
(((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
(((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
})
#define bswap_32(x) \
({ \
uint32_t __x = (x); \
((uint32_t)( \
(((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
(((uint32_t)(__x) & (uint32_t)0x0000ff00UL) << 8) | \
(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
})
#define bswap_64(x) \
({ \
uint64_t __x = (x); \
((uint64_t)( \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
})
#endif
#include "bswap.h"
#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
#define BSWAP_NEEDED
...
...
@@ -68,44 +32,7 @@
/* XXX: autoconf */
#define TARGET_LONG_BITS 32
#if defined(__alpha__) || defined (__ia64__)
#define HOST_LONG_BITS 64
#else
#define HOST_LONG_BITS 32
#endif
#define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8)
#define HOST_LONG_SIZE (HOST_LONG_BITS / 8)
static
inline
uint16_t
bswap16
(
uint16_t
x
)
{
return
bswap_16
(
x
);
}
static
inline
uint32_t
bswap32
(
uint32_t
x
)
{
return
bswap_32
(
x
);
}
static
inline
uint64_t
bswap64
(
uint64_t
x
)
{
return
bswap_64
(
x
);
}
static
inline
void
bswap16s
(
uint16_t
*
s
)
{
*
s
=
bswap16
(
*
s
);
}
static
inline
void
bswap32s
(
uint32_t
*
s
)
{
*
s
=
bswap32
(
*
s
);
}
static
inline
void
bswap64s
(
uint64_t
*
s
)
{
*
s
=
bswap64
(
*
s
);
}
#ifdef BSWAP_NEEDED
...
...
vlmkcow.c
浏览文件 @
abcd5da7
...
...
@@ -38,12 +38,12 @@
#include <sys/poll.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include "vl.h"
#define NO_THUNK_TYPE_SIZE
#include "thunk.h"
#include "bswap.h"
int
cow_create
(
int
cow_fd
,
const
char
*
image_filename
,
int64_t
image_sectors
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录