Files
qt6-migration-pipeline/external/rti_connext_dds-7.7.0/include/ndds/osapi/osapi_cpu.h
T
torsten 77c67c12ca Execute the same instructions but now for tools in folders you are getti
Entire-Metadata: .entire/metadata/fb87247f-2a75-407e-b336-cbc8c20ba5a6
Entire-Session: fb87247f-2a75-407e-b336-cbc8c20ba5a6
Entire-Strategy: manual-commit
2026-09-24 16:24:51 +00:00

91 lines
2.3 KiB
C

/*
* (c) Copyright, Real-Time Innovations, 2010-2024.
* All rights reserved.
*
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef osapi_cpu_h
#define osapi_cpu_h
#include "osapi/osapi_dll.h"
#include "osapi/osapi_type.h"
#ifdef __cplusplus
extern "C" {
#endif
/** @internal \file
* \brief Processor related utility
*/
/** @internal \defgroup RTIOsapiCpuBitmapClass RTIOsapiCpuBitmap
* \ingroup RTIOsapiModule
* \brief Bitmask of available processors.
*/
#if defined(RTI_QNX)
#define RTI_OSAPI_CPU_BITMAP_MAX_BITS (32)
#else
#define RTI_OSAPI_CPU_BITMAP_MAX_BITS (1024)
#endif
#define RTI_OSAPI_CPU_BITMAP_LENGTH (RTI_OSAPI_CPU_BITMAP_MAX_BITS / 32)
#define RTI_OSAPI_CPU_NO_ROTATION (0)
#define RTI_OSAPI_CPU_RR_ROTATION (1)
struct RTIOsapiCpuBitmap {
RTI_UINT32 mask[RTI_OSAPI_CPU_BITMAP_LENGTH];
int rotation;
int _numCpus;
int _numUses;
};
#if defined(RTI_QNX)
#define RTI_OSAPI_CPU_BITMAP_DEFAULT \
{ \
{ 0 }, RTI_OSAPI_CPU_NO_ROTATION, 0, 0 \
}
#else
#define RTI_OSAPI_CPU_BITMAP_DEFAULT \
{ \
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \
RTI_OSAPI_CPU_NO_ROTATION, 0, 0 \
}
#endif
#define RTIOsapiCpuBitmap_test(me, i) \
((me)->mask[i >> 5] & (RTI_UINT32) (1U << (i & 0x1F)))
#define RTIOsapiCpuBitmap_set(me, i) \
do { \
if (((me)->mask[i >> 5] & (RTI_UINT32) (1U << (i & 0x1F))) == 0) \
(me)->_numCpus++; \
(me)->mask[i >> 5] |= (RTI_UINT32) (1U << (i & 0x1F)); \
} while (0)
#define RTIOsapiCpuBitmap_zero(me) RTIOsapiMemory_zero((me), sizeof(*(me)))
#define RTIOsapiCpuBitmap_incrementUseCounter(me) ((me)->_numUses++)
#define RTIOsapiCpuBitmap_copy(to, src) \
RTIOsapiMemory_copy((to), (src), sizeof(*(src)))
extern RTIOsapiDllExport RTIBool RTIOsapiCpuBitmap_equals(
const struct RTIOsapiCpuBitmap *me,
const struct RTIOsapiCpuBitmap *other);
extern RTIOsapiDllExport void RTIOsapiCpuBitmap_toStringI(
struct RTIOsapiCpuBitmap *me,
char *dst,
int max);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* osapi_cpu_h */