Changes in kernel/arch/ppc32/src/asm.S [da52547:ffe276f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/asm.S
rda52547 rffe276f 1 /* 2 *Copyright (c) 2005 Martin Decky3 *All rights reserved.4 * 5 *Redistribution and use in source and binary forms, with or without6 *modification, are permitted provided that the following conditions7 *are met:8 * 9 *- Redistributions of source code must retain the above copyright10 *notice, this list of conditions and the following disclaimer.11 *- Redistributions in binary form must reproduce the above copyright12 *notice, this list of conditions and the following disclaimer in the13 *documentation and/or other materials provided with the distribution.14 *- The name of the author may not be used to endorse or promote products15 *derived from this software without specific prior written permission.16 * 17 *THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR18 *IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES19 *OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.20 *IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,21 *INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT22 *NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,23 *DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY24 *THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT25 *(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF26 *THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.27 */ 1 # 2 # Copyright (c) 2005 Martin Decky 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 # 9 # - Redistributions of source code must retain the above copyright 10 # notice, this list of conditions and the following disclaimer. 11 # - Redistributions in binary form must reproduce the above copyright 12 # notice, this list of conditions and the following disclaimer in the 13 # documentation and/or other materials provided with the distribution. 14 # - The name of the author may not be used to endorse or promote products 15 # derived from this software without specific prior written permission. 16 # 17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 # 28 28 29 29 #include <arch/asm/regname.h> … … 42 42 .global memcpy_from_uspace_failover_address 43 43 .global memcpy_to_uspace_failover_address 44 .global early_putchar45 44 46 45 userspace_asm: 47 46 48 /* 49 * r3 = uspace_uarg 50 * r4 = stack 51 * r5 = entry 52 */ 53 54 /* Disable interrupts */ 47 # r3 = uspace_uarg 48 # r4 = stack 49 # r5 = entry 50 51 # disable interrupts 55 52 56 53 mfmsr r31 … … 58 55 mtmsr r31 59 56 60 /* Set entry point */57 # set entry point 61 58 62 59 mtsrr0 r5 63 60 64 /* Set problem state, enable interrupts */61 # set problem state, enable interrupts 65 62 66 63 ori r31, r31, MSR_PR … … 68 65 mtsrr1 r31 69 66 70 /* Set stack */67 # set stack 71 68 72 69 mr sp, r4 73 70 74 /* %r6 is defined to hold pcb_ptr - set it to 0 */71 # %r6 is defined to hold pcb_ptr - set it to 0 75 72 76 73 xor r6, r6, r6 77 74 78 /* Jump to userspace */75 # jump to userspace 79 76 80 77 rfi … … 82 79 iret: 83 80 84 /* Disable interrupts */81 # disable interrupts 85 82 86 83 mfmsr r31 … … 144 141 iret_syscall: 145 142 146 /* Reset decrementer */143 # reset decrementer 147 144 148 145 li r31, 1000 149 146 mtdec r31 150 147 151 /* Disable interrupts */148 # disable interrupts 152 149 153 150 mfmsr r31 … … 281 278 memcpy_from_uspace_failover_address: 282 279 memcpy_to_uspace_failover_address: 283 /* Return zero, failure */280 # return zero, failure 284 281 xor r3, r3, r3 285 282 blr 286 287 early_putchar:288 blr
Note:
See TracChangeset
for help on using the changeset viewer.