1207753Smm///////////////////////////////////////////////////////////////////////////////
2207753Smm//
3207753Smm/// \file       hardware.h
4207753Smm/// \brief      Detection of available hardware resources
5207753Smm//
6207753Smm//  Author:     Lasse Collin
7207753Smm//
8207753Smm//  This file has been put into the public domain.
9207753Smm//  You can do whatever you want with this file.
10207753Smm//
11207753Smm///////////////////////////////////////////////////////////////////////////////
12207753Smm
13207753Smm/// Initialize some hardware-specific variables, which are needed by other
14207753Smm/// hardware_* functions.
15207753Smmextern void hardware_init(void);
16207753Smm
17207753Smm
18292588Sdelphij/// Set the maximum number of worker threads.
19292588Sdelphijextern void hardware_threads_set(uint32_t threadlimit);
20207753Smm
21292588Sdelphij/// Get the maximum number of worker threads.
22292588Sdelphijextern uint32_t hardware_threads_get(void);
23207753Smm
24207753Smm
25213700Smm/// Set the memory usage limit. There are separate limits for compression
26213700Smm/// and decompression (the latter includes also --list), one or both can
27213700Smm/// be set with a single call to this function. Zero indicates resetting
28213700Smm/// the limit back to the defaults. The limit can also be set as a percentage
29213700Smm/// of installed RAM; the percentage must be in the range [1, 100].
30213700Smmextern void hardware_memlimit_set(uint64_t new_memlimit,
31213700Smm		bool set_compress, bool set_decompress, bool is_percentage);
32207753Smm
33213700Smm/// Get the current memory usage limit for compression or decompression.
34213700Smmextern uint64_t hardware_memlimit_get(enum operation_mode mode);
35207753Smm
36213700Smm/// Display the amount of RAM and memory usage limits and exit.
37223935Smmextern void hardware_memlimit_show(void) lzma_attribute((__noreturn__));
38