1
0
Fork 0
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:
Xorg 2022-09-15 22:15:48 +02:00
parent 2b8023f733
commit ab395f8756
No known key found for this signature in database
GPG key ID: 1E55EE2EFF18BC1A
2 changed files with 9 additions and 9 deletions

View file

@ -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));
}

View file

@ -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);