Fixed implementation of register io functions

Added luid functions

svn path=/trunk/; revision=910
This commit is contained in:
Eric Kohl 1999-12-29 01:37:30 +00:00
parent c7580dacf3
commit 2284e742b3
8 changed files with 296 additions and 127 deletions

View file

@ -1,4 +1,4 @@
/* $Id: vidport.c,v 1.9 1999/12/04 20:58:42 ea Exp $
/* $Id: vidport.c,v 1.10 1999/12/29 01:37:30 ekohl Exp $
*
* VideoPort driver
* Written by Rex Jolliff
@ -6,7 +6,6 @@
#include <ddk/ntddk.h>
#include <ddk/ntddvid.h>
#include <internal/halio.h>
#include "vidport.h"
@ -288,7 +287,7 @@ VideoPortInitialize(IN PVOID Context1,
if (HwInitializationData->HwInterrupt != NULL)
{
IoDisconnectInterrupt(&ExtensionData->InterruptObject);
IoDisconnectInterrupt(ExtensionData->InterruptObject);
}
IoDeleteDevice(MPDeviceObject);
@ -566,7 +565,7 @@ STDCALL
VideoPortWritePortUchar(IN PUCHAR Port,
IN UCHAR Value)
{
UNIMPLEMENTED;
WRITE_PORT_UCHAR(Port, Value);
}
VOID
@ -574,7 +573,7 @@ STDCALL
VideoPortWritePortUshort(IN PUSHORT Port,
IN USHORT Value)
{
UNIMPLEMENTED;
WRITE_PORT_USHORT(Port, Value);
}
VOID
@ -582,7 +581,7 @@ STDCALL
VideoPortWritePortUlong(IN PULONG Port,
IN ULONG Value)
{
UNIMPLEMENTED;
WRITE_PORT_ULONG(Port, Value);
}
VOID
@ -591,7 +590,7 @@ VideoPortWritePortBufferUchar(IN PUCHAR Port,
IN PUCHAR Buffer,
IN ULONG Count)
{
UNIMPLEMENTED;
WRITE_PORT_BUFFER_UCHAR(Port, Buffer, Count);
}
VOID
@ -600,7 +599,7 @@ VideoPortWritePortBufferUshort(IN PUSHORT Port,
IN PUSHORT Buffer,
IN ULONG Count)
{
UNIMPLEMENTED;
WRITE_PORT_BUFFER_USHORT(Port, Buffer, Count);
}
VOID
@ -609,7 +608,7 @@ VideoPortWritePortBufferUlong(IN PULONG Port,
IN PULONG Buffer,
IN ULONG Count)
{
UNIMPLEMENTED;
WRITE_PORT_BUFFER_ULONG(Port, Buffer, Count);
}
VOID
@ -617,7 +616,7 @@ STDCALL
VideoPortWriteRegisterUchar(IN PUCHAR Register,
IN UCHAR Value)
{
UNIMPLEMENTED;
WRITE_REGISTER_UCHAR(Register, Value);
}
VOID
@ -625,7 +624,7 @@ STDCALL
VideoPortWriteRegisterUshort(IN PUSHORT Register,
IN USHORT Value)
{
UNIMPLEMENTED;
WRITE_REGISTER_USHORT(Register, Value);
}
VOID
@ -633,7 +632,7 @@ STDCALL
VideoPortWriteRegisterUlong(IN PULONG Register,
IN ULONG Value)
{
UNIMPLEMENTED;
WRITE_REGISTER_ULONG(Register, Value);
}
VOID
@ -642,7 +641,7 @@ VideoPortWriteRegisterBufferUchar(IN PUCHAR Register,
IN PUCHAR Buffer,
IN ULONG Count)
{
UNIMPLEMENTED;
WRITE_REGISTER_BUFFER_UCHAR(Register, Buffer, Count);
}
VOID
@ -651,7 +650,7 @@ VideoPortWriteRegisterBufferUshort(IN PUSHORT Register,
IN PUSHORT Buffer,
IN ULONG Count)
{
UNIMPLEMENTED;
WRITE_REGISTER_BUFFER_USHORT(Register, Buffer, Count);
}
VOID
@ -660,7 +659,7 @@ VideoPortWriteRegisterBufferUlong(IN PULONG Register,
IN PULONG Buffer,
IN ULONG Count)
{
UNIMPLEMENTED;
WRITE_REGISTER_BUFFER_ULONG(Register, Buffer, Count);
}
VOID

View file

@ -1,4 +1,4 @@
/* $Id: rtl.h,v 1.23 1999/12/27 15:04:50 ekohl Exp $
/* $Id: rtl.h,v 1.24 1999/12/29 01:36:58 ekohl Exp $
*
*/
@ -1139,6 +1139,84 @@ RtlxUnicodeStringToOemSize (
);
/* Register io functions */
UCHAR
READ_REGISTER_UCHAR (
PUCHAR Register
);
USHORT
READ_REGISTER_USHORT (
PUSHORT Register
);
ULONG
READ_REGISTER_ULONG (
PULONG Register
);
VOID
READ_REGISTER_BUFFER_UCHAR (
PUCHAR Register,
PUCHAR Buffer,
ULONG Count
);
VOID
READ_REGISTER_BUFFER_USHORT (
PUSHORT Register,
PUSHORT Buffer,
ULONG Count
);
VOID
READ_REGISTER_BUFFER_ULONG (
PULONG Register,
PULONG Buffer,
ULONG Count
);
VOID
WRITE_REGISTER_UCHAR (
PUCHAR Register,
UCHAR Value
);
VOID
WRITE_REGISTER_USHORT (
PUSHORT Register,
USHORT Value
);
VOID
WRITE_REGISTER_ULONG (
PULONG Register,
ULONG Value
);
VOID
WRITE_REGISTER_BUFFER_UCHAR (
PUCHAR Register,
PUCHAR Buffer,
ULONG Count
);
VOID
WRITE_REGISTER_BUFFER_USHORT (
PUSHORT Register,
PUSHORT Buffer,
ULONG Count
);
VOID
WRITE_REGISTER_BUFFER_ULONG (
PULONG Register,
PULONG Buffer,
ULONG Count
);
/* functions exported from NTOSKRNL.EXE which are considered RTL */
#if 0
_stricmp

