- Move atsmedia.h to PSDK, introduce pragma once and remove the comments block and...
[reactos.git] / 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 #include "video.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #define AGP_BUS_INTERFACE_V1 1L
33 #define AGP_BUS_INTERFACE_V2 2L
34
35 /* Indicates wether the GART supports mapping of physical memory for the CPU */
36 #define AGP_CAPABILITIES_MAP_PHYSICAL 0x00000001L
37
38 typedef NTSTATUS
39 (NTAPI *PAGP_BUS_COMMIT_MEMORY)(
40 IN PVOID AgpContext,
41 IN PVOID MapHandle,
42 IN ULONG NumberOfPages,
43 IN ULONG OffsetInPages,
44 IN OUT PMDL Mdl OPTIONAL,
45 OUT PHYSICAL_ADDRESS *MemoryBase);
46
47 typedef NTSTATUS
48 (NTAPI *PAGP_BUS_FREE_MEMORY)(
49 IN PVOID AgpContext,
50 IN PVOID MapHandle,
51 IN ULONG NumberOfPages,
52 IN ULONG OffsetInPages);
53
54 typedef NTSTATUS
55 (NTAPI *PAGP_BUS_RELEASE_MEMORY)(
56 IN PVOID AgpContext,
57 IN PVOID MapHandle);
58
59 typedef NTSTATUS
60 (NTAPI *PAGP_BUS_RESERVE_MEMORY)(
61 IN PVOID AgpContext,
62 IN ULONG NumberOfPages,
63 IN MEMORY_CACHING_TYPE MemoryType,
64 OUT PVOID *MapHandle,
65 OUT PHYSICAL_ADDRESS *PhysicalAddress OPTIONAL);
66
67 typedef NTSTATUS
68 (NTAPI *PAGP_BUS_SET_RATE)(
69 IN PVOID AgpContext,
70 IN ULONG AgpRate);
71
72 typedef NTSTATUS
73 (NTAPI *PAGP_GET_MAPPED_PAGES)(
74 IN PVOID AgpContext,
75 IN PVOID MapHandle,
76 IN ULONG NumberOfPages,
77 IN ULONG OffsetInPages,
78 OUT PMDL Mdl);
79
80 typedef struct _AGP_BUS_INTERFACE_STANDARD {
81 USHORT Size;
82 USHORT Version;
83 PVOID AgpContext;
84 PINTERFACE_REFERENCE InterfaceReference;
85 PINTERFACE_DEREFERENCE InterfaceDereference;
86
87 ULONG Capabilities;
88 PAGP_BUS_RESERVE_MEMORY ReserveMemory;
89 PAGP_BUS_RELEASE_MEMORY ReleaseMemory;
90 PAGP_BUS_COMMIT_MEMORY CommitMemory;
91 PAGP_BUS_FREE_MEMORY FreeMemory;
92 PAGP_GET_MAPPED_PAGES GetMappedPages;
93 PAGP_BUS_SET_RATE SetRate;
94 } AGP_BUS_INTERFACE_STANDARD, *PAGP_BUS_INTERFACE_STANDARD;
95
96 #define AGP_BUS_INTERFACE_V2_SIZE sizeof(AGP_BUS_INTERFACE_STANDARD)
97 #define AGP_BUS_INTERFACE_V1_SIZE \
98 (AGP_BUS_INTERFACE_V2_SIZE - sizeof(PAGP_BUS_SET_RATE))
99
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif /* __NTAGP_H */
105