summaryrefslogtreecommitdiffstats
path: root/private/ntos/nthals/halr96b/mips/r94aio.s
blob: fed2171e2409d9d0ce59e0c5467a62ba35b7fb87 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
//	.ident "@(#) r94aio.s 1.1 95/09/28 18:36:07 nec"
//++
//
// Copyright (c) 1994  KOBE NEC Software Corporation
//
// Module Name:
//
//    r94aio.s
//
// Abstract:
//
//    This module implements the system dependent kernel function to read
//    and write the 64-bit register on a MIPS R4000 R94A system.
//
// Author:
//
// Environment:
//
//    Kernel mode only.
//
// Revision History:
//
//	H000	Fri Oct  7 19:57:09 JST 1994	kbnes!kisimoto
//		new READ_REGISTER_DWORD
//		new WRITE_REGISTER_DWORD
//
//--

#if defined(_R94A_)

#include "halmips.h"

//++
//
// VOID
// READ_REGISTER_DWORD (
//    IN PLARGE_INTEGER RegisterAddress,
//    IN PVOID Variable
//    )
//
// Routine Description:
//
//    64-bit I/O space register read function.
//
// Arguments:
//
//    RegisterAddress (a0) - Supplies a pointer to the destination address of
//       the move operation.
//
//    Variable (a1) - Supplies a pointer to the source address of the move
//       operation.
//
// Return Value:
//
//    None.
//
//    Destination and Source must be 8-byte aligned.
//
//--

        LEAF_ENTRY(READ_REGISTER_DWORD)

        ldc1    f0,0(a0)                // move 8-byte block
        sdc1    f0,0(a1)                //

	sync                            // synchronize read

        j       ra                      // return

        .end    READ_REGISTER_DWORD


//++
//
// VOID
// WRITE_REGISTER_DWORD (
//    IN PLARGE_INTEGER RegisterAddress,
//    IN PVOID Variable
//    )
//
// Routine Description:
//
//    64-bit I/O space register write function.
//
// Arguments:
//
//    RegisterAddress (a0) - Supplies a pointer to the destination address of
//       the move operation.
//
//    Variable (a1) - Supplies a pointer to the source address of the move
//       operation.
//
// Return Value:
//
//    None.
//
//    Destination and Source must be 8-byte aligned.
//
//--

        LEAF_ENTRY(WRITE_REGISTER_DWORD)

        ldc1    f0,0(a1)                // move 8-byte block
        sdc1    f0,0(a0)                //

	sync                            // synchronize write

        j       ra                      // return

        .end    WRITE_REGISTER_DWORD


//++
//
// VOID
// HalpGetStatusRegister (
//    IN PULONG Variable
//    )
//
// Routine Description:
//
//    This function returns value which is status register of R4400.
//
// Arguments:
//
//    Variable (a0) - Supplies a pointer to the destination address of
//       the move operation.
//
// Return Value:
//
//    None.
//
//--

        LEAF_ENTRY(HalpGetStatusRegister)

        .set    noreorder
        .set    noat
        mfc0    t0,psr                  // get current processor status
        nop                             // 1 cycle hazzard
        sw      t0,0(a0)                // save integer registers a0 - a3
        .set    at
        .set    reorder

        j       ra                      // return

        .end    HalpGetStatusRegister

#endif