//\r
// Read a word if StartAddress is word aligned\r
//\r
- *(volatile UINT16 *)Buffer = PciRead16 (StartAddress);\r
+ WriteUnaligned16 (Buffer, PciRead16 (StartAddress));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Read as many double words as possible\r
//\r
- *(volatile UINT32 *)Buffer = PciRead32 (StartAddress);\r
+ WriteUnaligned32 (Buffer, PciRead32 (StartAddress));\r
StartAddress += sizeof (UINT32);\r
Size -= sizeof (UINT32);\r
Buffer = (UINT32*)Buffer + 1;\r
//\r
// Read the last remaining word if exist\r
//\r
- *(volatile UINT16 *)Buffer = PciRead16 (StartAddress);\r
+ WriteUnaligned16 (Buffer, PciRead16 (StartAddress));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Write a word if StartAddress is word aligned\r
//\r
- PciWrite16 (StartAddress, *(UINT16*)Buffer);\r
+ PciWrite16 (StartAddress, ReadUnaligned16 (Buffer));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Write as many double words as possible\r
//\r
- PciWrite32 (StartAddress, *(UINT32*)Buffer);\r
+ PciWrite32 (StartAddress, ReadUnaligned32 (Buffer));\r
StartAddress += sizeof (UINT32);\r
Size -= sizeof (UINT32);\r
Buffer = (UINT32*)Buffer + 1;\r
//\r
// Write the last remaining word if exist\r
//\r
- PciWrite16 (StartAddress, *(UINT16*)Buffer);\r
+ PciWrite16 (StartAddress, ReadUnaligned16 (Buffer));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Read a word if StartAddress is word aligned\r
//\r
- *(volatile UINT16 *)Buffer = PciSegmentRead16 (StartAddress);\r
+ WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Read as many double words as possible\r
//\r
- *(volatile UINT32 *)Buffer = PciSegmentRead32 (StartAddress);\r
+ WriteUnaligned32 (Buffer, PciSegmentRead32 (StartAddress));\r
StartAddress += sizeof (UINT32);\r
Size -= sizeof (UINT32);\r
Buffer = (UINT32*)Buffer + 1;\r
//\r
// Read the last remaining word if exist\r
//\r
- *(volatile UINT16 *)Buffer = PciSegmentRead16 (StartAddress);\r
+ WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Write a word if StartAddress is word aligned\r
//\r
- PciSegmentWrite16 (StartAddress, *(UINT16*)Buffer);\r
+ PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Write as many double words as possible\r
//\r
- PciSegmentWrite32 (StartAddress, *(UINT32*)Buffer);\r
+ PciSegmentWrite32 (StartAddress, ReadUnaligned32 (Buffer));\r
StartAddress += sizeof (UINT32);\r
Size -= sizeof (UINT32);\r
Buffer = (UINT32*)Buffer + 1;\r
//\r
// Write the last remaining word if exist\r
//\r
- PciSegmentWrite16 (StartAddress, *(UINT16*)Buffer);\r
+ PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Read a word if StartAddress is word aligned\r
//\r
- *(volatile UINT16 *)Buffer = PciRead16 (StartAddress);\r
+ WriteUnaligned16 (Buffer, PciRead16 (StartAddress));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Read as many double words as possible\r
//\r
- *(volatile UINT32 *)Buffer = PciRead32 (StartAddress);\r
+ WriteUnaligned32 (Buffer, PciRead32 (StartAddress));\r
StartAddress += sizeof (UINT32);\r
Size -= sizeof (UINT32);\r
Buffer = (UINT32*)Buffer + 1;\r
//\r
// Read the last remaining word if exist\r
//\r
- *(volatile UINT16 *)Buffer = PciRead16 (StartAddress);\r
+ WriteUnaligned16 (Buffer, PciRead16 (StartAddress));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Write a word if StartAddress is word aligned\r
//\r
- PciWrite16 (StartAddress, *(UINT16*)Buffer);\r
+ PciWrite16 (StartAddress, ReadUnaligned16 (Buffer));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Write as many double words as possible\r
//\r
- PciWrite32 (StartAddress, *(UINT32*)Buffer);\r
+ PciWrite32 (StartAddress, ReadUnaligned32 (Buffer));\r
StartAddress += sizeof (UINT32);\r
Size -= sizeof (UINT32);\r
Buffer = (UINT32*)Buffer + 1;\r
//\r
// Write the last remaining word if exist\r
//\r
- PciWrite16 (StartAddress, *(UINT16*)Buffer);\r
+ PciWrite16 (StartAddress, ReadUnaligned16 (Buffer));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Read a word if StartAddress is word aligned\r
//\r
- *(volatile UINT16 *)Buffer = PciSegmentRead16 (StartAddress);\r
+ WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Read as many double words as possible\r
//\r
- *(volatile UINT32 *)Buffer = PciSegmentRead32 (StartAddress);\r
+ WriteUnaligned32 (Buffer, PciSegmentRead32 (StartAddress));\r
StartAddress += sizeof (UINT32);\r
Size -= sizeof (UINT32);\r
Buffer = (UINT32*)Buffer + 1;\r
//\r
// Read the last remaining word if exist\r
//\r
- *(volatile UINT16 *)Buffer = PciSegmentRead16 (StartAddress);\r
+ WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Write a word if StartAddress is word aligned\r
//\r
- PciSegmentWrite16 (StartAddress, *(UINT16*)Buffer);\r
+ PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r
//\r
// Write as many double words as possible\r
//\r
- PciSegmentWrite32 (StartAddress, *(UINT32*)Buffer);\r
+ PciSegmentWrite32 (StartAddress, ReadUnaligned32 (Buffer));\r
StartAddress += sizeof (UINT32);\r
Size -= sizeof (UINT32);\r
Buffer = (UINT32*)Buffer + 1;\r
//\r
// Write the last remaining word if exist\r
//\r
- PciSegmentWrite16 (StartAddress, *(UINT16*)Buffer);\r
+ PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer));\r
StartAddress += sizeof (UINT16);\r
Size -= sizeof (UINT16);\r
Buffer = (UINT16*)Buffer + 1;\r