mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 09:00:27 +00:00
- Add ros_glue.cpp for implementing CrNt stubs.
- Start changing CrNt to actual ReactOS functions (no need for supporting different versions / importing CrossNT lib). svn path=/trunk/; revision=29280
This commit is contained in:
parent
ae56de4440
commit
604d7ae80f
4 changed files with 37 additions and 23 deletions
|
@ -2648,7 +2648,7 @@ AtapiHwInitialize__(
|
||||||
for (j = 0; j < 26; j += 2) {
|
for (j = 0; j < 26; j += 2) {
|
||||||
|
|
||||||
// Build a buffer based on the identify data.
|
// 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)) {
|
if (!AtapiStringCmp (vendorId, "CD-ROM CDR", 11)) {
|
||||||
|
@ -3054,9 +3054,9 @@ ReturnCallback:
|
||||||
|
|
||||||
chan = &(deviceExtension->chan[c]);
|
chan = &(deviceExtension->chan[c]);
|
||||||
|
|
||||||
if((ULONG)CrNtInterlockedCompareExchange((PVOID*)&(chan->CheckIntr),
|
if((ULONG)InterlockedCompareExchange(&chan->CheckIntr,
|
||||||
(PVOID)CHECK_INTR_ACTIVE,
|
CHECK_INTR_ACTIVE,
|
||||||
(PVOID)CHECK_INTR_DETECTED) == CHECK_INTR_DETECTED) {
|
CHECK_INTR_DETECTED) == CHECK_INTR_DETECTED) {
|
||||||
//ASSERT(!deviceExtension->simplexOnly);
|
//ASSERT(!deviceExtension->simplexOnly);
|
||||||
chan->DpcState = DPC_STATE_ISR;
|
chan->DpcState = DPC_STATE_ISR;
|
||||||
if(!AtapiInterrupt__(HwDeviceExtension, (UCHAR)c)) {
|
if(!AtapiInterrupt__(HwDeviceExtension, (UCHAR)c)) {
|
||||||
|
@ -3144,17 +3144,17 @@ AtapiInterrupt(
|
||||||
// if (deviceExtension->chan[c].CheckIntr == CHECK_INTR_DETECTED) {
|
// if (deviceExtension->chan[c].CheckIntr == CHECK_INTR_DETECTED) {
|
||||||
// deviceExtension->chan[c].CheckIntr = CHECK_INTR_ACTIVE;
|
// deviceExtension->chan[c].CheckIntr = CHECK_INTR_ACTIVE;
|
||||||
// }
|
// }
|
||||||
c_state = (ULONG)CrNtInterlockedCompareExchange((PVOID*)&(deviceExtension->chan[c].CheckIntr),
|
c_state = (ULONG)InterlockedCompareExchange(&(deviceExtension->chan[c].CheckIntr),
|
||||||
(PVOID)CHECK_INTR_ACTIVE,
|
CHECK_INTR_ACTIVE,
|
||||||
(PVOID)CHECK_INTR_DETECTED);
|
CHECK_INTR_DETECTED);
|
||||||
if(c_state == CHECK_INTR_IDLE) {
|
if(c_state == CHECK_INTR_IDLE) {
|
||||||
// c_state = deviceExtension->chan[c].CheckIntr;
|
// c_state = deviceExtension->chan[c].CheckIntr;
|
||||||
// if (deviceExtension->chan[c].CheckIntr == CHECK_INTR_IDLE) {
|
// if (deviceExtension->chan[c].CheckIntr == CHECK_INTR_IDLE) {
|
||||||
// deviceExtension->chan[c].CheckIntr = CHECK_INTR_ACTIVE
|
// deviceExtension->chan[c].CheckIntr = CHECK_INTR_ACTIVE
|
||||||
// }
|
// }
|
||||||
c_state = (ULONG)CrNtInterlockedCompareExchange((PVOID*)&(deviceExtension->chan[c].CheckIntr),
|
c_state = (ULONG)InterlockedCompareExchange(&(deviceExtension->chan[c].CheckIntr),
|
||||||
(PVOID)CHECK_INTR_ACTIVE,
|
CHECK_INTR_ACTIVE,
|
||||||
(PVOID)CHECK_INTR_IDLE);
|
CHECK_INTR_IDLE);
|
||||||
}
|
}
|
||||||
} while(c_state == CHECK_INTR_CHECK);
|
} while(c_state == CHECK_INTR_CHECK);
|
||||||
KdPrint2((PRINT_PREFIX "AtapiInterrupt(base): locked\n"));
|
KdPrint2((PRINT_PREFIX "AtapiInterrupt(base): locked\n"));
|
||||||
|
@ -3241,9 +3241,9 @@ AtapiInterrupt2(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((ULONG)CrNtInterlockedCompareExchange((PVOID*)&(deviceExtension->chan[c].CheckIntr),
|
if((ULONG)CrNtInterlockedCompareExchange(&(deviceExtension->chan[c].CheckIntr),
|
||||||
(PVOID)CHECK_INTR_CHECK,
|
CHECK_INTR_CHECK,
|
||||||
(PVOID)CHECK_INTR_IDLE) != CHECK_INTR_IDLE) {
|
CHECK_INTR_IDLE) != CHECK_INTR_IDLE) {
|
||||||
KdPrint2((PRINT_PREFIX "AtapiInterrupt2: !CHECK_INTR_IDLE\n"));
|
KdPrint2((PRINT_PREFIX "AtapiInterrupt2: !CHECK_INTR_IDLE\n"));
|
||||||
// hunt on unexpected intr (Some devices generate double interrupts,
|
// hunt on unexpected intr (Some devices generate double interrupts,
|
||||||
// some controllers (at least CMD649) interrupt twice with small delay.
|
// some controllers (at least CMD649) interrupt twice with small delay.
|
||||||
|
@ -3296,9 +3296,9 @@ AtapiInterruptDpc(
|
||||||
|
|
||||||
if(!(deviceExtension->chan[c].ChannelCtrlFlags & CTRFLAGS_DPC_REQ)) {
|
if(!(deviceExtension->chan[c].ChannelCtrlFlags & CTRFLAGS_DPC_REQ)) {
|
||||||
|
|
||||||
if((ULONG)CrNtInterlockedCompareExchange((PVOID*)&(deviceExtension->chan[c].CheckIntr),
|
if((ULONG)InterlockedCompareExchange(&(deviceExtension->chan[c].CheckIntr),
|
||||||
(PVOID)CHECK_INTR_ACTIVE,
|
CHECK_INTR_ACTIVE,
|
||||||
(PVOID)CHECK_INTR_DETECTED) != CHECK_INTR_DETECTED) {
|
CHECK_INTR_DETECTED) != CHECK_INTR_DETECTED) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3350,9 +3350,9 @@ AtapiEnableInterrupts__(
|
||||||
} else {
|
} else {
|
||||||
// check if other channel(s) interrupted
|
// check if other channel(s) interrupted
|
||||||
// must do nothing in simplex mode
|
// must do nothing in simplex mode
|
||||||
if((ULONG)CrNtInterlockedCompareExchange((PVOID*)&(chan->CheckIntr),
|
if((ULONG)CrNtInterlockedCompareExchange(&(chan->CheckIntr),
|
||||||
(PVOID)CHECK_INTR_ACTIVE,
|
CHECK_INTR_ACTIVE,
|
||||||
(PVOID)CHECK_INTR_DETECTED) != CHECK_INTR_DETECTED) {
|
CHECK_INTR_DETECTED) != CHECK_INTR_DETECTED) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//ASSERT(!deviceExtension->simplexOnly);
|
//ASSERT(!deviceExtension->simplexOnly);
|
||||||
|
@ -5569,7 +5569,7 @@ IdeVerify(
|
||||||
sectors));
|
sectors));
|
||||||
|
|
||||||
// Get starting sector number from CDB.
|
// 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);
|
MOV_DW_SWP(sectorCount, ((PCDB)Srb->Cdb)->CDB10.TransferBlocks);
|
||||||
|
|
||||||
KdPrint2((PRINT_PREFIX
|
KdPrint2((PRINT_PREFIX
|
||||||
|
@ -6345,7 +6345,7 @@ IdeSendCommand(
|
||||||
|
|
||||||
// Fill in vendor identification fields.
|
// Fill in vendor identification fields.
|
||||||
for (i = 0; i < 24; i += 2) {
|
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.
|
// Initialize unused portion of product id.
|
||||||
|
@ -6356,7 +6356,7 @@ IdeSendCommand(
|
||||||
// Move firmware revision from IDENTIFY data to
|
// Move firmware revision from IDENTIFY data to
|
||||||
// product revision in INQUIRY data.
|
// product revision in INQUIRY data.
|
||||||
for (i = 0; i < 4; i += 2) {
|
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;
|
status = SRB_STATUS_SUCCESS;
|
||||||
|
|
|
@ -16,7 +16,7 @@ KeTestSpinLock,(
|
||||||
(
|
(
|
||||||
SpinLock
|
SpinLock
|
||||||
))
|
))
|
||||||
|
#if 0
|
||||||
CROSSNT_DECL(
|
CROSSNT_DECL(
|
||||||
LONG,
|
LONG,
|
||||||
__fastcall,
|
__fastcall,
|
||||||
|
@ -62,6 +62,12 @@ InterlockedCompareExchange,(
|
||||||
IN PVOID ExChange,
|
IN PVOID ExChange,
|
||||||
IN PVOID Comperand
|
IN PVOID Comperand
|
||||||
))
|
))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CrNtInterlockedIncrement InterlockedIncrement
|
||||||
|
#define CrNtInterlockedDecrement InterlockedDecrement
|
||||||
|
#define CrNtInterlockedExchangeAdd InterlockedExchangeAdd
|
||||||
|
#define CrNtInterlockedCompareExchange InterlockedCompareExchange
|
||||||
|
|
||||||
CROSSNT_DECL_EX("HAL.DLL",
|
CROSSNT_DECL_EX("HAL.DLL",
|
||||||
KIRQL,__stdcall,
|
KIRQL,__stdcall,
|
||||||
|
|
7
reactos/drivers/storage/ide/uniata/ros_glue.cpp
Normal file
7
reactos/drivers/storage/ide/uniata/ros_glue.cpp
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ULONG MajorVersion = 0x04;
|
||||||
|
ULONG MinorVersion = 0x01;
|
||||||
|
ULONG BuildNumber = 0x0;
|
||||||
|
}
|
|
@ -16,6 +16,7 @@
|
||||||
<file>id_probe.cpp</file>
|
<file>id_probe.cpp</file>
|
||||||
<file>id_queue.cpp</file>
|
<file>id_queue.cpp</file>
|
||||||
<file>id_sata.cpp</file>
|
<file>id_sata.cpp</file>
|
||||||
|
<file>ros_glue.cpp</file>
|
||||||
<file>stdafx.cpp</file>
|
<file>stdafx.cpp</file>
|
||||||
<file>idedma.rc</file>
|
<file>idedma.rc</file>
|
||||||
</module>
|
</module>
|
||||||
|
|
Loading…
Reference in a new issue