TianoCore EDK2 master
Loading...
Searching...
No Matches
BitField.c File Reference
#include "BaseLibInternals.h"

Go to the source code of this file.

Functions

UINTN EFIAPI InternalBaseLibBitFieldReadUint (IN UINTN Operand, IN UINTN StartBit, IN UINTN EndBit)
 
UINTN EFIAPI InternalBaseLibBitFieldOrUint (IN UINTN Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINTN OrData)
 
UINTN EFIAPI InternalBaseLibBitFieldAndUint (IN UINTN Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINTN AndData)
 
UINT8 EFIAPI BitFieldRead8 (IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit)
 
UINT8 EFIAPI BitFieldWrite8 (IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 Value)
 
UINT8 EFIAPI BitFieldOr8 (IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 OrData)
 
UINT8 EFIAPI BitFieldAnd8 (IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData)
 
UINT8 EFIAPI BitFieldAndThenOr8 (IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData, IN UINT8 OrData)
 
UINT16 EFIAPI BitFieldRead16 (IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit)
 
UINT16 EFIAPI BitFieldWrite16 (IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 Value)
 
UINT16 EFIAPI BitFieldOr16 (IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 OrData)
 
UINT16 EFIAPI BitFieldAnd16 (IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData)
 
UINT16 EFIAPI BitFieldAndThenOr16 (IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData, IN UINT16 OrData)
 
UINT32 EFIAPI BitFieldRead32 (IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit)
 
UINT32 EFIAPI BitFieldWrite32 (IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 Value)
 
