提交 cbf239b7 编写于 作者: A Alvise Rigo 提交者: Edgar E. Iglesias

target-arm: sort TCG cpreg list by KVM-style 64 bit ID number

Both KVM and TCG populate the cpreg_list with 64 bit register IDs,
but in the TCG side the cpreg_list is sorted using the 32 bit ID
version while in the kvm side the 64 bit ID version is used.  This
patch makes the sorting of the cpreg_list consistent between KVM and
TCG.
Signed-off-by: NAlvise Rigo <a.rigo@virtualopensystems.com>
Message-id: 1381513125-26802-1-git-send-email-a.rigo@virtualopensystems.com
[PMM: fixed indent, coding style and commit message formatting]
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
上级 8641136c
......@@ -225,10 +225,16 @@ static void count_cpreg(gpointer key, gpointer opaque)
static gint cpreg_key_compare(gconstpointer a, gconstpointer b)
{
uint32_t aidx = *(uint32_t *)a;
uint32_t bidx = *(uint32_t *)b;
uint64_t aidx = cpreg_to_kvm_id(*(uint32_t *)a);
uint64_t bidx = cpreg_to_kvm_id(*(uint32_t *)b);
return aidx - bidx;
if (aidx > bidx) {
return 1;
}
if (aidx < bidx) {
return -1;
}
return 0;
}
static void cpreg_make_keylist(gpointer key, gpointer value, gpointer udata)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册