[eth] Add temporarily code for tracking shutter behavior.
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 12:49:32 +0000 (12:49 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 12:49:32 +0000 (12:49 +0000)
signed off by: Firas Mahamid

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2571 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mlx4/kernel/inc/shutter.h

index fcecb3d..467bea8 100644 (file)
@@ -105,11 +105,15 @@ static inline void shutter_shut(shutter_t * p_shutter)
        if (res) \r
                // We are now waiting for the object to reach -MAX_OPERATIONS\r
                KeWaitForSingleObject( &p_shutter->event, Executive, KernelMode, FALSE, NULL );\r
+\r
+    ASSERT(p_shutter->cnt == -MAX_OPERATIONS);\r
 }\r
 \r
 static inline void shutter_alive(shutter_t * p_shutter)\r
 {\r
     long res = 0;\r
+    long old_cnt = 0;\r
+    old_cnt = p_shutter->cnt;\r
     ASSERT(p_shutter->cnt == -MAX_OPERATIONS);\r
        // Mark the counter as locked\r
        res = InterlockedExchangeAdd(&p_shutter->cnt, MAX_OPERATIONS);\r