ReactOS  0.4.13-dev-99-g7e18b6d
ar_memio.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS PCI Bus Driver
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * FILE: drivers/bus/pci/arb/ar_memiono.c
5  * PURPOSE: Memory and I/O Port Resource Arbitration
6  * PROGRAMMERS: ReactOS Portable Systems Group
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include <pci.h>
12 
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* GLOBALS ********************************************************************/
17 
19 {
20  &GUID_ARBITER_INTERFACE_STANDARD,
21  sizeof(ARBITER_INTERFACE),
22  0,
23  0,
25  0,
29 };
30 
32 {
33  &GUID_ARBITER_INTERFACE_STANDARD,
34  sizeof(ARBITER_INTERFACE),
35  0,
36  0,
38  0,
39  PciArb_Io,
42 };
43 
44 /* FUNCTIONS ******************************************************************/
45 
47 NTAPI
49 {
51 
52  /* Not yet implemented */
54  //while (TRUE);
55  return STATUS_SUCCESS;
56 }
57 
59 NTAPI
60 ario_Constructor(IN PVOID DeviceExtension,
61  IN PVOID PciInterface,
64  IN USHORT Size,
66 {
69  PAGED_CODE();
70 
71  UNREFERENCED_PARAMETER(PciInterface);
75 
76  /* Make sure it's the expected interface */
78  {
79  /* Arbiter support must have been initialized first */
80  if (FdoExtension->ArbitersInitialized)
81  {
82  /* Not yet implemented */
84  while (TRUE);
85  }
86  else
87  {
88  /* No arbiters for this FDO */
90  }
91  }
92  else
93  {
94  /* Not the right interface */
96  }
97 
98  /* Return the status */
99  return Status;
100 }
101 
102 VOID
103 NTAPI
105 {
106  PPCI_ARBITER_INSTANCE PciArbiter;
107  //PARBITER_INSTANCE CommonInstance;
108  //NTSTATUS Status;
109 
110  /* Only valid for root FDOs who are being applied the hack for the first time */
111  ASSERT(!FdoExtension->BrokenVideoHackApplied);
113 
114  /* Find the I/O arbiter */
116  SecondaryExtension.Next,
117  PciArb_Io);
118  ASSERT(PciArbiter);
119 #if 0 // when arb exist
120  /* Get the Arb instance */
121  CommonInstance = &PciArbiter->CommonInstance;
122 
123  /* Free the two lists, enabling full VGA access */
124  ArbFreeOrderingList(&CommonInstance->OrderingList);
125  ArbFreeOrderingList(&CommonInstance->ReservedList);
126 
127  /* Build the ordering for broken video PCI access */
128  Status = ArbBuildAssignmentOrdering(CommonInstance,
129  L"Pci",
130  L"BrokenVideo",
131  NULL);
133 #else
134  //Status = STATUS_SUCCESS;
136  while (TRUE);
137 #endif
138  /* Now the hack has been applied */
139  FdoExtension->BrokenVideoHackApplied = TRUE;
140 }
141 
142 NTSTATUS
143 NTAPI
145 {
147 
148  /* Not yet implemented */
150  //while (TRUE);
151  return STATUS_SUCCESS;
152 }
153 
154 NTSTATUS
155 NTAPI
156 armem_Constructor(IN PVOID DeviceExtension,
157  IN PVOID PciInterface,
159  IN USHORT Version,
160  IN USHORT Size,
162 {
165  PAGED_CODE();
166 
167  UNREFERENCED_PARAMETER(PciInterface);
171 
172  /* Make sure it's the expected interface */
174  {
175  /* Arbiter support must have been initialized first */
176  if (FdoExtension->ArbitersInitialized)
177  {
178  /* Not yet implemented */
180  while (TRUE);
181  }
182  else
183  {
184  /* No arbiters for this FDO */
186  }
187  }
188  else
189  {
190  /* Not the right interface */
192  }
193 
194  /* Return the status */
195  return Status;
196 }
197 
198 /* EOF */
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:359
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
PCI_INTERFACE ArbiterInterfaceIo
Definition: ar_memio.c:31
NTSTATUS NTAPI armem_Constructor(IN PVOID DeviceExtension, IN PVOID PciInterface, IN PVOID InterfaceData, IN USHORT Version, IN USHORT Size, IN PINTERFACE Interface)
Definition: ar_memio.c:156
VOID NTAPI ario_ApplyBrokenVideoHack(IN PPCI_FDO_EXTENSION FdoExtension)
Definition: ar_memio.c:104
#define CmResourceTypePort
Definition: hwresource.cpp:123
#define PAGED_CODE()
Definition: video.h:57
#define PCI_INTERFACE_FDO
Definition: pci.h:56
uint32_t ULONG_PTR
Definition: typedefs.h:63
struct _PCI_FDO_EXTENSION * PPCI_FDO_EXTENSION
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PCI_INTERFACE ArbiterInterfaceMemory
Definition: ar_memio.c:18
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI armem_Initializer(IN PVOID Instance)
Definition: ar_memio.c:144
void * PVOID
Definition: retypes.h:9
#define STATUS_INVALID_PARAMETER_5
Definition: ntstatus.h:465
PPCI_SECONDARY_EXTENSION NTAPI PciFindNextSecondaryExtension(IN PSINGLE_LIST_ENTRY ListHead, IN PCI_SIGNATURE ExtensionType)
Definition: utils.c:584
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1250
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
struct _ARBITER_INTERFACE ARBITER_INTERFACE
Status
Definition: gdiplustypes.h:24
#define PCI_IS_ROOT_FDO(x)
Definition: pci.h:30
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI ario_Constructor(IN PVOID DeviceExtension, IN PVOID PciInterface, IN PVOID InterfaceData, IN USHORT Version, IN USHORT Size, IN PINTERFACE Interface)
Definition: ar_memio.c:60
NTSTATUS NTAPI ario_Initializer(IN PVOID Instance)
Definition: ar_memio.c:48
IN PVOID Instance
Definition: pci.h:359
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
#define UNIMPLEMENTED
Definition: debug.h:114
IN PVOID IN PVOID InterfaceData
Definition: pci.h:359
Definition: pci.h:94
#define CmResourceTypeMemory
Definition: hwresource.cpp:125
return STATUS_SUCCESS
Definition: btrfs.c:2725