poke-devel
[Top][All Lists]
Advanced

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

Re: [Patch] Added a JFFS2 pickle


From: Jose E. Marchesi
Subject: Re: [Patch] Added a JFFS2 pickle
Date: Mon, 08 Mar 2021 21:04:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> +type JFFS2_Summary =
>>> +struct
>>> +{
>>> +    uint<16> magic : magic in [JFFS2_MAGIC, JFFS2_MAGIC_OLD];
>>> +    uint<16> node_type = JFFS2_NODETYPE_SUMMARY;
>>> +    offset<uint<32>, B> total_len : total_len >= JFFS2_HEADER_SIZE;
>>> +    uint<32> node_header_crc;
>>> +    uint<32> sum_num;
>>> +    uint<32> cln_mkr;
>>> +    uint<32> padded;
>>> +    uint<32> sum_crc;
>>> +    uint<32> node_crc;
>>> +
>>> +    var rel_records_offset = OFFSET;
>>> +    byte[0] records;
>>> +
>>> +    // records end + padding
>>> +    byte[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
>>> +
>>> +    method get_records = JFFS2_Sum_Rec[]:
>>> +    {
>>> +        return JFFS2_Sum_Rec[sum_num] @ records'offset;
>>> +    }
>>> +
>>> +    method get_records_offset = uoff64:
>>> +    {
>>> +        return rel_records_offset;
>>> +    }
>>> +
>>> +};
>>
>>I don't think you need to have a `byte[0] records' field there.  You can
>>use rel_records_offset instead of records'offset in `get_records'.
>
> I'm a little confused. The map operator in the `get_records` function would
> expect a global offset wouldn't it? rel_records_offset would be a relative
> offset.

Yes you are right.

It is in the TODO to allow doing something like SELF'offset (i.e. to
reference explicitly the object in methods) and then this idiom wont be
necessary anymore.

>>If you create an account in savannah.gnu.org and let me know the
>>username I will add you to the `poke' project so you can commit and push
>>your patch yourself.
>
> Just made one: mtihlenfield

I have added you to the project.
Now you should have write access to the git repository.

Provided you add a ChangeLog entry, this patch is OK for master.

You can also add yourself to AUTHORS in a separated commit, also in
master.

Welcome on board Matt! :)



reply via email to

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