[PATCH V3 2/5] Add tools for reading and writing from splitblock table

Atsushi Kumagai kumagai-atsushi at mxc.nes.nec.co.jp
Wed Nov 5 20:20:01 PST 2014


>On 11/05/2014 12:18 PM, Atsushi Kumagai wrote:
>>> +unsigned long long
>>> >+read_from_splitblock_table(char *entry)
>>> >+{
>>> >+	unsigned long long value = 0;
>>> >+	int i;
>>> >+
>>> >+	for (i = splitblock->entry_size; i>  0; i--) {
>>> >+		value = value<<  BITPERBYTE;
>>> >+		value += *(entry + i - 1)&  0xff;
>>> >+	}
>> Did you forget to reflect the HATAYAMA-san's comment ?
>>
>
>I think it is needed.
>For example:
>	if *(entry + i - 1) == 0xfa
>	without & 0xff:
>		it will turn to: value += 0xfffffffffffffffa
>	with & 0xff:
>		it will be: value += 0xfffffffffffffffa & 0xff

Ah, I see, you meant "sign extension".
OK, I understand.


Thanks,
Atsushi Kumagai

>
>Thanks
>Zhou Wenjian


More information about the kexec mailing list