On 12/03/2023 15:23, BALATON Zoltan wrote:
On Sat, 11 Mar 2023, Mark Cave-Ayland wrote:
According to structures.fs the fields in struct instance are cell size which is 4 bytes on 32-bit systems and 8 bytes on 64-bit systems.
my-unit incorrectly assumes that the fields are always "l" (4 byte) size which causes it to return the wrong value on SPARC64. Fix the issue by updating my-unit to use the cell size to calculate its offsets.
This and the previous patch doing the same look good to me but I don't know enough about it to give a reviewed-by. That would be better done by somebody who knows Forth well. So this message does not help much I guess.
Regards, BALATON Zoltan
The change here is to reflect that the device node (phandle) structure in forth/device/structures.fs is defined in terms of cells (/n) rather than 4-byte units (/l), which isn't correct for 64-bit systems which use 8-byte cells.
Certainly more Forth reviews would be welcome, however it's quite straightforward in this case to validate that my-space, my-address and my-unit are now working as documented for the PCI devices.
ATB,
Mark.