A couple of header fixes to get all the FreeLDR-loaded boot drivers to compile and...
[reactos.git] / reactos / include / ddk / ntagp.h
1 /*
2 * ntagp.h
3 *
4 * NT AGP bus driver interface
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Gregor Anich <blight@blight.eu.org>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23 #ifndef __NTAGP_H
24 #define __NTAGP_H
25
26 #if __GNUC__ >=3
27 #pragma GCC system_header
28 #endif
29
30 #include "video.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #define AGP_BUS_INTERFACE_V1 1L
37 #define AGP_BUS_INTERFACE_V2 2L
38
39 /* Indicates wether the GART supports mapping of physical memory for the CPU */
40 #define AGP_CAPABILITIES_MAP_PHYSICAL 0x00000001L
41
42 typedef NTSTATUS
43 (DDKAPI *PAGP_BUS_COMMIT_MEMORY)(
44 IN PVOID AgpContext,
45 IN PVOID MapHandle,
46 IN ULONG NumberOfPages,
47 IN ULONG OffsetInPages,
48 IN OUT PMDL Mdl OPTIONAL,
49 OUT PHYSICAL_ADDRESS *MemoryBase);
50
51 typedef NTSTATUS
52 (DDKAPI *PAGP_BUS_FREE_MEMORY)(
53 IN PVOID AgpContext,
54 IN PVOID MapHandle,
55 IN ULONG NumberOfPages,
56 IN ULONG OffsetInPages);
57
58 typedef NTSTATUS
59 (DDKAPI *PAGP_BUS_RELEASE_MEMORY)(
60 IN PVOID AgpContext,
61 IN PVOID MapHandle);
62
63 typedef NTSTATUS
64 (DDKAPI *PAGP_BUS_RESERVE_MEMORY)(
65 IN PVOID AgpContext,
66 IN ULONG NumberOfPages,
67 IN MEMORY_CACHING_TYPE MemoryType,
68 OUT PVOID *MapHandle,
69 OUT PHYSICAL_ADDRESS *PhysicalAddress OPTIONAL);
70
71 typedef NTSTATUS
72 (DDKAPI *PAGP_BUS_SET_RATE)(
73 IN PVOID AgpContext,
74 IN ULONG AgpRate);
75
76 typedef NTSTATUS
77 (DDKAPI *PAGP_GET_MAPPED_PAGES)(
78 IN PVOID AgpContext,
79 IN PVOID MapHandle,
80 IN ULONG NumberOfPages,
81 IN ULONG OffsetInPages,
82 OUT PMDL Mdl);
83
84 typedef struct _AGP_BUS_INTERFACE_STANDARD {
85 USHORT Size;
86 USHORT Version;
87 PVOID AgpContext;
88 PINTERFACE_REFERENCE InterfaceReference;
89 PINTERFACE_DEREFERENCE InterfaceDereference;
90
91 ULONG Capabilities;
92 PAGP_BUS_RESERVE_MEMORY ReserveMemory;
93 PAGP_BUS_RELEASE_MEMORY ReleaseMemory;
94 PAGP_BUS_COMMIT_MEMORY CommitMemory;
95 PAGP_BUS_FREE_MEMORY FreeMemory;
96 PAGP_GET_MAPPED_PAGES GetMappedPages;
97 PAGP_BUS_SET_RATE SetRate;
98 } AGP_BUS_INTERFACE_STANDARD, *PAGP_BUS_INTERFACE_STANDARD;
99
100 #define AGP_BUS_INTERFACE_V2_SIZE sizeof(AGP_BUS_INTERFACE_STANDARD)
101 #define AGP_BUS_INTERFACE_V1_SIZE \
102 (AGP_BUS_INTERFACE_V2_SIZE - sizeof(PAGP_BUS_SET_RATE))
103
104 #ifdef __cplusplus
105 }
106 #endif
107
108 #endif /* __NTAGP_H */
109