| 337 | } |
| 338 | |
| 339 | void rt_floppy_init(void) |
| 340 | { |
| 341 | struct rt_device *device; |
| 342 | |
| 343 | rt_mutex_init(&lock,"fdlock", RT_IPC_FLAG_PRIO); |
| 344 | rt_sem_init(&sem, "fdsem", 0, RT_IPC_FLAG_FIFO); |
| 345 | |
| 346 | rt_hw_interrupt_install(FLOPPY_IRQ, rt_floppy_isr, RT_NULL, "floppy"); |
| 347 | rt_hw_interrupt_umask(FLOPPY_IRQ); |
| 348 | |
| 349 | floppy_get_info(); |
| 350 | rt_kprintf("Floppy Inc : %s Floppy Type : %s\n",floppy_inc_name,floppy_type); |
| 351 | |
| 352 | device = &(devF); |
| 353 | |
| 354 | device->type = RT_Device_Class_Block; |
| 355 | device->init = rt_floppy_init_internal; |
| 356 | device->open = rt_floppy_open; |
| 357 | device->close = rt_floppy_close; |
| 358 | device->read = rt_floppy_read; |
| 359 | device->write = rt_floppy_write; |
| 360 | device->control = rt_floppy_control; |
| 361 | device->user_data = RT_NULL; |
| 362 | |
| 363 | rt_device_register(device, "floppy", |
| 364 | RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_REMOVABLE | RT_DEVICE_FLAG_STANDALONE); |
| 365 | |
| 366 | } |
no test coverage detected