\hypertarget{g__part__mbr_8c_source}{}\doxysection{g\+\_\+part\+\_\+mbr.\+c}
\label{g__part__mbr_8c_source}\index{geom/part/g\_part\_mbr.c@{geom/part/g\_part\_mbr.c}}
\mbox{\hyperlink{g__part__mbr_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2007, 2008 Marcel Moolenaar}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00011}00011 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00015}00015 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00017}00017 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00019}00019 \textcolor{comment}{ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00020}00020 \textcolor{comment}{ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00021}00021 \textcolor{comment}{ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00022}00022 \textcolor{comment}{ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00023}00023 \textcolor{comment}{ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00024}00024 \textcolor{comment}{ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00025}00025 \textcolor{comment}{ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00026}00026 \textcolor{comment}{ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00030}\mbox{\hyperlink{g__part__mbr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00030}} \mbox{\hyperlink{g__part__mbr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/diskmbr.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/kobj.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/limits.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/sbuf.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__int_8h}{geom/geom\_int.h}}>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__part_8h}{geom/part/g\_part.h}}>}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00050}00050 \textcolor{preprocessor}{\#include "{}g\_part\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00052}\mbox{\hyperlink{g__part__mbr_8c_a993f2266a0292ed6ad95f1eaaf48595b}{00052}} \mbox{\hyperlink{g__part__mbr_8c_a993f2266a0292ed6ad95f1eaaf48595b}{FEATURE}}(geom\_part\_mbr, \textcolor{stringliteral}{"{}GEOM partitioning class for MBR support"{}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00053}00053 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00054}\mbox{\hyperlink{g__part__mbr_8c_a638d255fa53eaf6141bcd1f25a9f083d}{00054}} \mbox{\hyperlink{g__part__mbr_8c_a638d255fa53eaf6141bcd1f25a9f083d}{SYSCTL\_DECL}}(\_kern\_geom\_part);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00055}\mbox{\hyperlink{g__part__mbr_8c_a58986a28ab12f4f9bc668422d13fc448}{00055}} \textcolor{keyword}{static} \mbox{\hyperlink{g__part__mbr_8c_a58986a28ab12f4f9bc668422d13fc448}{SYSCTL\_NODE}}(\_kern\_geom\_part, OID\_AUTO, mbr,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00056}00056     CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00057}00057     \textcolor{stringliteral}{"{}GEOM\_PART\_MBR Master Boot Record"{}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00059}\mbox{\hyperlink{g__part__mbr_8c_a7d80df7a8881a678e162ac8fcc929ab1}{00059}} \textcolor{keyword}{static} u\_int \mbox{\hyperlink{g__part__mbr_8c_a7d80df7a8881a678e162ac8fcc929ab1}{enforce\_chs}} = 0;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00060}\mbox{\hyperlink{g__part__mbr_8c_a3198ee196b878b16444bd057272a16bb}{00060}} \mbox{\hyperlink{g__part__mbr_8c_a3198ee196b878b16444bd057272a16bb}{SYSCTL\_UINT}}(\_kern\_geom\_part\_mbr, OID\_AUTO, \mbox{\hyperlink{g__part__mbr_8c_a7d80df7a8881a678e162ac8fcc929ab1}{enforce\_chs}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00061}00061     CTLFLAG\_RWTUN, \&\mbox{\hyperlink{g__part__mbr_8c_a7d80df7a8881a678e162ac8fcc929ab1}{enforce\_chs}}, 0, \textcolor{stringliteral}{"{}Enforce alignment to CHS addressing"{}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00063}\mbox{\hyperlink{g__part__mbr_8c_a9fd8eab9aea0687d57ca1fcc031b37f9}{00063}} \textcolor{preprocessor}{\#define MBRSIZE         512}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00065}\mbox{\hyperlink{structg__part__mbr__table}{00065}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00066}\mbox{\hyperlink{structg__part__mbr__table_a2b78793d781022969a8872f58dd5724e}{00066}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__table}{g\_part\_table}} \mbox{\hyperlink{structg__part__mbr__table_a2b78793d781022969a8872f58dd5724e}{base}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00067}\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{00067}}         u\_char          \mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}}[\mbox{\hyperlink{g__part__mbr_8c_a9fd8eab9aea0687d57ca1fcc031b37f9}{MBRSIZE}}];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00068}00068 \};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00070}\mbox{\hyperlink{structg__part__mbr__entry}{00070}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00071}\mbox{\hyperlink{structg__part__mbr__entry_a135d9624d3b9b015a1a11b5c93436a1f}{00071}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} \mbox{\hyperlink{structg__part__mbr__entry_a135d9624d3b9b015a1a11b5c93436a1f}{base}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00072}\mbox{\hyperlink{structg__part__mbr__entry_a01d1b1e3733c8b8ad43ff2d48eec1dc7}{00072}}         \textcolor{keyword}{struct }dos\_partition \mbox{\hyperlink{structg__part__mbr__entry_a01d1b1e3733c8b8ad43ff2d48eec1dc7}{ent}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00073}00073 \};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00075}00075 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a5fc175a8f9310c795e58305d7264247a}{g\_part\_mbr\_add}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00076}00076     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00077}00077 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a63585d8f2f193b5810fd1dee2fd049d5}{g\_part\_mbr\_bootcode}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00078}00078 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a428ce0502785f0c1df74198639743c6f}{g\_part\_mbr\_create}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00079}00079 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a82792c97f5e9e79cc7cc6fc6eebcb64f}{g\_part\_mbr\_destroy}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00080}00080 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{g__part__mbr_8c_ab8a4256adf356106e7af4922876206d8}{g\_part\_mbr\_dumpconf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00081}00081     \textcolor{keyword}{struct} sbuf *, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00082}00082 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a7acf640ecdc78c2cf8fb1063a0329af2}{g\_part\_mbr\_dumpto}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00083}00083 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a690a5f034fec11582bc0ce3a9c2e3166}{g\_part\_mbr\_modify}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00084}00084     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00085}00085 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__mbr_8c_ac071f62b693e991468b6606df2245268}{g\_part\_mbr\_name}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00086}00086     \textcolor{keywordtype}{char} *, \textcolor{keywordtype}{size\_t});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00087}00087 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_af44d7f040427a44e68dd5110d9a6207a}{g\_part\_mbr\_probe}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00088}00088 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a145f42dc5a24579f667ed9b482332121}{g\_part\_mbr\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00089}00089 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a9882d64680a9a7fd2f1f794e249e3703}{g\_part\_mbr\_setunset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00090}00090     \textcolor{keyword}{const} \textcolor{keywordtype}{char} *, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00091}00091 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__mbr_8c_ad055a72b94e98df8cbeada5dc4154c4f}{g\_part\_mbr\_type}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00092}00092     \textcolor{keywordtype}{char} *, \textcolor{keywordtype}{size\_t});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00093}00093 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a6903e3805be819c9ae577ca6d2b02d38}{g\_part\_mbr\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00094}00094 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__mbr_8c_a5dd6319f516243c8bd390b4bfdedff1d}{g\_part\_mbr\_resize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00095}00095     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00097}\mbox{\hyperlink{g__part__mbr_8c_a202b0eb56b48676436b9a011d1886d09}{00097}} \textcolor{keyword}{static} kobj\_method\_t \mbox{\hyperlink{g__part__mbr_8c_a202b0eb56b48676436b9a011d1886d09}{g\_part\_mbr\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00098}00098         KOBJMETHOD(g\_part\_add,          \mbox{\hyperlink{g__part__mbr_8c_a5fc175a8f9310c795e58305d7264247a}{g\_part\_mbr\_add}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00099}00099         KOBJMETHOD(g\_part\_bootcode,     \mbox{\hyperlink{g__part__mbr_8c_a63585d8f2f193b5810fd1dee2fd049d5}{g\_part\_mbr\_bootcode}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00100}00100         KOBJMETHOD(g\_part\_create,       \mbox{\hyperlink{g__part__mbr_8c_a428ce0502785f0c1df74198639743c6f}{g\_part\_mbr\_create}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00101}00101         KOBJMETHOD(g\_part\_destroy,      \mbox{\hyperlink{g__part__mbr_8c_a82792c97f5e9e79cc7cc6fc6eebcb64f}{g\_part\_mbr\_destroy}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00102}00102         KOBJMETHOD(\mbox{\hyperlink{g__part_8c_ab34acccc61d4eaae892030944206e9c2}{g\_part\_dumpconf}},      \mbox{\hyperlink{g__part__mbr_8c_ab8a4256adf356106e7af4922876206d8}{g\_part\_mbr\_dumpconf}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00103}00103         KOBJMETHOD(g\_part\_dumpto,       \mbox{\hyperlink{g__part__mbr_8c_a7acf640ecdc78c2cf8fb1063a0329af2}{g\_part\_mbr\_dumpto}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00104}00104         KOBJMETHOD(g\_part\_modify,       \mbox{\hyperlink{g__part__mbr_8c_a690a5f034fec11582bc0ce3a9c2e3166}{g\_part\_mbr\_modify}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00105}00105         KOBJMETHOD(\mbox{\hyperlink{g__part_8c_a8a5b9fa2481c947e1fa2486f11c77f17}{g\_part\_resize}},  \mbox{\hyperlink{g__part__mbr_8c_a5dd6319f516243c8bd390b4bfdedff1d}{g\_part\_mbr\_resize}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00106}00106         KOBJMETHOD(g\_part\_name,         \mbox{\hyperlink{g__part__mbr_8c_ac071f62b693e991468b6606df2245268}{g\_part\_mbr\_name}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00107}00107         KOBJMETHOD(\mbox{\hyperlink{g__part_8c_af9edeef8af7e4a9bbe5604ef2bcd1266}{g\_part\_probe}},    \mbox{\hyperlink{g__part__mbr_8c_af44d7f040427a44e68dd5110d9a6207a}{g\_part\_mbr\_probe}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00108}00108         KOBJMETHOD(g\_part\_read,         \mbox{\hyperlink{g__part__mbr_8c_a145f42dc5a24579f667ed9b482332121}{g\_part\_mbr\_read}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00109}00109         KOBJMETHOD(g\_part\_setunset,     \mbox{\hyperlink{g__part__mbr_8c_a9882d64680a9a7fd2f1f794e249e3703}{g\_part\_mbr\_setunset}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00110}00110         KOBJMETHOD(g\_part\_type,         \mbox{\hyperlink{g__part__mbr_8c_ad055a72b94e98df8cbeada5dc4154c4f}{g\_part\_mbr\_type}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00111}00111         KOBJMETHOD(g\_part\_write,        \mbox{\hyperlink{g__part__mbr_8c_a6903e3805be819c9ae577ca6d2b02d38}{g\_part\_mbr\_write}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00112}00112         \{ 0, 0 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00113}00113 \};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00115}\mbox{\hyperlink{g__part__mbr_8c_a870c4962033a3af1331119efc1e2f53e}{00115}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__scheme}{g\_part\_scheme}} \mbox{\hyperlink{g__part__mbr_8c_a870c4962033a3af1331119efc1e2f53e}{g\_part\_mbr\_scheme}} = \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00116}00116         \textcolor{stringliteral}{"{}MBR"{}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00117}00117         \mbox{\hyperlink{g__part__mbr_8c_a202b0eb56b48676436b9a011d1886d09}{g\_part\_mbr\_methods}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00118}00118         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00119}00119         .gps\_entrysz = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}}),}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00120}00120         .gps\_minent = NDOSPART,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00121}00121         .gps\_maxent = NDOSPART,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00122}00122         .gps\_bootcodesz = \mbox{\hyperlink{g__part__mbr_8c_a9fd8eab9aea0687d57ca1fcc031b37f9}{MBRSIZE}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00123}00123 \};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00124}\mbox{\hyperlink{g__part__mbr_8c_aeedb040bd6d1eb7dd67fd82f1504117a}{00124}} \mbox{\hyperlink{g__part__mbr_8c_aeedb040bd6d1eb7dd67fd82f1504117a}{G\_PART\_SCHEME\_DECLARE}}(g\_part\_mbr);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00125}\mbox{\hyperlink{g__part__mbr_8c_acb1c8389cb7b17870f11afd485742bdf}{00125}} \mbox{\hyperlink{g__part__mbr_8c_acb1c8389cb7b17870f11afd485742bdf}{MODULE\_VERSION}}(geom\_part\_mbr, 0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00127}\mbox{\hyperlink{structg__part__mbr__alias}{00127}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__alias}{g\_part\_mbr\_alias}} \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00128}\mbox{\hyperlink{structg__part__mbr__alias_a3406fb166e0660dcbb6e996886b89e48}{00128}}         u\_char          \mbox{\hyperlink{structg__part__mbr__alias_a3406fb166e0660dcbb6e996886b89e48}{typ}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00129}\mbox{\hyperlink{structg__part__mbr__alias_a351b2a5f0f11d7fe0a4931e0741b081d}{00129}}         \textcolor{keywordtype}{int}             \mbox{\hyperlink{structg__part__mbr__alias_a351b2a5f0f11d7fe0a4931e0741b081d}{alias}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00130}00130 \} \mbox{\hyperlink{g__part__mbr_8c_a57619afa79c6fd6c597aa57bcc904216}{mbr\_alias\_match}}[] = \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00131}00131         \{ DOSPTYP\_386BSD,       \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba5a1b6ef56ffb2ca63c6090c043c09434}{G\_PART\_ALIAS\_FREEBSD}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00132}00132         \{ DOSPTYP\_APPLE\_BOOT,   \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba92aedc55399b87044ce2d08c49b52e32}{G\_PART\_ALIAS\_APPLE\_BOOT}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00133}00133         \{ DOSPTYP\_APPLE\_UFS,    \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fbad0b0fe47b9ccb2173f0e23c43ad9ac4a}{G\_PART\_ALIAS\_APPLE\_UFS}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00134}00134         \{ DOSPTYP\_EFI,          \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba7b4070bea5b0e6962a12892e5246f0f4}{G\_PART\_ALIAS\_EFI}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00135}00135         \{ DOSPTYP\_EXT,          \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba205f680b8f44006d232724d0321152a1}{G\_PART\_ALIAS\_EBR}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00136}00136         \{ DOSPTYP\_EXTLBA,       \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba205f680b8f44006d232724d0321152a1}{G\_PART\_ALIAS\_EBR}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00137}00137         \{ DOSPTYP\_FAT16,        \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba90484258d5aaf25edf185285a3354291}{G\_PART\_ALIAS\_MS\_FAT16}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00138}00138         \{ DOSPTYP\_FAT32,        \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba9fc89f1733752a94f052dba777398cdf}{G\_PART\_ALIAS\_MS\_FAT32}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00139}00139         \{ DOSPTYP\_FAT32LBA,     \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba58b10390d272835f855fe618483a2da5}{G\_PART\_ALIAS\_MS\_FAT32LBA}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00140}00140         \{ DOSPTYP\_HFS,          \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fbadb95a5e2b53c2c685075ca2228253d55}{G\_PART\_ALIAS\_APPLE\_HFS}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00141}00141         \{ DOSPTYP\_LDM,          \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba0f2eb06ec83371b4db0cee890cfa752a}{G\_PART\_ALIAS\_MS\_LDM\_DATA}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00142}00142         \{ DOSPTYP\_LINLVM,       \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fbab14430d234bfa0a63e732210553fe83f}{G\_PART\_ALIAS\_LINUX\_LVM}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00143}00143         \{ DOSPTYP\_LINRAID,      \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fbac7afc0b8c09a13583895ec8bacacbca3}{G\_PART\_ALIAS\_LINUX\_RAID}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00144}00144         \{ DOSPTYP\_LINSWP,       \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba70898edc1a36e6e6c87d162d62bf8f39}{G\_PART\_ALIAS\_LINUX\_SWAP}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00145}00145         \{ DOSPTYP\_LINUX,        \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba90949fa4834fc43ae2d00a472b1d9425}{G\_PART\_ALIAS\_LINUX\_DATA}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00146}00146         \{ DOSPTYP\_NTFS,         \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fbaad51db36a92e9870b9d91df8e87e4115}{G\_PART\_ALIAS\_MS\_NTFS}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00147}00147         \{ DOSPTYP\_PPCBOOT,      \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba8898b481e3959730c7950bb368f5ca3f}{G\_PART\_ALIAS\_PREP\_BOOT}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00148}00148         \{ DOSPTYP\_VMFS,         \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba61bba4cbc13c24102e6a8e366cebb808}{G\_PART\_ALIAS\_VMFS}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00149}00149         \{ DOSPTYP\_VMKDIAG,      \mbox{\hyperlink{g__part_8h_a19b7e9a64cde5cffbdf337cc286615fba2f806de9c2a27b9616e56d2d8fc66482}{G\_PART\_ALIAS\_VMKDIAG}} \},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00150}\mbox{\hyperlink{g__part__mbr_8c_a57619afa79c6fd6c597aa57bcc904216}{00150}} \};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00152}00152 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00153}\mbox{\hyperlink{g__part__mbr_8c_a4aff6a4a8b0ed7551a85dc9418bd8971}{00153}} \mbox{\hyperlink{g__part__mbr_8c_a4aff6a4a8b0ed7551a85dc9418bd8971}{mbr\_parse\_type}}(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}}, u\_char *dp\_typ)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00154}00154 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00155}00155         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *alias;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00156}00156         \textcolor{keywordtype}{char} *endp;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00157}00157         \textcolor{keywordtype}{long} lt;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00158}00158         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00160}00160         \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}}[0] == \textcolor{charliteral}{'!'}) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00161}00161                 lt = strtol(\mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}} + 1, \&endp, 0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00162}00162                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}}[1] == \textcolor{charliteral}{'\(\backslash\)0'} || *endp != \textcolor{charliteral}{'\(\backslash\)0'} || lt <= 0 || lt >= 256)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00163}00163                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00164}00164                 *dp\_typ = (u\_char)lt;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00165}00165                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00166}00166         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00167}00167         \textcolor{keywordflow}{for} (i = 0; i < nitems(\mbox{\hyperlink{g__part__mbr_8c_a57619afa79c6fd6c597aa57bcc904216}{mbr\_alias\_match}}); i++) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00168}00168                 alias = \mbox{\hyperlink{g__part_8c_a458397c9a8faf94592039e34134837dc}{g\_part\_alias\_name}}(\mbox{\hyperlink{g__part__mbr_8c_a57619afa79c6fd6c597aa57bcc904216}{mbr\_alias\_match}}[i].alias);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00169}00169                 \textcolor{keywordflow}{if} (strcasecmp(\mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}}, alias) == 0) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00170}00170                         *dp\_typ = \mbox{\hyperlink{g__part__mbr_8c_a57619afa79c6fd6c597aa57bcc904216}{mbr\_alias\_match}}[i].\mbox{\hyperlink{structg__part__mbr__alias_a3406fb166e0660dcbb6e996886b89e48}{typ}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00171}00171                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00172}00172                 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00173}00173         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00174}00174         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00175}00175 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00176}00176 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00177}00177 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00178}\mbox{\hyperlink{g__part__mbr_8c_a95f8b3a546b8b10ab0e8c18218dfa62b}{00178}} \mbox{\hyperlink{g__part__mbr_8c_a95f8b3a546b8b10ab0e8c18218dfa62b}{mbr\_probe\_bpb}}(u\_char *bpb)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00179}00179 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00180}00180         uint16\_t secsz;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00181}00181         \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}} clstsz;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00183}00183 \textcolor{preprocessor}{\#define PO2(x)  ((x \& (x -\/ 1)) == 0)}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00184}00184         secsz = le16dec(bpb);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00185}00185         \textcolor{keywordflow}{if} (secsz < 512 || secsz > 4096 || !\mbox{\hyperlink{g__part__mbr_8c_a02e3ddd6c2a2997d88d327cfa3b8281d}{PO2}}(secsz))}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00186}00186                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00187}00187         clstsz = bpb[2];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00188}00188         \textcolor{keywordflow}{if} (clstsz < 1 || clstsz > 128 || !\mbox{\hyperlink{g__part__mbr_8c_a02e3ddd6c2a2997d88d327cfa3b8281d}{PO2}}(clstsz))}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00189}00189                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00190}00190 \textcolor{preprocessor}{\#undef PO2}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00192}00192         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00193}00193 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00195}00195 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00196}\mbox{\hyperlink{g__part__mbr_8c_aca610d3ddd4945439a64d5fc108a6a4f}{00196}} \mbox{\hyperlink{g__part__mbr_8c_aca610d3ddd4945439a64d5fc108a6a4f}{mbr\_set\_chs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *table, uint32\_t lba, u\_char *cylp, u\_char *hdp,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00197}00197     u\_char *secp)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00198}00198 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00199}00199         uint32\_t cyl, hd, sec;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00201}00201         sec = lba \% table-\/>\mbox{\hyperlink{structg__part__table_a5472d6d927a4be105b3ef51f296b4b72}{gpt\_sectors}} + 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00202}00202         lba /= table-\/>\mbox{\hyperlink{structg__part__table_a5472d6d927a4be105b3ef51f296b4b72}{gpt\_sectors}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00203}00203         hd = lba \% table-\/>\mbox{\hyperlink{structg__part__table_a37be862f028201612aaa673c1e501d9b}{gpt\_heads}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00204}00204         lba /= table-\/>\mbox{\hyperlink{structg__part__table_a37be862f028201612aaa673c1e501d9b}{gpt\_heads}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00205}00205         cyl = lba;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00206}00206         \textcolor{keywordflow}{if} (cyl > 1023)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00207}00207                 sec = hd = cyl = \string~0;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00209}00209         *cylp = cyl \& 0xff;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00210}00210         *hdp = hd \& 0xff;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00211}00211         *secp = (sec \& 0x3f) | ((cyl >> 2) \& 0xc0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00212}00212 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00214}00214 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00215}\mbox{\hyperlink{g__part__mbr_8c_af6e650f57224062664f60f02fc5c5b98}{00215}} \mbox{\hyperlink{g__part__mbr_8c_af6e650f57224062664f60f02fc5c5b98}{mbr\_align}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable, uint32\_t *\mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}}, uint32\_t *size)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00216}00216 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00217}00217         uint32\_t sectors;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00219}00219         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__mbr_8c_a7d80df7a8881a678e162ac8fcc929ab1}{enforce\_chs}} == 0)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00220}00220                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00221}00221         sectors = basetable-\/>\mbox{\hyperlink{structg__part__table_a5472d6d927a4be105b3ef51f296b4b72}{gpt\_sectors}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00222}00222         \textcolor{keywordflow}{if} (*size < sectors)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00223}00223                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00224}00224         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}} != NULL \&\& (*\mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}} \% sectors)) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00225}00225                 *size += (*\mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}} \% sectors) -\/ sectors;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00226}00226                 *\mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}} -\/= (*\mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}} \% sectors) -\/ sectors;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00227}00227         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00228}00228         \textcolor{keywordflow}{if} (*size \% sectors)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00229}00229                 *size -\/= (*size \% sectors);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00230}00230         \textcolor{keywordflow}{if} (*size < sectors)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00231}00231                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00232}00232         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00233}00233 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00235}00235 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00236}\mbox{\hyperlink{g__part__mbr_8c_a5fc175a8f9310c795e58305d7264247a}{00236}} \mbox{\hyperlink{g__part__mbr_8c_a5fc175a8f9310c795e58305d7264247a}{g\_part\_mbr\_add}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *baseentry,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00237}00237     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00238}00238 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00239}00239         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00240}00240         uint32\_t \mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}}, size;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00241}00241 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00242}00242         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_aac8d6125fbcedb1791170d0cc791648a}{gpp\_parms}} \& \mbox{\hyperlink{g__part_8h_ac1f9e00d1a0a9fc01363d4d49541f42d}{G\_PART\_PARM\_LABEL}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00243}00243                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00245}00245         \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *)baseentry;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00246}00246         \mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}} = \mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_a0dafde1b8f8959235573b0479434e2cc}{gpp\_start}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00247}00247         size = \mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_a73f7831f174a1aa7c6c6b291b37b565d}{gpp\_size}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00248}00248         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__mbr_8c_af6e650f57224062664f60f02fc5c5b98}{mbr\_align}}(basetable, \&\mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}}, \&size) != 0)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00249}00249                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00250}00250         \textcolor{keywordflow}{if} (baseentry-\/>\mbox{\hyperlink{structg__part__entry_a4c7748c49b831d481c9fd5c26f2aaf0b}{gpe\_deleted}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00251}00251                 bzero(\&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent));}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00253}00253         KASSERT(baseentry-\/>\mbox{\hyperlink{structg__part__entry_a65789808f851b8e6a71d10511fdcd986}{gpe\_start}} <= \mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}}, (\textcolor{stringliteral}{"{}\%s"{}}, \_\_func\_\_));}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00254}00254         KASSERT(baseentry-\/>\mbox{\hyperlink{structg__part__entry_ab7641d98c0e79484e0652c795f1123ab}{gpe\_end}} >= \mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}} + size -\/ 1, (\textcolor{stringliteral}{"{}\%s"{}}, \_\_func\_\_));}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00255}00255         baseentry-\/>\mbox{\hyperlink{structg__part__entry_a65789808f851b8e6a71d10511fdcd986}{gpe\_start}} = \mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00256}00256         baseentry-\/>\mbox{\hyperlink{structg__part__entry_ab7641d98c0e79484e0652c795f1123ab}{gpe\_end}} = \mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}} + size -\/ 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00257}00257         \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_start = \mbox{\hyperlink{g__raid__tr__if_8m_a17b9425cc13d593841ed2c2054a14e26}{start}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00258}00258         \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_size = size;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00259}00259         \mbox{\hyperlink{g__part__mbr_8c_aca610d3ddd4945439a64d5fc108a6a4f}{mbr\_set\_chs}}(basetable, baseentry-\/>\mbox{\hyperlink{structg__part__entry_a65789808f851b8e6a71d10511fdcd986}{gpe\_start}}, \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_scyl,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00260}00260             \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_shd, \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_ssect);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00261}00261         \mbox{\hyperlink{g__part__mbr_8c_aca610d3ddd4945439a64d5fc108a6a4f}{mbr\_set\_chs}}(basetable, baseentry-\/>\mbox{\hyperlink{structg__part__entry_ab7641d98c0e79484e0652c795f1123ab}{gpe\_end}}, \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_ecyl,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00262}00262             \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_ehd, \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_esect);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00263}00263         \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__part__mbr_8c_a4aff6a4a8b0ed7551a85dc9418bd8971}{mbr\_parse\_type}}(\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_a01eada6a88b8471f77555e6805d2644a}{gpp\_type}}, \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_typ));}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00264}00264 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00265}00265 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00266}00266 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00267}\mbox{\hyperlink{g__part__mbr_8c_a63585d8f2f193b5810fd1dee2fd049d5}{00267}} \mbox{\hyperlink{g__part__mbr_8c_a63585d8f2f193b5810fd1dee2fd049d5}{g\_part\_mbr\_bootcode}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00268}00268 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00269}00269         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *table;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00270}00270         uint32\_t dsn;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00271}00271 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00272}00272         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_acc3de4e9f86b75313ab6fda982809815}{gpp\_codesize}} != \mbox{\hyperlink{g__part__mbr_8c_a9fd8eab9aea0687d57ca1fcc031b37f9}{MBRSIZE}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00273}00273                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00275}00275         table = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *)basetable;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00276}00276         dsn = *(uint32\_t *)(table-\/>\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}} + DOSDSNOFF);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00277}00277         bcopy(\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_a3f4c4c99d5414901515b39156ac2f3d5}{gpp\_codeptr}}, table-\/>\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}}, DOSPARTOFF);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00278}00278         \textcolor{keywordflow}{if} (dsn != 0 \&\& !\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_a36a77618fc18fd88b9839029646bcab7}{gpp\_skip\_dsn}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00279}00279                 *(uint32\_t *)(table-\/>\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}} + DOSDSNOFF) = dsn;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00280}00280         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00281}00281 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00282}00282 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00283}00283 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00284}\mbox{\hyperlink{g__part__mbr_8c_a428ce0502785f0c1df74198639743c6f}{00284}} \mbox{\hyperlink{g__part__mbr_8c_a428ce0502785f0c1df74198639743c6f}{g\_part\_mbr\_create}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00285}00285 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00286}00286         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00287}00287         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *table;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00288}00288 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00289}00289         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_a0167e72bae7184b18a4180134cc0c021}{gpp\_provider}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00290}00290         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} < \mbox{\hyperlink{g__part__mbr_8c_a9fd8eab9aea0687d57ca1fcc031b37f9}{MBRSIZE}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00291}00291                 \textcolor{keywordflow}{return} (ENOSPC);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00292}00292 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00293}00293         basetable-\/>\mbox{\hyperlink{structg__part__table_a20e1ef23449d8669abc2d1737bd04eb7}{gpt\_first}} = basetable-\/>\mbox{\hyperlink{structg__part__table_a5472d6d927a4be105b3ef51f296b4b72}{gpt\_sectors}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00294}00294         basetable-\/>\mbox{\hyperlink{structg__part__table_aed05f4ae3f70841485bb573fbb21e458}{gpt\_last}} = MIN(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} / \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00295}00295             UINT32\_MAX) -\/ 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00296}00296 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00297}00297         table = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *)basetable;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00298}00298         le16enc(table-\/>\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}} + DOSMAGICOFFSET, DOSMAGIC);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00299}00299         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00300}00300 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00301}00301 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00302}00302 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00303}\mbox{\hyperlink{g__part__mbr_8c_a82792c97f5e9e79cc7cc6fc6eebcb64f}{00303}} \mbox{\hyperlink{g__part__mbr_8c_a82792c97f5e9e79cc7cc6fc6eebcb64f}{g\_part\_mbr\_destroy}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00304}00304 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00305}00305 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00306}00306         \textcolor{comment}{/* Wipe the first sector to clear the partitioning. */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00307}00307         basetable-\/>\mbox{\hyperlink{structg__part__table_a9e646bdafec74517607d5cbbea17f0d6}{gpt\_smhead}} |= 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00308}00308         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00309}00309 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00310}00310 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00311}00311 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00312}\mbox{\hyperlink{g__part__mbr_8c_a951a5f24d294bd6b3acb390b5eefe199}{00312}} \mbox{\hyperlink{g__part__mbr_8c_a951a5f24d294bd6b3acb390b5eefe199}{g\_part\_mbr\_efimedia}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *table, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00313}00313     \textcolor{keyword}{struct} sbuf *\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00314}00314 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00315}00315         uint32\_t dsn;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00317}00317         dsn = le32dec(table-\/>\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}} + DOSDSNOFF);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00318}00318         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}HD(\%d,MBR,\%\#08x,\%\#jx,\%\#jx)"{}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00319}00319             \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>base.\mbox{\hyperlink{structg__part__entry_a908a1a135d9ed557c57c79d5fd866a02}{gpe\_index}}, dsn, (intmax\_t)\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>base.\mbox{\hyperlink{structg__part__entry_a65789808f851b8e6a71d10511fdcd986}{gpe\_start}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00320}00320             (intmax\_t)(\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>base.\mbox{\hyperlink{structg__part__entry_ab7641d98c0e79484e0652c795f1123ab}{gpe\_end}} -\/ \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>base.\mbox{\hyperlink{structg__part__entry_a65789808f851b8e6a71d10511fdcd986}{gpe\_start}} + 1));}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00321}00321 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00323}00323 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00324}\mbox{\hyperlink{g__part__mbr_8c_ab8a4256adf356106e7af4922876206d8}{00324}} \mbox{\hyperlink{g__part__mbr_8c_ab8a4256adf356106e7af4922876206d8}{g\_part\_mbr\_dumpconf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *baseentry,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00325}00325     \textcolor{keyword}{struct} sbuf *\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00326}00326 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00327}00327         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00328}00328         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *table;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00330}00330         table = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *)basetable;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00331}00331         \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *)baseentry;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00332}00332         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00333}00333                 \textcolor{comment}{/* conftxt: libdisk compatibility */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00334}00334                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{} xs MBR xt \%u"{}}, \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_typ);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00335}00335         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00336}00336                 \textcolor{comment}{/* confxml: partition entry information */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00337}00337                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<rawtype>\%u</rawtype>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00338}00338                     \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_typ);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00339}00339                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_flag \& 0x80)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00340}00340                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<attrib>active</attrib>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00341}00341                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<efimedia>"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00342}00342                 \mbox{\hyperlink{g__part__mbr_8c_a951a5f24d294bd6b3acb390b5eefe199}{g\_part\_mbr\_efimedia}}(table, \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}, \mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00343}00343                 sbuf\_cat(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}</efimedia>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00344}00344         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00345}00345                 \textcolor{comment}{/* confxml: scheme information */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00346}00346         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00347}00347 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00348}00348 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00349}00349 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00350}\mbox{\hyperlink{g__part__mbr_8c_a7acf640ecdc78c2cf8fb1063a0329af2}{00350}} \mbox{\hyperlink{g__part__mbr_8c_a7acf640ecdc78c2cf8fb1063a0329af2}{g\_part\_mbr\_dumpto}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *table, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *baseentry)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00351}00351 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00352}00352         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00353}00353 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00354}00354         \textcolor{comment}{/* Allow dumping to a FreeBSD partition or Linux swap partition only. */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00355}00355         \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *)baseentry;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00356}00356         \textcolor{keywordflow}{return} ((\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_typ == DOSPTYP\_386BSD ||}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00357}00357             \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_typ == DOSPTYP\_LINSWP) ? 1 : 0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00358}00358 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00360}00360 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00361}\mbox{\hyperlink{g__part__mbr_8c_a690a5f034fec11582bc0ce3a9c2e3166}{00361}} \mbox{\hyperlink{g__part__mbr_8c_a690a5f034fec11582bc0ce3a9c2e3166}{g\_part\_mbr\_modify}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00362}00362     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *baseentry, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00363}00363 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00364}00364         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00365}00365 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00366}00366         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_aac8d6125fbcedb1791170d0cc791648a}{gpp\_parms}} \& \mbox{\hyperlink{g__part_8h_ac1f9e00d1a0a9fc01363d4d49541f42d}{G\_PART\_PARM\_LABEL}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00367}00367                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00369}00369         \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *)baseentry;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00370}00370         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_aac8d6125fbcedb1791170d0cc791648a}{gpp\_parms}} \& \mbox{\hyperlink{g__part_8h_a2036d1a76dc411e4de5052cdb8c9a138}{G\_PART\_PARM\_TYPE}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00371}00371                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__part__mbr_8c_a4aff6a4a8b0ed7551a85dc9418bd8971}{mbr\_parse\_type}}(\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_a01eada6a88b8471f77555e6805d2644a}{gpp\_type}}, \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_typ));}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00372}00372         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00373}00373 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00374}00374 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00375}00375 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00376}\mbox{\hyperlink{g__part__mbr_8c_a5dd6319f516243c8bd390b4bfdedff1d}{00376}} \mbox{\hyperlink{g__part__mbr_8c_a5dd6319f516243c8bd390b4bfdedff1d}{g\_part\_mbr\_resize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00377}00377     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *baseentry, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__parms}{g\_part\_parms}} *\mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00378}00378 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00379}00379         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00380}00380         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00381}00381         uint32\_t size;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00382}00382 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00383}00383         \textcolor{keywordflow}{if} (baseentry == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00384}00384                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = LIST\_FIRST(\&basetable-\/>\mbox{\hyperlink{structg__part__table_a0dad02eb728a87c70f5100f6c5a704d1}{gpt\_gp}}-\/>consumer)-\/>provider;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00385}00385                 basetable-\/>\mbox{\hyperlink{structg__part__table_aed05f4ae3f70841485bb573fbb21e458}{gpt\_last}} = MIN(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} / \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}},}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00386}00386                     UINT32\_MAX) -\/ 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00387}00387                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00388}00388         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00389}00389         size = \mbox{\hyperlink{g__part__if_8m_ad13d1d1e03609f599a8c4ea0a6801bf0}{gpp}}-\/>\mbox{\hyperlink{structg__part__parms_a73f7831f174a1aa7c6c6b291b37b565d}{gpp\_size}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00390}00390         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__mbr_8c_af6e650f57224062664f60f02fc5c5b98}{mbr\_align}}(basetable, NULL, \&size) != 0)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00391}00391                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00392}00392         \textcolor{comment}{/* XXX: prevent unexpected shrinking. */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00393}00393         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = baseentry-\/>\mbox{\hyperlink{structg__part__entry_a66a86cc3331d381350a436c607520492}{gpe\_pp}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00394}00394         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{geom_8h_aca9e9300747035c84977158ea1fe1d38}{g\_debugflags}} \& \mbox{\hyperlink{geom_8h_ac5335e69a9ab03862196e80d4e2c5af8}{G\_F\_FOOTSHOOTING}}) == 0 \&\& size < gpp-\/>gpp\_size \&\&}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00395}00395             \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} / \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} > size)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00396}00396                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00397}00397         \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *)baseentry;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00398}00398         baseentry-\/>\mbox{\hyperlink{structg__part__entry_ab7641d98c0e79484e0652c795f1123ab}{gpe\_end}} = baseentry-\/>\mbox{\hyperlink{structg__part__entry_a65789808f851b8e6a71d10511fdcd986}{gpe\_start}} + size -\/ 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00399}00399         \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_size = size;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00400}00400         \mbox{\hyperlink{g__part__mbr_8c_aca610d3ddd4945439a64d5fc108a6a4f}{mbr\_set\_chs}}(basetable, baseentry-\/>\mbox{\hyperlink{structg__part__entry_ab7641d98c0e79484e0652c795f1123ab}{gpe\_end}}, \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_ecyl,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00401}00401             \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_ehd, \&\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_esect);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00402}00402         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00403}00403 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00404}00404 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00405}00405 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00406}\mbox{\hyperlink{g__part__mbr_8c_ac071f62b693e991468b6606df2245268}{00406}} \mbox{\hyperlink{g__part__mbr_8c_ac071f62b693e991468b6606df2245268}{g\_part\_mbr\_name}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *table, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *baseentry,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00407}00407     \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \textcolor{keywordtype}{size\_t} \mbox{\hyperlink{g__part__if_8m_a2a0790e716bccb2471387f8758962a1b}{bufsz}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00408}00408 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00409}00409 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00410}00410         snprintf(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \mbox{\hyperlink{g__part__if_8m_a2a0790e716bccb2471387f8758962a1b}{bufsz}}, \textcolor{stringliteral}{"{}s\%d"{}}, baseentry-\/>\mbox{\hyperlink{structg__part__entry_a908a1a135d9ed557c57c79d5fd866a02}{gpe\_index}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00411}00411         \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00412}00412 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00413}00413 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00414}00414 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00415}\mbox{\hyperlink{g__part__mbr_8c_af44d7f040427a44e68dd5110d9a6207a}{00415}} \mbox{\hyperlink{g__part__mbr_8c_af44d7f040427a44e68dd5110d9a6207a}{g\_part\_mbr\_probe}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *table, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00416}00416 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00417}00417         \textcolor{keywordtype}{char} psn[8];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00418}00418         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00419}00419         u\_char *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, *p;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00420}00420         \textcolor{keywordtype}{int} \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}}, \mbox{\hyperlink{structg__provider_af66d4470c5f372fdc0f71d66a65542be}{index}}, res, sum;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00421}00421         uint16\_t magic;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00423}00423         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00425}00425         \textcolor{comment}{/* Sanity-\/check the provider. */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00426}00426         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} < \mbox{\hyperlink{g__part__mbr_8c_a9fd8eab9aea0687d57ca1fcc031b37f9}{MBRSIZE}} || \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} < \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00427}00427                 \textcolor{keywordflow}{return} (ENOSPC);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00428}00428         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} > 4096)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00429}00429                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00431}00431         \textcolor{comment}{/* We don't nest under an MBR (see EBR instead). */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00432}00432         \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} = \mbox{\hyperlink{geom_8h_a5ae737a0eaaf6cb08f6f6efe52e90a49}{g\_getattr}}(\textcolor{stringliteral}{"{}PART::scheme"{}}, \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \&psn);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00433}00433         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} == 0 \&\& strcmp(psn, \mbox{\hyperlink{g__part__mbr_8c_a870c4962033a3af1331119efc1e2f53e}{g\_part\_mbr\_scheme}}.name) == 0)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00434}00434                 \textcolor{keywordflow}{return} (ELOOP);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00435}00435 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00436}00436         \textcolor{comment}{/* Check that there's a MBR. */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00437}00437         \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} = \mbox{\hyperlink{geom_8h_a550c2071f79908eea3d1ccbf821c4e4f}{g\_read\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0L, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, \&\mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00438}00438         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} == NULL)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00439}00439                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00440}00440 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00441}00441         \textcolor{comment}{/* We goto out on mismatch. */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00442}00442         res = ENXIO;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00443}00443 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00444}00444         magic = le16dec(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} + DOSMAGICOFFSET);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00445}00445         \textcolor{keywordflow}{if} (magic != DOSMAGIC)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00446}00446                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00447}00447 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00448}00448         \textcolor{keywordflow}{for} (\mbox{\hyperlink{structg__provider_af66d4470c5f372fdc0f71d66a65542be}{index}} = 0; \mbox{\hyperlink{structg__provider_af66d4470c5f372fdc0f71d66a65542be}{index}} < NDOSPART; \mbox{\hyperlink{structg__provider_af66d4470c5f372fdc0f71d66a65542be}{index}}++) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00449}00449                 p = \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} + DOSPARTOFF + \mbox{\hyperlink{structg__provider_af66d4470c5f372fdc0f71d66a65542be}{index}} * DOSPARTSIZE;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00450}00450                 \textcolor{keywordflow}{if} (p[0] != 0 \&\& p[0] != 0x80)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00451}00451                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00452}00452         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00453}00453 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00454}00454         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00455}00455 \textcolor{comment}{         * If the partition table does not consist of all zeroes,}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00456}00456 \textcolor{comment}{         * assume we have a MBR. If it's all zeroes, we could have}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00457}00457 \textcolor{comment}{         * a boot sector. For example, a boot sector that doesn't}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00458}00458 \textcolor{comment}{         * have boot code -\/-\/ common on non-\/i386 hardware. In that}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00459}00459 \textcolor{comment}{         * case we check if we have a possible BPB. If so, then we}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00460}00460 \textcolor{comment}{         * assume we have a boot sector instead.}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00461}00461 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00462}00462         sum = 0;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00463}00463         \textcolor{keywordflow}{for} (\mbox{\hyperlink{structg__provider_af66d4470c5f372fdc0f71d66a65542be}{index}} = 0; \mbox{\hyperlink{structg__provider_af66d4470c5f372fdc0f71d66a65542be}{index}} < NDOSPART * DOSPARTSIZE; \mbox{\hyperlink{structg__provider_af66d4470c5f372fdc0f71d66a65542be}{index}}++)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00464}00464                 sum += \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}[DOSPARTOFF + \mbox{\hyperlink{structg__provider_af66d4470c5f372fdc0f71d66a65542be}{index}}];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00465}00465         \textcolor{keywordflow}{if} (sum != 0 || !\mbox{\hyperlink{g__part__mbr_8c_a95f8b3a546b8b10ab0e8c18218dfa62b}{mbr\_probe\_bpb}}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} + 0x0b))}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00466}00466                 res = \mbox{\hyperlink{g__part_8h_ad9e6d8bedd7ac8ce9839c634537442da}{G\_PART\_PROBE\_PRI\_NORM}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00467}00467 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00468}00468  out:}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00469}00469         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00470}00470         \textcolor{keywordflow}{return} (res);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00471}00471 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00472}00472 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00473}00473 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00474}\mbox{\hyperlink{g__part__mbr_8c_a145f42dc5a24579f667ed9b482332121}{00474}} \mbox{\hyperlink{g__part__mbr_8c_a145f42dc5a24579f667ed9b482332121}{g\_part\_mbr\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00475}00475 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00476}00476         \textcolor{keyword}{struct }dos\_partition ent;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00477}00477         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00478}00478         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *table;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00479}00479         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00480}00480         u\_char *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, *p;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00481}00481         off\_t chs, msize, first;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00482}00482         u\_int sectors, heads;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00483}00483         \textcolor{keywordtype}{int} error, index;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00484}00484 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00485}00485         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00486}00486         table = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *)basetable;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00487}00487         first = basetable-\/>\mbox{\hyperlink{structg__part__table_a5472d6d927a4be105b3ef51f296b4b72}{gpt\_sectors}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00488}00488         msize = MIN(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} / \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, UINT32\_MAX);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00489}00489 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00490}00490         \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} = \mbox{\hyperlink{geom_8h_a550c2071f79908eea3d1ccbf821c4e4f}{g\_read\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0L, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, \&error);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00491}00491         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} == NULL)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00492}00492                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00493}00493 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00494}00494         bcopy(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, table-\/>\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}}, \textcolor{keyword}{sizeof}(table-\/>\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}}));}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00495}00495         \textcolor{keywordflow}{for} (index = NDOSPART -\/ 1; index >= 0; index-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00496}00496                 p = \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} + DOSPARTOFF + index * DOSPARTSIZE;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00497}00497                 ent.dp\_flag = p[0];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00498}00498                 ent.dp\_shd = p[1];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00499}00499                 ent.dp\_ssect = p[2];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00500}00500                 ent.dp\_scyl = p[3];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00501}00501                 ent.dp\_typ = p[4];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00502}00502                 ent.dp\_ehd = p[5];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00503}00503                 ent.dp\_esect = p[6];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00504}00504                 ent.dp\_ecyl = p[7];}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00505}00505                 ent.dp\_start = le32dec(p + 8);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00506}00506                 ent.dp\_size = le32dec(p + 12);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00507}00507                 \textcolor{keywordflow}{if} (ent.dp\_typ == 0 || ent.dp\_typ == DOSPTYP\_PMBR)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00508}00508                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00509}00509                 \textcolor{keywordflow}{if} (ent.dp\_start == 0 || ent.dp\_size == 0)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00510}00510                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00511}00511                 sectors = ent.dp\_esect \& 0x3f;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00512}00512                 \textcolor{keywordflow}{if} (sectors > basetable-\/>\mbox{\hyperlink{structg__part__table_a5472d6d927a4be105b3ef51f296b4b72}{gpt\_sectors}} \&\&}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00513}00513                     !basetable-\/>\mbox{\hyperlink{structg__part__table_a8ceff629d753812441cd14001b2ff4e2}{gpt\_fixgeom}}) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00514}00514                         \mbox{\hyperlink{g__part_8c_a107b24cbd5a66afc40731be7ec41c4bb}{g\_part\_geometry\_heads}}(msize, sectors, \&chs, \&heads);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00515}00515                         \textcolor{keywordflow}{if} (chs != 0) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00516}00516                                 basetable-\/>\mbox{\hyperlink{structg__part__table_a5472d6d927a4be105b3ef51f296b4b72}{gpt\_sectors}} = sectors;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00517}00517                                 basetable-\/>\mbox{\hyperlink{structg__part__table_a37be862f028201612aaa673c1e501d9b}{gpt\_heads}} = heads;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00518}00518                         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00519}00519                 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00520}00520                 \textcolor{keywordflow}{if} (ent.dp\_start < first)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00521}00521                         first = ent.dp\_start;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00522}00522                 \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *)\mbox{\hyperlink{g__part_8c_a010bc380adf72e4e075c5339c3b10f4e}{g\_part\_new\_entry}}(basetable,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00523}00523                     index + 1, \mbox{\hyperlink{structg__part__mbr__entry_a01d1b1e3733c8b8ad43ff2d48eec1dc7}{ent}}.dp\_start, \mbox{\hyperlink{structg__part__mbr__entry_a01d1b1e3733c8b8ad43ff2d48eec1dc7}{ent}}.dp\_start + \mbox{\hyperlink{structg__part__mbr__entry_a01d1b1e3733c8b8ad43ff2d48eec1dc7}{ent}}.dp\_size -\/ 1);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00524}00524                 \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent = \mbox{\hyperlink{structg__part__mbr__entry_a01d1b1e3733c8b8ad43ff2d48eec1dc7}{ent}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00525}00525         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00526}00526 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00527}00527         basetable-\/>\mbox{\hyperlink{structg__part__table_a593162aef033d63adcfe51eabd071f7b}{gpt\_entries}} = NDOSPART;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00528}00528         basetable-\/>\mbox{\hyperlink{structg__part__table_a20e1ef23449d8669abc2d1737bd04eb7}{gpt\_first}} = basetable-\/>\mbox{\hyperlink{structg__part__table_a5472d6d927a4be105b3ef51f296b4b72}{gpt\_sectors}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00529}00529         basetable-\/>\mbox{\hyperlink{structg__part__table_aed05f4ae3f70841485bb573fbb21e458}{gpt\_last}} = msize -\/ 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00530}00530 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00531}00531         \textcolor{keywordflow}{if} (first < basetable-\/>gpt\_first)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00532}00532                 basetable-\/>\mbox{\hyperlink{structg__part__table_a20e1ef23449d8669abc2d1737bd04eb7}{gpt\_first}} = 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00534}00534         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00535}00535         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00536}00536 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00537}00537 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00538}00538 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00539}\mbox{\hyperlink{g__part__mbr_8c_a9882d64680a9a7fd2f1f794e249e3703}{00539}} \mbox{\hyperlink{g__part__mbr_8c_a9882d64680a9a7fd2f1f794e249e3703}{g\_part\_mbr\_setunset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *table, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *baseentry,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00540}00540     \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aa8d9346fc5577c5ebab9d1ed5258a90d}{attrib}}, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__part__if_8m_a32f61524ac738fb8219d01f04ab7d698}{set}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00541}00541 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00542}00542         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *iter;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00543}00543         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00544}00544         \textcolor{keywordtype}{int} changed;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00545}00545 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00546}00546         \textcolor{keywordflow}{if} (baseentry == NULL)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00547}00547                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00548}00548         \textcolor{keywordflow}{if} (strcasecmp(\mbox{\hyperlink{g__part__if_8m_aa8d9346fc5577c5ebab9d1ed5258a90d}{attrib}}, \textcolor{stringliteral}{"{}active"{}}) != 0)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00549}00549                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00551}00551         \textcolor{comment}{/* Only one entry can have the active attribute. */}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00552}00552         LIST\_FOREACH(iter, \&table-\/>gpt\_entry, gpe\_entry) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00553}00553                 \textcolor{keywordflow}{if} (iter-\/>\mbox{\hyperlink{structg__part__entry_a4c7748c49b831d481c9fd5c26f2aaf0b}{gpe\_deleted}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00554}00554                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00555}00555                 changed = 0;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00556}00556                 \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *)iter;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00557}00557                 \textcolor{keywordflow}{if} (iter == baseentry) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00558}00558                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a32f61524ac738fb8219d01f04ab7d698}{set}} \&\& (\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_flag \& 0x80) == 0) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00559}00559                                 \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_flag |= 0x80;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00560}00560                                 changed = 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00561}00561                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!\mbox{\hyperlink{g__part__if_8m_a32f61524ac738fb8219d01f04ab7d698}{set}} \&\& (\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_flag \& 0x80)) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00562}00562                                 \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_flag \&= \string~0x80;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00563}00563                                 changed = 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00564}00564                         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00565}00565                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00566}00566                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a32f61524ac738fb8219d01f04ab7d698}{set}} \&\& (\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_flag \& 0x80)) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00567}00567                                 \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_flag \&= \string~0x80;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00568}00568                                 changed = 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00569}00569                         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00570}00570                 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00571}00571                 \textcolor{keywordflow}{if} (changed \&\& !iter-\/>\mbox{\hyperlink{structg__part__entry_a69108d2a6ef4380b30d84ddab039043b}{gpe\_created}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00572}00572                         iter-\/>\mbox{\hyperlink{structg__part__entry_a23411cb54b171e9d8d2e364f18e9adc2}{gpe\_modified}} = 1;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00573}00573         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00574}00574         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00575}00575 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00576}00576 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00577}00577 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00578}\mbox{\hyperlink{g__part__mbr_8c_ad055a72b94e98df8cbeada5dc4154c4f}{00578}} \mbox{\hyperlink{g__part__mbr_8c_ad055a72b94e98df8cbeada5dc4154c4f}{g\_part\_mbr\_type}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *baseentry,}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00579}00579     \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \textcolor{keywordtype}{size\_t} \mbox{\hyperlink{g__part__if_8m_a2a0790e716bccb2471387f8758962a1b}{bufsz}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00580}00580 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00581}00581         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00582}00582         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00584}00584         \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *)baseentry;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00585}00585         \textcolor{keywordflow}{for} (i = 0; i < nitems(\mbox{\hyperlink{g__part__mbr_8c_a57619afa79c6fd6c597aa57bcc904216}{mbr\_alias\_match}}); i++) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00586}00586                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__mbr_8c_a57619afa79c6fd6c597aa57bcc904216}{mbr\_alias\_match}}[i].typ == \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_typ)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00587}00587                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__part_8c_a458397c9a8faf94592039e34134837dc}{g\_part\_alias\_name}}(\mbox{\hyperlink{g__part__mbr_8c_a57619afa79c6fd6c597aa57bcc904216}{mbr\_alias\_match}}[i].alias));}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00588}00588         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00589}00589         snprintf(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \mbox{\hyperlink{g__part__if_8m_a2a0790e716bccb2471387f8758962a1b}{bufsz}}, \textcolor{stringliteral}{"{}!\%d"{}}, \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_typ);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00590}00590         \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00591}00591 \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00592}00592 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00593}00593 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00594}\mbox{\hyperlink{g__part__mbr_8c_a6903e3805be819c9ae577ca6d2b02d38}{00594}} \mbox{\hyperlink{g__part__mbr_8c_a6903e3805be819c9ae577ca6d2b02d38}{g\_part\_mbr\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__table}{g\_part\_table}} *basetable, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00595}00595 \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00596}00596         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__entry}{g\_part\_entry}} *baseentry;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00597}00597         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}};}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00598}00598         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *table;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00599}00599         u\_char *p;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00600}00600         \textcolor{keywordtype}{int} error, index;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00601}00601 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00602}00602         table = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__part__mbr__table}{g\_part\_mbr\_table}} *)basetable;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00603}00603         baseentry = LIST\_FIRST(\&basetable-\/>gpt\_entry);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00604}00604         \textcolor{keywordflow}{for} (index = 1; index <= basetable-\/>\mbox{\hyperlink{structg__part__table_a593162aef033d63adcfe51eabd071f7b}{gpt\_entries}}; index++) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00605}00605                 p = table-\/>\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}} + DOSPARTOFF + (index -\/ 1) * DOSPARTSIZE;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00606}00606                 \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} = (baseentry != NULL \&\& index == baseentry-\/>\mbox{\hyperlink{structg__part__entry_a908a1a135d9ed557c57c79d5fd866a02}{gpe\_index}})}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00607}00607                     ? (\textcolor{keyword}{struct} \mbox{\hyperlink{structg__part__mbr__entry}{g\_part\_mbr\_entry}} *)baseentry : NULL;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00608}00608                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} != NULL \&\& !baseentry-\/>\mbox{\hyperlink{structg__part__entry_a4c7748c49b831d481c9fd5c26f2aaf0b}{gpe\_deleted}}) \{}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00609}00609                         p[0] = \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_flag;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00610}00610                         p[1] = \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_shd;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00611}00611                         p[2] = \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_ssect;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00612}00612                         p[3] = \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_scyl;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00613}00613                         p[4] = \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_typ;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00614}00614                         p[5] = \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_ehd;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00615}00615                         p[6] = \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_esect;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00616}00616                         p[7] = \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_ecyl;}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00617}00617                         le32enc(p + 8, \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_start);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00618}00618                         le32enc(p + 12, \mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}}-\/>ent.dp\_size);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00619}00619                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00620}00620                         bzero(p, DOSPARTSIZE);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00622}00622                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a2c2a1eba20a891e9a733abad308a3bbc}{entry}} != NULL)}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00623}00623                         baseentry = LIST\_NEXT(baseentry, gpe\_entry);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00624}00624         \}}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00626}00626         error = \mbox{\hyperlink{geom_8h_a9b87ecbd812c109546b077da483baada}{g\_write\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0, table-\/>\mbox{\hyperlink{structg__part__mbr__table_a6388bcc3e8174063006f561b87a89faf}{mbr}}, \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}});}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00627}00627         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__part__mbr_8c_source_l00628}00628 \}}

\end{DoxyCode}
