Changeset f817d3a in mainline for kernel/arch/ppc32/src/drivers/cuda.c
- Timestamp:
- 2009-01-29T17:24:35Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 43d6401
- Parents:
- 26c67a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/drivers/cuda.c
r26c67a8 rf817d3a 237 237 int cuda_get_scancode(void) 238 238 { 239 uint8_t kind; 240 uint8_t data[4]; 241 242 receive_packet(&kind, 4, data); 243 244 if ((kind == PACKET_ADB) && (data[0] == 0x40) && (data[1] == 0x2c)) 245 return data[2]; 239 if (cuda) { 240 uint8_t kind; 241 uint8_t data[4]; 242 243 receive_packet(&kind, 4, data); 244 245 if ((kind == PACKET_ADB) && (data[0] == 0x40) && (data[1] == 0x2c)) 246 return data[2]; 247 } 246 248 247 249 return -1; … … 272 274 void cuda_grab(void) 273 275 { 274 ipl_t ipl = interrupts_disable(); 275 spinlock_lock(&cuda_irq.lock); 276 cuda_irq.notif_cfg.notify = false; 277 spinlock_unlock(&cuda_irq.lock); 278 interrupts_restore(ipl); 276 if (cuda) { 277 ipl_t ipl = interrupts_disable(); 278 spinlock_lock(&cuda_irq.lock); 279 cuda_irq.notif_cfg.notify = false; 280 spinlock_unlock(&cuda_irq.lock); 281 interrupts_restore(ipl); 282 } 279 283 } 280 284 … … 283 287 void cuda_release(void) 284 288 { 285 ipl_t ipl = interrupts_disable(); 286 spinlock_lock(&cuda_irq.lock); 287 if (cuda_irq.notif_cfg.answerbox) 288 cuda_irq.notif_cfg.notify = true; 289 spinlock_unlock(&cuda_irq.unlock); 290 interrupts_restore(ipl); 289 if (cuda) { 290 ipl_t ipl = interrupts_disable(); 291 spinlock_lock(&cuda_irq.lock); 292 if (cuda_irq.notif_cfg.answerbox) 293 cuda_irq.notif_cfg.notify = true; 294 spinlock_unlock(&cuda_irq.unlock); 295 interrupts_restore(ipl); 296 } 291 297 } 292 298 … … 294 300 void cuda_init(devno_t devno, uintptr_t base, size_t size) 295 301 { 296 cuda = (uint8_t *) hw_map(base, size); 302 cuda = (uint8_t *) hw_map(base, size); 297 303 298 304 chardev_initialize("cuda_kbd", &kbrd, &ops); … … 307 313 308 314 pic_enable_interrupt(CUDA_IRQ); 309 315 310 316 sysinfo_set_item_val("kbd", NULL, true); 311 317 sysinfo_set_item_val("kbd.devno", NULL, devno); … … 346 352 347 353 void arch_reboot(void) { 348 send_packet(PACKET_CUDA, 1, CUDA_RESET); 354 if (cuda) 355 send_packet(PACKET_CUDA, 1, CUDA_RESET); 356 349 357 asm volatile ( 350 358 "b 0\n"
Note:
See TracChangeset
for help on using the changeset viewer.