[BACK]Return to lcore_ddb.S CVS log [TXT][DIR] Up to [local] / sys / arch / mips64 / mips64

Annotation of sys/arch/mips64/mips64/lcore_ddb.S, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: lcore_ddb.S,v 1.8 2005/12/20 07:06:26 miod Exp $ */
                      2:
                      3: /*
                      4:  * Copyright (c) 2001-2003 Opsycon AB  (www.opsycon.se / www.opsycon.com)
                      5:  *
                      6:  * Redistribution and use in source and binary forms, with or without
                      7:  * modification, are permitted provided that the following conditions
                      8:  * are met:
                      9:  * 1. Redistributions of source code must retain the above copyright
                     10:  *    notice, this list of conditions and the following disclaimer.
                     11:  * 2. 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:  *
                     15:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
                     16:  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
                     17:  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     18:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
                     19:  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     20:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     21:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     22:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     23:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     24:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     25:  * SUCH DAMAGE.
                     26:  *
                     27:  */
                     28: #include <sys/errno.h>
                     29: #include <sys/syscall.h>
                     30:
                     31: #include <machine/param.h>
                     32: #include <machine/psl.h>
                     33: #include <machine/asm.h>
                     34: #include <machine/cpu.h>
                     35: #include <machine/regnum.h>
                     36: #include <machine/cpustate.h>
                     37: #include <machine/trap.h>
                     38:
                     39: #include "assym.h"
                     40:
                     41:        .set    noreorder               # Noreorder is default style!
                     42:
                     43: #ifdef __LP64__
                     44: LEAF(kdbpeekd, 0)
                     45:        PTR_L   t0, curprocpaddr
                     46:        li      v0, KT_DDBERR
                     47:        and     v1, a0, 7                       # unaligned ?
                     48:        bne     v1, zero, 1f
                     49:        sw      v0, PCB_ONFAULT(t0)
                     50:
                     51:        ld      v0, (a0)
                     52:        jr      ra
                     53:        sw      zero, PCB_ONFAULT(t0)
                     54:
                     55: 1:
                     56:        LDHI    v0, 0(a0)
                     57:        LDLO    v0, 7(a0)
                     58:        jr      ra
                     59:        sw      zero, PCB_ONFAULT(t0)
                     60: END(kdbpeekd)
                     61: #endif
                     62:
                     63: LEAF(kdbpeek, 0)
                     64:        PTR_L   t0, curprocpaddr
                     65:        li      v0, KT_DDBERR
                     66:        and     v1, a0, 3                       # unaligned ?
                     67:        bne     v1, zero, 1f
                     68:        sw      v0, PCB_ONFAULT(t0)
                     69:
                     70:        lw      v0, (a0)
                     71:        jr      ra
                     72:        sw      zero, PCB_ONFAULT(t0)
                     73:
                     74: 1:
                     75:        LWHI    v0, 0(a0)
                     76:        LWLO    v0, 3(a0)
                     77:        jr      ra
                     78:        sw      zero, PCB_ONFAULT(t0)
                     79: END(kdbpeek)
                     80:
                     81: LEAF(kdbpeekw, 0)
                     82:        PTR_L   t0, curprocpaddr
                     83:        li      v0, KT_DDBERR
                     84:        and     v1, a0, 1                       # unaligned ?
                     85:        bne     v1, zero, 1f
                     86:        sw      v0, PCB_ONFAULT(t0)
                     87:
                     88:        lh      v0, (a0)
                     89:        jr      ra
                     90:        sw      zero, PCB_ONFAULT(t0)
                     91:
                     92: 1:
                     93:        li      v0, -1                          # error!
                     94:        jr      ra
                     95:        sw      zero, PCB_ONFAULT(t0)
                     96: END(kdbpeekw)
                     97:
                     98: LEAF(kdbpeekb, 0)
                     99:        PTR_L   t0, curprocpaddr
                    100:        li      v0, KT_DDBERR
                    101:        sw      v0, PCB_ONFAULT(t0)
                    102:        lb      v0, 0(a0)
                    103:        jr      ra
                    104:        sw      zero, PCB_ONFAULT(t0)
                    105: END(kdbpeekb)
                    106:
                    107:        .globl  kt_ddberr
                    108: kt_ddberr:
                    109:        jr      ra
                    110:        li      v0, -1
                    111:
                    112: #ifdef __LP64__
                    113: LEAF(kdbpoked, 0)
                    114:        PTR_L   t0, curprocpaddr
                    115:        li      v0, KT_DDBERR
                    116:        and     v1, a0, 7                       # unaligned ?
                    117:        bne     v1, zero, 1f
                    118:        sw      v0, PCB_ONFAULT(t0)
                    119:
                    120:        sd      a1, (a0)
                    121:        jr      ra
                    122:        sw      zero, PCB_ONFAULT(t0)
                    123:
                    124: 1:
                    125:        SDHI    a1, 0(a0)
                    126:        SDLO    a1, 7(a0)
                    127:        jr      ra
                    128:        sw      zero, PCB_ONFAULT(t0)
                    129: END(kdbpoked)
                    130: #endif
                    131:
                    132:
                    133: LEAF(kdbpoke, 0)
                    134:        PTR_L   t0, curprocpaddr
                    135:        li      v0, KT_DDBERR
                    136:        and     v1, a0, 3                       # unaligned ?
                    137:        bne     v1, zero, 1f
                    138:        sw      v0, PCB_ONFAULT(t0)
                    139:
                    140:        sw      a1, (a0)
                    141:        jr      ra
                    142:        sw      zero, PCB_ONFAULT(t0)
                    143:
                    144: 1:
                    145:        SWHI    a1, 0(a0)
                    146:        SWLO    a1, 3(a0)
                    147:        jr      ra
                    148:        sw      zero, PCB_ONFAULT(t0)
                    149: END(kdbpoke)
                    150:
                    151: LEAF(kdbpokew, 0)
                    152:        PTR_L   t0, curprocpaddr
                    153:        li      v0, KT_DDBERR
                    154:        and     v1, a0, 1                       # unaligned ?
                    155:        bne     v1, zero, 1f
                    156:        sw      v0, PCB_ONFAULT(t0)
                    157:
                    158:        sh      a1, (a0)
                    159:        jr      ra
                    160:        sw      zero, PCB_ONFAULT(t0)
                    161:
                    162: 1:
                    163:        jr      ra
                    164:        sw      zero, PCB_ONFAULT(t0)
                    165: END(kdbpokew)
                    166:
                    167: LEAF(kdbpokeb, 0)
                    168:        PTR_L   t0, curprocpaddr
                    169:        li      v0, KT_DDBERR
                    170:        sw      v0, PCB_ONFAULT(t0)
                    171:        sb      a1, 0(a0)
                    172:        jr      ra
                    173:        sw      zero, PCB_ONFAULT(t0)
                    174: END(kdbpokeb)
                    175:
                    176: LEAF(Debugger, 0)
                    177:        break   BREAK_SOVER_VAL
                    178:        jr      ra
                    179:        nop
                    180: END(Debugger)
                    181:
                    182: LEAF(setjmp, 0)
                    183:        mfc0    v0, COP_0_STATUS_REG    # Later the "real" spl value!
                    184:        REG_S   s0, REGSZ * 0(a0)
                    185:        REG_S   s1, REGSZ * 1(a0)
                    186:        REG_S   s2, REGSZ * 2(a0)
                    187:        REG_S   s3, REGSZ * 3(a0)
                    188:        REG_S   s4, REGSZ * 4(a0)
                    189:        REG_S   s5, REGSZ * 5(a0)
                    190:        REG_S   s6, REGSZ * 6(a0)
                    191:        REG_S   s7, REGSZ * 7(a0)
                    192:        REG_S   s8, REGSZ * 8(a0)
                    193:        REG_S   sp, REGSZ * 9(a0)
                    194:        REG_S   ra, REGSZ * 10(a0)
                    195:        REG_S   v0, REGSZ * 11(a0)
                    196:        jr      ra
                    197:        li      v0, 0                   # setjmp return
                    198: END(setjmp)
                    199:
                    200: LEAF(longjmp, 0)
                    201:        REG_L   v0, REGSZ * 11(a0)
                    202:        REG_L   ra, REGSZ * 10(a0)
                    203:        REG_L   s0, REGSZ * 0(a0)
                    204:        REG_L   s1, REGSZ * 1(a0)
                    205:        REG_L   s2, REGSZ * 2(a0)
                    206:        REG_L   s3, REGSZ * 3(a0)
                    207:        REG_L   s4, REGSZ * 4(a0)
                    208:        REG_L   s5, REGSZ * 5(a0)
                    209:        REG_L   s6, REGSZ * 6(a0)
                    210:        REG_L   s7, REGSZ * 7(a0)
                    211:        REG_L   s8, REGSZ * 8(a0)
                    212:        REG_L   sp, REGSZ * 9(a0)
                    213:        mtc0    v0, COP_0_STATUS_REG    # Later the "real" spl value!
                    214:        ITLBNOPFIX
                    215:        jr      ra
                    216:        li      v0, 1                   # longjmp return
                    217: END(longjmp)
                    218:

CVSweb