Author: ekohl
Date: Sun Feb 26 18:57:28 2017
New Revision: 73967
URL:
http://svn.reactos.org/svn/reactos?rev=73967&view=rev
Log:
[PROCESSR]
Add a generic processor driver that does nothing but provide a proper CPU device name
(FriendlyName) to the registry.
CORE-5960 #resolve
Added:
trunk/reactos/drivers/processor/ (with props)
trunk/reactos/drivers/processor/CMakeLists.txt (with props)
trunk/reactos/drivers/processor/processr/ (with props)
trunk/reactos/drivers/processor/processr/CMakeLists.txt (with props)
trunk/reactos/drivers/processor/processr/misc.c (with props)
trunk/reactos/drivers/processor/processr/pnp.c (with props)
trunk/reactos/drivers/processor/processr/processr.c (with props)
trunk/reactos/drivers/processor/processr/processr.h (with props)
trunk/reactos/drivers/processor/processr/processr.rc (with props)
Modified:
trunk/reactos/drivers/CMakeLists.txt
trunk/reactos/media/inf/cpu.inf
Modified: trunk/reactos/drivers/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/CMakeLists.txt?rev…
==============================================================================
--- trunk/reactos/drivers/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/drivers/CMakeLists.txt [iso-8859-1] Sun Feb 26 18:57:28 2017
@@ -14,6 +14,7 @@
add_subdirectory(ksfilter)
add_subdirectory(network)
add_subdirectory(parallel)
+add_subdirectory(processor)
add_subdirectory(sac)
add_subdirectory(serial)
add_subdirectory(setup)
Propchange: trunk/reactos/drivers/processor/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Sun Feb 26 18:57:28 2017
@@ -0,0 +1 @@
+((CORE|ROSTESTS|ROSAPPS)-\d+)(,? ?((CORE|ROSTESTS|ROSAPPS)-\d+))*(,? ?(and |or
)?((CORE|ROSTESTS|ROSAPPS)-\d+))?
Propchange: trunk/reactos/drivers/processor/
------------------------------------------------------------------------------
bugtraq:message = See issue %BUGID% for more details.
Propchange: trunk/reactos/drivers/processor/
------------------------------------------------------------------------------
bugtraq:url =
https://jira.reactos.org/browse/%BUGID%
Propchange: trunk/reactos/drivers/processor/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Added: trunk/reactos/drivers/processor/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/processor/CMakeLis…
==============================================================================
--- trunk/reactos/drivers/processor/CMakeLists.txt (added)
+++ trunk/reactos/drivers/processor/CMakeLists.txt [iso-8859-1] Sun Feb 26 18:57:28 2017
@@ -0,0 +1,2 @@
+
+add_subdirectory(processr)
Propchange: trunk/reactos/drivers/processor/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/reactos/drivers/processor/processr/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Sun Feb 26 18:57:28 2017
@@ -0,0 +1 @@
+((CORE|ROSTESTS|ROSAPPS)-\d+)(,? ?((CORE|ROSTESTS|ROSAPPS)-\d+))*(,? ?(and |or
)?((CORE|ROSTESTS|ROSAPPS)-\d+))?
Propchange: trunk/reactos/drivers/processor/processr/
------------------------------------------------------------------------------
bugtraq:message = See issue %BUGID% for more details.
Propchange: trunk/reactos/drivers/processor/processr/
------------------------------------------------------------------------------
bugtraq:url =
https://jira.reactos.org/browse/%BUGID%
Propchange: trunk/reactos/drivers/processor/processr/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Added: trunk/reactos/drivers/processor/processr/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/processor/processr…
==============================================================================
--- trunk/reactos/drivers/processor/processr/CMakeLists.txt (added)
+++ trunk/reactos/drivers/processor/processr/CMakeLists.txt [iso-8859-1] Sun Feb 26
18:57:28 2017
@@ -0,0 +1,12 @@
+
+list(APPEND SOURCE
+ processr.c
+ misc.c
+ pnp.c
+ processr.h)
+
+add_library(processr SHARED ${SOURCE} processr.rc)
+set_module_type(processr kernelmodedriver)
+add_importlibs(processr hal ntoskrnl)
+add_pch(processr processr.h SOURCE)
+add_cd_file(TARGET processr DESTINATION reactos/system32/drivers FOR all)
Propchange: trunk/reactos/drivers/processor/processr/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/processor/processr/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/processor/processr…
==============================================================================
--- trunk/reactos/drivers/processor/processr/misc.c (added)
+++ trunk/reactos/drivers/processor/processr/misc.c [iso-8859-1] Sun Feb 26 18:57:28 2017
@@ -0,0 +1,81 @@
+/*
+ * PROJECT: ReactOS Generic CPU Driver
+ * LICENSE: GNU GPLv2 only as published by the Free Software Foundation
+ * FILE: drivers/processor/processr/misc.c
+ * PURPOSE: Misc routines
+ * PROGRAMMERS: Eric Kohl <eric.kohl(a)reactos.org>
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include "processr.h"
+
+#define NDEBUG
+#include <debug.h>
+
+/* FUNCTIONS ******************************************************************/
+
+static IO_COMPLETION_ROUTINE ForwardIrpAndWaitCompletion;
+
+static
+NTSTATUS
+NTAPI
+ForwardIrpAndWaitCompletion(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp,
+ IN PVOID Context)
+{
+ if (Irp->PendingReturned)
+ KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE);
+
+ return STATUS_MORE_PROCESSING_REQUIRED;
+}
+
+
+NTSTATUS
+NTAPI
+ForwardIrpAndWait(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ PDEVICE_OBJECT LowerDevice;
+ KEVENT Event;
+ NTSTATUS Status;
+
+ LowerDevice = ((PDEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
+ ASSERT(LowerDevice);
+
+ KeInitializeEvent(&Event, NotificationEvent, FALSE);
+ IoCopyCurrentIrpStackLocationToNext(Irp);
+
+ DPRINT("Calling lower device %p\n", LowerDevice);
+ IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE,
TRUE);
+
+ Status = IoCallDriver(LowerDevice, Irp);
+ if (Status == STATUS_PENDING)
+ {
+ Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
+ if (NT_SUCCESS(Status))
+ Status = Irp->IoStatus.Status;
+ }
+
+ return Status;
+}
+
+
+NTSTATUS
+NTAPI
+ForwardIrpAndForget(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ PDEVICE_OBJECT LowerDevice;
+
+ LowerDevice = ((PDEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
+ ASSERT(LowerDevice);
+
+ IoSkipCurrentIrpStackLocation(Irp);
+ return IoCallDriver(LowerDevice, Irp);
+}
+
+/* EOF */
Propchange: trunk/reactos/drivers/processor/processr/misc.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/processor/processr/pnp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/processor/processr…
==============================================================================
--- trunk/reactos/drivers/processor/processr/pnp.c (added)
+++ trunk/reactos/drivers/processor/processr/pnp.c [iso-8859-1] Sun Feb 26 18:57:28 2017
@@ -0,0 +1,402 @@
+/*
+ * PROJECT: ReactOS Generic CPU Driver
+ * LICENSE: GNU GPLv2 only as published by the Free Software Foundation
+ * FILE: drivers/processor/processr/pnp.c
+ * PURPOSE: Plug N Play routines
+ * PROGRAMMERS: Eric Kohl <eric.kohl(a)reactos.org>
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include "processr.h"
+
+#include <stdio.h>
+#define NDEBUG
+#include <debug.h>
+
+/* FUNCTIONS ******************************************************************/
+
+static
+NTSTATUS
+GetDeviceId(
+ PDEVICE_OBJECT DeviceObject,
+ BUS_QUERY_ID_TYPE IdType,
+ PWSTR *DeviceId)
+{
+ PIO_STACK_LOCATION IrpStack;
+ IO_STATUS_BLOCK IoStatus;
+ PDEVICE_OBJECT TargetObject;
+ KEVENT Event;
+ PIRP Irp;
+ NTSTATUS Status;
+
+ PAGED_CODE();
+
+ /* Initialize the event */
+ KeInitializeEvent(&Event, NotificationEvent, FALSE);
+
+ TargetObject = IoGetAttachedDeviceReference(DeviceObject);
+
+ /* Build the IRP */
+ Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP,
+ TargetObject,
+ NULL,
+ 0,
+ NULL,
+ &Event,
+ &IoStatus);
+ if (Irp == NULL)
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto done;
+ }
+
+ /* PNP IRPs all begin life as STATUS_NOT_SUPPORTED */
+ Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
+
+ /* Get the top of stack */
+ IrpStack = IoGetNextIrpStackLocation(Irp);
+
+ /* Set the top of stack */
+ RtlZeroMemory(IrpStack, sizeof(IO_STACK_LOCATION));
+ IrpStack->MajorFunction = IRP_MJ_PNP;
+ IrpStack->MinorFunction = IRP_MN_QUERY_ID;
+ IrpStack->Parameters.QueryId.IdType = IdType;
+
+ /* Call the driver */
+ Status = IoCallDriver(TargetObject, Irp);
+ if (Status == STATUS_PENDING)
+ {
+ KeWaitForSingleObject(&Event,
+ Executive,
+ KernelMode,
+ FALSE,
+ NULL);
+
+ Status = IoStatus.Status;
+ }
+
+ if (NT_SUCCESS(Status))
+ {
+ *DeviceId = (PWSTR)IoStatus.Information;
+ }
+
+done:
+ /* Dereference the target device object */
+ ObDereferenceObject(TargetObject);
+
+ return Status;
+}
+
+
+
+static
+VOID
+ProcessorSetFriendlyName(
+ PDEVICE_OBJECT DeviceObject)
+{
+ KEY_VALUE_PARTIAL_INFORMATION *Buffer = NULL;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ UNICODE_STRING HardwareKeyName, ValueName, EnumKeyName;
+ HANDLE KeyHandle = NULL;
+ ULONG DataLength = 0;
+ ULONG BufferLength = 0;
+ NTSTATUS Status;
+ PWSTR KeyNameBuffer = NULL;
+ PWSTR DeviceId = NULL;
+ PWSTR InstanceId = NULL;
+ PWSTR pszPrefix = L"\\Registry\\Machine\\System\\CurrentcontrolSet\\Enum";
+
+ RtlInitUnicodeString(&HardwareKeyName,
+
L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
+ InitializeObjectAttributes(&ObjectAttributes,
+ &HardwareKeyName,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+ NULL,
+ NULL);
+ Status = ZwOpenKey(&KeyHandle,
+ KEY_READ,
+ &ObjectAttributes);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("ZwOpenKey() failed (Status 0x%08lx)\n", Status);
+ return;
+ }
+
+ RtlInitUnicodeString(&ValueName,
+ L"ProcessorNameString");
+ Status = ZwQueryValueKey(KeyHandle,
+ &ValueName,
+ KeyValuePartialInformation,
+ NULL,
+ 0,
+ &DataLength);
+ if (Status != STATUS_BUFFER_OVERFLOW && Status != STATUS_BUFFER_TOO_SMALL
&& Status != STATUS_SUCCESS)
+ {
+ DPRINT1("ZwQueryValueKey() failed (Status 0x%08lx)\n", Status);
+ goto done;
+ }
+
+ Buffer = ExAllocatePool(PagedPool,
+ DataLength + sizeof(KEY_VALUE_PARTIAL_INFORMATION));
+ if (Buffer == NULL)
+ {
+ DPRINT1("ExAllocatePool() failed\n");
+ goto done;
+ }
+
+ Status = ZwQueryValueKey(KeyHandle,
+ &ValueName,
+ KeyValuePartialInformation,
+ Buffer,
+ DataLength + sizeof(KEY_VALUE_PARTIAL_INFORMATION),
+ &DataLength);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("ZwQueryValueKey() failed (Status 0x%08lx)\n", Status);
+ goto done;
+ }
+
+ DPRINT("ProcessorNameString: %S\n", (PWSTR)&Buffer->Data[0]);
+
+ ZwClose(KeyHandle);
+ KeyHandle = NULL;
+
+ Status = GetDeviceId(DeviceObject,
+ BusQueryDeviceID,
+ &DeviceId);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("GetDeviceId() failed (Status 0x%08lx)\n", Status);
+ goto done;
+ }
+
+ DPRINT("DeviceId: %S\n", DeviceId);
+
+ Status = GetDeviceId(DeviceObject,
+ BusQueryInstanceID,
+ &InstanceId);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("GetDeviceId() failed (Status 0x%08lx)\n", Status);
+ goto done;
+ }
+
+ DPRINT("InstanceId: %S\n", InstanceId);
+
+ BufferLength = wcslen(pszPrefix) + 1 + wcslen(DeviceId) + 1 + wcslen(InstanceId) +
1;
+
+ KeyNameBuffer = ExAllocatePool(PagedPool, BufferLength * sizeof(WCHAR));
+ if (KeyNameBuffer == NULL)
+ {
+ DPRINT1("ExAllocatePool() failed\n");
+ goto done;
+ }
+
+ swprintf(KeyNameBuffer, L"%s\\%s\\%s", pszPrefix, DeviceId, InstanceId);
+
+ RtlInitUnicodeString(&EnumKeyName, KeyNameBuffer);
+ InitializeObjectAttributes(&ObjectAttributes,
+ &EnumKeyName,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+ NULL,
+ NULL);
+ Status = ZwOpenKey(&KeyHandle,
+ KEY_WRITE,
+ &ObjectAttributes);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("ZwOpenKey() failed (Status 0x%08lx)\n", Status);
+ goto done;
+ }
+
+ RtlInitUnicodeString(&ValueName,
+ L"FriendlyName");
+ Status = ZwSetValueKey(KeyHandle,
+ &ValueName,
+ 0,
+ REG_SZ,
+ (PVOID)&Buffer->Data[0],
+ Buffer->DataLength);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("ZwSetValueKey() failed (Status 0x%08lx)\n", Status);
+ goto done;
+ }
+
+done:
+ if (KeyHandle != NULL)
+ ZwClose(KeyHandle);
+
+ if (KeyNameBuffer != NULL)
+ ExFreePool(KeyNameBuffer);
+
+ if (InstanceId != NULL)
+ ExFreePool(InstanceId);
+
+ if (DeviceId != NULL)
+ ExFreePool(DeviceId);
+
+ if (Buffer != NULL)
+ ExFreePool(Buffer);
+}
+
+
+static
+NTSTATUS
+ProcessorStartDevice(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PCM_RESOURCE_LIST ResourceList,
+ IN PCM_RESOURCE_LIST ResourceListTranslated)
+{
+ DPRINT("ProcessorStartDevice()\n");
+
+ ProcessorSetFriendlyName(DeviceObject);
+
+ return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+NTAPI
+ProcessorPnp(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ PIO_STACK_LOCATION IrpSp;
+ ULONG_PTR Information = 0;
+ NTSTATUS Status = STATUS_NOT_SUPPORTED;
+
+ DPRINT("ProcessorPnp()\n");
+
+ IrpSp = IoGetCurrentIrpStackLocation(Irp);
+
+ switch (IrpSp->MinorFunction)
+ {
+ case IRP_MN_START_DEVICE:
+ DPRINT(" IRP_MN_START_DEVICE received\n");
+
+ /* Call lower driver */
+ Status = ForwardIrpAndWait(DeviceObject, Irp);
+ if (NT_SUCCESS(Status))
+ {
+ Status = ProcessorStartDevice(DeviceObject,
+
IrpSp->Parameters.StartDevice.AllocatedResources,
+
IrpSp->Parameters.StartDevice.AllocatedResourcesTranslated);
+ }
+ break;
+
+ case IRP_MN_QUERY_REMOVE_DEVICE:
+ DPRINT(" IRP_MN_QUERY_REMOVE_DEVICE\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+
+ case IRP_MN_REMOVE_DEVICE:
+ DPRINT(" IRP_MN_REMOVE_DEVICE received\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+
+ case IRP_MN_CANCEL_REMOVE_DEVICE:
+ DPRINT(" IRP_MN_CANCEL_REMOVE_DEVICE\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+
+ case IRP_MN_STOP_DEVICE:
+ DPRINT(" IRP_MN_STOP_DEVICE received\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+
+ case IRP_MN_QUERY_STOP_DEVICE:
+ DPRINT(" IRP_MN_QUERY_STOP_DEVICE received\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+
+ case IRP_MN_CANCEL_STOP_DEVICE:
+ DPRINT(" IRP_MN_CANCEL_STOP_DEVICE\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+
+ case IRP_MN_QUERY_DEVICE_RELATIONS:
+ DPRINT(" IRP_MN_QUERY_DEVICE_RELATIONS\n");
+
+ switch (IrpSp->Parameters.QueryDeviceRelations.Type)
+ {
+ case BusRelations:
+ DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS /
BusRelations\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+ break;
+
+ case RemovalRelations:
+ DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS /
RemovalRelations\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+
+ default:
+ DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown
type 0x%lx\n",
+ IrpSp->Parameters.QueryDeviceRelations.Type);
+ return ForwardIrpAndForget(DeviceObject, Irp);
+ }
+ break;
+
+ case IRP_MN_SURPRISE_REMOVAL:
+ DPRINT(" IRP_MN_SURPRISE_REMOVAL received\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+
+ case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* (optional) 0xd */
+ DPRINT(" IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
+ return ForwardIrpAndForget(DeviceObject, Irp);
+
+ default:
+ DPRINT(" Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction);
+ return ForwardIrpAndForget(DeviceObject, Irp);
+ }
+
+ Irp->IoStatus.Information = Information;
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+ return Status;
+}
+
+
+NTSTATUS
+NTAPI
+ProcessorAddDevice(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDEVICE_OBJECT Pdo)
+{
+ PDEVICE_EXTENSION DeviceExtension = NULL;
+ PDEVICE_OBJECT Fdo = NULL;
+ NTSTATUS Status;
+
+ DPRINT("ProcessorAddDevice()\n");
+
+ ASSERT(DriverObject);
+ ASSERT(Pdo);
+
+ /* Create functional device object */
+ Status = IoCreateDevice(DriverObject,
+ sizeof(DEVICE_EXTENSION),
+ NULL,
+ FILE_DEVICE_UNKNOWN,
+ FILE_DEVICE_SECURE_OPEN,
+ FALSE,
+ &Fdo);
+ if (NT_SUCCESS(Status))
+ {
+ DeviceExtension = (PDEVICE_EXTENSION)Fdo->DeviceExtension;
+ RtlZeroMemory(DeviceExtension, sizeof(DEVICE_EXTENSION));
+
+ DeviceExtension->DeviceObject = Fdo;
+
+ Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo,
&DeviceExtension->LowerDevice);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("IoAttachDeviceToDeviceStackSafe() failed with status
0x%08lx\n", Status);
+ IoDeleteDevice(Fdo);
+ return Status;
+ }
+
+ Fdo->Flags |= DO_DIRECT_IO;
+ Fdo->Flags |= DO_POWER_PAGABLE;
+
+ Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
+ }
+
+ return Status;
+}
+
+/* EOF */
Propchange: trunk/reactos/drivers/processor/processr/pnp.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/processor/processr/processr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/processor/processr…
==============================================================================
--- trunk/reactos/drivers/processor/processr/processr.c (added)
+++ trunk/reactos/drivers/processor/processr/processr.c [iso-8859-1] Sun Feb 26 18:57:28
2017
@@ -0,0 +1,65 @@
+/*
+ * PROJECT: ReactOS Generic CPU Driver
+ * LICENSE: GNU GPLv2 only as published by the Free Software Foundation
+ * FILE: drivers/processor/processr/processr.c
+ * PURPOSE: Main Driver Routines
+ * PROGRAMMERS: Eric Kohl <eric.kohl(a)reactos.org>
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include "processr.h"
+
+#define NDEBUG
+#include <debug.h>
+
+
+/* FUNCTIONS ******************************************************************/
+
+static
+VOID
+NTAPI
+ProcessorUnload(
+ IN PDRIVER_OBJECT DriverObject)
+{
+ DPRINT("ProcessorUnload()\n");
+}
+
+
+static
+NTSTATUS
+NTAPI
+ProcessorPower(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+// PIO_STACK_LOCATION IrpSp;
+// NTSTATUS Status = Irp->IoStatus.Status;
+ PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
+
+ DPRINT("ProcessorPower()\n");
+
+// IrpSp = IoGetCurrentIrpStackLocation(Irp);
+
+ PoStartNextPowerIrp(Irp);
+ IoSkipCurrentIrpStackLocation(Irp);
+ return PoCallDriver(DeviceExtension->LowerDevice, Irp);
+}
+
+
+NTSTATUS
+NTAPI
+DriverEntry(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PUNICODE_STRING RegistryPath)
+{
+ DPRINT("Processr: DriverEntry()\n");
+
+ DriverObject->MajorFunction[IRP_MJ_PNP] = ProcessorPnp;
+ DriverObject->MajorFunction[IRP_MJ_POWER] = ProcessorPower;
+
+ DriverObject->DriverExtension->AddDevice = ProcessorAddDevice;
+ DriverObject->DriverUnload = ProcessorUnload;
+
+ return STATUS_SUCCESS;
+}
Propchange: trunk/reactos/drivers/processor/processr/processr.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/processor/processr/processr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/processor/processr…
==============================================================================
--- trunk/reactos/drivers/processor/processr/processr.h (added)
+++ trunk/reactos/drivers/processor/processr/processr.h [iso-8859-1] Sun Feb 26 18:57:28
2017
@@ -0,0 +1,51 @@
+/*
+ * PROJECT: ReactOS Generic CPU Driver
+ * LICENSE: GNU GPLv2 only as published by the Free Software Foundation
+ * FILE: drivers/processor/processr/processr.h
+ * PURPOSE: Common header file
+ * PROGRAMMERS: Eric Kohl <eric.kohl(a)reactos.org>
+ */
+
+#ifndef _PROCESSR_PCH_
+#define _PROCESSR_PCH_
+
+#include <ntddk.h>
+
+typedef struct _DEVICE_EXTENSION
+{
+ PDEVICE_OBJECT DeviceObject;
+ PDEVICE_OBJECT LowerDevice;
+
+} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
+
+
+/* misc.c */
+
+NTSTATUS
+NTAPI
+ForwardIrpAndWait(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp);
+
+NTSTATUS
+NTAPI
+ForwardIrpAndForget(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp);
+
+
+/* pnp.c */
+
+NTSTATUS
+NTAPI
+ProcessorPnp(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp);
+
+NTSTATUS
+NTAPI
+ProcessorAddDevice(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDEVICE_OBJECT Pdo);
+
+#endif /* _PROCESSR_PCH_ */
Propchange: trunk/reactos/drivers/processor/processr/processr.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/processor/processr/processr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/processor/processr…
==============================================================================
--- trunk/reactos/drivers/processor/processr/processr.rc (added)
+++ trunk/reactos/drivers/processor/processr/processr.rc [iso-8859-1] Sun Feb 26 18:57:28
2017
@@ -0,0 +1,13 @@
+/*
+ * PROJECT: ReactOS Generic CPU Driver
+ * LICENSE: GNU GPLv2 only as published by the Free Software Foundation
+ * FILE: drivers/processor/processr/processr.rc
+ * PURPOSE: Resource definition file
+ * PROGRAMMERS: Eric Kohl <eric.kohl(a)reactos.org>
+ */
+
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "Processor Device Driver\0"
+#define REACTOS_STR_INTERNAL_NAME "processr\0"
+#define REACTOS_STR_ORIGINAL_FILENAME "processr.sys\0"
+#include <reactos/version.rc>
Propchange: trunk/reactos/drivers/processor/processr/processr.rc
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/media/inf/cpu.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/cpu.inf?rev=7396…
==============================================================================
--- trunk/reactos/media/inf/cpu.inf [iso-8859-1] (original)
+++ trunk/reactos/media/inf/cpu.inf [iso-8859-1] Sun Feb 26 18:57:28 2017
@@ -29,73 +29,83 @@
%VIAMfg%=VIA
[Standard]
-%Processor.DeviceDesc% = NO_DRV,ACPI\Processor
+%Processor.DeviceDesc% = Processr_Inst,ACPI\Processor
[Cyrix]
-%CyrixProcessor.DeviceDesc% = NO_DRV,ACPI\CyrixInstead_-_x86
+%CyrixProcessor.DeviceDesc% = Processr_Inst,ACPI\CyrixInstead_-_x86
[Intel]
-%IntelProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_1
-%IntelProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_2
-%IntelProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_3
-%IntelMMXProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_4
-%IntelMMXProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_7
-%IntelMMXProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_5_model_8
-%IntelPROProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_1
-%IntelP2Processor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_3
-%IntelP2Processor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_5
-%IntelP2Processor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_6
-%IntelP3Processor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_7
-%IntelP3Processor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_8
-%IntelMProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_9
-%IntelP3Processor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_10
-%IntelP3Processor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_11
-%IntelMProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_13
-%IntelCoreProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_14
-%IntelCoreProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_15
-%IntelCoreProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_22
-%IntelCoreProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_23
-%IntelCoreiXProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_26
-%IntelAtomProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_28
-%IntelCoreiXProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_30
-%IntelCoreiXProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_6_Model_37
-%IntelP4Processor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86_Family_15
-%IntelProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineIntel_-_x86
+%IntelProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_1
+%IntelProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_2
+%IntelProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_3
+%IntelMMXProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_4
+%IntelMMXProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_7
+%IntelMMXProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_5_model_8
+%IntelPROProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_1
+%IntelP2Processor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_3
+%IntelP2Processor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_5
+%IntelP2Processor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_6
+%IntelP3Processor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_7
+%IntelP3Processor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_8
+%IntelMProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_9
+%IntelP3Processor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_10
+%IntelP3Processor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_11
+%IntelMProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_13
+%IntelCoreProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_14
+%IntelCoreProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_15
+%IntelCoreProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_22
+%IntelCoreProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_23
+%IntelCoreiXProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_26
+%IntelAtomProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_28
+%IntelCoreiXProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_30
+%IntelCoreiXProcessor.DeviceDesc% =
Processr_Inst,ACPI\GenuineIntel_-_x86_Family_6_Model_37
+%IntelP4Processor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_15
+%IntelProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_x86
[AMD]
-%AMDK6Processor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_7
-%AMDK62Processor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_8
-%AMDK63Processor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_9
-%AMDK63Processor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_10
-%AMDK63Processor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_5_Model_13
-%AMDK7Processor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_6
-%AMDK8Processor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_15
-%AMDPHENProcessor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_16
-%AMDQProcessor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86_Family_17
-%AMDProcessor.DeviceDesc% = NO_DRV,ACPI\AuthenticAMD_-_x86
+%AMDK6Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_7
+%AMDK62Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_8
+%AMDK63Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_9
+%AMDK63Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_10
+%AMDK63Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_13
+%AMDK7Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_6
+%AMDK8Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_15
+%AMDPHENProcessor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_16
+%AMDQProcessor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_17
+%AMDProcessor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86
[Transmeta]
-%TransmetaProcessor.DeviceDesc% = NO_DRV,ACPI\GenuineTMx86_-_x86
+%TransmetaProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineTMx86_-_x86
[VIA]
-%ViaNEHProcessor.DeviceDesc% = NO_DRV,ACPI\CentaurHauls_-_x86_Family_6_Model_9
-%ViaESTProcessor.DeviceDesc% = NO_DRV,ACPI\CentaurHauls_-_x86_Family_6_Model_10
-%ViaC7Processor.DeviceDesc% = NO_DRV,ACPI\CentaurHauls_-_x86_Family_6_Model_13
-%ViaNANOProcessor.DeviceDesc% = NO_DRV,ACPI\CentaurHauls_-_x86_Family_6_Model_15
-%ViaProcessor.DeviceDesc% = NO_DRV,ACPI\CentaurHauls_-_x86
-
-;---------------------------- NO DRIVER REQ -----------------------------
-
-[NO_DRV]
-AddReg=NO_DRV.AddReg
-
-[NO_DRV.Services]
-AddService = , 0x00000002
-
-[NO_DRV.HW]
-
-[NO_DRV.AddReg]
+%ViaNEHProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_9
+%ViaESTProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_10
+%ViaC7Processor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_13
+%ViaNANOProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_15
+%ViaProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86
+
+;---------------------------- Processr Driver ---------------------------
+
+[Processr_Inst.NT]
+CopyFiles = Processr_Inst.CopyFiles.NT
+AddReg = Processr_Inst.AddReg.NT
+
+[Processr_Inst.CopyFiles.NT]
+processr.sys
+
+[Processr_Inst.AddReg.NT]
HKR,,EnumPropPages32,,"devcpux.dll,PropSheetExtProc"
+
+[Processr_Inst.NT.Services]
+AddService = Processor, 0x00000002, Processr_Service_Inst
+
+[Processr_Service_Inst]
+DisplayName = %Processor.ServiceDesc%
+ServiceType = 1
+StartType = 1
+ErrorControl = 1
+ServiceBinary = %12%\processr.sys
+LoadOrderGroup = Extended Base
;-------------------------------- STRINGS -------------------------------
@@ -110,6 +120,7 @@
TransmetaMfg = "Transmeta"
VIAMfg = "VIA"
Processor.DeviceDesc = "Processor"
+Processor.ServiceDesc = "Processor driver"
CyrixProcessor.DeviceDesc = "Cyrix 6x86 Processor"
IntelProcessor.DeviceDesc = "Intel Pentium Processor"
IntelMMXProcessor.DeviceDesc = "Intel Pentium MMX Processor"
@@ -139,6 +150,7 @@
[Strings.0405]
Processor.DeviceDesc = "Procesor"
+Processor.ServiceDesc = "Processor driver"
CyrixProcessor.DeviceDesc = "Procesor Cyrix 6x86"
IntelProcessor.DeviceDesc = "Procesor Intel Pentium"
IntelMMXProcessor.DeviceDesc = "Procesor Intel Pentium MMX"
@@ -169,6 +181,7 @@
[Strings.0407]
ProcessorClassName = "Prozessoren"
Processor.DeviceDesc = "Prozessor"
+Processor.ServiceDesc = "Prozessortreiber"
CyrixProcessor.DeviceDesc = "Cyrix 6x86 Prozessor"
IntelProcessor.DeviceDesc = "Intel Pentium Prozessor"
IntelMMXProcessor.DeviceDesc = "Intel Pentium MMX Prozessor"
@@ -198,23 +211,27 @@
[Strings.0408]
Processor.DeviceDesc = "ÎÏεξεÏγαÏÏήÏ"
+Processor.ServiceDesc = "Processor driver"
IntelProcessor.DeviceDesc = "ÎÏεξεÏγαÏÏÎ®Ï Intel"
Standard = "Î ÏÏÏÏ
ÏÎ¿Ï ÎµÏεξεÏγαÏÏήÏ"
[Strings.0a]
ReactOS = "Equipo de ReactOS"
Processor.DeviceDesc = "Procesador"
+Processor.ServiceDesc = "Processor driver"
IntelProcessor.DeviceDesc = "Procesador Intel"
AMDProcessor.DeviceDesc = "Procesador AMD"
Standard = "Procesador estándar"
[Strings.040C]
Processor.DeviceDesc = "Processeur"
+Processor.ServiceDesc = "Processor driver"
IntelProcessor.DeviceDesc = "Processeur Intel"
Standard = "Processeur standard"
[Strings.0411]
Processor.DeviceDesc = "ããã»ããµ"
+Processor.ServiceDesc = "Processor driver"
IntelProcessor.DeviceDesc = "Intel ããã»ããµ"
Standard = "ã¹ã¿ã³ãã¼ãããã»ããµ"
@@ -228,6 +245,7 @@
TransmetaMfg = "Transmeta"
VIAMfg = "VIA"
Processor.DeviceDesc = "Procesor"
+Processor.ServiceDesc = "Processor driver"
CyrixProcessor.DeviceDesc = "Procesor Cyrix 6x86"
IntelProcessor.DeviceDesc = "Procesor Intel Pentium"
IntelMMXProcessor.DeviceDesc = "Procesor Intel Pentium MMX"
@@ -257,6 +275,7 @@
[Strings.0416]
Processor.DeviceDesc = "Processadores"
+Processor.ServiceDesc = "Processor driver"
IntelProcessor.DeviceDesc = "Procesador Intel"
Standard = "Processador padrão"
@@ -264,6 +283,7 @@
ReactOS = "FundaÈia ReactOS"
ProcessorClassName = "Procesoare"
Processor.DeviceDesc = "Procesor"
+Processor.ServiceDesc = "Processor driver"
CyrixProcessor.DeviceDesc = "Procesor Cyrix 6x86"
IntelProcessor.DeviceDesc = "Procesor Intel Pentium"
IntelMMXProcessor.DeviceDesc = "Procesor Intel Pentium MMX"
@@ -297,6 +317,7 @@
ProcessorClassName = "ÐÑоÑеÑÑоÑÑ"
Processor.DeviceDesc = "ÐÑоÑеÑÑоÑ"
+Processor.ServiceDesc = "Processor driver"
CyrixProcessor.DeviceDesc = "Cyrix 6x86 пÑоÑеÑÑоÑ"
IntelProcessor.DeviceDesc = "Intel Pentium пÑоÑеÑÑоÑ"
IntelMMXProcessor.DeviceDesc = "Intel Pentium MMX пÑоÑеÑÑоÑ"
@@ -326,6 +347,7 @@
[Strings.041B]
Processor.DeviceDesc = "Procesor"
+Processor.ServiceDesc = "Processor driver"
IntelProcessor.DeviceDesc = "Intel procesor"
Standard = "Štandardný procesor"
@@ -339,6 +361,7 @@
TransmetaMfg = "Transmeta"
VIAMfg = "VIA"
Processor.DeviceDesc = "Ä°Ålemci"
+Processor.ServiceDesc = "Processor driver"
CyrixProcessor.DeviceDesc = "Cyrix 6x86 Ä°Ålemci"
IntelProcessor.DeviceDesc = "Intel Pentium Ä°Ålemci"
IntelMMXProcessor.DeviceDesc = "Intel Pentium MMX Ä°Ålemci"
@@ -370,6 +393,7 @@
ReactOS = "Фонд ReactOS"
ProcessorClassName = "ÐÑоÑеÑоÑи"
Processor.DeviceDesc = "ÐÑоÑеÑоÑ"
+Processor.ServiceDesc = "Processor driver"
CyrixProcessor.DeviceDesc = "ÐÑоÑеÑÐ¾Ñ Cyrix 6x86"
IntelProcessor.DeviceDesc = "ÐÑоÑеÑÐ¾Ñ Intel Pentium"
IntelMMXProcessor.DeviceDesc = "ÐÑоÑеÑÐ¾Ñ Intel Pentium MMX"
@@ -399,5 +423,6 @@
[Strings.0427]
Processor.DeviceDesc = "Procesorius"
+Processor.ServiceDesc = "Processor driver"
IntelProcessor.DeviceDesc = "Intel procesorius"
Standard = "Standartinis procesorius"