ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ar_memio.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS PCI Bus Driver
00003  * LICENSE:         BSD - See COPYING.ARM in the top level directory
00004  * FILE:            drivers/bus/pci/arb/ar_memiono.c
00005  * PURPOSE:         Memory and I/O Port Resource Arbitration
00006  * PROGRAMMERS:     ReactOS Portable Systems Group
00007  */
00008 
00009 /* INCLUDES *******************************************************************/
00010 
00011 #include <pci.h>
00012 #define NDEBUG
00013 #include <debug.h>
00014 
00015 /* GLOBALS ********************************************************************/
00016 
00017 PCI_INTERFACE ArbiterInterfaceMemory =
00018 {
00019     &GUID_ARBITER_INTERFACE_STANDARD,
00020     sizeof(ARBITER_INTERFACE),
00021     0,
00022     0,
00023     PCI_INTERFACE_FDO,
00024     0,
00025     PciArb_Memory,
00026     armem_Constructor,
00027     armem_Initializer
00028 };
00029 
00030 PCI_INTERFACE ArbiterInterfaceIo =
00031 {
00032     &GUID_ARBITER_INTERFACE_STANDARD,
00033     sizeof(ARBITER_INTERFACE),
00034     0,
00035     0,
00036     PCI_INTERFACE_FDO,
00037     0,
00038     PciArb_Io,
00039     ario_Constructor,
00040     ario_Initializer
00041 };
00042 
00043 /* FUNCTIONS ******************************************************************/
00044 
00045 NTSTATUS
00046 NTAPI
00047 ario_Initializer(IN PVOID Instance)
00048 {
00049     /* Not yet implemented */
00050     UNIMPLEMENTED;
00051     //while (TRUE);
00052     return STATUS_SUCCESS;
00053 }
00054 
00055 NTSTATUS
00056 NTAPI
00057 ario_Constructor(IN PVOID DeviceExtension,
00058                  IN PVOID PciInterface,
00059                  IN PVOID InterfaceData,
00060                  IN USHORT Version,
00061                  IN USHORT Size,
00062                  IN PINTERFACE Interface)
00063 {
00064     PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
00065     NTSTATUS Status;
00066     PAGED_CODE();
00067 
00068     /* Make sure it's the expected interface */
00069     if ((ULONG)InterfaceData != CmResourceTypePort)
00070     {
00071         /* Arbiter support must have been initialized first */
00072         if (FdoExtension->ArbitersInitialized)
00073         {
00074             /* Not yet implemented */
00075             UNIMPLEMENTED;
00076             while (TRUE);
00077         }
00078         else
00079         {
00080             /* No arbiters for this FDO */
00081             Status = STATUS_NOT_SUPPORTED;
00082         }
00083     }
00084     else
00085     {
00086         /* Not the right interface */
00087         Status = STATUS_INVALID_PARAMETER_5;
00088     }
00089 
00090     /* Return the status */
00091     return Status;
00092 }
00093 
00094 VOID
00095 NTAPI
00096 ario_ApplyBrokenVideoHack(IN PPCI_FDO_EXTENSION FdoExtension)
00097 {
00098     PPCI_ARBITER_INSTANCE PciArbiter;
00099     //PARBITER_INSTANCE CommonInstance;
00100     //NTSTATUS Status;
00101 
00102     /* Only valid for root FDOs who are being applied the hack for the first time */
00103     ASSERT(!FdoExtension->BrokenVideoHackApplied);
00104     ASSERT(PCI_IS_ROOT_FDO(FdoExtension));
00105 
00106     /* Find the I/O arbiter */
00107     PciArbiter = (PVOID)PciFindNextSecondaryExtension(FdoExtension->
00108                                                       SecondaryExtension.Next,
00109                                                       PciArb_Io);
00110     ASSERT(PciArbiter);
00111 #if 0 // when arb exist
00112     /* Get the Arb instance */
00113     CommonInstance = &PciArbiter->CommonInstance;
00114 
00115     /* Free the two lists, enabling full VGA access */
00116     ArbFreeOrderingList(&CommonInstance->OrderingList);
00117     ArbFreeOrderingList(&CommonInstance->ReservedList);
00118 
00119     /* Build the ordering for broken video PCI access */
00120     Status = ArbBuildAssignmentOrdering(CommonInstance,
00121                                         L"Pci",
00122                                         L"BrokenVideo",
00123                                         NULL);
00124     ASSERT(NT_SUCCESS(Status));
00125 #else
00126     //Status = STATUS_SUCCESS;
00127     UNIMPLEMENTED;
00128     while (TRUE);
00129 #endif
00130     /* Now the hack has been applied */
00131     FdoExtension->BrokenVideoHackApplied = TRUE;
00132 }
00133 
00134 NTSTATUS
00135 NTAPI
00136 armem_Initializer(IN PVOID Instance)
00137 {
00138     /* Not yet implemented */
00139     UNIMPLEMENTED;
00140     //while (TRUE);
00141     return STATUS_SUCCESS;
00142 }
00143 
00144 NTSTATUS
00145 NTAPI
00146 armem_Constructor(IN PVOID DeviceExtension,
00147                   IN PVOID PciInterface,
00148                   IN PVOID InterfaceData,
00149                   IN USHORT Version,
00150                   IN USHORT Size,
00151                   IN PINTERFACE Interface)
00152 {
00153     PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
00154     NTSTATUS Status;
00155     PAGED_CODE();
00156 
00157     /* Make sure it's the expected interface */
00158     if ((ULONG)InterfaceData != CmResourceTypeMemory)
00159     {
00160         /* Arbiter support must have been initialized first */
00161         if (FdoExtension->ArbitersInitialized)
00162         {
00163             /* Not yet implemented */
00164             UNIMPLEMENTED;
00165             while (TRUE);
00166         }
00167         else
00168         {
00169             /* No arbiters for this FDO */
00170             Status = STATUS_NOT_SUPPORTED;
00171         }
00172     }
00173     else
00174     {
00175         /* Not the right interface */
00176         Status = STATUS_INVALID_PARAMETER_5;
00177     }
00178 
00179     /* Return the status */
00180     return Status;
00181 }
00182 
00183 /* EOF */

Generated on Sun May 27 2012 04:27:29 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.