X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=libcfs%2Finclude%2Flibcfs%2Flibcfs_cpu.h;h=97510694efbb8f4e7c0c9705b499e99b60377393;hp=ef1529700c638526b41752d3aaa80d4895e8cf00;hb=d39408943a56f452d68b3c8b170ee4ce10e416fa;hpb=98060d83459ba10409f295898f0ec917f938b4d3 diff --git a/libcfs/include/libcfs/libcfs_cpu.h b/libcfs/include/libcfs/libcfs_cpu.h index ef15297..9751069 100644 --- a/libcfs/include/libcfs/libcfs_cpu.h +++ b/libcfs/include/libcfs/libcfs_cpu.h @@ -77,8 +77,16 @@ #ifndef HAVE_LIBCFS_CPT -typedef unsigned long cpumask_t; -typedef unsigned long nodemask_t; +#ifndef __KERNEL__ +typedef struct nodemask { DECLARE_BITMAP(bits, 1); } nodemask_t; +typedef struct cpumask { DECLARE_BITMAP(bits, 1); } cpumask_t; + +#define node_set(node, dst) __node_set((node), &(dst)) +static __always_inline void __node_set(int node, nodemask_t *dstp) +{ + set_bit(node, dstp->bits); +} +#endif /* __KERNEL__ */ struct cfs_cpt_table { /* # of CPU partitions */ @@ -195,6 +203,11 @@ void cfs_cpt_clear(struct cfs_cpt_table *cptab, int cpt); int cfs_cpt_spread_node(struct cfs_cpt_table *cptab, int cpt); /** + * return number of HTs in the same core of \a cpu + */ +int cfs_cpu_ht_nsiblings(int cpu); + +/** * iterate over all CPU partitions in \a cptab */ #define cfs_cpt_for_each(i, cptab) \