ofwcall32.S (222613) | ofwcall32.S (223485) |
---|---|
1/*- 2 * Copyright (C) 2009-2011 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 8 unchanged lines hidden (view full) --- 17 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * | 1/*- 2 * Copyright (C) 2009-2011 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 8 unchanged lines hidden (view full) --- 17 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * |
25 * $FreeBSD: head/sys/powerpc/ofw/ofwcall32.S 222613 2011-06-02 14:12:37Z nwhitehorn $ | 25 * $FreeBSD: head/sys/powerpc/ofw/ofwcall32.S 223485 2011-06-23 22:21:28Z nwhitehorn $ |
26 */ 27 28#include <sys/syscall.h> 29 30#include <machine/trap.h> 31#include <machine/param.h> 32#include <machine/spr.h> 33#include <machine/asm.h> --- 48 unchanged lines hidden (view full) --- 82 83 /* 84 * Set up OF stack. This needs to be potentially accessible in real mode 85 * The pointer to the current kernel stack is placed at the very 86 * top of the stack along with the old MSR so we can get them back 87 * later. 88 */ 89 mr %r5,%r1 | 26 */ 27 28#include <sys/syscall.h> 29 30#include <machine/trap.h> 31#include <machine/param.h> 32#include <machine/spr.h> 33#include <machine/asm.h> --- 48 unchanged lines hidden (view full) --- 82 83 /* 84 * Set up OF stack. This needs to be potentially accessible in real mode 85 * The pointer to the current kernel stack is placed at the very 86 * top of the stack along with the old MSR so we can get them back 87 * later. 88 */ 89 mr %r5,%r1 |
90 lis %r1,(ofwstk+OFWSTKSZ-16)@ha 91 addi %r1,%r1,(ofwstk+OFWSTKSZ-16)@l 92 stw %r5,8(%r1) /* Save real stack pointer */ 93 stw %r6,12(%r1) /* Save old MSR */ | 90 lis %r1,(ofwstk+OFWSTKSZ-32)@ha 91 addi %r1,%r1,(ofwstk+OFWSTKSZ-32)@l 92 stw %r5,20(%r1) /* Save real stack pointer */ 93 stw %r2,24(%r1) /* Save curthread */ 94 stw %r6,28(%r1) /* Save old MSR */ |
94 li %r5,0 95 stw %r5,4(%r1) 96 stw %r5,0(%r1) 97 98 /* Finally, branch to OF */ 99 mtctr %r4 100 bctrl 101 102 /* Reload stack pointer and MSR from the OFW stack */ | 95 li %r5,0 96 stw %r5,4(%r1) 97 stw %r5,0(%r1) 98 99 /* Finally, branch to OF */ 100 mtctr %r4 101 bctrl 102 103 /* Reload stack pointer and MSR from the OFW stack */ |
103 lwz %r6,12(%r1) 104 lwz %r1,8(%r1) | 104 lwz %r6,28(%r1) 105 lwz %r2,24(%r1) 106 lwz %r1,20(%r1) |
105 106 /* Now set the real MSR */ 107 mtmsr %r6 108 isync 109 110 /* Return */ 111 lwz %r0,4(%r1) 112 mtlr %r0 --- 42 unchanged lines hidden --- | 107 108 /* Now set the real MSR */ 109 mtmsr %r6 110 isync 111 112 /* Return */ 113 lwz %r0,4(%r1) 114 mtlr %r0 --- 42 unchanged lines hidden --- |