geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Enumerations | Functions
geopm_hash.h File Reference
#include <stdint.h>
#include <string.h>
#include "geopm_public.h"
Include dependency graph for geopm_hash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  geopm_region_hash_e { GEOPM_REGION_HASH_INVALID = 0x0ULL , GEOPM_REGION_HASH_UNMARKED = 0x725e8066ULL , GEOPM_U64_SENTINEL_REGION_HASH = UINT64_MAX }
 
enum  geopm_region_hash_epoch_e { GEOPM_REGION_HASH_EPOCH = 0x66c91423ULL , GEOPM_REGION_HASH_APP = 0x9d540c53ULL }
 Enum for internally defined region hashes. More...
 

Functions

uint64_t GEOPM_PUBLIC geopm_crc32_u64 (uint64_t begin, uint64_t key)
 DEPRECATED Implements a hashing algorithm. More...
 
uint64_t GEOPM_PUBLIC geopm_crc32_str (const char *key)
 This function is used to produce unique region IDs for named regions. More...
 

Enumeration Type Documentation

◆ geopm_region_hash_e

Enumerator
GEOPM_REGION_HASH_INVALID 
GEOPM_REGION_HASH_UNMARKED 
GEOPM_U64_SENTINEL_REGION_HASH 

◆ geopm_region_hash_epoch_e

Enum for internally defined region hashes.

Enumerator
GEOPM_REGION_HASH_EPOCH 
GEOPM_REGION_HASH_APP 

Function Documentation

◆ geopm_crc32_str()

uint64_t GEOPM_PUBLIC geopm_crc32_str ( const char *  key)

This function is used to produce unique region IDs for named regions.

An Agent implementation with specialized behavior for specific region names can use this function to figure out the region ID to expect for the desired region. Only the bottom 32 bits will be filled in, reserving the top 32 bits for hints and other information.

Parameters
[in]keyThis string is hashed to produce a 64-bit value.
Returns
uint64_t The result is returned as a 64-bit integer.

◆ geopm_crc32_u64()

uint64_t GEOPM_PUBLIC geopm_crc32_u64 ( uint64_t  begin,
uint64_t  key 
)

DEPRECATED Implements a hashing algorithm.

Parameters
[in]beginAlgorithm starts with this value
[in]keyThis value is hashed to produce a 32-bit result.
Returns
uint64_t The result is returned as a 64-bit integer.