\hypertarget{ldivmod__helper_8c_source}{}\doxysection{ldivmod\+\_\+helper.\+c}
\label{ldivmod__helper_8c_source}\index{libkern/arm/ldivmod\_helper.c@{libkern/arm/ldivmod\_helper.c}}
\mbox{\hyperlink{ldivmod__helper_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (C) 2012 Andrew Turner}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00027}00027 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00028}00028 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00031}\mbox{\hyperlink{ldivmod__helper_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00031}} \mbox{\hyperlink{ldivmod__helper_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{quad_8h}{libkern/quad.h}}>}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00035}00035 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00036}00036 \textcolor{comment}{ * Helper for \_\_aeabi\_ldivmod.}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00037}00037 \textcolor{comment}{ * TODO: \_\_divdi3 calls \_\_qdivrem. We should do the same and use the}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00038}00038 \textcolor{comment}{ * remainder value rather than re-\/calculating it.}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00039}00039 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00040}00040 \textcolor{keywordtype}{long} \textcolor{keywordtype}{long} \mbox{\hyperlink{ldivmod__helper_8c_a5e740f3b335c4e369742c6e25e73d883}{\_\_kern\_ldivmod}}(\textcolor{keywordtype}{long} \textcolor{keywordtype}{long}, \textcolor{keywordtype}{long} \textcolor{keywordtype}{long}, \textcolor{keywordtype}{long} \textcolor{keywordtype}{long} *);}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00042}00042 \textcolor{keywordtype}{long} \textcolor{keywordtype}{long}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00043}\mbox{\hyperlink{ldivmod__helper_8c_a5e740f3b335c4e369742c6e25e73d883}{00043}} \mbox{\hyperlink{ldivmod__helper_8c_a5e740f3b335c4e369742c6e25e73d883}{\_\_kern\_ldivmod}}(\textcolor{keywordtype}{long} \textcolor{keywordtype}{long} n, \textcolor{keywordtype}{long} \textcolor{keywordtype}{long} m, \textcolor{keywordtype}{long} \textcolor{keywordtype}{long} *rem)}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00044}00044 \{}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00045}00045         \textcolor{keywordtype}{long} \textcolor{keywordtype}{long} q;}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00047}00047         q = \mbox{\hyperlink{divdi3_8c_a4a8c5f9eac2f7dbabb3b6eefb0da4e80}{\_\_divdi3}}(n, m);     \textcolor{comment}{/* q = n / m */}}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00048}00048         *rem = n -\/ m * q;}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00050}00050         \textcolor{keywordflow}{return} q;}
\DoxyCodeLine{\Hypertarget{ldivmod__helper_8c_source_l00051}00051 \}}

\end{DoxyCode}
