|
Monero
|
#include <assert.h>#include <stddef.h>#include <stdint.h>#include <stdbool.h>#include <string.h>#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <limits.h>#include "randomx.h"#include "c_threads.h"#include "hash-ops.h"#include "misc_log_ex.h"
Classes | |
| struct | seedinfo |
| struct | thread_info |
Macros | |
| #define | RX_LOGCAT "randomx" |
| #define | alloc_err_msg(x) |
| #define | THREADV __thread |
| #define | SEEDHASH_EPOCH_BLOCKS 2048 /* Must be same as BLOCKS_SYNCHRONIZING_MAX_COUNT in cryptonote_config.h */ |
| #define | SEEDHASH_EPOCH_LAG 64 |
Typedefs | |
| typedef struct seedinfo | seedinfo |
| typedef struct thread_info | thread_info |
Functions | |
| static bool | is_main (const char *seedhash) |
| static bool | is_secondary (const char *seedhash) |
| static void | local_abort (const char *msg) |
| static void | hash2hex (const char *hash, char *hex) |
| static int | disabled_flags (void) |
| static int | enabled_flags (void) |
| static int | is_power_of_2 (uint64_t n) |
| static int | get_seedhash_epoch_lag (void) |
| static unsigned int | get_seedhash_epoch_blocks (void) |
| uint64_t | rx_seedheight (const uint64_t height) |
| void | rx_seedheights (const uint64_t height, uint64_t *seedheight, uint64_t *nextheight) |
| static void | rx_alloc_dataset (randomx_flags flags, randomx_dataset **dataset, int ignore_env) |
| static void | rx_alloc_cache (randomx_flags flags, randomx_cache **cache) |
| static void | rx_init_full_vm (randomx_flags flags, randomx_vm **vm) |
| static void | rx_init_light_vm (randomx_flags flags, randomx_vm **vm, randomx_cache *cache) |
| static CTHR_THREAD_RTYPE | rx_seedthread (void *arg) |
| static void | rx_init_dataset (size_t max_threads) |
| static CTHR_THREAD_RTYPE | rx_set_main_seedhash_thread (void *arg) |
| void | rx_set_main_seedhash (const char *seedhash, size_t max_dataset_init_threads) |
| void | rx_slow_hash (const char *seedhash, const void *data, size_t length, char *result_hash) |
| void | rx_set_miner_thread (uint32_t value, size_t max_dataset_init_threads) |
| uint32_t | rx_get_miner_thread () |
| void | rx_slow_hash_allocate_state () |
| static void | rx_destroy_vm (randomx_vm **vm) |
| void | rx_slow_hash_free_state () |
Variables | |
| static CTHR_RWLOCK_TYPE | main_dataset_lock = CTHR_RWLOCK_INIT |
| static CTHR_RWLOCK_TYPE | main_cache_lock = CTHR_RWLOCK_INIT |
| static randomx_dataset * | main_dataset = NULL |
| static randomx_cache * | main_cache = NULL |
| static char | main_seedhash [HASH_SIZE] |
| static int | main_seedhash_set = 0 |
| static CTHR_RWLOCK_TYPE | secondary_cache_lock = CTHR_RWLOCK_INIT |
| static randomx_cache * | secondary_cache = NULL |
| static char | secondary_seedhash [HASH_SIZE] |
| static int | secondary_seedhash_set = 0 |
| static THREADV randomx_vm * | main_vm_full = NULL |
| static THREADV randomx_vm * | main_vm_light = NULL |
| static THREADV randomx_vm * | secondary_vm_light = NULL |
| static THREADV uint32_t | miner_thread = 0 |
| #define alloc_err_msg | ( | x | ) |
| #define RX_LOGCAT "randomx" |
| #define SEEDHASH_EPOCH_BLOCKS 2048 /* Must be same as BLOCKS_SYNCHRONIZING_MAX_COUNT in cryptonote_config.h */ |
| #define SEEDHASH_EPOCH_LAG 64 |
| #define THREADV __thread |
| typedef struct seedinfo seedinfo |
| typedef struct thread_info thread_info |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
| uint32_t rx_get_miner_thread | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
| void rx_set_main_seedhash | ( | const char * | seedhash, |
| size_t | max_dataset_init_threads ) |
|
static |
| void rx_set_miner_thread | ( | uint32_t | value, |
| size_t | max_dataset_init_threads ) |
| void rx_slow_hash | ( | const char * | seedhash, |
| const void * | data, | ||
| size_t | length, | ||
| char * | result_hash ) |
| void rx_slow_hash_allocate_state | ( | void | ) |
| void rx_slow_hash_free_state | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |