/* * Done by Dietmar Hahn * Parts taken from FreeBSD. * *************************************************************************** * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include #include #include #include #include #include /* * ia64_change_mode: change mode to/from physical mode * * Arguments: * r14 psr for desired mode * * Modifies: * r15-r20 scratch * ar.bsp translated to new mode * sp translated to new mode * iip translated to new mode */ ENTRY(ia64_change_mode) rsm psr.i | psr.ic mov r19=ar.rsc // save rsc while we change mode tbit.nz p8,p9=r14,17 // Uses psr.dt-physical or virtual ? // p8 == true: switch to virtual // p9 == true: switch to physical ;; mov ar.rsc=IA64_RSE_LAZY // turn off RSE mov r16=rp ;; flushrs // clean the rse srlz.i ;; 1: mov r15=ip mov r17=ar.bsp mov r18=ar.rnat ;; add r15=2f-1b,r15 // address to rfi to /* !!! must be the same like in minios-ia64.lds */ (p8) movl r20=(KERNEL_START - (1<