RTEMS CPU Kit with SuperCore
4.11.3
|
This handler encapsulates functionality which abstracts address manipulation in a portable manner. More...
![]() |
Functions | |
RTEMS_INLINE_ROUTINE void * | _Addresses_Add_offset (const void *base, uintptr_t offset) |
Add offset to an address. More... | |
RTEMS_INLINE_ROUTINE void * | _Addresses_Subtract_offset (const void *base, uintptr_t offset) |
Subtract offset from offset. More... | |
RTEMS_INLINE_ROUTINE int32_t | _Addresses_Subtract (const void *left, const void *right) |
Subtract two offsets. More... | |
RTEMS_INLINE_ROUTINE bool | _Addresses_Is_aligned (const void *address) |
Is address aligned. More... | |
RTEMS_INLINE_ROUTINE bool | _Addresses_Is_in_range (const void *address, const void *base, const void *limit) |
Is address in range. More... | |
RTEMS_INLINE_ROUTINE void * | _Addresses_Align_up (void *address, size_t alignment) |
Align address to nearest multiple of alignment, rounding up. More... | |
RTEMS_INLINE_ROUTINE void * | _Addresses_Align_down (void *address, size_t alignment) |
Align address to nearest multiple of alignment, truncating. More... | |
This handler encapsulates functionality which abstracts address manipulation in a portable manner.
RTEMS_INLINE_ROUTINE void* _Addresses_Add_offset | ( | const void * | base, |
uintptr_t | offset | ||
) |
Add offset to an address.
This function is used to add an offset to a base address. It returns the resulting address. This address is typically converted to an access type before being used further.
[in] | base | is the base address. |
[in] | offset | is the offset to add to base. |
Referenced by _Partition_Is_buffer_valid().
RTEMS_INLINE_ROUTINE void* _Addresses_Align_down | ( | void * | address, |
size_t | alignment | ||
) |
Align address to nearest multiple of alignment, truncating.
This function returns the given address aligned to the given alignment. If the address already is aligned, or if alignment is 0, the address is returned as is. The returned address is less than or equal to the given address.
[in] | address | is the address to align. |
[in] | alignment | is the boundary for alignment and must be a power of 2. |
RTEMS_INLINE_ROUTINE void* _Addresses_Align_up | ( | void * | address, |
size_t | alignment | ||
) |
Align address to nearest multiple of alignment, rounding up.
This function returns the given address aligned to the given alignment. If the address already is aligned, or if alignment is 0, the address is returned as is. The returned address is greater than or equal to the given address.
[in] | address | is the address to align. |
[in] | alignment | is the boundary for alignment and must be a power of 2 |
RTEMS_INLINE_ROUTINE bool _Addresses_Is_aligned | ( | const void * | address | ) |
Is address aligned.
This function returns true if the given address is correctly aligned for this processor and false otherwise. Proper alignment is based on correctness and efficiency.
[in] | address | is the address being checked for alignment. |
true | The address is aligned. |
false | The address is not aligned. |
RTEMS_INLINE_ROUTINE bool _Addresses_Is_in_range | ( | const void * | address, |
const void * | base, | ||
const void * | limit | ||
) |
Is address in range.
This function returns true if the given address is within the memory range specified and false otherwise. base is the address of the first byte in the memory range and limit is the address of the last byte in the memory range. The base address is assumed to be lower than the limit address.
[in] | address | is the address to check. |
[in] | base | is the lowest address of the range to check against. |
[in] | limit | is the highest address of the range to check against. |
true | The address is within the memory range specified |
false | The address is not within the memory range specified. |
Referenced by _Partition_Is_buffer_valid().
RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract | ( | const void * | left, |
const void * | right | ||
) |
Subtract two offsets.
This function is used to subtract two addresses. It returns the resulting offset.
[in] | left | is the address on the left hand side of the subtraction. |
[in] | right | is the address on the right hand side of the subtraction. |
Referenced by _Partition_Is_buffer_on_boundary().
RTEMS_INLINE_ROUTINE void* _Addresses_Subtract_offset | ( | const void * | base, |
uintptr_t | offset | ||
) |
Subtract offset from offset.
This function is used to subtract an offset from a base address. It returns the resulting address. This address is typically converted to an access type before being used further.
[in] | base | is the base address. |
[in] | offset | is the offset to subtract to base. |
Referenced by _Thread_MP_Find_proxy().