xref: /freebsd/sys/libkern/udivmoddi4.c (revision cc4f247fb9468bbece5286557ab2d6810704aaf3)
1*cc4f247fSJohn Baldwin /*-
2*cc4f247fSJohn Baldwin  * SPDX-License-Identifier: BSD-3-Clause
3*cc4f247fSJohn Baldwin  *
4*cc4f247fSJohn Baldwin  * Copyright (c) 1992, 1993
5*cc4f247fSJohn Baldwin  *	The Regents of the University of California.  All rights reserved.
6*cc4f247fSJohn Baldwin  *
7*cc4f247fSJohn Baldwin  * This software was developed by the Computer Systems Engineering group
8*cc4f247fSJohn Baldwin  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9*cc4f247fSJohn Baldwin  * contributed to Berkeley.
10*cc4f247fSJohn Baldwin  *
11*cc4f247fSJohn Baldwin  * Redistribution and use in source and binary forms, with or without
12*cc4f247fSJohn Baldwin  * modification, are permitted provided that the following conditions
13*cc4f247fSJohn Baldwin  * are met:
14*cc4f247fSJohn Baldwin  * 1. Redistributions of source code must retain the above copyright
15*cc4f247fSJohn Baldwin  *    notice, this list of conditions and the following disclaimer.
16*cc4f247fSJohn Baldwin  * 2. Redistributions in binary form must reproduce the above copyright
17*cc4f247fSJohn Baldwin  *    notice, this list of conditions and the following disclaimer in the
18*cc4f247fSJohn Baldwin  *    documentation and/or other materials provided with the distribution.
19*cc4f247fSJohn Baldwin  * 3. Neither the name of the University nor the names of its contributors
20*cc4f247fSJohn Baldwin  *    may be used to endorse or promote products derived from this software
21*cc4f247fSJohn Baldwin  *    without specific prior written permission.
22*cc4f247fSJohn Baldwin  *
23*cc4f247fSJohn Baldwin  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24*cc4f247fSJohn Baldwin  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25*cc4f247fSJohn Baldwin  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26*cc4f247fSJohn Baldwin  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27*cc4f247fSJohn Baldwin  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28*cc4f247fSJohn Baldwin  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29*cc4f247fSJohn Baldwin  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30*cc4f247fSJohn Baldwin  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31*cc4f247fSJohn Baldwin  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32*cc4f247fSJohn Baldwin  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33*cc4f247fSJohn Baldwin  * SUCH DAMAGE.
34*cc4f247fSJohn Baldwin  */
35*cc4f247fSJohn Baldwin 
36*cc4f247fSJohn Baldwin #include <libkern/quad.h>
37*cc4f247fSJohn Baldwin 
38*cc4f247fSJohn Baldwin /*
39*cc4f247fSJohn Baldwin  * Divide two unsigned quads.
40*cc4f247fSJohn Baldwin  */
41*cc4f247fSJohn Baldwin u_quad_t
__udivmoddi4(u_quad_t a,u_quad_t b,u_quad_t * rem)42*cc4f247fSJohn Baldwin __udivmoddi4(u_quad_t a, u_quad_t b, u_quad_t *rem)
43*cc4f247fSJohn Baldwin {
44*cc4f247fSJohn Baldwin 
45*cc4f247fSJohn Baldwin 	return (__qdivrem(a, b, rem));
46*cc4f247fSJohn Baldwin }
47