xref: /reactos/drivers/network/ndis/include/ndissys.h (revision 60eea2d7)
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS NDIS library
4  * FILE:        ndissys.h
5  * PURPOSE:     NDIS library definitions
6  * NOTES:       Spin lock acquire order:
7  *                - Miniport list lock
8  *                - Adapter list lock
9  */
10 #ifndef __NDISSYS_H
11 #define __NDISSYS_H
12 
13 #include <ntifs.h>
14 #include <ndis.h>
15 #include <xfilter.h>
16 #include <afilter.h>
17 #include <atm.h>
18 #include <ndistapi.h>
19 #include <ndisguid.h>
20 #include <debug.h>
21 
22 #include "miniport.h"
23 #include "protocol.h"
24 #include "efilter.h"
25 #include "buffer.h"
26 
27 /* Exported functions */
28 #ifndef EXPORT
29 #define EXPORT NTAPI
30 #endif
31 
32 /* the version of NDIS we claim to be */
33 #define NDIS_VERSION 0x00050001
34 
35 #define NDIS_TAG  0x4e4d4953
36 
37 #define MIN(value1, value2) \
38     ((value1 < value2)? value1 : value2)
39 
40 #define MAX(value1, value2) \
41     ((value1 > value2)? value1 : value2)
42 
43 #define ExInterlockedRemoveEntryList(_List,_Lock) \
44  { KIRQL OldIrql; \
45    KeAcquireSpinLock(_Lock, &OldIrql); \
46    RemoveEntryList(_List); \
47    KeReleaseSpinLock(_Lock, OldIrql); \
48  }
49 
50 /* missing protypes */
51 VOID
52 NTAPI
53 ExGetCurrentProcessorCounts(
54    PULONG ThreadKernelTime,
55    PULONG TotalCpuTime,
56    PULONG ProcessorNumber);
57 
58 VOID
59 NTAPI
60 ExGetCurrentProcessorCpuUsage(
61     PULONG CpuUsage);
62 
63 /* portability fixes */
64 #ifdef _M_AMD64
65 #define KfReleaseSpinLock KeReleaseSpinLock
66 #define KefAcquireSpinLockAtDpcLevel KeAcquireSpinLockAtDpcLevel
67 #define KefReleaseSpinLockFromDpcLevel KeReleaseSpinLockFromDpcLevel
68 #endif
69 
70 #endif /* __NDISSYS_H */
71 
72 /* EOF */
73