On Mon, 10 Oct 2022, Segher Boessenkool wrote:
Hi!
On Sun, Oct 09, 2022 at 09:41:21PM +0200, BALATON Zoltan wrote:
On Sun, 25 Sep 2022, BALATON Zoltan wrote:
Define the r[bwl][!@] register access words as io[bwl][!@] for now. I'm not sure this is correct.
https://github.com/aik/SLOF/blob/master/slof/fs/fcode/evaluator.fs#L107 https://github.com/aik/SLOF/blob/master/slof/fs/fcode/tokens.fs#L19
(If these are FCode tokens I don't get when the big endian versions could be used as these should only be called from FCode so not sure this change of rokens is really necessary and we could just do little endian access in these register access words.)
And the user interface rb@ etc. should use get-token (or equivalent):
rb@ (user interface) ( addr -- byte ) Fetch a byte from device register at addr.
Compilation: ( -- ) Perform the equivalent of the phrase: h# 230 get-token if execute else compile, then
Interpretation: ( addr -- byte ) Perform the equivalent of the phrase: h# 230 get-token drop execute
NOTE— A bus device can substitute (see set-token) a bus-specific implementation of rb@ for use by its children. This is sometimes necessary to correctly implement its semantics with respect to bit-order and write-buffer flushing. The given user interface semantics of rb@ ensure that such substitutions are visible at the user interface level.
OK so what does all that mean? We could do what you say in openbios/forth/device/other.fs for r[bwl][!@] words. There are already rx[!@] words that seem to do that so I could just copy that with modified token numbers for the other words. But where to assign the tokens for PCI then? Or is it OK for now to just add little endian versions which should work for FCode ROMs and nothing else uses these words otherwise as they are currently unimplemented.
Regards, BALATON Zoltan