1*c242ec1bSRoger A. Faulkner/* 2*c242ec1bSRoger A. Faulkner * CDDL HEADER START 3*c242ec1bSRoger A. Faulkner * 4*c242ec1bSRoger A. Faulkner * The contents of this file are subject to the terms of the 5*c242ec1bSRoger A. Faulkner * Common Development and Distribution License (the "License"). 6*c242ec1bSRoger A. Faulkner * You may not use this file except in compliance with the License. 7*c242ec1bSRoger A. Faulkner * 8*c242ec1bSRoger A. Faulkner * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*c242ec1bSRoger A. Faulkner * or http://www.opensolaris.org/os/licensing. 10*c242ec1bSRoger A. Faulkner * See the License for the specific language governing permissions 11*c242ec1bSRoger A. Faulkner * and limitations under the License. 12*c242ec1bSRoger A. Faulkner * 13*c242ec1bSRoger A. Faulkner * When distributing Covered Code, include this CDDL HEADER in each 14*c242ec1bSRoger A. Faulkner * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*c242ec1bSRoger A. Faulkner * If applicable, add the following below this CDDL HEADER, with the 16*c242ec1bSRoger A. Faulkner * fields enclosed by brackets "[]" replaced with your own identifying 17*c242ec1bSRoger A. Faulkner * information: Portions Copyright [yyyy] [name of copyright owner] 18*c242ec1bSRoger A. Faulkner * 19*c242ec1bSRoger A. Faulkner * CDDL HEADER END 20*c242ec1bSRoger A. Faulkner */ 21*c242ec1bSRoger A. Faulkner 22*c242ec1bSRoger A. Faulkner/* 23*c242ec1bSRoger A. Faulkner * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24*c242ec1bSRoger A. Faulkner * Use is subject to license terms. 25*c242ec1bSRoger A. Faulkner */ 26*c242ec1bSRoger A. Faulkner 27*c242ec1bSRoger A. Faulkner/* Copyright (c) 1988 AT&T */ 28*c242ec1bSRoger A. Faulkner/* All Rights Reserved */ 29*c242ec1bSRoger A. Faulkner 30*c242ec1bSRoger A. Faulkner .file "mmap.s" 31*c242ec1bSRoger A. Faulkner 32*c242ec1bSRoger A. Faulkner#include <sys/asm_linkage.h> 33*c242ec1bSRoger A. Faulkner 34*c242ec1bSRoger A. Faulkner#if !defined(_LARGEFILE_SOURCE) 35*c242ec1bSRoger A. Faulkner ANSI_PRAGMA_WEAK(mmap,function) 36*c242ec1bSRoger A. Faulkner#else 37*c242ec1bSRoger A. Faulkner ANSI_PRAGMA_WEAK(mmap64,function) 38*c242ec1bSRoger A. Faulkner#endif 39*c242ec1bSRoger A. Faulkner 40*c242ec1bSRoger A. Faulkner#include "SYS.h" 41*c242ec1bSRoger A. Faulkner#include <sys/mman.h> /* Need _MAP_NEW definition */ 42*c242ec1bSRoger A. Faulkner 43*c242ec1bSRoger A. Faulkner#if !defined(_LARGEFILE_SOURCE) 44*c242ec1bSRoger A. Faulkner 45*c242ec1bSRoger A. Faulkner/* 46*c242ec1bSRoger A. Faulkner * C library -- mmap 47*c242ec1bSRoger A. Faulkner * caddr_t mmap(caddr_t addr, size_t len, int prot, 48*c242ec1bSRoger A. Faulkner * int flags, int fd, off_t off) 49*c242ec1bSRoger A. Faulkner */ 50*c242ec1bSRoger A. Faulkner 51*c242ec1bSRoger A. Faulkner ENTRY(mmap) 52*c242ec1bSRoger A. Faulkner#if defined(__sparc) 53*c242ec1bSRoger A. Faulkner /* this depends upon the _MAP_NEW flag being in the top bits */ 54*c242ec1bSRoger A. Faulkner sethi %hi(_MAP_NEW), %g1 55*c242ec1bSRoger A. Faulkner or %g1, %o3, %o3 56*c242ec1bSRoger A. Faulkner#endif 57*c242ec1bSRoger A. Faulkner SYSTRAP_RVAL1(mmap) 58*c242ec1bSRoger A. Faulkner SYSCERROR 59*c242ec1bSRoger A. Faulkner RET 60*c242ec1bSRoger A. Faulkner SET_SIZE(mmap) 61*c242ec1bSRoger A. Faulkner 62*c242ec1bSRoger A. Faulkner#else 63*c242ec1bSRoger A. Faulkner 64*c242ec1bSRoger A. Faulkner/* 65*c242ec1bSRoger A. Faulkner * C library -- mmap64 66*c242ec1bSRoger A. Faulkner * caddr_t mmap64(caddr_t addr, size_t len, int prot, 67*c242ec1bSRoger A. Faulkner * int flags, int fd, off64_t off) 68*c242ec1bSRoger A. Faulkner */ 69*c242ec1bSRoger A. Faulkner 70*c242ec1bSRoger A. Faulkner ENTRY(mmap64) 71*c242ec1bSRoger A. Faulkner#if defined(__sparc) 72*c242ec1bSRoger A. Faulkner /* this depends upon the _MAP_NEW flag being in the top bits */ 73*c242ec1bSRoger A. Faulkner sethi %hi(_MAP_NEW), %g1 74*c242ec1bSRoger A. Faulkner or %g1, %o3, %o3 75*c242ec1bSRoger A. Faulkner#endif 76*c242ec1bSRoger A. Faulkner SYSTRAP_RVAL1(mmap64) 77*c242ec1bSRoger A. Faulkner SYSCERROR 78*c242ec1bSRoger A. Faulkner RET 79*c242ec1bSRoger A. Faulkner SET_SIZE(mmap64) 80*c242ec1bSRoger A. Faulkner 81*c242ec1bSRoger A. Faulkner#endif 82