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

pcivrify.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/pcivrify.c
00005  * PURPOSE:         PCI Driver Verifier Support
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 BOOLEAN PciVerifierRegistered;
00018 PVOID PciVerifierNotificationHandle;
00019 
00020 PCI_VERIFIER_DATA PciVerifierFailureTable[PCI_VERIFIER_CODES] =
00021 {
00022     {
00023         1,
00024         VFFAILURE_FAIL_LOGO,
00025         0,
00026         "The BIOS has reprogrammed the bus numbers of an active PCI device "
00027         "(!devstack %DevObj) during a dock or undock!"
00028     },
00029     {
00030         2,
00031         VFFAILURE_FAIL_LOGO,
00032         0,
00033         "A device in the system did not update it's PMCSR register in the spec "
00034         "mandated time (!devstack %DevObj, Power state D%Ulong)"
00035     },
00036     {
00037         3,
00038         VFFAILURE_FAIL_LOGO,
00039         0,
00040         "A driver controlling a PCI device has tried to access OS controlled "
00041         "configuration space registers (!devstack %DevObj, Offset 0x%Ulong1, "
00042         "Length 0x%Ulong2)"
00043     },
00044     {
00045         4,
00046         VFFAILURE_FAIL_UNDER_DEBUGGER,
00047         0,
00048         "A driver controlling a PCI device has tried to read or write from an "
00049         "invalid space using IRP_MN_READ/WRITE_CONFIG or via BUS_INTERFACE_STANDARD."
00050         "  NB: These functions take WhichSpace parameters of the form PCI_WHICHSPACE_*"
00051         " and not a BUS_DATA_TYPE (!devstack %DevObj, WhichSpace 0x%Ulong1)"
00052     },
00053 };
00054 
00055 /* FUNCTIONS ******************************************************************/
00056 
00057 PPCI_VERIFIER_DATA
00058 NTAPI
00059 PciVerifierRetrieveFailureData(IN ULONG FailureCode)
00060 {
00061     PPCI_VERIFIER_DATA VerifierData;
00062 
00063     /* Scan the verifier failure table for this code */
00064     VerifierData = PciVerifierFailureTable;
00065     while (VerifierData->FailureCode != FailureCode)
00066     {
00067         /* Keep searching */
00068         ++VerifierData;
00069         ASSERT(VerifierData < &PciVerifierFailureTable[PCI_VERIFIER_CODES]);
00070     }
00071 
00072     /* Return the entry for this code */
00073     return VerifierData;
00074 }
00075 
00076 NTSTATUS
00077 NTAPI
00078 PciVerifierProfileChangeCallback(IN PVOID NotificationStructure,
00079                                  IN PVOID Context)
00080 {
00081     /* This function is not yet implemented */
00082     UNIMPLEMENTED;
00083     while (TRUE);
00084     return STATUS_SUCCESS;
00085 }
00086 
00087 VOID
00088 NTAPI
00089 PciVerifierInit(IN PDRIVER_OBJECT DriverObject)
00090 {
00091     NTSTATUS Status;
00092 
00093     /* Check if the kernel driver verifier is enabled */
00094     if (VfIsVerificationEnabled(VFOBJTYPE_SYSTEM_BIOS, NULL))
00095     {
00096         /* Register a notification for changes, to keep track of the PCI tree */
00097         Status = IoRegisterPlugPlayNotification(EventCategoryHardwareProfileChange,
00098                                                 0,
00099                                                 NULL,
00100                                                 DriverObject,
00101                                                 PciVerifierProfileChangeCallback,
00102                                                 NULL,
00103                                                 &PciVerifierNotificationHandle);
00104         if (NT_SUCCESS(Status)) PciVerifierRegistered = TRUE;
00105     }
00106 }
00107 
00108 /* 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.