View file

@ -164,111 +164,6 @@ __OUTS(l)
__inlc_p(port) : \
__inl_p(port))
/* HAL Memory mapped I/O functions */
/* FIXME: these ops should be 'lock' prefixed */
extern inline unsigned char
READ_REGISTER_UCHAR(unsigned char *Register)
{
return *Register;
}
extern inline unsigned short
READ_REGISTER_USHORT(unsigned short *Register)
{
return *Register;
}
extern inline unsigned long
READ_REGISTER_ULONG(unsigned long *Register)
{
return *Register;
}
extern inline void
READ_REGISTER_BUFFER_UCHAR(unsigned char *Register,
unsigned char *Buffer,
unsigned long Count)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
extern inline void
READ_REGISTER_BUFFER_USHORT(unsigned short *Register,
unsigned short *Buffer,
unsigned long Count)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
extern inline void
READ_REGISTER_BUFFER_ULONG(unsigned long *Register,
unsigned long *Buffer,
unsigned long Count)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
extern inline void
WRITE_REGISTER_UCHAR(unsigned char *Register, unsigned char Value)
{
*Register = Value;
}
extern inline void
WRITE_REGISTER_USHORT(unsigned short *Register, unsigned short Value)
{
*Register = Value;
}
extern inline void
WRITE_REGISTER_ULONG(unsigned long *Register, unsigned long Value)
{
*Register = Value;
}
extern inline void
WRITE_REGISTER_BUFFER_UCHAR(unsigned char *Register,
unsigned char *Buffer,
unsigned long Count)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
extern inline void
WRITE_REGISTER_BUFFER_USHORT(unsigned short *Register,
unsigned short *Buffer,
unsigned long Count)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
extern inline void
WRITE_REGISTER_BUFFER_ULONG(unsigned long *Register,
unsigned long *Buffer,
unsigned long Count)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
#endif

View file

