Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/src/asm.S

    rda52547 rffe276f  
    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  */
     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#
    2828
    2929#include <arch/asm/regname.h>
     
    4242.global memcpy_from_uspace_failover_address
    4343.global memcpy_to_uspace_failover_address
    44 .global early_putchar
    4544
    4645userspace_asm:
    4746       
    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
    5552       
    5653        mfmsr r31
     
    5855        mtmsr r31
    5956       
    60         /* Set entry point */
     57        # set entry point
    6158       
    6259        mtsrr0 r5
    6360       
    64         /* Set problem state, enable interrupts */
     61        # set problem state, enable interrupts
    6562       
    6663        ori r31, r31, MSR_PR
     
    6865        mtsrr1 r31
    6966       
    70         /* Set stack */
     67        # set stack
    7168       
    7269        mr sp, r4
    7370       
    74         /* %r6 is defined to hold pcb_ptr - set it to 0 */
     71        # %r6 is defined to hold pcb_ptr - set it to 0
    7572       
    7673        xor r6, r6, r6
    7774       
    78         /* Jump to userspace */
     75        # jump to userspace
    7976       
    8077        rfi
     
    8279iret:
    8380       
    84         /* Disable interrupts */
     81        # disable interrupts
    8582       
    8683        mfmsr r31
     
    144141iret_syscall:
    145142       
    146         /* Reset decrementer */
     143        # reset decrementer
    147144       
    148145        li r31, 1000
    149146        mtdec r31
    150147       
    151         /* Disable interrupts */
     148        # disable interrupts
    152149       
    153150        mfmsr r31
     
    281278memcpy_from_uspace_failover_address:
    282279memcpy_to_uspace_failover_address:
    283         /* Return zero, failure */
     280        # return zero, failure
    284281        xor r3, r3, r3
    285282        blr
    286 
    287 early_putchar:
    288         blr
Note: See TracChangeset for help on using the changeset viewer.