Mark Cave-Ayland wrote:
On 15/08/11 15:28, Bob Breuer wrote:
Add an implementation of sbus-intr>cpu for sun4m to map sbus interrupt levels (1 to 7) into cpu interrupts, and make use of it for bpp. Assumes false is the same as -1.
Signed-off-by: Bob Breuerbreuerr@mc.net
Unfortunately I have no way of testing what the output should be for any given input for this function, but to my untrained eye the general patch style/location look fine. The only thing I'd like to see is a stack diagram for the sun4m-sbus-intr>cpu word at which point if no-one else objects then I'm happy to commit.
Ah, I forgot a pointer to something resembling documentation. I used the Linux source file arch/sparc/kernel/sun4m_irq.c. To get the resulting value for intr, the low 4 bits are the PIL, and the upper 4 bits correspond to 0x30 for SBUS.
If someone could show how this C snippet might translate into forth: static const uint8_t map[7] = { 0x32, ... }; return map[sbus_level]; then I could just do an array lookup in sun4m-sbus-intr>cpu to make the mapping more obvious.
Bob