X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseIoLibIntrinsic%2FIoLibGcc.c;h=785d3ed4207499874aeadce194b22b68156ebd3c;hp=db94f0f47e657489a18cc52c8bebe01b18abe355;hb=4dd6f84007005ca39eb931f6e1a61f5b5b0b9ae5;hpb=38bbd3d91c38481d18c1a7e2049473c951ee98ed diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c index db94f0f47e..785d3ed420 100644 --- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c +++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c @@ -10,8 +10,8 @@ We don't advocate putting compiler specifics in libraries or drivers but there is no other way to make this work. - Copyright (c) 2006 - 2007, Intel Corporation
- All rights reserved. This program and the accompanying materials + Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -21,214 +21,8 @@ **/ -// -// Include common header file for this module. -// -#include "BaseIoLibIntrinsicInternal.h" - -/** - Reads an 8-bit MMIO register. - - Reads the 8-bit MMIO register specified by Address. The 8-bit read value is - returned. This function must guarantee that all MMIO read and write - operations are serialized. - - If 8-bit MMIO register operations are not supported, then ASSERT(). - - @param Address The MMIO register to read. - - @return The value read from Address. - -**/ -UINT8 -EFIAPI -MmioRead8 ( - IN UINTN Address - ) -{ - return *(volatile UINT8*)Address; -} - -/** - Writes an 8-bit MMIO register. - - Writes the 8-bit MMIO register specified by Address with the value specified - by Value and returns Value. This function must guarantee that all MMIO read - and write operations are serialized. - - If 8-bit MMIO register operations are not supported, then ASSERT(). - - @param Address The MMIO register to write. - @param Value The value to write to the MMIO register. - - @return The value written to the Mmio. It equals to the input - Value instead of the actual value read back from the - Mmio. -**/ -UINT8 -EFIAPI -MmioWrite8 ( - IN UINTN Address, - IN UINT8 Value - ) -{ - return *(volatile UINT8*)Address = Value; -} - -/** - Reads a 16-bit MMIO register. - - Reads the 16-bit MMIO register specified by Address. The 16-bit read value is - returned. This function must guarantee that all MMIO read and write - operations are serialized. - - If 16-bit MMIO register operations are not supported, then ASSERT(). - - @param Address The MMIO register to read. - - @return The value read from Address. - -**/ -UINT16 -EFIAPI -MmioRead16 ( - IN UINTN Address - ) -{ - ASSERT ((Address & 1) == 0); - return *(volatile UINT16*)Address; -} - -/** - Writes a 16-bit MMIO register. - - Writes the 16-bit MMIO register specified by Address with the value specified - by Value and returns Value. This function must guarantee that all MMIO read - and write operations are serialized. - - If 16-bit MMIO register operations are not supported, then ASSERT(). - - @param Address The MMIO register to write. - @param Value The value to write to the MMIO register. - - @return The value written to the Mmio. It equals to the input - Value instead of the actual value read back from the - Mmio. -**/ -UINT16 -EFIAPI -MmioWrite16 ( - IN UINTN Address, - IN UINT16 Value - ) -{ - ASSERT ((Address & 1) == 0); - return *(volatile UINT16*)Address = Value; -} - -/** - Reads a 32-bit MMIO register. - - Reads the 32-bit MMIO register specified by Address. The 32-bit read value is - returned. This function must guarantee that all MMIO read and write - operations are serialized. - - If 32-bit MMIO register operations are not supported, then ASSERT(). - - @param Address The MMIO register to read. - - @return The value read from Address. - -**/ -UINT32 -EFIAPI -MmioRead32 ( - IN UINTN Address - ) -{ - ASSERT ((Address & 3) == 0); - return *(volatile UINT32*)Address; -} - -/** - Writes a 32-bit MMIO register. - - Writes the 32-bit MMIO register specified by Address with the value specified - by Value and returns Value. This function must guarantee that all MMIO read - and write operations are serialized. - - If 32-bit MMIO register operations are not supported, then ASSERT(). - - @param Address The MMIO register to write. - @param Value The value to write to the MMIO register. - - @return The value written to the Mmio. It equals to the input - Value instead of the actual value read back from the - Mmio. -**/ -UINT32 -EFIAPI -MmioWrite32 ( - IN UINTN Address, - IN UINT32 Value - ) -{ - ASSERT ((Address & 3) == 0); - return *(volatile UINT32*)Address = Value; -} - -/** - Reads a 64-bit MMIO register. - - Reads the 64-bit MMIO register specified by Address. The 64-bit read value is - returned. This function must guarantee that all MMIO read and write - operations are serialized. - - If 64-bit MMIO register operations are not supported, then ASSERT(). - - @param Address The MMIO register to read. - - @return The value read from Address. - -**/ -UINT64 -EFIAPI -MmioRead64 ( - IN UINTN Address - ) -{ - ASSERT ((Address & 7) == 0); - return *(volatile UINT64*)Address; -} - -/** - Writes a 64-bit MMIO register. - - Writes the 64-bit MMIO register specified by Address with the value specified - by Value and returns Value. This function must guarantee that all MMIO read - and write operations are serialized. - - If 64-bit MMIO register operations are not supported, then ASSERT(). - - @param Address The MMIO register to write. - @param Value The value to write to the MMIO register. - - @return The value written to the Mmio. It equals to the input - Value instead of the actual value read back from the - Mmio. -**/ -UINT64 -EFIAPI -MmioWrite64 ( - IN UINTN Address, - IN UINT64 Value - ) -{ - ASSERT ((Address & 7) == 0); - return *(volatile UINT64*)Address = Value; -} - +#include "BaseIoLibIntrinsicInternal.h" /** Reads an 8-bit I/O port. @@ -241,7 +35,7 @@ MmioWrite64 ( @param Port The I/O port to read. - @return The value read from Port. + @return The value read. **/ __inline__ @@ -269,9 +63,7 @@ IoRead8 ( @param Port The I/O port to write. @param Value The value to write to the I/O port. - @return The value written to the I/O port. It equals to the - input Value instead of the actual value read back from - the I/O port. + @return The value written the I/O port. **/ __inline__ @@ -294,10 +86,11 @@ IoWrite8 ( serialized. If 16-bit I/O port operations are not supported, then ASSERT(). + If Port is not aligned on a 16-bit boundary, then ASSERT(). @param Port The I/O port to read. - @return The value read from Port. + @return The value read. **/ __inline__ @@ -322,13 +115,12 @@ IoRead16 ( operations are serialized. If 16-bit I/O port operations are not supported, then ASSERT(). - + If Port is not aligned on a 16-bit boundary, then ASSERT(). + @param Port The I/O port to write. @param Value The value to write to the I/O port. - @return The value written to the I/O port. It equals to the - input Value instead of the actual value read back from - the I/O port. + @return The value written the I/O port. **/ __inline__ @@ -352,10 +144,11 @@ IoWrite16 ( serialized. If 32-bit I/O port operations are not supported, then ASSERT(). - + If Port is not aligned on a 32-bit boundary, then ASSERT(). + @param Port The I/O port to read. - @return The value read from Port. + @return The value read. **/ __inline__ @@ -380,13 +173,12 @@ IoRead32 ( operations are serialized. If 32-bit I/O port operations are not supported, then ASSERT(). - + If Port is not aligned on a 32-bit boundary, then ASSERT(). + @param Port The I/O port to write. @param Value The value to write to the I/O port. - @return The value written to the I/O port. It equals to the - input Value instead of the actual value read back from - the I/O port. + @return The value written the I/O port. **/ __inline__ @@ -394,7 +186,7 @@ UINT32 EFIAPI IoWrite32 ( IN UINTN Port, - IN UINT32 Value + IN UINT32 Value ) { ASSERT ((Port & 3) == 0);