Changeset eedf4c5 in mainline
- Timestamp:
- 2010-07-01T22:27:45Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dbd4ae5
- Parents:
- d5042d28
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/asm.S
rd5042d28 reedf4c5 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_putchar 44 45 45 46 userspace_asm: 46 47 47 # r3 = uspace_uarg 48 # r4 = stack 49 # r5 = entry 50 51 # disable interrupts 48 /* 49 * r3 = uspace_uarg 50 * r4 = stack 51 * r5 = entry 52 */ 53 54 /* Disable interrupts */ 52 55 53 56 mfmsr r31 … … 55 58 mtmsr r31 56 59 57 # set entry point60 /* Set entry point */ 58 61 59 62 mtsrr0 r5 60 63 61 # set problem state, enable interrupts64 /* Set problem state, enable interrupts */ 62 65 63 66 ori r31, r31, MSR_PR … … 65 68 mtsrr1 r31 66 69 67 # set stack70 /* Set stack */ 68 71 69 72 mr sp, r4 70 73 71 # %r6 is defined to hold pcb_ptr - set it to 074 /* %r6 is defined to hold pcb_ptr - set it to 0 */ 72 75 73 76 xor r6, r6, r6 74 77 75 # jump to userspace78 /* Jump to userspace */ 76 79 77 80 rfi … … 79 82 iret: 80 83 81 # disable interrupts84 /* Disable interrupts */ 82 85 83 86 mfmsr r31 … … 141 144 iret_syscall: 142 145 143 # reset decrementer146 /* Reset decrementer */ 144 147 145 148 li r31, 1000 146 149 mtdec r31 147 150 148 # disable interrupts151 /* Disable interrupts */ 149 152 150 153 mfmsr r31 … … 278 281 memcpy_from_uspace_failover_address: 279 282 memcpy_to_uspace_failover_address: 280 # return zero, failure283 /* Return zero, failure */ 281 284 xor r3, r3, r3 282 285 blr
Note:
See TracChangeset
for help on using the changeset viewer.