Cpu

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

Macros | Typedefs | Enumerations | Functions | Variables
Cpu
Eina » Tools

Cpu and architecture related helpers. More...

## Macros
#define | MIN(x, y) (((x) > (y)) ? (y) : (x))
| Returns the minimum of the two parameters.
#define | MAX(x, y) (((x) > (y)) ? (x) : (y))
| Returns the maximum of the two parameters.

## Typedefs
typedef enum _Eina_Cpu_Features | Eina_Cpu_Features
| Enumerates different hardware architectures.

## Enumerations
enum | _Eina_Cpu_Features { EINA_CPU_MMX = 0x00000001 , EINA_CPU_SSE = 0x00000002 , EINA_CPU_SSE2 = 0x00000004 , EINA_CPU_SSE3 = 0x00000008 , EINA_CPU_ALTIVEC = 0x00000010 , EINA_CPU_VIS = 0x00000020 , EINA_CPU_NEON = 0x00000040 , EINA_CPU_SSSE3 = 0x00000080 , EINA_CPU_SSE41 = 0x00000100 , EINA_CPU_SSE42 = 0x00000200 , EINA_CPU_SVE = 0x00000400 }

## Functions
EINA_API Eina_Cpu_Features | eina_cpu_features_get (void)
| Cpu features accessor.
EINA_API int | eina_cpu_count (void)
| Gets the current number of processors.
EINA_API int | eina_cpu_page_size (void)
| Gets the current virtual page size.
static unsigned short | eina_swap16 (unsigned short x)
| Reverses the byte order of a 16-bit (destination) register.
static unsigned int | eina_swap32 (unsigned int x)
| Reverses the byte order of a 32-bit (destination) register.
static unsigned long long | eina_swap64 (unsigned long long x)
| Reverses the byte order of a 64-bit (destination) register.
static unsigned short | eina_htons (unsigned short host)
static unsigned int | eina_htonl (unsigned int host)
static unsigned long long | eina_htonll (unsigned long long host)
static unsigned short | eina_ntohs (unsigned short net)
static unsigned int | eina_ntohl (unsigned int net)
static unsigned long long | eina_ntohll (unsigned long long net)

## Variables
EINA_API Eina_Cpu_Features | eina_cpu_features
| Global hardware architecture handler.

## Detailed Description

Cpu and architecture related helpers.

## Macro Definition Documentation

## ◆ MIN

#define MIN | ( |  | x,
|  |  | y
| ) |  | (((x) > (y)) ? (y) : (x))

Returns the minimum of the two parameters.

Warning
  Beware of side effects, since the returned parameter is evaluated twice.

## ◆ MAX

#define MAX | ( |  | x,
|  |  | y
| ) |  | (((x) > (y)) ? (x) : (y))

Returns the maximum of the two parameters.

Warning
  Beware of side effects, since the returned parameter is evaluated twice.

## Enumeration Type Documentation

## ◆ _Eina_Cpu_Features

enum _Eina_Cpu_Features

Enumerator
EINA_CPU_MMX | Multimedia Extensions (Intel)
EINA_CPU_SSE | Streaming SIMD Extensions (Intel)
EINA_CPU_SSE2 | Streaming SIMD Extensions 2 (Intel)
EINA_CPU_SSE3 | Streaming SIMD Extensions 3 (Intel)
EINA_CPU_ALTIVEC | Single-precision floating point and integer SIMD (PowerPC)
EINA_CPU_VIS | Visual Instruction Set (Spark)
EINA_CPU_NEON | Advanced SIMD Extension (ARM)
EINA_CPU_SSSE3 | Supplemental Streaming SIMD Extension 3 (Intel)
EINA_CPU_SSE41 | Streaming SIMD Extension 4.1 (Intel)
EINA_CPU_SSE42 | Streaming SIMD Extension 4.2 (Intel)
EINA_CPU_SVE | Scalable Vector Extension (ARM)

## Function Documentation

## ◆ eina_cpu_features_get()

EINA_API Eina_Cpu_Features eina_cpu_features_get | ( | void |  | ) |

Cpu features accessor.

Returns
  the current cpu features

References eina_cpu_features.

## ◆ eina_cpu_count()

EINA_API int eina_cpu_count | ( | void |  | ) |

Gets the current number of processors.

Returns
  The number of processors that are online, that is available when the function is called.

Referenced by ecore_thread_max_reset(), and ecore_thread_max_set().

## ◆ eina_cpu_page_size()

EINA_API int eina_cpu_page_size | ( | void |  | ) |

Gets the current virtual page size.

Returns
  The fixed length that represents the smallest unit of data for memory allocation performed by the operating system on behalf of the program, and for transfers between the main memory and any other auxiliary store.

Referenced by eina_mmap_safety_enabled_set().

## ◆ eina_swap16()

static unsigned short eina_swap16 | ( | unsigned short | x | ) |
| inlinestatic

Reverses the byte order of a 16-bit (destination) register.

Parameters

  [in] | x | The binary word to swap

Returns
  A byte order swapped 16-bit integer.

On big endian systems, the number is converted to little endian byte order. On little endian systems, the number is converted to big endian byte order.

## ◆ eina_swap32()

static unsigned int eina_swap32 | ( | unsigned int | x | ) |
| inlinestatic

Reverses the byte order of a 32-bit (destination) register.

Parameters

  [in] | x | The binary word to swap

Returns
  A byte order swapped 32-bit integer.

On big endian systems, the number is converted to little endian byte order. On little endian systems, the number is converted to big endian byte order.

## ◆ eina_swap64()

static unsigned long long eina_swap64 | ( | unsigned long long | x | ) |
| inlinestatic

Reverses the byte order of a 64-bit (destination) register.

Parameters

  [in] | x | The binary word to swap

Returns
  A byte order swapped 64-bit integer.

On big endian systems, the number is converted to little endian byte order. On little endian systems, the number is converted to big endian byte order.

## Variable Documentation

## ◆ eina_cpu_features

EINA_API Eina_Cpu_Features eina_cpu_features
| extern

Global hardware architecture handler.

Returns
  the current cpu features

Referenced by eina_cpu_features_get().