17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 22*89518a1cSdmick 237c478bd9Sstevel@tonic-gate /* 24*89518a1cSdmick * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 257c478bd9Sstevel@tonic-gate * Use is subject to license terms. 267c478bd9Sstevel@tonic-gate */ 277c478bd9Sstevel@tonic-gate 28*89518a1cSdmick #ifndef _MULDIV_H 29*89518a1cSdmick #define _MULDIV_H 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate /* 34*89518a1cSdmick * Helper routines for Sun and GCC compilers in 32-bit mode, 35*89518a1cSdmick * doing 64-bit math. These routines should not be called directly; 36*89518a1cSdmick * they are called by code generated by the compiler. Their declarations 37*89518a1cSdmick * are here for kmdb's hdr2map and map2linktest mechanisms. 387c478bd9Sstevel@tonic-gate */ 397c478bd9Sstevel@tonic-gate 40*89518a1cSdmick #if !defined(__amd64) 41*89518a1cSdmick 427c478bd9Sstevel@tonic-gate #ifdef __cplusplus 437c478bd9Sstevel@tonic-gate extern "C" { 447c478bd9Sstevel@tonic-gate #endif 457c478bd9Sstevel@tonic-gate 46*89518a1cSdmick extern int64_t __mul64(int64_t a, int64_t b); 47*89518a1cSdmick 48*89518a1cSdmick extern uint64_t __udiv64(uint64_t x, uint64_t y); 49*89518a1cSdmick extern uint64_t __urem64(uint64_t x, uint64_t y); 50*89518a1cSdmick extern int64_t __div64(int64_t x, int64_t y); 51*89518a1cSdmick extern int64_t __rem64(int64_t x, int64_t y); 52*89518a1cSdmick 53*89518a1cSdmick extern uint64_t __udivdi3(uint64_t a, uint64_t b); 54*89518a1cSdmick extern uint64_t __umoddi3(uint64_t a, uint64_t b); 55*89518a1cSdmick extern int64_t __divdi3(int64_t a, int64_t b); 56*89518a1cSdmick extern int64_t __moddi3(int64_t a, int64_t b); 57*89518a1cSdmick 58*89518a1cSdmick extern uint64_t __udivrem64(uint64_t x, uint64_t y); 59*89518a1cSdmick extern int64_t __divrem64(int64_t x, int64_t y); 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gate #ifdef __cplusplus 627c478bd9Sstevel@tonic-gate } 637c478bd9Sstevel@tonic-gate #endif 647c478bd9Sstevel@tonic-gate 65*89518a1cSdmick #endif /* !defined(amd64) */ 66*89518a1cSdmick 67*89518a1cSdmick #endif /* _MULDIV_H */ 68