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: Matt Ihlenfield
Subject: Re: [Patch] Added a JFFS2 pickle
Date: Mon, 08 Mar 2021 19:57:42 +0000

Hi Jose,

>> +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.

>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

Thanks!

Matt Ihlenfield





reply via email to

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