2007-12-08 17:42:33 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2009-02-05 02:12:57 -05:00
|
|
|
/// \file hardware.h
|
2007-12-08 17:42:33 -05:00
|
|
|
/// \brief Detection of available hardware resources
|
|
|
|
//
|
2009-04-13 04:27:40 -04:00
|
|
|
// Author: Lasse Collin
|
2007-12-08 17:42:33 -05:00
|
|
|
//
|
2009-04-13 04:27:40 -04:00
|
|
|
// This file has been put into the public domain.
|
|
|
|
// You can do whatever you want with this file.
|
2007-12-08 17:42:33 -05:00
|
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-11-19 13:46:52 -05:00
|
|
|
/// Initialize some hardware-specific variables, which are needed by other
|
|
|
|
/// hardware_* functions.
|
2007-12-08 17:42:33 -05:00
|
|
|
extern void hardware_init(void);
|
|
|
|
|
2008-11-19 13:46:52 -05:00
|
|
|
|
2011-04-09 08:11:13 -04:00
|
|
|
/// Set the maximum number of worker threads.
|
|
|
|
extern void hardware_threads_set(uint32_t threadlimit);
|
2009-02-13 17:45:29 -05:00
|
|
|
|
2011-04-09 08:11:13 -04:00
|
|
|
/// Get the maximum number of worker threads.
|
|
|
|
extern uint32_t hardware_threads_get(void);
|
2009-02-13 17:45:29 -05:00
|
|
|
|
|
|
|
|
2010-08-07 13:45:18 -04:00
|
|
|
/// Set the memory usage limit. There are separate limits for compression
|
|
|
|
/// and decompression (the latter includes also --list), one or both can
|
|
|
|
/// be set with a single call to this function. Zero indicates resetting
|
|
|
|
/// the limit back to the defaults. The limit can also be set as a percentage
|
|
|
|
/// of installed RAM; the percentage must be in the range [1, 100].
|
|
|
|
extern void hardware_memlimit_set(uint64_t new_memlimit,
|
|
|
|
bool set_compress, bool set_decompress, bool is_percentage);
|
|
|
|
|
|
|
|
/// Get the current memory usage limit for compression or decompression.
|
|
|
|
extern uint64_t hardware_memlimit_get(enum operation_mode mode);
|
|
|
|
|
|
|
|
/// Display the amount of RAM and memory usage limits and exit.
|
2011-05-17 04:54:38 -04:00
|
|
|
extern void hardware_memlimit_show(void) lzma_attribute((__noreturn__));
|