mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Fixed port i/o functions
svn path=/trunk/; revision=1305
This commit is contained in:
parent
cc22ad9378
commit
f7d76fbc5b
1 changed files with 12 additions and 11 deletions
|
@ -14,7 +14,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include "../../../ntoskrnl/include/internal/i386/io.h"
|
|
||||||
|
|
||||||
#include "floppy.h"
|
#include "floppy.h"
|
||||||
|
|
||||||
|
@ -96,7 +95,7 @@ static BOOLEAN FloppyInitialized = FALSE;
|
||||||
static int
|
static int
|
||||||
FloppyReadSTAT(ULONG PortBase)
|
FloppyReadSTAT(ULONG PortBase)
|
||||||
{
|
{
|
||||||
return(inb_p(PortBase + FLOPPY_STATUS));
|
return(READ_PORT_UCHAR((PUCHAR)(PortBase + FLOPPY_STATUS)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* waits until the fdc becomes ready */
|
/* waits until the fdc becomes ready */
|
||||||
|
@ -128,7 +127,7 @@ FloppyWaitUntilReady(WORD PortBase)
|
||||||
static VOID
|
static VOID
|
||||||
FloppyWriteData(WORD PortBase, BYTE Byte)
|
FloppyWriteData(WORD PortBase, BYTE Byte)
|
||||||
{
|
{
|
||||||
outb_p(PortBase + FLOPPY_DATA, Byte);
|
WRITE_PORT_UCHAR((PUCHAR)(PortBase + FLOPPY_DATA), Byte);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sends a command byte to the fdc */
|
/* sends a command byte to the fdc */
|
||||||
|
@ -179,7 +178,7 @@ FloppyReadResultCode(WORD PortBase, PUCHAR Result)
|
||||||
}
|
}
|
||||||
if (Status == (STATUS_DIR | STATUS_READY | STATUS_BUSY))
|
if (Status == (STATUS_DIR | STATUS_READY | STATUS_BUSY))
|
||||||
{
|
{
|
||||||
Result[Replies] = inb_p(FLOPPY_DATA);
|
Result[Replies] = READ_PORT_UCHAR((PUCHAR)FLOPPY_DATA);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -395,6 +394,7 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject,
|
||||||
UNICODE_STRING SymlinkName;
|
UNICODE_STRING SymlinkName;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PDEVICE_OBJECT DeviceObject;
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
PCONFIGURATION_INFORMATION ConfigInfo;
|
||||||
|
|
||||||
/* Detect controller and determine type */
|
/* Detect controller and determine type */
|
||||||
if (!FloppyGetControllerVersion(ControllerParameters, &ControllerType))
|
if (!FloppyGetControllerVersion(ControllerParameters, &ControllerType))
|
||||||
|
@ -475,9 +475,10 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject,
|
||||||
DeviceObject->Flags = DeviceObject->Flags | DO_DIRECT_IO;
|
DeviceObject->Flags = DeviceObject->Flags | DO_DIRECT_IO;
|
||||||
DeviceObject->AlignmentRequirement = FILE_WORD_ALIGNMENT;
|
DeviceObject->AlignmentRequirement = FILE_WORD_ALIGNMENT;
|
||||||
|
|
||||||
/* Create a symlink */
|
/* count new floppy drive */
|
||||||
RtlInitUnicodeString(&SymlinkName, L"\\??\\A:");
|
/* NOTE: HalIoAssignDriveLetters assigns the drive letters! */
|
||||||
IoCreateSymbolicLink(&SymlinkName, &DeviceName);
|
ConfigInfo = IoGetConfigurationInformation ();
|
||||||
|
ConfigInfo->FloppyCount++;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue