blob: d52aa1d489e939b62970c5b67e4d28ef6599cd3e (
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
|
/* xmsa20.c - A20 related XMS routines
*
* XMSA20
*
* Modification History:
*
* Sudeepb 15-May-1991 Created
*/
#include "xms.h"
#include <xmssvc.h>
#include <softpc.h>
void sas_enable_20_bit_wrapping(void);
void sas_disable_20_bit_wrapping(void);
BOOL sas_twenty_bit_wrapping_enabled(void);
BYTE * pHimemA20State = NULL;
/* xmsA20 - Handle A20 requests
*
*
* Entry - Client (AX) 0 - Disable A20
* 1 - Enable A20
* 2 - Query
*
* Exit
* SUCCESS
* Client (AX) = 1
* if on entry AX=2 Then
* Cleint (AX) =1 means was enabled
* Cleint (AX) =0 means was disabled
*
* FAILURE
* Client (AX) = 0
*/
VOID xmsA20 (VOID)
{
int reason;
reason = getAX();
setAX(1);
if (reason == 0)
xmsEnableA20Wrapping();
else if (reason == 1)
xmsDisableA20Wrapping();
else if (reason == 2) {
if (sas_twenty_bit_wrapping_enabled())
setAX(0);
setBL(0);
}
else
setAX(0);
}
// function to enable 1MB wrapping (turn off A20 line)
VOID xmsEnableA20Wrapping(VOID)
{
sas_enable_20_bit_wrapping();
if (pHimemA20State != NULL)
*pHimemA20State = 0;
#if 0 // this is not necessay because the intel space(pointed by
// HimemA20State) doesn't contain instruction
// doesn't contain instruction
#ifdef MIPS
Sim32FlushVDMPointer
(
(((ULONG)pHimemA20State >> 4) << 16) | ((ULONG)pHimemA20State & 0xF),
1,
pHimemA20State,
FALSE
);
#endif
#endif
}
// function to disable 1MB wrapping(turn on A20 line)
VOID xmsDisableA20Wrapping(VOID)
{
sas_disable_20_bit_wrapping();
if (pHimemA20State != NULL)
*pHimemA20State = 1;
#if 0 // this is not necessay because the intel space(pointed by
// HimemA20State) doesn't contain instruction
// doesn't contain instruction
#ifdef MIPS
Sim32FlushVDMPointer
(
(((ULONG)pHimemA20State >> 4) << 16) | ((ULONG)pHimemA20State & 0xF),
1,
pHimemA20State,
FALSE
);
#endif
#endif
}
|