From 3ba4a3b3da05aa3afc2074701f067f9954e27691 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Tue, 17 Apr 2018 13:39:41 +0800 Subject: [PATCH] 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 Acked-by: Anthony Xu Acked-by: Eddie Dong --- include/arch/x86/io.h | 260 ------------------------------------------ 1 file changed, 260 deletions(-) diff --git a/include/arch/x86/io.h b/include/arch/x86/io.h index 0ec95da51..30c5be4ef 100644 --- a/include/arch/x86/io.h +++ b/include/arch/x86/io.h @@ -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.