qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 02/12 v9] linux-user: tilegx: Add target feature


From: Chen Gang
Subject: Re: [Qemu-devel] [PATCH 02/12 v9] linux-user: tilegx: Add target features support within qemu
Date: Sat, 11 Apr 2015 04:41:31 +0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 4/10/15 05:31, Peter Maydell wrote:
> On 27 March 2015 at 10:49, Chen Gang <address@hidden> wrote:
[...]
>> +static inline void cpu_clone_regs(CPUTLGState *env, target_ulong newsp)
>> +{
>> +    if (newsp) {
>> +        env->regs[TILEGX_R_SP] = newsp;
>> +    }
>> +    env->regs[TILEGX_R_RE] = 0;
> 
> This is slightly confusing, because the kernel code we're matching here
> doesn't call this register RE, it just uses 0:
>         childregs->regs[0] = 0;         /* return value is zero */
> 

TILEGX_R_RE is just 0, I define a macro instead the hardcode number in
cpu.h with the comment for it.

[...]
>> +
>> +/* this struct defines a stack used during syscall handling */
>> +
>> +typedef struct target_sigaltstack {
>> +    abi_ulong ss_sp;
>> +    abi_ulong ss_size;
>> +    abi_long ss_flags;
>> +} target_stack_t;
> 
> Where does this come from? It doesn't match the kernel's
> generic-headers struct layout.
> 

Oh, sorry, originally, I guess, I only copied it from microblaze, did
not check kernel.

I shall use generic-headers which tilegx will use (the result will like
alpha has done):

typedef struct target_sigaltstack {
    abi_ulong ss_sp;
    int32_t ss_flags;
    int32_t dummy;
    abi_ulong ss_size;
} target_stack_t;


[...]
>> +
>> +struct target_ipc_perm {
>> +    abi_int __key;                      /* Key.  */
>> +    abi_uint uid;                       /* Owner's user ID.  */
>> +    abi_uint gid;                       /* Owner's group ID.  */
>> +    abi_uint cuid;                      /* Creator's user ID.  */
>> +    abi_uint cgid;                      /* Creator's group ID.  */
>> +    abi_uint mode;                    /* Read/write permission.  */
>> +    abi_ushort __seq;                   /* Sequence number.  */
>> +    abi_ushort __pad2;
>> +    abi_ulong __unused1;
>> +    abi_ulong __unused2;
>> +};
> 
> Again, doesn't seem to match kernel?
> 

For me, it matches kernel. mode is abi_uint (__kernel_mode_t is 32-bit).


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed



reply via email to

[Prev in Thread] Current Thread [Next in Thread]