On 4/10/15 05:31, Peter Maydell wrote:
> On 27 March 2015 at 10:49, Chen Gang <xili_gchen_5...@hotmail.com> 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