wineps.drv: Slightly simplify a PPD parser code snippet.
[wine] / dlls / hal / hal.c
1 /*
2  * hal.dll implementation
3  *
4  * Copyright (C) 2007 Chris Wulff
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include "config.h"
22 #include "wine/port.h"
23
24 #include <stdarg.h>
25
26 #define NONAMELESSUNION
27 #define NONAMELESSSTRUCT
28
29 #include "ntstatus.h"
30 #define WIN32_NO_STATUS
31 #include "windef.h"
32 #include "winternl.h"
33 #include "excpt.h"
34 #include "ddk/ntddk.h"
35 #include "wine/debug.h"
36
37 WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl);
38
39 #ifdef __i386__
40 #define DEFINE_FASTCALL1_ENTRYPOINT( name ) \
41     __ASM_STDCALL_FUNC( name, 4, \
42                        "popl %eax\n\t" \
43                        "pushl %ecx\n\t" \
44                        "pushl %eax\n\t" \
45                        "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(4))
46 #define DEFINE_FASTCALL2_ENTRYPOINT( name ) \
47     __ASM_STDCALL_FUNC( name, 8, \
48                        "popl %eax\n\t" \
49                        "pushl %edx\n\t" \
50                        "pushl %ecx\n\t" \
51                        "pushl %eax\n\t" \
52                        "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(8))
53 #endif
54
55
56 #ifdef DEFINE_FASTCALL1_ENTRYPOINT
57 DEFINE_FASTCALL1_ENTRYPOINT( ExAcquireFastMutex )
58 VOID WINAPI __regs_ExAcquireFastMutex(PFAST_MUTEX FastMutex)
59 #else
60 VOID WINAPI ExAcquireFastMutex(PFAST_MUTEX FastMutex)
61 #endif
62 {
63     FIXME("%p: stub\n", FastMutex);
64 }
65
66 #ifdef DEFINE_FASTCALL1_ENTRYPOINT
67 DEFINE_FASTCALL1_ENTRYPOINT( ExReleaseFastMutex )
68 VOID WINAPI __regs_ExReleaseFastMutex(PFAST_MUTEX FastMutex)
69 #else
70 VOID WINAPI ExReleaseFastMutex(PFAST_MUTEX FastMutex)
71 #endif
72 {
73     FIXME("%p: stub\n", FastMutex);
74 }
75
76 #ifdef DEFINE_FASTCALL1_ENTRYPOINT
77 DEFINE_FASTCALL1_ENTRYPOINT( ExTryToAcquireFastMutex )
78 BOOLEAN WINAPI __regs_ExTryToAcquireFastMutex(PFAST_MUTEX FastMutex)
79 #else
80 BOOLEAN WINAPI ExTryToAcquireFastMutex(PFAST_MUTEX FastMutex)
81 #endif
82 {
83     FIXME("(%p) stub\n", FastMutex);
84     return TRUE;
85 }
86
87 #ifdef DEFINE_FASTCALL1_ENTRYPOINT
88 DEFINE_FASTCALL1_ENTRYPOINT( KfAcquireSpinLock )
89 KIRQL WINAPI __regs_KfAcquireSpinLock(PKSPIN_LOCK SpinLock)
90 #else
91 KIRQL WINAPI KfAcquireSpinLock(PKSPIN_LOCK SpinLock)
92 #endif
93 {
94     FIXME( "(%p) stub!\n", SpinLock );
95
96     return 0;
97 }
98
99
100 #ifdef DEFINE_FASTCALL1_ENTRYPOINT
101 DEFINE_FASTCALL1_ENTRYPOINT( KfLowerIrql )
102 VOID WINAPI __regs_KfLowerIrql(KIRQL NewIrql)
103 #else
104 VOID WINAPI KfLowerIrql(KIRQL NewIrql)
105 #endif
106 {
107     FIXME( "(%u) stub!\n", NewIrql );
108 }
109
110
111 #ifdef DEFINE_FASTCALL1_ENTRYPOINT
112 DEFINE_FASTCALL1_ENTRYPOINT( KfRaiseIrql )
113 KIRQL WINAPI __regs_KfRaiseIrql(KIRQL NewIrql)
114 #else
115 KIRQL WINAPI KfRaiseIrql(KIRQL NewIrql)
116 #endif
117 {
118     FIXME( "(%u) stub!\n", NewIrql );
119
120     return 0;
121 }
122
123
124 #ifdef DEFINE_FASTCALL2_ENTRYPOINT
125 DEFINE_FASTCALL2_ENTRYPOINT( KfReleaseSpinLock )
126 VOID WINAPI __regs_KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql)
127 #else
128 VOID WINAPI KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql)
129 #endif
130 {
131     FIXME( "(%p %u) stub!\n", SpinLock, NewIrql );
132 }
133
134 ULONG WINAPI HalGetBusData(BUS_DATA_TYPE BusDataType, ULONG BusNumber, ULONG SlotNumber, PVOID Buffer, ULONG Length)
135 {
136     FIXME("(%u %u %u %p %u) stub!\n", BusDataType, BusNumber, SlotNumber, Buffer, Length);
137     /* Claim that there is no such bus */
138     return 0;
139 }
140
141 ULONG WINAPI HalGetBusDataByOffset(BUS_DATA_TYPE BusDataType, ULONG BusNumber, ULONG SlotNumber, PVOID Buffer, ULONG Offset, ULONG Length)
142 {
143     FIXME("(%u %u %u %p %u %u) stub!\n", BusDataType, BusNumber, SlotNumber, Buffer, Offset, Length);
144     /* Claim that there is no such bus */
145     return 0;
146 }
147
148 BOOLEAN WINAPI HalTranslateBusAddress(INTERFACE_TYPE InterfaceType, ULONG BusNumber, PHYSICAL_ADDRESS BusAddress,
149                                               PULONG AddressSpace, PPHYSICAL_ADDRESS TranslatedAddress)
150 {
151     FIXME("(%d %d %s %p %p) stub!\n", InterfaceType, BusNumber,
152                 wine_dbgstr_longlong(BusAddress.QuadPart), AddressSpace, TranslatedAddress);
153     return FALSE;
154 }
155
156 KIRQL WINAPI KeGetCurrentIrql(VOID)
157 {
158     FIXME( " stub!\n");
159     return 0;
160 }