@ -1,4 +1,4 @@
# $Id: makefile_rex,v 1.43 1999/12/26 17:22:18 ea Exp $
# $Id: makefile_rex,v 1.44 1999/12/29 01:36:34 ekohl Exp $
#
# ReactOS Operating System
#
@ -21,7 +21,8 @@ RTL_OBJECTS = rtl/vsprintf.o rtl/lookas.o rtl/unicode.o rtl/time.o \
rtl/unalign.o rtl/mem.o rtl/largeint.o rtl/ctype.o \
rtl/list.o rtl/slist.o rtl/interlck.o rtl/return.o \
rtl/wstring.o rtl/memcpy.o rtl/memmove.o rtl/memset.o \
rtl/memchr.o rtl/nls.o rtl/string.o rtl/stdlib.o
rtl/memchr.o rtl/nls.o rtl/string.o rtl/stdlib.o \
rtl/regio.o
KE_OBJECTS = ke/main.o ke/timer.o ke/error.o ke/catch.o \
ke/dpc.o ke/wait.o ke/kqueue.o ke/dispatch.o \

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.35 1999/12/27 15:05:33 ekohl Exp $
; $Id: ntoskrnl.def,v 1.36 1999/12/29 01:36:34 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -201,6 +201,12 @@ NtWriteFile@36
PoQueryPowerSequence@0
PoRequestPowerChange@12
PoSetDeviceIdleDetection@8
READ_REGISTER_UCHAR
READ_REGISTER_ULONG
READ_REGISTER_USHORT
READ_REGISTER_BUFFER_UCHAR
READ_REGISTER_BUFFER_ULONG
READ_REGISTER_BUFFER_USHORT
RtlAnsiCharToUnicodeChar@4
RtlAnsiStringToUnicodeSize@4
RtlAnsiStringToUnicodeString@12
@ -214,6 +220,7 @@ RtlCompareString@12
RtlCompareUnicodeString@12
RtlConvertLongToLargeInteger@4
RtlConvertUlongToLargeInteger@4
RtlCopyLuid@8
RtlCopyMemory
RtlCopyString@8
RtlCopyUnicodeString@8
@ -222,6 +229,7 @@ RtlDowncaseUnicodeString@12
RtlEnlargedIntegerMultiply@8
RtlEnlargedUnsignedDivide@16
RtlEnlargedUnsignedMultiply@8
RtlEqualLuid@8
RtlEqualString@12
RtlEqualUnicodeString@12
RtlExtendedIntegerMultiply@12
@ -278,6 +286,12 @@ RtlxAnsiStringToUnicodeSize@4
RtlxOemStringToUnicodeSize@4
RtlxUnicodeStringToAnsiSize@4
RtlxUnicodeStringToOemSize@4
WRITE_REGISTER_UCHAR
WRITE_REGISTER_ULONG
WRITE_REGISTER_USHORT
WRITE_REGISTER_BUFFER_UCHAR
WRITE_REGISTER_BUFFER_ULONG
WRITE_REGISTER_BUFFER_USHORT
ZwAccessCheckAndAuditAlarm@44
ZwAlertThread@4
ZwAllocateVirtualMemory@24

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.edf,v 1.22 1999/12/27 15:05:33 ekohl Exp $
; $Id: ntoskrnl.edf,v 1.23 1999/12/29 01:36:34 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -201,6 +201,12 @@ NtWriteFile=NtWriteFile@36
PoQueryPowerSequence=PoQueryPowerSequence@0
PoRequestPowerChange=PoRequestPowerChange@12
PoSetDeviceIdleDetection=PoSetDeviceIdleDetection@8
READ_REGISTER_UCHAR
READ_REGISTER_ULONG
READ_REGISTER_USHORT
READ_REGISTER_BUFFER_UCHAR
READ_REGISTER_BUFFER_ULONG
READ_REGISTER_BUFFER_USHORT
RtlAnsiCharToUnicodeChar=RtlAnsiCharToUnicodeChar@4
RtlAnsiStringToUnicodeSize=RtlAnsiStringToUnicodeSize@4
RtlAnsiStringToUnicodeString=RtlAnsiStringToUnicodeString@12
@ -214,6 +220,7 @@ RtlCompareString=RtlCompareString@12
RtlCompareUnicodeString=RtlCompareUnicodeString@12
RtlConvertLongToLargeInteger=RtlConvertLongToLargeInteger@4
RtlConvertUlongToLargeInteger=RtlConvertUlongToLargeInteger@4
RtlCopyLuid=RtlCopyLuid@8
RtlCopyMemory
RtlCopyString=RtlCopyString@8
RtlCopyUnicodeString=RtlCopyUnicodeString@8
@ -222,6 +229,7 @@ RtlDowncaseUnicodeString=RtlDowncaseUnicodeString@12
RtlEnlargedIntegerMultiply=RtlEnlargedIntegerMultiply@8
RtlEnlargedUnsignedDivide=RtlEnlargedUnsignedDivide@16
RtlEnlargedUnsignedMultiply=RtlEnlargedUnsignedMultiply@8
RtlEqualLuid=RtlEqualLuid@8
RtlEqualString=RtlEqualString@12
RtlEqualUnicodeString=RtlEqualUnicodeString@12
RtlExtendedIntegerMultiply=RtlExtendedIntegerMultiply@12
@ -276,6 +284,12 @@ RtlxAnsiStringToUnicodeSize=RtlxAnsiStringToUnicodeSize@4
RtlxOemStringToUnicodeSize=RtlxOemStringToUnicodeSize@4
RtlxUnicodeStringToAnsiSize=RtlxUnicodeStringToAnsiSize@4
RtlxUnicodeStringToOemSize=RtlxUnicodeStringToOemSize@4
WRITE_REGISTER_UCHAR
WRITE_REGISTER_ULONG
WRITE_REGISTER_USHORT
WRITE_REGISTER_BUFFER_UCHAR
WRITE_REGISTER_BUFFER_ULONG
WRITE_REGISTER_BUFFER_USHORT
ZwAccessCheckAndAuditAlarm=ZwAccessCheckAndAuditAlarm@44
ZwAlertThread=ZwAlertThread@4
ZwAllocateVirtualMemory=ZwAllocateVirtualMemory@24

