Author: turner
Date: Sat Aug 19 01:37:02 2006
New Revision: 23604
URL:
http://svn.reactos.org/svn/reactos?rev=23604&view=rev
Log:
Don't redefine HIWORD or LOWORD if they are defined already.
Make 2 new macros USE_NON_PENDING_IRQL, USE_BASIC_NON_PENDING_IRQL and use accordingly to
remove warnings
Modified:
trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h
trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h Sat Aug 19 01:37:02 2006
@@ -17,8 +17,12 @@
#define WORD USHORT
#define DWORD ULONG
+#ifndef LOWORD
#define LOWORD(l) ( (WORD) ( ( l ) & 0xffff ) )
+#endif
+#ifndef HIWORD
#define HIWORD(l) ( (WORD) ( ( l ) >> 16 ) )
+#endif
#define PCI_MAX_FUNCTIONS 8
@@ -505,6 +509,13 @@
#define USE_IRQL \
KIRQL _pending_endp_lock_old_irql, _pending_endp_list_lock_old_irql, _dev_lock_old_irql,
old_irql;
+
+#define USE_NON_PENDING_IRQL \
+KIRQL _dev_lock_old_irql, old_irql;
+
+#define USE_BASIC_NON_PENDING_IRQL \
+KIRQL _dev_lock_old_irql;
+
#define USB_DEV_STATE_MASK ( 0xff << 8 )
#define USB_DEV_STATE_POWERED ( 0x01 << 8 )
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c Sat Aug 19 01:37:02 2006
@@ -152,7 +152,7 @@
PUSB_DEV pdev;
BOOL valid_dev;
- USE_IRQL;
+ USE_NON_PENDING_IRQL;
*ppdev = NULL;
@@ -212,7 +212,7 @@
PUSB_DEV dev
)
{
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( dev == NULL )
return STATUS_INVALID_PARAMETER;
@@ -237,7 +237,7 @@
PUSB_DEV pdev;
LONG if_idx, endp_idx;
PUSB_ENDPOINT pendp;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( dev_mgr == NULL )
return STATUS_INVALID_PARAMETER;
@@ -297,7 +297,7 @@
NTSTATUS status;
DEV_HANDLE dev_handle;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( pdev == NULL || pendp == NULL )
return STATUS_INVALID_PARAMETER;
@@ -345,7 +345,7 @@
PUSB_DEV pdev;
PUSB_ENDPOINT pendp;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( purb == NULL || context == NULL )
return;
@@ -623,7 +623,7 @@
NTSTATUS status;
PHCD hcd;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( purb == NULL )
return STATUS_INVALID_PARAMETER;
@@ -712,14 +712,14 @@
)
{
NTSTATUS status;
- PUSB_DEV pdev, parent_dev;
+ PUSB_DEV pdev;
LONG if_idx, endp_idx;
- DEV_HANDLE endp_handle, parent_dev_handle;
+ DEV_HANDLE endp_handle;
PUSB_CTRL_SETUP_PACKET psetup;
PUSB_ENDPOINT pendp;
PHCD hcd;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( purb == NULL || dev_mgr == NULL)
return STATUS_INVALID_PARAMETER;
@@ -820,7 +820,7 @@
&& psetup->bRequest == USB_REQ_CLEAR_FEATURE
&& psetup->wValue == 0 ) //reset pipe
{
- ULONG endp_addr, endp_handle_to_reset;
+ ULONG endp_addr;
BOOL found;
endp_addr = psetup->wIndex;
if( ( endp_addr & 0xf ) == 0 )
@@ -887,7 +887,7 @@
ULONG config_val;
NTSTATUS status;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( purb == NULL )
{
@@ -992,7 +992,7 @@
PBYTE buf;
PUSB_CONFIGURATION_DESC pcfg_desc1;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( pdev == NULL || purb == NULL )
return STATUS_INVALID_PARAMETER;
@@ -1192,7 +1192,6 @@
usb_cal_cpu_freq()
{
LARGE_INTEGER tick1, tick2;
- LARGE_INTEGER interval;
LONG i;
// interval.QuadPart = -40 * 1000 * 1000;
@@ -1227,7 +1226,7 @@
NTSTATUS status;
PHCD hcd;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
purb1 = purb;
pdev = purb->pdev;
@@ -1363,7 +1362,7 @@
ULONG i;
PLIST_ENTRY pthis, pnext;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( purb == NULL )
return;