The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/disk.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * ----------------------------------------------------------------------------
    3  * "THE BEER-WARE LICENSE" (Revision 42):
    4  * <phk@FreeBSD.ORG> wrote this file.  As long as you retain this notice you
    5  * can do whatever you want with this stuff. If we meet some day, and you think
    6  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
    7  * ----------------------------------------------------------------------------
    8  *
    9  * $FreeBSD: releng/5.0/sys/sys/disk.h 103714 2002-09-20 19:36:05Z phk $
   10  *
   11  */
   12 
   13 #ifndef _SYS_DISK_H_
   14 #define _SYS_DISK_H_
   15 
   16 #include <sys/ioccom.h>
   17 
   18 #ifdef _KERNEL
   19 
   20 #include <sys/queue.h>
   21 
   22 struct disk {
   23         u_int                   d_flags;
   24         u_int                   d_dsflags;
   25         struct cdevsw           *d_devsw;
   26         dev_t                   d_dev;
   27 
   28         /* These four fields must be valid while opened */
   29         u_int                   d_sectorsize;
   30         off_t                   d_mediasize;
   31         u_int                   d_fwsectors;
   32         u_int                   d_fwheads;
   33 
   34         struct diskslices       *d_slice;
   35         struct disklabel        *d_label;
   36         LIST_ENTRY(disk)        d_list;
   37         void                    *d_softc;
   38 };
   39 
   40 #define DISKFLAG_LOCK           0x1
   41 #define DISKFLAG_WANTED         0x2
   42 
   43 dev_t disk_create(int unit, struct disk *disk, int flags, struct cdevsw *cdevsw, struct cdevsw *diskdevsw);
   44 void disk_destroy(dev_t dev);
   45 struct disk *disk_enumerate(struct disk *disk);
   46 void disk_err(struct bio *bp, const char *what, int blkdone, int nl);
   47 void disk_invalidate(struct disk *disk);
   48 
   49 #endif
   50 
   51 #define DIOCGSECTORSIZE _IOR('d', 128, u_int)
   52         /*-
   53          * Get the sectorsize of the device in bytes.  The sectorsize is the
   54          * smallest unit of data which can be transfered from this device.
   55          * Usually this is a power of two but it may not be. (ie: CDROM audio)
   56          */
   57 
   58 #define DIOCGMEDIASIZE  _IOR('d', 129, off_t)   /* Get media size in bytes */
   59         /*-
   60          * Get the size of the entire device in bytes.  This should be a
   61          * multiple of the sectorsize.
   62          */
   63 
   64 #define DIOCGFWSECTORS  _IOR('d', 130, u_int)   /* Get firmware sectorcount */
   65         /*-
   66          * Get the firmwares notion of number of sectors per track.  This
   67          * value is mostly used for compatibility with various ill designed
   68          * disk label formats.  Don't use it unless you have to.
   69          */
   70 
   71 #define DIOCGFWHEADS    _IOR('d', 131, u_int)   /* Get firmware headcount */
   72         /*-
   73          * Get the firmwares notion of number of heads per cylinder.  This
   74          * value is mostly used for compatibility with various ill designed
   75          * disk label formats.  Don't use it unless you have to.
   76          */
   77 
   78 #define DIOCSKERNELDUMP _IOW('d', 133, u_int)   /* Set/Clear kernel dumps */
   79         /*-
   80          * Enable/Disable (the argument is boolean) the device for kernel
   81          * core dumps.
   82          */
   83         
   84 #define DIOCGFRONTSTUFF _IOR('d', 134, off_t)
   85         /*-
   86          * Many disk formats have some amount of space reserved at the
   87          * start of the disk to hold bootblocks, various disklabels and
   88          * similar stuff.  This ioctl returns the number of such bytes
   89          * which may apply to the device.
   90          */
   91 
   92 #endif /* _SYS_DISK_H_ */

Cache object: d65394a6a385f458235993d3183eea76


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.