View file

@ -0,0 +1,146 @@
/* $Id: regio.c,v 1.1 1999/12/29 01:35:53 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/rtl/regio.c
* PURPOSE: Register io functions
* PROGRAMMER: Eric Kohl (ekohl@abo.rhein-zeitung.de)
* REVISION HISTORY:
* 29/12/1999 Created
*/
#include <ddk/ntddk.h>
/* FUNCTIONS ***************************************************************/
UCHAR
READ_REGISTER_UCHAR (
PUCHAR Register
)
{
return *Register;
}
USHORT
READ_REGISTER_USHORT (
PUSHORT Register
)
{
return *Register;
}
ULONG
READ_REGISTER_ULONG (
PULONG Register
)
{
return *Register;
}
VOID
READ_REGISTER_BUFFER_UCHAR (
PUCHAR Register,
PUCHAR Buffer,
ULONG Count
)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
VOID
READ_REGISTER_BUFFER_USHORT (
PUSHORT Register,
PUSHORT Buffer,
ULONG Count
)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
VOID
READ_REGISTER_BUFFER_ULONG (
PULONG Register,
PULONG Buffer,
ULONG Count
)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
VOID
WRITE_REGISTER_UCHAR (
PUCHAR Register,
UCHAR Value
)
{
*Register = Value;
}
VOID
WRITE_REGISTER_USHORT (
PUSHORT Register,
USHORT Value
)
{
*Register = Value;
}
VOID
WRITE_REGISTER_ULONG (
PULONG Register,
ULONG Value
)
{
*Register = Value;
}
VOID
WRITE_REGISTER_BUFFER_UCHAR (
PUCHAR Register,
PUCHAR Buffer,
ULONG Count
)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
VOID
WRITE_REGISTER_BUFFER_USHORT (
PUSHORT Register,
PUSHORT Buffer,
ULONG Count
)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
VOID
WRITE_REGISTER_BUFFER_ULONG (
PULONG Register,
PULONG Buffer,
ULONG Count
)
{
while (Count--)
{
*Buffer++ = *Register++;
}
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: luid.c,v 1.2 1999/12/26 17:22:19 ea Exp $
/* $Id: luid.c,v 1.3 1999/12/29 01:36:06 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -35,3 +35,25 @@ NTSTATUS STDCALL NtAllocateLocallyUniqueId(OUT LUID* LocallyUniqueId)
*LocallyUniqueId = ReturnedLuid;
return(STATUS_SUCCESS);
}
VOID
STDCALL
RtlCopyLuid (
PLUID LuidDest,
PLUID LuidSrc
)
{
LuidDest->QuadPart = LuidSrc->QuadPart;
}
BOOLEAN
STDCALL
RtlEqualLuid (
PLUID Luid1,
PLUID Luid2
)
{
return ((Luid1->QuadPart == Luid2->QuadPart) ? TRUE : FALSE);
}
/* EOF */