17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
57c478bdstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
67c478bdstevel@tonic-gate * (the "License").  You may not use this file except in compliance
77c478bdstevel@tonic-gate * with the License.
87c478bdstevel@tonic-gate *
97c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
117c478bdstevel@tonic-gate * See the License for the specific language governing permissions
127c478bdstevel@tonic-gate * and limitations under the License.
137c478bdstevel@tonic-gate *
147c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
157c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
177c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
187c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bdstevel@tonic-gate *
207c478bdstevel@tonic-gate * CDDL HEADER END
217c478bdstevel@tonic-gate */
2289518a1dmick
237c478bdstevel@tonic-gate/*
2489518a1dmick * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
257c478bdstevel@tonic-gate * Use is subject to license terms.
267c478bdstevel@tonic-gate */
277c478bdstevel@tonic-gate
2889518a1dmick#ifndef _MULDIV_H
2989518a1dmick#define	_MULDIV_H
307c478bdstevel@tonic-gate
317c478bdstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
327c478bdstevel@tonic-gate
337c478bdstevel@tonic-gate/*
3489518a1dmick * Helper routines for Sun and GCC compilers in 32-bit mode,
3589518a1dmick * doing 64-bit math.  These routines should not be called directly;
3689518a1dmick * they are called by code generated by the compiler.  Their declarations
3789518a1dmick * are here for kmdb's hdr2map and map2linktest mechanisms.
387c478bdstevel@tonic-gate */
397c478bdstevel@tonic-gate
4089518a1dmick#if !defined(__amd64)
4189518a1dmick
427c478bdstevel@tonic-gate#ifdef __cplusplus
437c478bdstevel@tonic-gateextern "C" {
447c478bdstevel@tonic-gate#endif
457c478bdstevel@tonic-gate
4689518a1dmickextern int64_t __mul64(int64_t a, int64_t b);
4789518a1dmick
4889518a1dmickextern uint64_t __udiv64(uint64_t x, uint64_t y);
4989518a1dmickextern uint64_t __urem64(uint64_t x, uint64_t y);
5089518a1dmickextern int64_t __div64(int64_t x, int64_t y);
5189518a1dmickextern int64_t __rem64(int64_t x, int64_t y);
5289518a1dmick
5389518a1dmickextern uint64_t __udivdi3(uint64_t a, uint64_t b);
5489518a1dmickextern uint64_t __umoddi3(uint64_t a, uint64_t b);
5589518a1dmickextern int64_t __divdi3(int64_t a, int64_t b);
5689518a1dmickextern int64_t __moddi3(int64_t a, int64_t b);
5789518a1dmick
5889518a1dmickextern uint64_t __udivrem64(uint64_t x, uint64_t y);
5989518a1dmickextern int64_t __divrem64(int64_t x, int64_t y);
607c478bdstevel@tonic-gate
617c478bdstevel@tonic-gate#ifdef __cplusplus
627c478bdstevel@tonic-gate}
637c478bdstevel@tonic-gate#endif
647c478bdstevel@tonic-gate
6589518a1dmick#endif /* !defined(amd64) */
6689518a1dmick
6789518a1dmick#endif /* _MULDIV_H */
68