236,6 → 236,7 |
|
int cuda_get_scancode(void) |
{ |
if (cuda) { |
uint8_t kind; |
uint8_t data[4]; |
|
243,6 → 244,7 |
|
if ((kind == PACKET_ADB) && (data[0] == 0x40) && (data[1] == 0x2c)) |
return data[2]; |
} |
|
return -1; |
} |
271,6 → 273,7 |
/** Initialize keyboard and service interrupts using kernel routine */ |
void cuda_grab(void) |
{ |
if (cuda) { |
ipl_t ipl = interrupts_disable(); |
spinlock_lock(&cuda_irq.lock); |
cuda_irq.notif_cfg.notify = false; |
277,11 → 280,13 |
spinlock_unlock(&cuda_irq.lock); |
interrupts_restore(ipl); |
} |
} |
|
|
/** Resume the former interrupt vector */ |
void cuda_release(void) |
{ |
if (cuda) { |
ipl_t ipl = interrupts_disable(); |
spinlock_lock(&cuda_irq.lock); |
if (cuda_irq.notif_cfg.answerbox) |
289,6 → 294,7 |
spinlock_unlock(&cuda_irq.unlock); |
interrupts_restore(ipl); |
} |
} |
|
|
void cuda_init(devno_t devno, uintptr_t base, size_t size) |
345,7 → 351,9 |
} |
|
void arch_reboot(void) { |
if (cuda) |
send_packet(PACKET_CUDA, 1, CUDA_RESET); |
|
asm volatile ( |
"b 0\n" |
); |