Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 68 of file misc.c.
Referenced by SerialAddDeviceInternal().
{ PSERIAL_DEVICE_EXTENSION DeviceExtension; PUCHAR ComPortBase; UCHAR Byte; KIRQL Irql; UCHAR IER; NTSTATUS Status; DeviceExtension = (PSERIAL_DEVICE_EXTENSION)pDeviceExtension; ComPortBase = ULongToPtr(DeviceExtension->BaseAddress); KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql); while (READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_DATA_RECEIVED) { Byte = READ_PORT_UCHAR(SER_RBR(ComPortBase)); INFO_(SERIAL, "Byte received on COM%lu: 0x%02x\n", DeviceExtension->ComPort, Byte); Status = PushCircularBufferEntry(&DeviceExtension->InputBuffer, Byte); if (NT_SUCCESS(Status)) DeviceExtension->SerialPerfStats.ReceivedCount++; else DeviceExtension->SerialPerfStats.BufferOverrunErrorCount++; } KeSetEvent(&DeviceExtension->InputBufferNotEmpty, 0, FALSE); KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql); /* allow new interrupts */ IER = READ_PORT_UCHAR(SER_IER(ComPortBase)); WRITE_PORT_UCHAR(SER_IER(ComPortBase), IER | SR_IER_DATA_RECEIVED); }