mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-17 08:51:42 +00:00
HV: Remove the unused mmio_or/and/rmw operation
The mmio_or_long/mmio_and_long/mmio_rmw_long is defined to perform the read & write operation. But they are not used. So they are removed. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
2cc368eec2
commit
3ba4a3b3da
@ -238,133 +238,6 @@ static inline uint8_t mmio_read_byte(void *addr)
|
||||
return *((uint8_t *)addr);
|
||||
}
|
||||
|
||||
/** Sets bits in a 32 bit value from a memory mapped IO device.
|
||||
*
|
||||
* @param mask Contains the bits to set at the memory address.
|
||||
* Bits set in this mask are set in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void mmio_or_long(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint32_t *)addr) |= mask;
|
||||
}
|
||||
|
||||
/** Sets bits in a 16 bit value from a memory mapped IO device.
|
||||
*
|
||||
* @param mask Contains the bits to set at the memory address.
|
||||
* Bits set in this mask are set in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void mmio_or_word(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint16_t *)addr) |= mask;
|
||||
}
|
||||
|
||||
/** Sets bits in an 8 bit value from a memory mapped IO device.
|
||||
*
|
||||
* @param mask Contains the bits to set at the memory address.
|
||||
* Bits set in this mask are set in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void mmio_or_byte(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint8_t *)addr) |= mask;
|
||||
}
|
||||
|
||||
/** Clears bits in a 32 bit value from a memory mapped IO device.
|
||||
*
|
||||
* @param mask Contains the bits to clear at the memory address.
|
||||
* Bits set in this mask are cleared in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void mmio_and_long(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint32_t *)addr) &= ~mask;
|
||||
}
|
||||
|
||||
/** Clears bits in a 16 bit value from a memory mapped IO device.
|
||||
*
|
||||
* @param mask Contains the bits to clear at the memory address.
|
||||
* Bits set in this mask are cleared in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void mmio_and_word(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint16_t *)addr) &= ~mask;
|
||||
}
|
||||
|
||||
/** Clears bits in an 8 bit value from a memory mapped IO device.
|
||||
*
|
||||
* @param mask Contains the bits to clear at the memory address.
|
||||
* Bits set in this mask are cleared in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void mmio_and_byte(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint8_t *)addr) &= ~mask;
|
||||
}
|
||||
|
||||
/** Performs a read-modify-write cycle for a 32 bit value from a MMIO device.
|
||||
*
|
||||
* Reads a 32 bit value from a memory mapped IO device, sets and clears
|
||||
* bits and writes the value back. If a bit is specified in both, the 'set'
|
||||
* and in the 'clear' mask, it is undefined whether the resulting bit is set
|
||||
* or cleared.
|
||||
*
|
||||
* @param set Contains the bits to set. Bits set in this mask
|
||||
* are set at the memory address.
|
||||
* @param clear Contains the bits to clear. Bits set in this
|
||||
* mask are cleared at the memory address.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void mmio_rmw_long(uint32_t set, uint32_t clear, void *addr)
|
||||
{
|
||||
*((uint32_t *)addr) =
|
||||
(*((uint32_t *)addr) & ~clear) | set;
|
||||
}
|
||||
|
||||
/** Performs a read-modify-write cycle for a 16 bit value from a MMIO device.
|
||||
*
|
||||
* Reads a 16 bit value from a memory mapped IO device, sets and clears
|
||||
* bits and writes the value back. If a bit is specified in both, the 'set'
|
||||
* and in the 'clear' mask, it is undefined whether the resulting bit is set
|
||||
* or cleared.
|
||||
*
|
||||
* @param set Contains the bits to set. Bits set in this mask
|
||||
* are set at the memory address.
|
||||
* @param clear Contains the bits to clear. Bits set in this
|
||||
* mask are cleared at the memory address.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void mmio_rmw_word(uint32_t set, uint32_t clear, void *addr)
|
||||
{
|
||||
*((uint16_t *)addr) =
|
||||
(*((uint16_t *)addr) & ~clear) | set;
|
||||
}
|
||||
|
||||
/** Performs a read-modify-write cycle for an 8 bit value from a MMIO device.
|
||||
*
|
||||
* Reads an 8 bit value from a memory mapped IO device, sets and clears
|
||||
* bits and writes the value back. If a bit is specified in both, the 'set'
|
||||
* and in the 'clear' mask, it is undefined whether the resulting bit is set
|
||||
* or cleared.
|
||||
*
|
||||
* @param set Contains the bits to set. Bits set in this mask
|
||||
* are set at the memory address.
|
||||
* @param clear Contains the bits to clear. Bits set in this
|
||||
* mask are cleared at the memory address.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void mmio_rmw_byte(uint32_t set, uint32_t clear, void *addr)
|
||||
{
|
||||
*((uint8_t *)addr) = (*((uint8_t *)addr) & ~clear) | set;
|
||||
}
|
||||
|
||||
/** Writes a 32 bit value to a memory mapped IO device (ROM code version).
|
||||
*
|
||||
@ -429,139 +302,6 @@ static inline uint8_t __mmio_read_byte(void *addr)
|
||||
return *((uint8_t *)addr);
|
||||
}
|
||||
|
||||
/** Sets bits in a 32 bit value from a MMIO device (ROM code version).
|
||||
*
|
||||
* @param mask Contains the bits to set at the memory address.
|
||||
* Bits set in this mask are set in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void __mmio_or_long(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint32_t *)addr) |= mask;
|
||||
}
|
||||
|
||||
/** Sets bits in a 16 bit value from a MMIO device (ROM code version).
|
||||
*
|
||||
* @param mask Contains the bits to set at the memory address.
|
||||
* Bits set in this mask are set in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void __mmio_or_word(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint16_t *)addr) |= mask;
|
||||
}
|
||||
|
||||
/** Sets bits in an 8 bit value from a MMIO device (ROM code version).
|
||||
*
|
||||
* @param mask Contains the bits to set at the memory address.
|
||||
* Bits set in this mask are set in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void __mmio_or_byte(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint8_t *)addr) |= mask;
|
||||
}
|
||||
|
||||
/** Clears bits in a 32 bit value from a MMIO device (ROM code version).
|
||||
*
|
||||
* @param mask Contains the bits to clear at the memory address.
|
||||
* Bits set in this mask are cleared in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void __mmio_and_long(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint32_t *)addr) &= ~mask;
|
||||
}
|
||||
|
||||
/** Clears bits in a 16 bit value from a MMIO device (ROM code version).
|
||||
*
|
||||
* @param mask Contains the bits to clear at the memory address.
|
||||
* Bits set in this mask are cleared in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void __mmio_and_word(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint16_t *)addr) &= ~mask;
|
||||
}
|
||||
|
||||
/** Clears bits in an 8 bit value from a MMIO device (ROM code version).
|
||||
*
|
||||
* @param mask Contains the bits to clear at the memory address.
|
||||
* Bits set in this mask are cleared in the memory
|
||||
* location.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void __mmio_and_byte(uint32_t mask, void *addr)
|
||||
{
|
||||
*((uint8_t *)addr) &= ~mask;
|
||||
}
|
||||
|
||||
/** Performs a read-modify-write cycle for a 32 bit value from a MMIO device
|
||||
* (ROM code version).
|
||||
*
|
||||
* Reads a 32 bit value from a memory mapped IO device, sets and clears
|
||||
* bits and writes the value back. If a bit is specified in both, the 'set'
|
||||
* and in the 'clear' mask, it is undefined whether the resulting bit is set
|
||||
* or cleared.
|
||||
*
|
||||
* @param set Contains the bits to set. Bits set in this mask
|
||||
* are set at the memory address.
|
||||
* @param clear Contains the bits to clear. Bits set in this
|
||||
* mask are cleared at the memory address.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void
|
||||
__mmio_rmw_long(uint32_t set, uint32_t clear, void *addr)
|
||||
{
|
||||
*((uint32_t *)addr) =
|
||||
(*((uint32_t *)addr) & ~clear) | set;
|
||||
}
|
||||
|
||||
/** Performs a read-modify-write cycle for a 16 bit value from a MMIO device
|
||||
* (ROM code version).
|
||||
*
|
||||
* Reads a 16 bit value from a memory mapped IO device, sets and clears
|
||||
* bits and writes the value back. If a bit is specified in both, the 'set'
|
||||
* and in the 'clear' mask, it is undefined whether the resulting bit is set
|
||||
* or cleared.
|
||||
*
|
||||
* @param set Contains the bits to set. Bits set in this mask
|
||||
* are set at the memory address.
|
||||
* @param clear Contains the bits to clear. Bits set in this
|
||||
* mask are cleared at the memory address.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void
|
||||
__mmio_rmw_word(uint32_t set, uint32_t clear, void *addr)
|
||||
{
|
||||
*((uint16_t *)addr) =
|
||||
(*((uint16_t *)addr) & ~clear) | set;
|
||||
}
|
||||
|
||||
/** Performs a read-modify-write cycle for an 8 bit value from a MMIO device
|
||||
* (ROM code version).
|
||||
*
|
||||
* Reads an 8 bit value from a memory mapped IO device, sets and clears
|
||||
* bits and writes the value back. If a bit is specified in both, the 'set'
|
||||
* and in the 'clear' mask, it is undefined whether the resulting bit is set
|
||||
* or cleared.
|
||||
*
|
||||
* @param set Contains the bits to set. Bits set in this mask
|
||||
* are set at the memory address.
|
||||
* @param clear Contains the bits to clear. Bits set in this
|
||||
* mask are cleared at the memory address.
|
||||
* @param addr The memory address to read from/write to.
|
||||
*/
|
||||
static inline void
|
||||
__mmio_rmw_byte(uint32_t set, uint32_t clear, void *addr)
|
||||
{
|
||||
*((uint8_t *)addr) = (*((uint8_t *)addr) & ~clear) | set;
|
||||
}
|
||||
|
||||
/** Reads a 32 Bit memory mapped IO register, mask it and write it back into
|
||||
* memory mapped IO register.
|
||||
|
Loading…
Reference in New Issue
Block a user