00907 :
00908
00909 This function
is called in response of a read io space extended state
00910 manipulation message. Its function
is to read system io
00911 locations.
00912
00913 Arguments:
00914
00915 m - Supplies
the state manipulation message.
00916
00917 AdditionalData - Supplies any additional data
for the message.
00918
00919 Context - Supplies
the current context.
00920
00921 Return Value:
00922
00923 None.
00924
00925 --*/
00926
00927 {
00928 PDBGKD_READ_WRITE_IO_EXTENDED a = &m->u.ReadWriteIoExtended;
00929 ULONG Length;
00930 STRING MessageHeader;
00931 PUCHAR b;
00932
PUSHORT s;
00933 PULONG l;
00934 ULONG
BusNumber;
00935 ULONG AddressSpace;
00936 ULONG SavedAddressSpace;
00937 PHYSICAL_ADDRESS IoAddress;
00938 ULONG DataSize;
00939 PHYSICAL_ADDRESS TranslatedAddress;
00940 INTERFACE_TYPE
InterfaceType;
00941 ULONG Value;
00942
00943 MessageHeader.Length =
sizeof(*m);
00944 MessageHeader.Buffer = (PCHAR)m;
00945
00946
ASSERT(AdditionalData->Length == 0);
00947
00948 m->ReturnStatus = STATUS_SUCCESS;
00949
00950
InterfaceType = a->InterfaceType;
00951
BusNumber = a->BusNumber;
00952 AddressSpace = SavedAddressSpace = a->AddressSpace;
00953 IoAddress.QuadPart = (ULONG_PTR)a->IoAddress;
00954 DataSize = a->DataSize;
00955 Value = a->DataValue;
00956
00957
00958
00959
00960
00961
00962
if( !
HalTranslateBusAddress( InterfaceType,
00963 BusNumber,
00964 IoAddress,
00965 &AddressSpace,
00966 &TranslatedAddress ) ){
00967 m->ReturnStatus = STATUS_INVALID_PARAMETER;
00968
goto SendWriteIoSpaceExtendedResponse;
00969 }
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
if( !AddressSpace ){
00981 m->ReturnStatus = STATUS_INVALID_PARAMETER;
00982
goto SendWriteIoSpaceExtendedResponse;
00983 }
00984
00985
00986
00987
00988
00989
00990
if( !SavedAddressSpace ){
00991
00992
00993
00994
00995
00996
switch( DataSize ){
00997
00998
case 1:
00999 WRITE_REGISTER_UCHAR( (PUCHAR)TranslatedAddress.QuadPart, (UCHAR)Value );
01000
break;
01001
01002
case 2:
01003 WRITE_REGISTER_USHORT( (PUSHORT)TranslatedAddress.QuadPart, (USHORT)Value );
01004
break;
01005
01006
case 4:
01007 WRITE_REGISTER_ULONG( (PULONG)TranslatedAddress.QuadPart, Value );
01008
break;
01009
01010
default:
01011 m->ReturnStatus = STATUS_INVALID_PARAMETER;
01012 }
01013
01014 }
else {
01015
01016
01017
01018
01019
01020
switch( DataSize ){
01021
01022
case 1:
01023 WRITE_PORT_UCHAR( (PUCHAR)TranslatedAddress.QuadPart, (UCHAR)Value );
01024
break;
01025
01026
case 2:
01027 WRITE_PORT_USHORT( (PUSHORT)TranslatedAddress.QuadPart, (USHORT)Value);
01028
break;
01029
01030
case 4:
01031 WRITE_PORT_ULONG( (PULONG)TranslatedAddress.QuadPart, Value );
01032
break;
01033
01034
default:
01035 m->ReturnStatus = STATUS_INVALID_PARAMETER;
01036 }
01037 }
01038
01039
01040
01041 SendWriteIoSpaceExtendedResponse:
01042
01043
KdpSendPacket(
01044 PACKET_TYPE_KD_STATE_MANIPULATE,
01045 &MessageHeader,
01046 NULL
01047 );
01048 }
}