mirror of
https://github.com/anrieff/libcpuid
synced 2024-12-16 16:35:45 +00:00
Do not inline util functions
It creates warning with GCC.
This commit is contained in:
parent
2b8023f733
commit
ab395f8756
2 changed files with 9 additions and 9 deletions
|
@ -241,27 +241,27 @@ void debug_print_lbits(int debuglevel, uint64_t mask)
|
|||
/* Functions to manage cpu_affinity_mask_t type
|
||||
* Adapted from https://electronics.stackexchange.com/a/200070
|
||||
*/
|
||||
void inline init_affinity_mask(cpu_affinity_mask_t *affinity_mask)
|
||||
void init_affinity_mask(cpu_affinity_mask_t *affinity_mask)
|
||||
{
|
||||
memset(affinity_mask->__bits, 0x00, __MASK_SETSIZE);
|
||||
}
|
||||
|
||||
void inline copy_affinity_mask(cpu_affinity_mask_t *dest_affinity_mask, cpu_affinity_mask_t *src_affinity_mask)
|
||||
void copy_affinity_mask(cpu_affinity_mask_t *dest_affinity_mask, cpu_affinity_mask_t *src_affinity_mask)
|
||||
{
|
||||
memcpy(dest_affinity_mask->__bits, src_affinity_mask->__bits, __MASK_SETSIZE);
|
||||
}
|
||||
|
||||
void inline set_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask)
|
||||
void set_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask)
|
||||
{
|
||||
affinity_mask->__bits[logical_cpu / __MASK_NCPUBITS] |= 0x1 << (logical_cpu % __MASK_NCPUBITS);
|
||||
}
|
||||
|
||||
bool inline get_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask)
|
||||
bool get_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask)
|
||||
{
|
||||
return (affinity_mask->__bits[logical_cpu / __MASK_NCPUBITS] & (0x1 << (logical_cpu % __MASK_NCPUBITS))) != 0x00;
|
||||
}
|
||||
|
||||
void inline clear_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask)
|
||||
void clear_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask)
|
||||
{
|
||||
affinity_mask->__bits[logical_cpu / __MASK_NCPUBITS] &= ~(0x1 << (logical_cpu % __MASK_NCPUBITS));
|
||||
}
|
||||
|
|
|
@ -100,16 +100,16 @@ extern int _current_verboselevel;
|
|||
*/
|
||||
|
||||
/* initialize affinity_mask */
|
||||
extern inline void init_affinity_mask(cpu_affinity_mask_t *affinity_mask);
|
||||
void init_affinity_mask(cpu_affinity_mask_t *affinity_mask);
|
||||
|
||||
/* copy one affinity_mask to another one */
|
||||
extern inline void copy_affinity_mask(cpu_affinity_mask_t *dest_affinity_mask, cpu_affinity_mask_t *src_affinity_mask);
|
||||
void copy_affinity_mask(cpu_affinity_mask_t *dest_affinity_mask, cpu_affinity_mask_t *src_affinity_mask);
|
||||
|
||||
/* set bit corresponding to 'logical_cpu' to '1' */
|
||||
extern inline void set_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask);
|
||||
void set_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask);
|
||||
|
||||
/* get bit corresponding to 'logical_cpu' */
|
||||
extern inline bool get_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask);
|
||||
bool get_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask);
|
||||
|
||||
/* set bit corresponding to 'logical_cpu' to '0' */
|
||||
void clear_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask);
|
||||
|
|
Loading…
Reference in a new issue