via-cuda.c (fe73b582f179354e233e5deddbd274efe8d3bbb9) via-cuda.c (cfbf99801bcaf8398492ebc16af72259ad7aa146)
1/*
2 * Device driver for the via-cuda on Apple Powermacs.
3 *
4 * The VIA (versatile interface adapter) interfaces to the CUDA,
5 * a 6805 microprocessor core which controls the ADB (Apple Desktop
6 * Bus) which connects to the keyboard and mouse. The CUDA also
7 * controls system power and the RTC (real time clock) chip.
8 *

--- 578 unchanged lines hidden (view full) ---

587 } else {
588 /* leave just the command and result bytes in the reply */
589 req->reply_len -= 2;
590 memmove(req->reply, req->reply + 2, req->reply_len);
591 }
592 }
593 current_req = req->next;
594 complete = 1;
1/*
2 * Device driver for the via-cuda on Apple Powermacs.
3 *
4 * The VIA (versatile interface adapter) interfaces to the CUDA,
5 * a 6805 microprocessor core which controls the ADB (Apple Desktop
6 * Bus) which connects to the keyboard and mouse. The CUDA also
7 * controls system power and the RTC (real time clock) chip.
8 *

--- 578 unchanged lines hidden (view full) ---

587 } else {
588 /* leave just the command and result bytes in the reply */
589 req->reply_len -= 2;
590 memmove(req->reply, req->reply + 2, req->reply_len);
591 }
592 }
593 current_req = req->next;
594 complete = 1;
595 reading_reply = 0;
595 } else {
596 /* This is tricky. We must break the spinlock to call
597 * cuda_input. However, doing so means we might get
598 * re-entered from another CPU getting an interrupt
599 * or calling cuda_poll(). I ended up using the stack
600 * (it's only for 16 bytes) and moving the actual
601 * call to cuda_input to outside of the lock.
602 */
603 ibuf_len = reply_ptr - cuda_rbuf;
604 memcpy(ibuf, cuda_rbuf, ibuf_len);
605 }
596 } else {
597 /* This is tricky. We must break the spinlock to call
598 * cuda_input. However, doing so means we might get
599 * re-entered from another CPU getting an interrupt
600 * or calling cuda_poll(). I ended up using the stack
601 * (it's only for 16 bytes) and moving the actual
602 * call to cuda_input to outside of the lock.
603 */
604 ibuf_len = reply_ptr - cuda_rbuf;
605 memcpy(ibuf, cuda_rbuf, ibuf_len);
606 }
607 reply_ptr = cuda_rbuf;
606 if (TREQ_asserted(status)) {
607 assert_TIP();
608 cuda_state = reading;
608 if (TREQ_asserted(status)) {
609 assert_TIP();
610 cuda_state = reading;
609 reply_ptr = cuda_rbuf;
610 reading_reply = 0;
611 } else {
612 cuda_state = idle;
613 cuda_start();
614 }
615 break;
616
617 default:
618 pr_err("cuda_interrupt: unknown cuda_state %d?\n", cuda_state);

--- 41 unchanged lines hidden ---
611 } else {
612 cuda_state = idle;
613 cuda_start();
614 }
615 break;
616
617 default:
618 pr_err("cuda_interrupt: unknown cuda_state %d?\n", cuda_state);

--- 41 unchanged lines hidden ---