UINT32 EFIAPI BitFieldOr32 (IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
 
UINT32 EFIAPI BitFieldAnd32 (IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData)
 
UINT32 EFIAPI BitFieldAndThenOr32 (IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData, IN UINT32 OrData)
 
UINT64 EFIAPI BitFieldRead64 (IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit)
 
UINT64 EFIAPI BitFieldWrite64 (IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 Value)
 
UINT64 EFIAPI BitFieldOr64 (IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 OrData)
 
UINT64 EFIAPI BitFieldAnd64 (IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 AndData)
 
UINT64 EFIAPI BitFieldAndThenOr64 (IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 AndData, IN UINT64 OrData)
 
UINT8 EFIAPI BitFieldCountOnes32 (IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit)
 
UINT8 EFIAPI BitFieldCountOnes64 (IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit)
 

Detailed Description

Bit field functions of BaseLib.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BitField.c.

Function Documentation

◆ BitFieldAnd16()

UINT16 EFIAPI BitFieldAnd16 ( IN UINT16  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT16  AndData 
)

Reads a bit field from a 16-bit value, performs a bitwise AND, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData. All other bits in Operand are preserved. The new 16-bit value is returned.

If 16-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..15.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..15.
AndDataThe value to AND with the read value from the value.
Returns
The new 16-bit value.

Definition at line 447 of file BitField.c.

◆ BitFieldAnd32()

UINT32 EFIAPI BitFieldAnd32 ( IN UINT32  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT32  AndData 
)

Reads a bit field from a 32-bit value, performs a bitwise AND, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData. All other bits in Operand are preserved. The new 32-bit value is returned.

If 32-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..31.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..31.
AndDataThe value to AND with the read value from the value.
Returns
The new 32-bit value.

Definition at line 639 of file BitField.c.

◆ BitFieldAnd64()

UINT64 EFIAPI BitFieldAnd64 ( IN UINT64  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT64  AndData 
)

Reads a bit field from a 64-bit value, performs a bitwise AND, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData. All other bits in Operand are preserved. The new 64-bit value is returned.

If 64-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..63.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..63.
AndDataThe value to AND with the read value from the value.
Returns
The new 64-bit value.

Definition at line 845 of file BitField.c.

◆ BitFieldAnd8()

UINT8 EFIAPI BitFieldAnd8 ( IN UINT8  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT8  AndData 
)

Reads a bit field from an 8-bit value, performs a bitwise AND, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData. All other bits in Operand are preserved. The new 8-bit value is returned.

If 8-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..7.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..7.
AndDataThe value to AND with the read value from the value.
Returns
The new 8-bit value.

Definition at line 255 of file BitField.c.

◆ BitFieldAndThenOr16()

UINT16 EFIAPI BitFieldAndThenOr16 ( IN UINT16  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT16  AndData,
IN UINT16  OrData 
)

Reads a bit field from a 16-bit value, performs a bitwise AND followed by a bitwise OR, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData, followed by a bitwise OR with value specified by OrData. All other bits in Operand are preserved. The new 16-bit value is returned.

If 16-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..15.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..15.
AndDataThe value to AND with the read value from the value.
OrDataThe value to OR with the result of the AND operation.
Returns
The new 16-bit value.

Definition at line 488 of file BitField.c.

◆ BitFieldAndThenOr32()

UINT32 EFIAPI BitFieldAndThenOr32 ( IN UINT32  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT32  AndData,
IN UINT32  OrData 
)

Reads a bit field from a 32-bit value, performs a bitwise AND followed by a bitwise OR, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData, followed by a bitwise OR with value specified by OrData. All other bits in Operand are preserved. The new 32-bit value is returned.

If 32-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..31.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..31.
AndDataThe value to AND with the read value from the value.
OrDataThe value to OR with the result of the AND operation.
Returns
The new 32-bit value.

Definition at line 680 of file BitField.c.

◆ BitFieldAndThenOr64()

UINT64 EFIAPI BitFieldAndThenOr64 ( IN UINT64  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT64  AndData,
IN UINT64  OrData 
)

Reads a bit field from a 64-bit value, performs a bitwise AND followed by a bitwise OR, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData, followed by a bitwise OR with value specified by OrData. All other bits in Operand are preserved. The new 64-bit value is returned.

If 64-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..63.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..63.
AndDataThe value to AND with the read value from the value.
OrDataThe value to OR with the result of the AND operation.
Returns
The new 64-bit value.

Definition at line 900 of file BitField.c.

◆ BitFieldAndThenOr8()

UINT8 EFIAPI BitFieldAndThenOr8 ( IN UINT8  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT8  AndData,
IN UINT8  OrData 
)

Reads a bit field from an 8-bit value, performs a bitwise AND followed by a bitwise OR, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData, followed by a bitwise OR with value specified by OrData. All other bits in Operand are preserved. The new 8-bit value is returned.

If 8-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..7.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..7.
AndDataThe value to AND with the read value from the value.
OrDataThe value to OR with the result of the AND operation.
Returns
The new 8-bit value.

Definition at line 296 of file BitField.c.

◆ BitFieldCountOnes32()

UINT8 EFIAPI BitFieldCountOnes32 ( IN UINT32  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit 
)

Reads a bit field from a 32-bit value, counts and returns the number of set bits.

Counts the number of set bits in the bit field specified by StartBit and EndBit in Operand. The count is returned.

If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..31.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..31.
Returns
The number of bits set between StartBit and EndBit.

Definition at line 940 of file BitField.c.

◆ BitFieldCountOnes64()

UINT8 EFIAPI BitFieldCountOnes64 ( IN UINT64  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit 
)

Reads a bit field from a 64-bit value, counts and returns the number of set bits.

Counts the number of set bits in the bit field specified by StartBit and EndBit in Operand. The count is returned.

If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..63.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..63.
Returns
The number of bits set between StartBit and EndBit.

Definition at line 984 of file BitField.c.

◆ BitFieldOr16()

UINT16 EFIAPI BitFieldOr16 ( IN UINT16  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT16  OrData 
)

Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the result.

Performs a bitwise OR between the bit field specified by StartBit and EndBit in Operand and the value specified by OrData. All other bits in Operand are preserved. The new 16-bit value is returned.

If 16-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..15.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..15.
OrDataThe value to OR with the read value from the value.
Returns
The new 16-bit value.

Definition at line 409 of file BitField.c.

◆ BitFieldOr32()

UINT32 EFIAPI BitFieldOr32 ( IN UINT32  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT32  OrData 
)

Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the result.

Performs a bitwise OR between the bit field specified by StartBit and EndBit in Operand and the value specified by OrData. All other bits in Operand are preserved. The new 32-bit value is returned.

If 32-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..31.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..31.
OrDataThe value to OR with the read value from the value.
Returns
The new 32-bit value.

Definition at line 601 of file BitField.c.

◆ BitFieldOr64()

UINT64 EFIAPI BitFieldOr64 ( IN UINT64  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT64  OrData 
)

Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the result.

Performs a bitwise OR between the bit field specified by StartBit and EndBit in Operand and the value specified by OrData. All other bits in Operand are preserved. The new 64-bit value is returned.

If 64-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..63.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..63.
OrDataThe value to OR with the read value from the value
Returns
The new 64-bit value.

Definition at line 793 of file BitField.c.

◆ BitFieldOr8()

UINT8 EFIAPI BitFieldOr8 ( IN UINT8  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT8  OrData 
)

Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the result.

Performs a bitwise OR between the bit field specified by StartBit and EndBit in Operand and the value specified by OrData. All other bits in Operand are preserved. The new 8-bit value is returned.

If 8-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..7.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..7.
OrDataThe value to OR with the read value from the value.
Returns
The new 8-bit value.

Definition at line 217 of file BitField.c.

◆ BitFieldRead16()

UINT16 EFIAPI BitFieldRead16 ( IN UINT16  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit 
)

Returns a bit field from a 16-bit value.

Returns the bitfield specified by the StartBit and the EndBit from Operand.

If 16-bit operations are not supported, then ASSERT(). If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..15.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..15.
Returns
The bit field read.

Definition at line 335 of file BitField.c.

◆ BitFieldRead32()

UINT32 EFIAPI BitFieldRead32 ( IN UINT32  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit 
)

Returns a bit field from a 32-bit value.

Returns the bitfield specified by the StartBit and the EndBit from Operand.

If 32-bit operations are not supported, then ASSERT(). If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..31.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..31.
Returns
The bit field read.

Definition at line 527 of file BitField.c.

◆ BitFieldRead64()

UINT64 EFIAPI BitFieldRead64 ( IN UINT64  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit 
)

Returns a bit field from a 64-bit value.

Returns the bitfield specified by the StartBit and the EndBit from Operand.

If 64-bit operations are not supported, then ASSERT(). If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..63.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..63.
Returns
The bit field read.

Definition at line 719 of file BitField.c.

◆ BitFieldRead8()

UINT8 EFIAPI BitFieldRead8 ( IN UINT8  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit 
)

Returns a bit field from an 8-bit value.

Returns the bitfield specified by the StartBit and the EndBit from Operand.

If 8-bit operations are not supported, then ASSERT(). If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..7.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..7.
Returns
The bit field read.

Definition at line 143 of file BitField.c.

◆ BitFieldWrite16()

UINT16 EFIAPI BitFieldWrite16 ( IN UINT16  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT16  Value 
)

Writes a bit field to a 16-bit value, and returns the result.

Writes Value to the bit field specified by the StartBit and the EndBit in Operand. All other bits in Operand are preserved. The new 16-bit value is returned.

If 16-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..15.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..15.
ValueThe new value of the bit field.
Returns
The new 16-bit value.

Definition at line 371 of file BitField.c.

◆ BitFieldWrite32()

UINT32 EFIAPI BitFieldWrite32 ( IN UINT32  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT32  Value 
)

Writes a bit field to a 32-bit value, and returns the result.

Writes Value to the bit field specified by the StartBit and the EndBit in Operand. All other bits in Operand are preserved. The new 32-bit value is returned.

If 32-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..31.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..31.
ValueThe new value of the bit field.
Returns
The new 32-bit value.

Definition at line 563 of file BitField.c.

◆ BitFieldWrite64()

UINT64 EFIAPI BitFieldWrite64 ( IN UINT64  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT64  Value 
)

Writes a bit field to a 64-bit value, and returns the result.

Writes Value to the bit field specified by the StartBit and the EndBit in Operand. All other bits in Operand are preserved. The new 64-bit value is returned.

If 64-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..63.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..63.
ValueThe new value of the bit field.
Returns
The new 64-bit value.

Definition at line 755 of file BitField.c.

◆ BitFieldWrite8()

UINT8 EFIAPI BitFieldWrite8 ( IN UINT8  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINT8  Value 
)

Writes a bit field to an 8-bit value, and returns the result.

Writes Value to the bit field specified by the StartBit and the EndBit in Operand. All other bits in Operand are preserved. The new 8-bit value is returned.

If 8-bit operations are not supported, then ASSERT(). 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().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field. Range 0..7.
EndBitThe ordinal of the most significant bit in the bit field. Range 0..7.
ValueThe new value of the bit field.
Returns
The new 8-bit value.

Definition at line 179 of file BitField.c.

◆ InternalBaseLibBitFieldAndUint()

UINTN EFIAPI InternalBaseLibBitFieldAndUint ( IN UINTN  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINTN  AndData 
)

Worker function that reads a bit field from Operand, performs a bitwise AND, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData. All other bits in Operand are preserved. The new value is returned.

If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field.
EndBitThe ordinal of the most significant bit in the bit field.
AndDataThe value to And with the read value from the value.
Returns
The new value.

Definition at line 100 of file BitField.c.

◆ InternalBaseLibBitFieldOrUint()

UINTN EFIAPI InternalBaseLibBitFieldOrUint ( IN UINTN  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINTN  OrData 
)

Worker function that reads a bit field from Operand, performs a bitwise OR, and returns the result.

Performs a bitwise OR between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData. All other bits in Operand are preserved. The new value is returned.

If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field.
EndBitThe ordinal of the most significant bit in the bit field.
OrDataThe value to OR with the read value from the value.
Returns
The new value.

Definition at line 58 of file BitField.c.

◆ InternalBaseLibBitFieldReadUint()

UINTN EFIAPI InternalBaseLibBitFieldReadUint ( IN UINTN  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit 
)

Worker function that returns a bit field from Operand.

Returns the bitfield specified by the StartBit and the EndBit from Operand.

Parameters
OperandOperand on which to perform the bitfield operation.
StartBitThe ordinal of the least significant bit in the bit field.
EndBitThe ordinal of the most significant bit in the bit field.
Returns
The bit field read.

Definition at line 25 of file BitField.c.