X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FPeiIoLibCpuIo%2FIoHighLevel.c;h=ce73658e84e368cf2aa16416495f0b0224c07783;hb=c2ab95806bf0e5ae272f47ea6f192c12ce7ca069;hp=1e5af5175032a6e0b50cc794d5f83b63d29bdf7d;hpb=80f0c0c44f0a414efc2a0e5a0ff59ca998d595a3;p=mirror_edk2.git diff --git a/MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c b/MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c index 1e5af51750..ce73658e84 100644 --- a/MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c +++ b/MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c @@ -4,11 +4,11 @@ All assertions for bit field operations are handled bit field functions in the Base Library. - Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials + Copyright (c) 2006 - 2012, 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 + http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @@ -152,13 +152,14 @@ IoBitFieldRead8 ( If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..7. @param EndBit The ordinal of the most significant bit in the bit field. Range 0..7. - @param Value New value of the bit field. + @param Value The new value of the bit field. @return The value written back to the I/O port. @@ -192,6 +193,7 @@ IoBitFieldWrite8 ( If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -232,6 +234,7 @@ IoBitFieldOr8 ( If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -274,6 +277,8 @@ IoBitFieldAnd8 ( If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -437,13 +442,14 @@ IoBitFieldRead16 ( If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..15. @param EndBit The ordinal of the most significant bit in the bit field. Range 0..15. - @param Value New value of the bit field. + @param Value The new value of the bit field. @return The value written back to the I/O port. @@ -478,6 +484,7 @@ IoBitFieldWrite16 ( If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -519,6 +526,7 @@ IoBitFieldOr16 ( If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -562,6 +570,8 @@ IoBitFieldAnd16 ( If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -725,13 +735,14 @@ IoBitFieldRead32 ( If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..31. @param EndBit The ordinal of the most significant bit in the bit field. Range 0..31. - @param Value New value of the bit field. + @param Value The new value of the bit field. @return The value written back to the I/O port. @@ -766,6 +777,7 @@ IoBitFieldWrite32 ( If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -807,6 +819,7 @@ IoBitFieldOr32 ( If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -850,6 +863,8 @@ IoBitFieldAnd32 ( If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -1013,13 +1028,14 @@ IoBitFieldRead64 ( If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..63. @param EndBit The ordinal of the most significant bit in the bit field. Range 0..63. - @param Value New value of the bit field. + @param Value The new value of the bit field. @return The value written back to the I/O port. @@ -1054,6 +1070,7 @@ IoBitFieldWrite64 ( If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -1095,6 +1112,7 @@ IoBitFieldOr64 ( If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -1138,6 +1156,8 @@ IoBitFieldAnd64 ( If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Port The I/O port to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -1265,7 +1285,7 @@ MmioAndThenOr8 ( If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). - @param Address MMIO register to read. + @param Address The MMIO register to read. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..7. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1296,13 +1316,14 @@ MmioBitFieldRead8 ( If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..7. @param EndBit The ordinal of the most significant bit in the bit field. Range 0..7. - @param Value New value of the bit field. + @param Value The new value of the bit field. @return The value written back to the MMIO register. @@ -1337,8 +1358,9 @@ MmioBitFieldWrite8 ( If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..7. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1378,8 +1400,9 @@ MmioBitFieldOr8 ( If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..7. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1420,8 +1443,10 @@ MmioBitFieldAnd8 ( If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..7. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1550,7 +1575,7 @@ MmioAndThenOr16 ( If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). - @param Address MMIO register to read. + @param Address The MMIO register to read. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..15. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1582,13 +1607,14 @@ MmioBitFieldRead16 ( If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..15. @param EndBit The ordinal of the most significant bit in the bit field. Range 0..15. - @param Value New value of the bit field. + @param Value The new value of the bit field. @return The value written back to the MMIO register. @@ -1624,8 +1650,9 @@ MmioBitFieldWrite16 ( If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..15. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1666,8 +1693,9 @@ MmioBitFieldOr16 ( If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..15. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1709,8 +1737,10 @@ MmioBitFieldAnd16 ( If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..15. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1839,7 +1869,7 @@ MmioAndThenOr32 ( If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). - @param Address MMIO register to read. + @param Address The MMIO register to read. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..31. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1871,13 +1901,14 @@ MmioBitFieldRead32 ( If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..31. @param EndBit The ordinal of the most significant bit in the bit field. Range 0..31. - @param Value New value of the bit field. + @param Value The new value of the bit field. @return The value written back to the MMIO register. @@ -1913,8 +1944,9 @@ MmioBitFieldWrite32 ( If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..31. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1955,8 +1987,9 @@ MmioBitFieldOr32 ( If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..31. @param EndBit The ordinal of the most significant bit in the bit field. @@ -1998,8 +2031,10 @@ MmioBitFieldAnd32 ( If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..31. @param EndBit The ordinal of the most significant bit in the bit field. @@ -2128,7 +2163,7 @@ MmioAndThenOr64 ( If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). - @param Address MMIO register to read. + @param Address The MMIO register to read. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..63. @param EndBit The ordinal of the most significant bit in the bit field. @@ -2160,13 +2195,14 @@ MmioBitFieldRead64 ( If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..63. @param EndBit The ordinal of the most significant bit in the bit field. Range 0..63. - @param Value New value of the bit field. + @param Value The new value of the bit field. @return The value written back to the MMIO register. @@ -2202,6 +2238,7 @@ MmioBitFieldWrite64 ( If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Address MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -2244,6 +2281,7 @@ MmioBitFieldOr64 ( If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). @param Address MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. @@ -2287,8 +2325,10 @@ MmioBitFieldAnd64 ( If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). + If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). + If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - @param Address MMIO register to write. + @param Address The MMIO register to write. @param StartBit The ordinal of the least significant bit in the bit field. Range 0..63. @param EndBit The ordinal of the most significant bit in the bit field.