[ros-diffs] [dgorbachev] 43386: [CHEW] - Fix formatting, comments. - Delete an empty directory.

dgorbachev at svn.reactos.org dgorbachev at svn.reactos.org
Mon Oct 12 05:27:45 CEST 2009


Author: dgorbachev
Date: Mon Oct 12 05:27:45 2009
New Revision: 43386

URL: http://svn.reactos.org/svn/reactos?rev=43386&view=rev
Log:
[CHEW]
- Fix formatting, comments.
- Delete an empty directory.

Removed:
    trunk/reactos/include/reactos/chew/chew/
Modified:
    trunk/reactos/include/reactos/chew/chew.h
    trunk/reactos/lib/drivers/chew/chew.rbuild
    trunk/reactos/lib/drivers/chew/workqueue.c

Modified: trunk/reactos/include/reactos/chew/chew.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/chew/chew.h?rev=43386&r1=43385&r2=43386&view=diff
==============================================================================
--- trunk/reactos/include/reactos/chew/chew.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/chew/chew.h [iso-8859-1] Mon Oct 12 05:27:45 2009
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
- * FILE:            include/chew/chew.h
+ * FILE:            include/reactos/chew/chew.h
  * PURPOSE:         Common Highlevel Executive Worker
  *
  * PROGRAMMERS:     arty (ayerkes at speakeasy.net)
@@ -14,15 +14,16 @@
  * Initialize CHEW, given a device object (since IoAllocateWorkItem relies on
  * it).
  */
-VOID ChewInit( PDEVICE_OBJECT DeviceObject );
+VOID ChewInit(PDEVICE_OBJECT DeviceObject);
+
 /**
  * Shutdown CHEW, waits for remaining work items.
  */
-VOID ChewShutdown();
+VOID ChewShutdown(VOID);
+
 /**
  * Creates and queues a work item.
  */
-BOOLEAN ChewCreate
-( VOID (*Worker)(PVOID), PVOID WorkerContext );
+BOOLEAN ChewCreate(VOID (*Worker)(PVOID), PVOID WorkerContext);
 
 #endif/*_REACTOS_CHEW_H*/

Modified: trunk/reactos/lib/drivers/chew/chew.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/chew/chew.rbuild?rev=43386&r1=43385&r2=43386&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/chew/chew.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/chew/chew.rbuild [iso-8859-1] Mon Oct 12 05:27:45 2009
@@ -4,4 +4,4 @@
 	<define name="_NTOSKRNL_" />
 	<include base="chew">include</include>
 	<file>workqueue.c</file>
-</module>
+</module>

Modified: trunk/reactos/lib/drivers/chew/workqueue.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/chew/workqueue.c?rev=43386&r1=43385&r2=43386&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/chew/workqueue.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/chew/workqueue.c [iso-8859-1] Mon Oct 12 05:27:45 2009
@@ -1,82 +1,93 @@
-/*
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS kernel
- * FILE:            drivers/lib/chew/workqueue.c
- * PURPOSE:         Common Highlevel Executive Worker
- *
- * PROGRAMMERS:     arty (ayerkes at speakeasy.net)
- */
-#include <ntddk.h>
-#include <chew/chew.h>
-
-#define NDEBUG
-
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS kernel
+ * FILE:            lib/drivers/chew/workqueue.c
+ * PURPOSE:         Common Highlevel Executive Worker
+ *
+ * PROGRAMMERS:     arty (ayerkes at speakeasy.net)
+ */
+
+#include <ntddk.h>
+#include <chew/chew.h>
+
+#define NDEBUG
+//#include <debug.h>
+
 #define FOURCC(w,x,y,z) (((w) << 24) | ((x) << 16) | ((y) << 8) | (z))
-#define CHEW_TAG FOURCC('C','H','E','W')
-
-PDEVICE_OBJECT WorkQueueDevice;
-LIST_ENTRY     WorkQueue;
+#define CHEW_TAG FOURCC('C','H','E','W')
+
+PDEVICE_OBJECT WorkQueueDevice;
+LIST_ENTRY     WorkQueue;
 KSPIN_LOCK     WorkQueueLock;
