Main Page | Directories | File List | Globals

adi_block.c

Go to the documentation of this file.
00001 /*
00002  * kernel_drivers/adi_core/adi_block.c
00003  *
00004  * Copyright (c) 2003-2004 Lukasz Dembinski <dembol@nasa.com.pl>
00005  * All Rights Reserved
00006  * 
00007  * Date:        2004/09
00008  * Author:      Lukasz Dembinski
00009  * Info:        adi_block.c core file
00010  * Contact:     mailto: <dembol@nasa.com.pl>
00011  *
00012  */
00013 
00014 /* 
00015  * TODO
00016  */
00017 
00018 #include <agnix/agnix.h>
00019 #include <agnix/adi/adi.h>
00020 #include <agnix/list.h>
00021 #include <agnix/spinlock.h>
00022 #include <agnix/console.h>
00023 
00024 #define MOD_NAME        "BLK: "
00025 
00026 struct adi_blkdev_s     *blkdevs[BLKDEV_MAX];
00027 
00028 extern int adi_blkdrv_floppy_init(void);
00029 
00030 void adi_blkdev_lock_irq(struct adi_blkdev_s *blkdev)
00031 {
00032     adi_device_lock_irq(&blkdev->dev_lock);
00033 }
00034 
00035 void adi_blkdev_unlock_irq(struct adi_blkdev_s *blkdev)
00036 {
00037     adi_device_unlock_irq(&blkdev->dev_lock);
00038 }
00039 
00040 struct adi_blkdev_s *adi_get_blkdev(u16 blkdev_nr)
00041 {
00042     return blkdevs[blkdev_nr];
00043 }
00044 
00045 int adi_register_blkdev(struct adi_blkdev_s *blkdev)
00046 {
00047     blkdevs[blkdev->dev_nr] = blkdev;
00048 
00049     return 0;
00050 }
00051 
00052 int __init adi_blkdrv_init(void)
00053 {
00054     printk(MOD_NAME "Initializing block drivers\n");
00055 
00056     adi_blkdrv_floppy_init();
00057 
00058     return 0;
00059 }
Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix