An AMD firmware component must update selected bits in a hardware register without changing unrelated control bits. Given a register value, its width, and an inclusive bit range, invert only the bits in that range.
Bit positions are numbered from 0 for the least significant bit to width - 1 for the most significant bit. A bit inversion changes 0 to 1 and 1 to 0.
Implement invert_bit_range(register, width, left, right).
register, a non-negative integer containing the register value; width, a positive integer; left and right, inclusive bit positions.left through right, inclusive.def invert_bit_range(register, width, left, right):