| 1 | #ifndef __CB_BDK_INIT_H__ |
| 2 | #define __CB_BDK_INIT_H__ |
| 3 | /***********************license start*********************************** |
| 4 | * Copyright (c) 2003-2017 Cavium Inc. ([email protected]). All rights |
| 5 | * reserved. |
| 6 | * |
| 7 | * |
| 8 | * Redistribution and use in source and binary forms, with or without |
| 9 | * modification, are permitted provided that the following conditions are |
| 10 | * met: |
| 11 | * |
| 12 | * * Redistributions of source code must retain the above copyright |
| 13 | * notice, this list of conditions and the following disclaimer. |
| 14 | * |
| 15 | * * Redistributions in binary form must reproduce the above |
| 16 | * copyright notice, this list of conditions and the following |
| 17 | * disclaimer in the documentation and/or other materials provided |
| 18 | * with the distribution. |
| 19 | * |
| 20 | * * Neither the name of Cavium Inc. nor the names of |
| 21 | * its contributors may be used to endorse or promote products |
| 22 | * derived from this software without specific prior written |
| 23 | * permission. |
| 24 | * |
| 25 | * This Software, including technical data, may be subject to U.S. export |
| 26 | * control laws, including the U.S. Export Administration Act and its |
| 27 | * associated regulations, and may be subject to export or import |
| 28 | * regulations in other countries. |
| 29 | * |
| 30 | * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
| 31 | * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR |
| 32 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT |
| 33 | * TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY |
| 34 | * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT |
| 35 | * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES |
| 36 | * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR |
| 37 | * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, |
| 38 | * QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK |
| 39 | * ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. |
| 40 | ***********************license end**************************************/ |
| 41 | |
| 42 | /** |
| 43 | * @file |
| 44 | * |
| 45 | * Core initialization functions |
| 46 | * |
| 47 | * <hr>$Revision: 49448 $<hr> |
| 48 | * |
| 49 | * @defgroup thread Threading library |
| 50 | * @{ |
| 51 | */ |
| 52 | |
| 53 | /** |
| 54 | * Call this function to take secondary cores out of reset and have |
| 55 | * them start running threads |
| 56 | * |
| 57 | * @param node Node to use in a Numa setup. Can be an exact ID or a special |
| 58 | * value. |
| 59 | * @param coremask Cores to start. Zero is a shortcut for all. |
| 60 | * |
| 61 | * @return Zero on success, negative on failure. |
| 62 | */ |
| 63 | extern int bdk_init_cores(bdk_node_t node, uint64_t coremask); |
| 64 | |
| 65 | /** |
| 66 | * Put cores back in reset and power them down |
| 67 | * |
| 68 | * @param node Node to update |
| 69 | * @param coremask Each bit will be a core put in reset. Cores already in reset are unaffected |
| 70 | * |
| 71 | * @return Zero on success, negative on failure |
| 72 | */ |
| 73 | extern int bdk_reset_cores(bdk_node_t node, uint64_t coremask); |
| 74 | |
| 75 | /** |
| 76 | * Get the coremask of the cores actively running the BDK. Doesn't count cores |
| 77 | * that aren't booted. |
| 78 | * |
| 79 | * @param node Node to coremask the count for |
| 80 | * |
| 81 | * @return 64bit bitmask |
| 82 | */ |
| 83 | uint64_t bdk_get_running_coremask(bdk_node_t node); |
| 84 | |
| 85 | /** |
| 86 | * Return the number of cores actively running in the BDK for the given node |
| 87 | * |
| 88 | * @param node Node to get the core count for |
| 89 | * |
| 90 | * @return Number of cores running. Doesn't count cores that aren't booted |
| 91 | */ |
| 92 | int bdk_get_num_running_cores(bdk_node_t node); |
| 93 | |
| 94 | /** @} */ |
| 95 | |
| 96 | #endif /* !__CB_BDK_INIT_H__ */ |