userret.h revision 1.10
11.10Smatt/* $NetBSD: userret.h,v 1.10 2012/02/06 02:14:13 matt Exp $ */
21.1Sthorpej
31.1Sthorpej/*-
41.1Sthorpej * Copyright (c) 2000 The NetBSD Foundation, Inc.
51.1Sthorpej * All rights reserved.
61.1Sthorpej *
71.1Sthorpej * This code is derived from software contributed to The NetBSD Foundation
81.1Sthorpej * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
91.1Sthorpej * NASA Ames Research Center, and by Charles M. Hannum.
101.1Sthorpej *
111.1Sthorpej * Redistribution and use in source and binary forms, with or without
121.1Sthorpej * modification, are permitted provided that the following conditions
131.1Sthorpej * are met:
141.1Sthorpej * 1. Redistributions of source code must retain the above copyright
151.1Sthorpej *    notice, this list of conditions and the following disclaimer.
161.1Sthorpej * 2. Redistributions in binary form must reproduce the above copyright
171.1Sthorpej *    notice, this list of conditions and the following disclaimer in the
181.1Sthorpej *    documentation and/or other materials provided with the distribution.
191.1Sthorpej *
201.1Sthorpej * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
211.1Sthorpej * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
221.1Sthorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
231.1Sthorpej * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
241.1Sthorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
251.1Sthorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
261.1Sthorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
271.1Sthorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
281.1Sthorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
291.1Sthorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
301.1Sthorpej * POSSIBILITY OF SUCH DAMAGE.
311.1Sthorpej */
321.1Sthorpej
331.1Sthorpej/*
341.1Sthorpej * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
351.1Sthorpej *
361.1Sthorpej * Redistribution and use in source and binary forms, with or without
371.1Sthorpej * modification, are permitted provided that the following conditions
381.1Sthorpej * are met:
391.1Sthorpej * 1. Redistributions of source code must retain the above copyright
401.1Sthorpej *    notice, this list of conditions and the following disclaimer.
411.1Sthorpej * 2. Redistributions in binary form must reproduce the above copyright
421.1Sthorpej *    notice, this list of conditions and the following disclaimer in the
431.1Sthorpej *    documentation and/or other materials provided with the distribution.
441.1Sthorpej * 3. All advertising materials mentioning features or use of this software
451.1Sthorpej *    must display the following acknowledgement:
461.1Sthorpej *      This product includes software developed by Christopher G. Demetriou
471.1Sthorpej *	for the NetBSD Project.
481.1Sthorpej * 4. The name of the author may not be used to endorse or promote products
491.1Sthorpej *    derived from this software without specific prior written permission
501.1Sthorpej *
511.1Sthorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
521.1Sthorpej * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
531.1Sthorpej * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
541.1Sthorpej * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
551.1Sthorpej * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
561.1Sthorpej * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
571.1Sthorpej * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
581.1Sthorpej * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
591.1Sthorpej * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
601.1Sthorpej * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
611.1Sthorpej */
621.1Sthorpej
631.1Sthorpej/*
641.1Sthorpej * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
651.1Sthorpej * All rights reserved.
661.1Sthorpej *
671.1Sthorpej * Author: Chris G. Demetriou
681.10Smatt *
691.1Sthorpej * Permission to use, copy, modify and distribute this software and
701.1Sthorpej * its documentation is hereby granted, provided that both the copyright
711.1Sthorpej * notice and this permission notice appear in all copies of the
721.1Sthorpej * software, derivative works or modified versions, and any portions
731.1Sthorpej * thereof, and that both notices appear in supporting documentation.
741.10Smatt *
751.10Smatt * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
761.10Smatt * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
771.1Sthorpej * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
781.10Smatt *
791.1Sthorpej * Carnegie Mellon requests users of this software to return to
801.1Sthorpej *
811.1Sthorpej *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
821.1Sthorpej *  School of Computer Science
831.1Sthorpej *  Carnegie Mellon University
841.1Sthorpej *  Pittsburgh PA 15213-3890
851.1Sthorpej *
861.1Sthorpej * any improvements or extensions that they make and grant Carnegie the
871.1Sthorpej * rights to redistribute these changes.
881.1Sthorpej */
891.1Sthorpej
901.1Sthorpej#ifndef _ALPHA_USERRET_H_
911.1Sthorpej#define	_ALPHA_USERRET_H_
921.1Sthorpej
931.3Scl#include <sys/userret.h>
941.9Smatt#include <uvm/uvm_extern.h>
951.3Scl
961.1Sthorpej/*
971.1Sthorpej * Define the code needed before returning to user mode, for
981.1Sthorpej * trap and syscall.
991.1Sthorpej */
1001.6Sperrystatic __inline void
1011.2Sthorpejuserret(struct lwp *l)
1021.1Sthorpej{
1031.2Sthorpej	struct proc *p = l->l_proc;
1041.1Sthorpej
1051.1Sthorpej	/* Do any deferred user pmap operations. */
1061.1Sthorpej	PMAP_USERRET(vm_map_pmap(&p->p_vmspace->vm_map));
1071.1Sthorpej
1081.3Scl	/* Invoke MI userret code */
1091.3Scl	mi_userret(l);
1101.1Sthorpej}
1111.1Sthorpej
1121.1Sthorpej#endif /* _ALPHA_USERRET_H_ */
113