Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: src/trusted/platform_qualify/arch/x86/nacl_cpuwhitelist.c

Issue 11864002: Move CPU features into its own static library. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Address bsy's comments by not building x86 target when host isn't x86. This is how things are curre… Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * An implementation of CPU whitelisting for x86's CPUID identification scheme. 8 * An implementation of CPU whitelisting for x86's CPUID identification scheme.
9 */ 9 */
10 10
11 #include "native_client/src/include/portability.h" 11 #include "native_client/src/include/portability.h"
12 #include <stdio.h> 12 #include <stdio.h>
13 #include <string.h> 13 #include <string.h>
14 #include <assert.h> 14 #include <assert.h>
15 #include <stdlib.h> 15 #include <stdlib.h>
16 #include "native_client/src/include/nacl_macros.h" 16 #include "native_client/src/include/nacl_macros.h"
17 #include "native_client/src/trusted/validator/x86/nacl_cpuid.h" 17 #include "native_client/src/trusted/cpu_features/arch/x86/cpu_x86.h"
18 #include "native_client/src/trusted/platform_qualify/nacl_cpuwhitelist.h" 18 #include "native_client/src/trusted/platform_qualify/nacl_cpuwhitelist.h"
19 19
20 20
21 static int idcmp(const void *s1, const void *s2) { 21 static int idcmp(const void *s1, const void *s2) {
22 return strncmp((char *)s1, *(char **)s2, kCPUIDStringLength); 22 return strncmp((char *)s1, *(char **)s2, kCPUIDStringLength);
23 } 23 }
24 24
25 /* NOTE: The blacklist must be in alphabetical order. */ 25 /* NOTE: The blacklist must be in alphabetical order. */
26 static const char* const kNaclCpuBlacklist[] = { 26 static const char* const kNaclCpuBlacklist[] = {
27 /* 1 2 */ 27 /* 1 2 */
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 int NaCl_ThisCPUIsBlacklisted(void) { 111 int NaCl_ThisCPUIsBlacklisted(void) {
112 NaClCPUData data; 112 NaClCPUData data;
113 const char* myid; 113 const char* myid;
114 NaClCPUDataGet(&data); 114 NaClCPUDataGet(&data);
115 myid = GetCPUIDString(&data); 115 myid = GetCPUIDString(&data);
116 return IsCpuInList(myid, 116 return IsCpuInList(myid,
117 kNaclCpuBlacklist, 117 kNaclCpuBlacklist,
118 NACL_ARRAY_SIZE(kNaclCpuBlacklist)); 118 NACL_ARRAY_SIZE(kNaclCpuBlacklist));
119 } 119 }
OLDNEW
« no previous file with comments | « src/trusted/cpu_features/cpu_features.gyp ('k') | src/trusted/platform_qualify/arch/x86/nacl_cpuwhitelist_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698