-KEVENT         WorkQueueClear;
-
-typedef struct _WORK_ITEM {
-    LIST_ENTRY Entry;
-    PIO_WORKITEM WorkItem;
-    VOID (*Worker)( PVOID WorkerContext );
-    PVOID WorkerContext;
-} WORK_ITEM, *PWORK_ITEM;
-
-VOID ChewInit( PDEVICE_OBJECT DeviceObject ) {
-    WorkQueueDevice = DeviceObject;
-    InitializeListHead( &WorkQueue );
-    KeInitializeSpinLock( &WorkQueueLock );
-    KeInitializeEvent(&WorkQueueClear, NotificationEvent, TRUE);
-}
-
-VOID ChewShutdown() {
-    KeWaitForSingleObject(&WorkQueueClear, Executive, KernelMode, FALSE, NULL);
-}
-
-VOID NTAPI ChewWorkItem( PDEVICE_OBJECT DeviceObject, PVOID ChewItem ) {
+KEVENT         WorkQueueClear;
+
+typedef struct _WORK_ITEM
+{
+    LIST_ENTRY Entry;
+    PIO_WORKITEM WorkItem;
+    VOID (*Worker)(PVOID WorkerContext);
+    PVOID WorkerContext;
+} WORK_ITEM, *PWORK_ITEM;
+
+VOID ChewInit(PDEVICE_OBJECT DeviceObject)
+{
+    WorkQueueDevice = DeviceObject;
+    InitializeListHead(&WorkQueue);
+    KeInitializeSpinLock(&WorkQueueLock);
+    KeInitializeEvent(&WorkQueueClear, NotificationEvent, TRUE);
+}
+
+VOID ChewShutdown(VOID)
+{
+    KeWaitForSingleObject(&WorkQueueClear, Executive, KernelMode, FALSE, NULL);
+}
+
+VOID NTAPI ChewWorkItem(PDEVICE_OBJECT DeviceObject, PVOID ChewItem)
+{
     PWORK_ITEM WorkItem = ChewItem;
-    KIRQL OldIrql;
-
-    WorkItem->Worker( WorkItem->WorkerContext );
-
-    IoFreeWorkItem( WorkItem->WorkItem );
+    KIRQL OldIrql;
+
+    WorkItem->Worker(WorkItem->WorkerContext);
+
+    IoFreeWorkItem(WorkItem->WorkItem);
 
     KeAcquireSpinLock(&WorkQueueLock, &OldIrql);
     RemoveEntryList(&WorkItem->Entry);
 
     if (IsListEmpty(&WorkQueue))
         KeSetEvent(&WorkQueueClear, 0, FALSE);
+
     KeReleaseSpinLock(&WorkQueueLock, OldIrql);
 
-    ExFreePoolWithTag(WorkItem, CHEW_TAG);
-}
-    
-BOOLEAN ChewCreate
-( VOID (*Worker)( PVOID ), PVOID WorkerContext ) {
+    ExFreePoolWithTag(WorkItem, CHEW_TAG);
+}
+
+BOOLEAN ChewCreate(VOID (*Worker)(PVOID), PVOID WorkerContext)
+{
     PWORK_ITEM Item;
-
    Item = ExAllocatePoolWithTag
-	    ( NonPagedPool, 
-	      sizeof( WORK_ITEM ), 
-	      CHEW_TAG );
-	
-    if( Item ) {
-	Item->WorkItem = IoAllocateWorkItem( WorkQueueDevice );
-	if( !Item->WorkItem ) {
-	    ExFreePool( Item );
-	    return FALSE;
-	}
-	Item->Worker = Worker;
-	Item->WorkerContext = WorkerContext;

-	ExInterlockedInsertTailList( &WorkQueue, &Item->Entry, &WorkQueueLock );
-	KeResetEvent(&WorkQueueClear);
-	IoQueueWorkItem( Item->WorkItem, ChewWorkItem, DelayedWorkQueue, Item );
-
-	return TRUE;
-    } else {
-	return FALSE;
-    }
-}
+    Item = ExAllocatePoolWithTag(NonPagedPool, 
+                                 sizeof(WORK_ITEM),
+                                 CHEW_TAG);
+
+    if (Item)
+    {
+        Item->WorkItem = IoAllocateWorkItem(WorkQueueDevice);
+        if (!Item->WorkItem)
+        {
+            ExFreePool(Item);
+            return FALSE;
+        }
+
+        Item->Worker = Worker;
+        Item->WorkerContext = WorkerContext;
+        ExInterlockedInsertTailList(&WorkQueue, &Item->Entry, &WorkQueueLock);
+        KeResetEvent(&WorkQueueClear);
+        IoQueueWorkItem(Item->WorkItem, ChewWorkItem, DelayedWorkQueue, Item);
+
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
+}




More information about the Ros-diffs mailing list