~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/nsprpub/pr/src/md/unix/os_ReliantUNIX.s

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/* 
 
3
* The contents of this file are subject to the Mozilla Public
 
4
* License Version 1.1 (the "License"); you may not use this file
 
5
* except in compliance with the License. You may obtain a copy of
 
6
* the License at http://www.mozilla.org/MPL/
 
7
 
8
* Software distributed under the License is distributed on an "AS
 
9
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
10
* implied. See the License for the specific language governing
 
11
* rights and limitations under the License.
 
12
 
13
* The Original Code is the Netscape Portable Runtime (NSPR).
 
14
 
15
* The Initial Developer of the Original Code is Netscape
 
16
* Communications Corporation.  Portions created by Netscape are 
 
17
* Copyright (C) 1998-2000 Netscape Communications Corporation.  All
 
18
* Rights Reserved.
 
19
 
20
* Contributor(s):
 
21
 
22
* Alternatively, the contents of this file may be used under the
 
23
* terms of the GNU General Public License Version 2 or later (the
 
24
* "GPL"), in which case the provisions of the GPL are applicable 
 
25
* instead of those above.  If you wish to allow use of your 
 
26
* version of this file only under the terms of the GPL and not to
 
27
* allow others to use your version of this file under the MPL,
 
28
* indicate your decision by deleting the provisions above and
 
29
* replace them with the notice and other provisions required by
 
30
* the GPL.  If you do not delete the provisions above, a recipient
 
31
* may use your version of this file under either the MPL or the
 
32
* GPL.
 
33
*/
 
34
 
 
35
/* We want position independent code */
 
36
#define PIC
 
37
 
 
38
#include <sys/asm.h>
 
39
#include <sys/regdef.h>
 
40
#include <sys/syscall.h>
 
41
 
 
42
        .file 1 "os_ReliantUNIX.s"
 
43
        .option pic2
 
44
        .text
 
45
 
 
46
        .align  2
 
47
        .globl  getcxt
 
48
        .ent    getcxt
 
49
getcxt:
 
50
        .frame  sp,0,$31                # vars= 0, regs= 0/0, args= 0, extra= 0
 
51
        # saved integer regs
 
52
        sw      ra,180(a0)      # gpregs[CXT_EPC]
 
53
        sw      gp,152(a0)      # gpregs[CXT_GP]
 
54
        sw      sp,156(a0)      # gpregs[CXT_SP]
 
55
        sw      s8,160(a0)      # gpregs[CXT_S8]
 
56
        sw      s0,104(a0)      # gpregs[CXT_S0]
 
57
        sw      s1,108(a0)      # gpregs[CXT_S1]
 
58
        sw      s2,112(a0)      # gpregs[CXT_S2]
 
59
        sw      s3,116(a0)      # gpregs[CXT_S3]
 
60
        sw      s4,120(a0)      # gpregs[CXT_S4]
 
61
        sw      s5,124(a0)      # gpregs[CXT_S5]
 
62
        sw      s6,128(a0)      # gpregs[CXT_S6]
 
63
        sw      s7,132(a0)      # gpregs[CXT_S7]
 
64
        # csr
 
65
        cfc1    v0,$31
 
66
        # saved float regs
 
67
        s.d     $f20,264(a0)    # fpregs.fp_r.fp_dregs[10]
 
68
        s.d     $f22,272(a0)    # fpregs.fp_r.fp_dregs[11]
 
69
        s.d     $f24,280(a0)    # fpregs.fp_r.fp_dregs[12]
 
70
        s.d     $f26,288(a0)    # fpregs.fp_r.fp_dregs[13]
 
71
        s.d     $f28,296(a0)    # fpregs.fp_r.fp_dregs[14]
 
72
        s.d     $f30,304(a0)    # fpregs.fp_r.fp_dregs[15]
 
73
        sw      v0,312(a0)      # fpregs.fp_csr
 
74
 
 
75
        # give no illusions about the contents
 
76
        li      v0,0x0c         # UC_CPU | UC_MAU
 
77
        sw      v0,0(a0)        # uc_flags
 
78
 
 
79
        move    v0,zero
 
80
        j       ra
 
81
        .end    getcxt
 
82
 
 
83
        .align  2
 
84
        .globl  setcxt
 
85
        .ent    setcxt
 
86
setcxt:
 
87
        .frame  sp,0,$31                # vars= 0, regs= 0/0, args= 0, extra= 0
 
88
        lw      v0,312(a0)      # fpregs.fp_csr
 
89
        li      v1,0xfffc0fff   # mask out exception cause bits
 
90
        and     v0,v0,v1
 
91
        # saved integer regs
 
92
        lw      t9,180(a0)      # gpregs[CXT_EPC]
 
93
        lw      ra,180(a0)      # gpregs[CXT_EPC]
 
94
        lw      gp,152(a0)      # gpregs[CXT_GP]
 
95
        lw      sp,156(a0)      # gpregs[CXT_SP]
 
96
        ctc1    v0,$31          # fp_csr
 
97
        lw      s8,160(a0)      # gpregs[CXT_S8]
 
98
        lw      s0,104(a0)      # gpregs[CXT_S0]
 
99
        lw      s1,108(a0)      # gpregs[CXT_S1]
 
100
        lw      s2,112(a0)      # gpregs[CXT_S2]
 
101
        lw      s3,116(a0)      # gpregs[CXT_S3]
 
102
        lw      s4,120(a0)      # gpregs[CXT_S4]
 
103
        lw      s5,124(a0)      # gpregs[CXT_S5]
 
104
        lw      s6,128(a0)      # gpregs[CXT_S6]
 
105
        lw      s7,132(a0)      # gpregs[CXT_S7]
 
106
        # saved float regs
 
107
        l.d     $f20,264(a0)    # fpregs.fp_r.fp_dregs[10]
 
108
        l.d     $f22,272(a0)    # fpregs.fp_r.fp_dregs[11]
 
109
        l.d     $f24,280(a0)    # fpregs.fp_r.fp_dregs[12]
 
110
        l.d     $f26,288(a0)    # fpregs.fp_r.fp_dregs[13]
 
111
        l.d     $f28,296(a0)    # fpregs.fp_r.fp_dregs[14]
 
112
        l.d     $f30,304(a0)    # fpregs.fp_r.fp_dregs[15]
 
113
 
 
114
        # load these, too
 
115
        # they were not saved, but maybe the user modified them...
 
116
        lw      v0,48(a0)
 
117
        lw      v1,52(a0)
 
118
        lw      a1,60(a0)
 
119
        lw      a2,64(a0)
 
120
        lw      a3,68(a0)
 
121
        lw      a0,56(a0)       # there is no way back
 
122
 
 
123
        j       ra
 
124
 
 
125
        .end    setcxt