~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/include/asm/octeon/cvmx-coremask.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * Copyright (c) 2016  Cavium Inc. (support@cavium.com).
  7  *
  8  */
  9 
 10 /*
 11  * Module to support operations on bitmap of cores. Coremask can be used to
 12  * select a specific core, a group of cores, or all available cores, for
 13  * initialization and differentiation of roles within a single shared binary
 14  * executable image.
 15  *
 16  * The core numbers used in this file are the same value as what is found in
 17  * the COP0_EBASE register and the rdhwr 0 instruction.
 18  *
 19  * For the CN78XX and other multi-node environments the core numbers are not
 20  * contiguous.  The core numbers for the CN78XX are as follows:
 21  *
 22  * Node 0:      Cores 0 - 47
 23  * Node 1:      Cores 128 - 175
 24  * Node 2:      Cores 256 - 303
 25  * Node 3:      Cores 384 - 431
 26  *
 27  */
 28 
 29 #ifndef __CVMX_COREMASK_H__
 30 #define __CVMX_COREMASK_H__
 31 
 32 #define CVMX_MIPS_MAX_CORES 1024
 33 /* bits per holder */
 34 #define CVMX_COREMASK_ELTSZ 64
 35 
 36 /* cvmx_coremask_t's size in u64 */
 37 #define CVMX_COREMASK_BMPSZ (CVMX_MIPS_MAX_CORES / CVMX_COREMASK_ELTSZ)
 38 
 39 
 40 /* cvmx_coremask_t */
 41 struct cvmx_coremask {
 42         u64 coremask_bitmap[CVMX_COREMASK_BMPSZ];
 43 };
 44 
 45 /*
 46  * Is ``core'' set in the coremask?
 47  */
 48 static inline bool cvmx_coremask_is_core_set(const struct cvmx_coremask *pcm,
 49                                             int core)
 50 {
 51         int n, i;
 52 
 53         n = core % CVMX_COREMASK_ELTSZ;
 54         i = core / CVMX_COREMASK_ELTSZ;
 55 
 56         return (pcm->coremask_bitmap[i] & ((u64)1 << n)) != 0;
 57 }
 58 
 59 /*
 60  * Make a copy of a coremask
 61  */
 62 static inline void cvmx_coremask_copy(struct cvmx_coremask *dest,
 63                                       const struct cvmx_coremask *src)
 64 {
 65         memcpy(dest, src, sizeof(*dest));
 66 }
 67 
 68 /*
 69  * Set the lower 64-bit of the coremask.
 70  */
 71 static inline void cvmx_coremask_set64(struct cvmx_coremask *pcm,
 72                                        uint64_t coremask_64)
 73 {
 74         pcm->coremask_bitmap[0] = coremask_64;
 75 }
 76 
 77 /*
 78  * Clear ``core'' from the coremask.
 79  */
 80 static inline void cvmx_coremask_clear_core(struct cvmx_coremask *pcm, int core)
 81 {
 82         int n, i;
 83 
 84         n = core % CVMX_COREMASK_ELTSZ;
 85         i = core / CVMX_COREMASK_ELTSZ;
 86         pcm->coremask_bitmap[i] &= ~(1ull << n);
 87 }
 88 
 89 #endif /* __CVMX_COREMASK_H__ */
 90 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php