Source-Changes-D archive

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

Re: CVS commit: src/sys/arch/atari/stand/installboot



   Date: Mon, 17 Nov 2014 01:37:37 +0900
   From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>

   > Changing `*(uint16_t *)p = v' to `memcpy(p, &v, 2)' doesn't change any
   > of that.

   The formar can be easily changed
    *(uint16_t *)p = htobe16(v);
   but the latter can't. You might be able to use functions like
   host16enc and target16enc for streaming data, but the target
   cksum is not stream but just calculated in uint16_t.

So write this?

	host16enc(bb->bb_xxboot + 510, 0);
	host16enc(bb->bb_xxboot + 510, 0x1234 - abcksum(bb->bb_xxboot));

I don't see the problem.


Home | Main Index | Thread Index | Old Index