Author: fireball Date: Fri Sep 28 16:35:41 2007 New Revision: 29280
URL: http://svn.reactos.org/svn/reactos?rev=29280&view=rev Log: - Add ros_glue.cpp for implementing CrNt stubs. - Start changing CrNt to actual ReactOS functions (no need for supporting different versions / importing CrossNT lib).
Added: trunk/reactos/drivers/storage/ide/uniata/ros_glue.cpp (with props) Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp trunk/reactos/drivers/storage/ide/uniata/inc/CrNtStubs.h trunk/reactos/drivers/storage/ide/uniata/uniata.rbuild
Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata/... ============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp Fri Sep 28 16:35:41 2007 @@ -2648,7 +2648,7 @@ for (j = 0; j < 26; j += 2) {
// Build a buffer based on the identify data. - MOV_DW_SWP(vendorId[j], ((PUCHAR)LunExt->IdentifyData.ModelNumber)[j]); + vendorId[j] = RtlUshortByteSwap(((PUCHAR)LunExt->IdentifyData.ModelNumber)[j]); }
if (!AtapiStringCmp (vendorId, "CD-ROM CDR", 11)) { @@ -3054,9 +3054,9 @@
chan = &(deviceExtension->chan[c]);
- if((ULONG)CrNtInterlockedCompareExchange((PVOID*)&(chan->CheckIntr), - (PVOID)CHECK_INTR_ACTIVE, - (PVOID)CHECK_INTR_DETECTED) == CHECK_INTR_DETECTED) { + if((ULONG)InterlockedCompareExchange(&chan->CheckIntr, + CHECK_INTR_ACTIVE, + CHECK_INTR_DETECTED) == CHECK_INTR_DETECTED) { //ASSERT(!deviceExtension->simplexOnly); chan->DpcState = DPC_STATE_ISR; if(!AtapiInterrupt__(HwDeviceExtension, (UCHAR)c)) { @@ -3144,17 +3144,17 @@ // if (deviceExtension->chan[c].CheckIntr == CHECK_INTR_DETECTED) { // deviceExtension->chan[c].CheckIntr = CHECK_INTR_ACTIVE; // } - c_state = (ULONG)CrNtInterlockedCompareExchange((PVOID*)&(deviceExtension->chan[c].CheckIntr), - (PVOID)CHECK_INTR_ACTIVE, - (PVOID)CHECK_INTR_DETECTED); + c_state = (ULONG)InterlockedCompareExchange(&(deviceExtension->chan[c].CheckIntr), + CHECK_INTR_ACTIVE, + CHECK_INTR_DETECTED); if(c_state == CHECK_INTR_IDLE) { // c_state = deviceExtension->chan[c].CheckIntr; // if (deviceExtension->chan[c].CheckIntr == CHECK_INTR_IDLE) { // deviceExtension->chan[c].CheckIntr = CHECK_INTR_ACTIVE // } - c_state = (ULONG)CrNtInterlockedCompareExchange((PVOID*)&(deviceExtension->chan[c].CheckIntr), - (PVOID)CHECK_INTR_ACTIVE, - (PVOID)CHECK_INTR_IDLE); + c_state = (ULONG)InterlockedCompareExchange(&(deviceExtension->chan[c].CheckIntr), + CHECK_INTR_ACTIVE, + CHECK_INTR_IDLE); } } while(c_state == CHECK_INTR_CHECK); KdPrint2((PRINT_PREFIX "AtapiInterrupt(base): locked\n")); @@ -3241,9 +3241,9 @@ continue; }
- if((ULONG)CrNtInterlockedCompareExchange((PVOID*)&(deviceExtension->chan[c].CheckIntr), - (PVOID)CHECK_INTR_CHECK, - (PVOID)CHECK_INTR_IDLE) != CHECK_INTR_IDLE) { + if((ULONG)CrNtInterlockedCompareExchange(&(deviceExtension->chan[c].CheckIntr), + CHECK_INTR_CHECK, + CHECK_INTR_IDLE) != CHECK_INTR_IDLE) { KdPrint2((PRINT_PREFIX "AtapiInterrupt2: !CHECK_INTR_IDLE\n")); // hunt on unexpected intr (Some devices generate double interrupts, // some controllers (at least CMD649) interrupt twice with small delay. @@ -3296,9 +3296,9 @@
if(!(deviceExtension->chan[c].ChannelCtrlFlags & CTRFLAGS_DPC_REQ)) {
- if((ULONG)CrNtInterlockedCompareExchange((PVOID*)&(deviceExtension->chan[c].CheckIntr), - (PVOID)CHECK_INTR_ACTIVE, - (PVOID)CHECK_INTR_DETECTED) != CHECK_INTR_DETECTED) { + if((ULONG)InterlockedCompareExchange(&(deviceExtension->chan[c].CheckIntr), + CHECK_INTR_ACTIVE, + CHECK_INTR_DETECTED) != CHECK_INTR_DETECTED) { continue; }
@@ -3350,9 +3350,9 @@ } else { // check if other channel(s) interrupted // must do nothing in simplex mode - if((ULONG)CrNtInterlockedCompareExchange((PVOID*)&(chan->CheckIntr), - (PVOID)CHECK_INTR_ACTIVE, - (PVOID)CHECK_INTR_DETECTED) != CHECK_INTR_DETECTED) { + if((ULONG)CrNtInterlockedCompareExchange(&(chan->CheckIntr), + CHECK_INTR_ACTIVE, + CHECK_INTR_DETECTED) != CHECK_INTR_DETECTED) { continue; } //ASSERT(!deviceExtension->simplexOnly); @@ -5569,7 +5569,7 @@ sectors));
// Get starting sector number from CDB. - MOV_DD_SWP(startingSector, ((PCDB)Srb->Cdb)->CDB10.LBA); + startingSector = RtlUlongByteSwap((ULONG)((PCDB)Srb->Cdb)->CDB10.LBA); MOV_DW_SWP(sectorCount, ((PCDB)Srb->Cdb)->CDB10.TransferBlocks);
KdPrint2((PRINT_PREFIX @@ -6345,7 +6345,7 @@
// Fill in vendor identification fields. for (i = 0; i < 24; i += 2) { - MOV_DW_SWP(inquiryData->VendorId[i], ((PUCHAR)identifyData->ModelNumber)[i]); + inquiryData->VendorId[i] = RtlUshortByteSwap(((PUCHAR)identifyData->ModelNumber)[i]); } /* // Initialize unused portion of product id. @@ -6356,7 +6356,7 @@ // Move firmware revision from IDENTIFY data to // product revision in INQUIRY data. for (i = 0; i < 4; i += 2) { - MOV_DW_SWP(inquiryData->ProductRevisionLevel[i], ((PUCHAR)identifyData->FirmwareRevision)[i]); + inquiryData->ProductRevisionLevel[i] = RtlUshortByteSwap(((PUCHAR)identifyData->FirmwareRevision)[i]); }
status = SRB_STATUS_SUCCESS;
Modified: trunk/reactos/drivers/storage/ide/uniata/inc/CrNtStubs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata/... ============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/inc/CrNtStubs.h (original) +++ trunk/reactos/drivers/storage/ide/uniata/inc/CrNtStubs.h Fri Sep 28 16:35:41 2007 @@ -16,7 +16,7 @@ ( SpinLock )) - +#if 0 CROSSNT_DECL( LONG, __fastcall, @@ -62,6 +62,12 @@ IN PVOID ExChange, IN PVOID Comperand )) +#endif + +#define CrNtInterlockedIncrement InterlockedIncrement +#define CrNtInterlockedDecrement InterlockedDecrement +#define CrNtInterlockedExchangeAdd InterlockedExchangeAdd +#define CrNtInterlockedCompareExchange InterlockedCompareExchange
CROSSNT_DECL_EX("HAL.DLL", KIRQL,__stdcall,
Added: trunk/reactos/drivers/storage/ide/uniata/ros_glue.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata/... ============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/ros_glue.cpp (added) +++ trunk/reactos/drivers/storage/ide/uniata/ros_glue.cpp Fri Sep 28 16:35:41 2007 @@ -1,0 +1,7 @@ +#include "stdafx.h" + +extern "C" { +ULONG MajorVersion = 0x04; +ULONG MinorVersion = 0x01; +ULONG BuildNumber = 0x0; +}
Propchange: trunk/reactos/drivers/storage/ide/uniata/ros_glue.cpp ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/drivers/storage/ide/uniata/uniata.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata/... ============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/uniata.rbuild (original) +++ trunk/reactos/drivers/storage/ide/uniata/uniata.rbuild Fri Sep 28 16:35:41 2007 @@ -16,6 +16,7 @@ <file>id_probe.cpp</file> <file>id_queue.cpp</file> <file>id_sata.cpp</file> + <file>ros_glue.cpp</file> <file>stdafx.cpp</file> <file>idedma.rc</file> </module>