OLD | NEW |
1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 #ifndef BASE_VDSO_SUPPORT_H_ | 55 #ifndef BASE_VDSO_SUPPORT_H_ |
56 #define BASE_VDSO_SUPPORT_H_ | 56 #define BASE_VDSO_SUPPORT_H_ |
57 | 57 |
58 #include <config.h> | 58 #include <config.h> |
59 #include "base/basictypes.h" | 59 #include "base/basictypes.h" |
60 #include "base/elf_mem_image.h" | 60 #include "base/elf_mem_image.h" |
61 | 61 |
62 #ifdef HAVE_ELF_MEM_IMAGE | 62 #ifdef HAVE_ELF_MEM_IMAGE |
63 | 63 |
| 64 // This matches the same conditions of stacktrace_x86-inl.h, the only client of |
| 65 // vdso_support, to avoid static initializers. |
| 66 #if defined(__linux__) && defined(__i386__) |
64 #define HAVE_VDSO_SUPPORT 1 | 67 #define HAVE_VDSO_SUPPORT 1 |
| 68 #endif |
65 | 69 |
66 #include <stdlib.h> // for NULL | 70 #include <stdlib.h> // for NULL |
67 | 71 |
68 namespace base { | 72 namespace base { |
69 | 73 |
70 // NOTE: this class may be used from within tcmalloc, and can not | 74 // NOTE: this class may be used from within tcmalloc, and can not |
71 // use any memory allocation routines. | 75 // use any memory allocation routines. |
72 class VDSOSupport { | 76 class VDSOSupport { |
73 public: | 77 public: |
74 VDSOSupport(); | 78 VDSOSupport(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // Return current CPU, using (fast) __vdso_getcpu@LINUX_2.6 if present, | 150 // Return current CPU, using (fast) __vdso_getcpu@LINUX_2.6 if present, |
147 // otherwise use syscall(SYS_getcpu,...). | 151 // otherwise use syscall(SYS_getcpu,...). |
148 // May return -1 with errno == ENOSYS if the kernel doesn't | 152 // May return -1 with errno == ENOSYS if the kernel doesn't |
149 // support SYS_getcpu. | 153 // support SYS_getcpu. |
150 int GetCPU(); | 154 int GetCPU(); |
151 } // namespace base | 155 } // namespace base |
152 | 156 |
153 #endif // HAVE_ELF_MEM_IMAGE | 157 #endif // HAVE_ELF_MEM_IMAGE |
154 | 158 |
155 #endif // BASE_VDSO_SUPPORT_H_ | 159 #endif // BASE_VDSO_SUPPORT_H_ |
OLD | NEW |