<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Ubixos: diskslice.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<h1>diskslice.h</h1><div class="fragment"><pre>00001 <span class="comment">/*-</span>
00002 <span class="comment"> * Copyright (c) 1994 Bruce D. Evans.</span>
00003 <span class="comment"> * All rights reserved.</span>
00004 <span class="comment"> *</span>
00005 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
00006 <span class="comment"> * modification, are permitted provided that the following conditions</span>
00007 <span class="comment"> * are met:</span>
00008 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
00009 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
00010 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
00011 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
00012 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
00013 <span class="comment"> *</span>
00014 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span>
00015 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
00016 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
00017 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span>
00018 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
00019 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
00020 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
00021 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
00022 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
00023 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
00024 <span class="comment"> * SUCH DAMAGE.</span>
00025 <span class="comment"> *</span>
00026 <span class="comment"> * $FreeBSD: src/sys/sys/diskslice.h,v 1.36.2.1 2001/01/29 01:50:50 ken Exp $</span>
00027 <span class="comment"> */</span>
00028
00029 <span class="preprocessor">#ifndef _SYS_DISKSLICE_H_</span>
00030 <span class="preprocessor"></span><span class="preprocessor">#define _SYS_DISKSLICE_H_</span>
00031 <span class="preprocessor"></span>
00032 <span class="preprocessor">#ifndef _KERNEL</span>
00033 <span class="preprocessor"></span><span class="preprocessor">#include <sys/types.h></span>
00034 <span class="preprocessor">#endif</span>
00035 <span class="preprocessor"></span><span class="preprocessor">#include <sys/ioccom.h></span>
00036
00037 <span class="preprocessor">#define BASE_SLICE 2</span>
00038 <span class="preprocessor"></span><span class="preprocessor">#define COMPATIBILITY_SLICE 0</span>
00039 <span class="preprocessor"></span><span class="preprocessor">#define DIOCGSLICEINFO _IOR('d', 111, struct diskslices)</span>
00040 <span class="preprocessor"></span><span class="preprocessor">#define DIOCSYNCSLICEINFO _IOW('d', 112, int)</span>
00041 <span class="preprocessor"></span><span class="preprocessor">#define MAX_SLICES 32</span>
00042 <span class="preprocessor"></span><span class="preprocessor">#define WHOLE_DISK_SLICE 1</span>
00043 <span class="preprocessor"></span>
00044 <span class="keyword">struct </span>diskslice {
00045 u_long ds_offset; <span class="comment">/* starting sector */</span>
00046 u_long ds_size; <span class="comment">/* number of sectors */</span>
00047 <span class="keywordtype">int</span> ds_type; <span class="comment">/* (foreign) slice type */</span>
00048 <span class="preprocessor">#ifdef PC98</span>
00049 <span class="preprocessor"></span> <span class="keywordtype">int</span> ds_subtype; <span class="comment">/* sub slice type */</span>
00050 u_char ds_name[16]; <span class="comment">/* slice name */</span>
00051 <span class="preprocessor">#endif</span>
00052 <span class="preprocessor"></span> <span class="keyword">struct </span>disklabel *ds_label; <span class="comment">/* BSD label, if any */</span>
00053 <span class="keywordtype">void</span> *ds_dev; <span class="comment">/* devfs token for raw whole slice */</span>
00054 <span class="preprocessor">#ifdef MAXPARTITIONS </span><span class="comment">/* XXX don't depend on disklabel.h */</span>
00055 <span class="preprocessor">#if MAXPARTITIONS != 8 </span><span class="comment">/* but check consistency if possible */</span>
00056 <span class="preprocessor">#error "inconsistent MAXPARTITIONS"</span>
00057 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
00058 <span class="preprocessor"></span><span class="preprocessor">#else</span>
00059 <span class="preprocessor"></span><span class="preprocessor">#define MAXPARTITIONS 8</span>
00060 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
00061 <span class="preprocessor"></span> <span class="keywordtype">void</span> *ds_devs[MAXPARTITIONS]; <span class="comment">/* XXX s.b. in label */</span>
00062 u_char ds_openmask; <span class="comment">/* devs open */</span>
00063 u_char ds_wlabel; <span class="comment">/* nonzero if label is writable */</span>
00064 };
00065
00066 <span class="keyword">struct </span>diskslices {
00067 <span class="keyword">struct </span>cdevsw *dss_cdevsw; <span class="comment">/* for containing device */</span>
00068 <span class="keywordtype">int</span> dss_first_bsd_slice; <span class="comment">/* COMPATIBILITY_SLICE is mapped here */</span>
00069 u_int dss_nslices; <span class="comment">/* actual dimension of dss_slices[] */</span>
00070 u_int dss_oflags; <span class="comment">/* copy of flags for "first" open */</span>
00071 <span class="keywordtype">int</span> dss_secmult; <span class="comment">/* block to sector multiplier */</span>
00072 <span class="keywordtype">int</span> dss_secshift; <span class="comment">/* block to sector shift (or -1) */</span>
00073 <span class="keywordtype">int</span> dss_secsize; <span class="comment">/* sector size */</span>
00074 <span class="keyword">struct </span>diskslice
00075 dss_slices[MAX_SLICES]; <span class="comment">/* actually usually less */</span>
00076 };
00077
00078 <span class="preprocessor">#ifdef _KERNEL</span>
00079 <span class="preprocessor"></span>
00080 <span class="comment">/* Flags for dsopen(). */</span>
00081 <span class="preprocessor">#define DSO_NOLABELS 1</span>
00082 <span class="preprocessor"></span><span class="preprocessor">#define DSO_ONESLICE 2</span>
00083 <span class="preprocessor"></span><span class="preprocessor">#define DSO_COMPATLABEL 4</span>
00084 <span class="preprocessor"></span>
00085 <span class="preprocessor">#define dsgetlabel(dev, ssp) (ssp->dss_slices[dkslice(dev)].ds_label)</span>
00086 <span class="preprocessor"></span>
00087 <span class="keyword">struct </span>buf;
00088 <span class="keyword">struct </span>disklabel;
00089
00090 <span class="keywordtype">int</span> dscheck __P((<span class="keyword">struct</span> buf *bp, <span class="keyword">struct</span> diskslices *ssp));
00091 <span class="keywordtype">void</span> dsclose __P((dev_t dev, <span class="keywordtype">int</span> mode, <span class="keyword">struct</span> diskslices *ssp));
00092 <span class="keywordtype">void</span> dsgone __P((<span class="keyword">struct</span> diskslices **sspp));
00093 <span class="keywordtype">int</span> dsinit __P((dev_t dev, <span class="keyword">struct</span> disklabel *lp,
00094 <span class="keyword">struct</span> diskslices **sspp));
00095 <span class="keywordtype">int</span> dsioctl __P((dev_t dev, u_long cmd, caddr_t data,
00096 <span class="keywordtype">int</span> flags, <span class="keyword">struct</span> diskslices **sspp));
00097 <span class="keywordtype">int</span> dsisopen __P((<span class="keyword">struct</span> diskslices *ssp));
00098 <span class="keyword">struct </span>diskslices *dsmakeslicestruct __P((<span class="keywordtype">int</span> nslices, <span class="keyword">struct</span> disklabel *lp));
00099 <span class="keywordtype">char</span> *dsname __P((dev_t dev, <span class="keywordtype">int</span> unit, <span class="keywordtype">int</span> slice, <span class="keywordtype">int</span> part,
00100 <span class="keywordtype">char</span> *partname));
00101 <span class="keywordtype">int</span> dsopen __P((dev_t dev, <span class="keywordtype">int</span> mode, u_int flags,
00102 <span class="keyword">struct</span> diskslices **sspp, <span class="keyword">struct</span> disklabel *lp));
00103 <span class="keywordtype">int</span> dssize __P((dev_t dev, <span class="keyword">struct</span> diskslices **sspp));
00104
00105 <span class="preprocessor">#endif </span><span class="comment">/* _KERNEL */</span>
00106
00107 <span class="preprocessor">#endif </span><span class="comment">/* !_SYS_DISKSLICE_H_ */</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Apr 28 17:49:33 2004 for Ubixos by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>