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/cddl/compat/opensolaris/sys/dkio.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  * CDDL HEADER START
    3  *
    4  * The contents of this file are subject to the terms of the
    5  * Common Development and Distribution License (the "License").
    6  * You may not use this file except in compliance with the License.
    7  *
    8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
    9  * or http://www.opensolaris.org/os/licensing.
   10  * See the License for the specific language governing permissions
   11  * and limitations under the License.
   12  *
   13  * When distributing Covered Code, include this CDDL HEADER in each
   14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
   15  * If applicable, add the following below this CDDL HEADER, with the
   16  * fields enclosed by brackets "[]" replaced with your own identifying
   17  * information: Portions Copyright [yyyy] [name of copyright owner]
   18  *
   19  * CDDL HEADER END
   20  *
   21  * $FreeBSD$
   22  */
   23 /*
   24  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
   25  * Use is subject to license terms.
   26  */
   27 
   28 #ifndef _OPENSOLARIS_SYS_DKIO_H_
   29 #define _OPENSOLARIS_SYS_DKIO_H_
   30 
   31 #ifdef  __cplusplus
   32 extern "C" {
   33 #endif
   34 
   35 /*
   36  * Disk io control commands
   37  * Warning: some other ioctls with the DIOC prefix exist elsewhere.
   38  * The Generic DKIOC numbers are from   0   -  50.
   39  *      The Floppy Driver uses          51  - 100.
   40  *      The Hard Disk (except SCSI)     101 - 106.      (these are obsolete)
   41  *      The CDROM Driver                151 - 200.
   42  *      The USCSI ioctl                 201 - 250.
   43  */
   44 #define DKIOC           (0x04 << 8)
   45 
   46 /*
   47  * The following ioctls are generic in nature and need to be
   48  * suported as appropriate by all disk drivers
   49  */
   50 #define DKIOCGGEOM      (DKIOC|1)               /* Get geometry */
   51 #define DKIOCINFO       (DKIOC|3)               /* Get info */
   52 #define DKIOCEJECT      (DKIOC|6)               /* Generic 'eject' */
   53 #define DKIOCGVTOC      (DKIOC|11)              /* Get VTOC */
   54 #define DKIOCSVTOC      (DKIOC|12)              /* Set VTOC & Write to Disk */
   55 
   56 /*
   57  * Disk Cache Controls.  These ioctls should be supported by
   58  * all disk drivers.
   59  *
   60  * DKIOCFLUSHWRITECACHE when used from user-mode ignores the ioctl
   61  * argument, but it should be passed as NULL to allow for future
   62  * reinterpretation.  From user-mode, this ioctl request is synchronous.
   63  *
   64  * When invoked from within the kernel, the arg can be NULL to indicate
   65  * a synchronous request or can be the address of a struct dk_callback
   66  * to request an asynchronous callback when the flush request is complete.
   67  * In this case, the flag to the ioctl must include FKIOCTL and the
   68  * dkc_callback field of the pointed to struct must be non-null or the
   69  * request is made synchronously.
   70  *
   71  * In the callback case: if the ioctl returns 0, a callback WILL be performed.
   72  * If the ioctl returns non-zero, a callback will NOT be performed.
   73  * NOTE: In some cases, the callback may be done BEFORE the ioctl call
   74  * returns.  The caller's locking strategy should be prepared for this case.
   75  */
   76 #define DKIOCFLUSHWRITECACHE    (DKIOC|34)      /* flush cache to phys medium */
   77 
   78 struct dk_callback {
   79         void (*dkc_callback)(void *dkc_cookie, int error);
   80         void *dkc_cookie;
   81 };
   82 
   83 #ifdef  __cplusplus
   84 }
   85 #endif
   86 
   87 #endif /* _OPENSOLARIS_SYS_DKIO_H_ */

Cache object: 0b8e0ccc2dcd6cddc880f4171b1c49c3


[ 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.