2
* Copyright (C) 2003-2005 Pontus Fuchs, Giridhar Pemmasani
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
16
#include "ntoskernel.h"
17
#include "hal_exports.h"
19
wstdcall void WIN_FUNC(WRITE_PORT_ULONG,2)
20
(ULONG_PTR port, ULONG value)
25
wstdcall ULONG WIN_FUNC(READ_PORT_ULONG,1)
31
wstdcall void WIN_FUNC(WRITE_PORT_USHORT,2)
32
(ULONG_PTR port, USHORT value)
37
wstdcall USHORT WIN_FUNC(READ_PORT_USHORT,1)
43
wstdcall void WIN_FUNC(WRITE_PORT_UCHAR,2)
44
(ULONG_PTR port, UCHAR value)
49
wstdcall UCHAR WIN_FUNC(READ_PORT_UCHAR,1)
55
wstdcall void WIN_FUNC(WRITE_PORT_BUFFER_USHORT,3)
56
(ULONG_PTR port, USHORT *buf, ULONG count)
58
outsw(port, buf, count);
61
wstdcall void WIN_FUNC(READ_PORT_BUFFER_USHORT,3)
62
(ULONG_PTR port, USHORT *buf, ULONG count)
64
insw(port, buf, count);
67
wstdcall void WIN_FUNC(WRITE_PORT_BUFFER_ULONG,3)
68
(ULONG_PTR port, ULONG *buf, ULONG count)
70
outsl(port, buf, count);
73
wstdcall void WIN_FUNC(READ_PORT_BUFFER_ULONG,3)
74
(ULONG_PTR port, ULONG *buf, ULONG count)
76
insl(port, buf, count);
79
wstdcall USHORT WIN_FUNC(READ_REGISTER_USHORT,1)
85
wstdcall void WIN_FUNC(WRITE_REGISTER_ULONG,2)
86
(void __iomem *reg, UINT val)
91
wstdcall void WIN_FUNC(WRITE_REGISTER_USHORT,2)
92
(void __iomem *reg, USHORT val)
97
wstdcall void WIN_FUNC(WRITE_REGISTER_UCHAR,2)
98
(void __iomem *reg, UCHAR val)
103
wstdcall void WIN_FUNC(KeStallExecutionProcessor,1)
109
wstdcall KIRQL WIN_FUNC(KeGetCurrentIrql,0)
112
return current_irql();
115
wfastcall KIRQL WIN_FUNC(KfRaiseIrql,1)
118
return raise_irql(newirql);
121
wfastcall void WIN_FUNC(KfLowerIrql,1)
127
wfastcall KIRQL WIN_FUNC(KfAcquireSpinLock,1)
130
return nt_spin_lock_irql(lock, DISPATCH_LEVEL);
133
wfastcall void WIN_FUNC(KfReleaseSpinLock,2)
134
(NT_SPIN_LOCK *lock, KIRQL oldirql)
136
nt_spin_unlock_irql(lock, oldirql);
139
wfastcall void WIN_FUNC(KefAcquireSpinLockAtDpcLevel,1)
143
if (current_irql() != DISPATCH_LEVEL)
144
ERROR("irql != DISPATCH_LEVEL");
149
wfastcall void WIN_FUNC(KefReleaseSpinLockFromDpcLevel,1)
153
if (current_irql() != DISPATCH_LEVEL)
154
ERROR("irql != DISPATCH_LEVEL");
156
nt_spin_unlock(lock);