[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support
From: |
Richard Henderson |
Subject: |
Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support |
Date: |
Wed, 24 Nov 2021 11:44:45 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
On 11/24/21 11:22 AM, gaosong wrote:
I see that kernel define the fcc used type uint64_t, and used movgr2cf/movcf2gr
save and restore the fcc0-fcc7.
but qemu define fcc0-fcc7 as bool cf[8] at target/loongarch/cpu.h, how qemu can
save/restore fcc, Do you have any idea?
Does we can define the fcc as bool cf[8] at struct target_sigcontext?
No, you need to leave the declaration the same.
To create the uint64_t, you do what the kernel does in sc_save_fcc: insert each bit into
the first bit of each byte.
static uint64_t read_all_fcc(CPULoongArchState *env)
{
uint64_t ret = 0;
for (int i = 0; i < 8; ++i) {
ret |= (uint64_t)env->cf[i] << (i * 8);
}
return ret;
}
And similarly from sc_restore_fcc:
static void write_all_fcc(CPULoongArchState *env, uint64_t val)
{
for (int i = 0; i < 8; ++i) {
env->cf[i] = (val >> (i * 8)) & 1;
}
}
Remembering that movcf2gr copies the least significant bit.
r~
- [PATCH v11 19/26] linux-user: Add LoongArch signal support, (continued)
- [PATCH v11 19/26] linux-user: Add LoongArch signal support, Song Gao, 2021/11/19
- Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support, Richard Henderson, 2021/11/20
- Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support, gaosong, 2021/11/23
- Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support, Richard Henderson, 2021/11/24
- Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support, gaosong, 2021/11/24
- Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support, Richard Henderson, 2021/11/24
- Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support, gaosong, 2021/11/24
- Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support,
Richard Henderson <=
- Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support, gaosong, 2021/11/24
- Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support, Richard Henderson, 2021/11/25
[PATCH v11 17/26] linux-user: Add LoongArch generic header files, Song Gao, 2021/11/19
[PATCH v11 16/26] target/loongarch: Add disassembler, Song Gao, 2021/11/19
[PATCH v11 22/26] linux-user: Add LoongArch cpu_loop support, Song Gao, 2021/11/19
[PATCH v11 24/26] target/loongarch: Add target build suport, Song Gao, 2021/11/19
[PATCH v11 25/26] target/loongarch: 'make check-tcg' support, Song Gao, 2021/11/19