On 25/10/2019 11:28, Segher Boessenkool wrote:
On Fri, Oct 25, 2019 at 08:42:13AM +0100, Mark Cave-Ayland wrote:
On 20/10/2019 13:22, Mark Cave-Ayland wrote:
On 18/10/2019 17:23, Segher Boessenkool wrote: unsigned char keyboard_readdata(void) { volatile unsigned char ch;
while (!keyboard_dataready()) { } do { ch = kbd_dev[2] & 0xff; if (ch == 99) shiftstate |= 1; else if (ch == 110) shiftstate |= 2; else if (ch == 227) shiftstate &= ~1; else if (ch == 238) shiftstate &= ~2; //printk("getch: %d\n", ch); } // If release, wait for key press while ((ch & 0x80) == 0x80 || ch == 238 || ch == 227); //printk("getch rel: %d\n", ch); ch &= 0x7f; if (shiftstate) ch = sunkbd_keycode_shifted[ch]; else ch = sunkbd_keycode[ch]; //printk("getch xlate: %d\n", ch); return ch;
}
I don't see how this would loop, given that kbd_dev is a pointer to volatile.
Any further comments? I'd like to get these last couple of patchsets applied fairly soon since it's QEMU freeze starting next week.
I'd use your workaround then? But something else is going on, it would be good to figure out what.
Okay I've gone with this approach for now, probably one to dig into when I have a bit more time. Applied to master.
ATB,
Mark.