libcpuid
libcpuid_types.h
1 /*
2  * Copyright 2008 Veselin Georgiev,
3  * anrieffNOSPAM @ mgail_DOT.com (convert to gmail)
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
32 #ifndef __LIBCPUID_TYPES_H__
33 #define __LIBCPUID_TYPES_H__
34 
35 #if !defined(_MSC_VER) || _MSC_VER >= 1600
36 # include <stdint.h>
37 #else
38 /* we have to provide our own: */
39 # if !defined(__int32_t_defined)
40 typedef int int32_t;
41 # endif
42 
43 # if !defined(__uint32_t_defined)
44 typedef unsigned uint32_t;
45 # endif
46 
47 typedef signed char int8_t;
48 typedef unsigned char uint8_t;
49 typedef signed short int16_t;
50 typedef unsigned short uint16_t;
51 #if (defined _MSC_VER) && (_MSC_VER <= 1300)
52  /* MSVC 6.0: no long longs ... */
53  typedef signed __int64 int64_t;
54  typedef unsigned __int64 uint64_t;
55 #else
56  /* all other sane compilers: */
57  typedef signed long long int64_t;
58  typedef unsigned long long uint64_t;
59 #endif
60 
61 #endif
62 
63 typedef uint16_t logical_cpu_t;
64 #define __MASK_NCPUBITS 8
65 #define __MASK_SETSIZE (1ULL << (sizeof(logical_cpu_t) * __MASK_NCPUBITS)) / __MASK_NCPUBITS
69 typedef struct {
70  uint8_t __bits[__MASK_SETSIZE];
72 
73 #endif /* __LIBCPUID_TYPES_H__ */
Internal structure, used in affinity_mask_str_r and affinity_mask_str.
Definition: libcpuid_types.h:69