cpuid.c (1f503e7743df91eb6f63af27c310c557edfc3307) | cpuid.c (92cb7612aee39642d109b8d935ad265e602c0563) |
---|---|
1/* ----------------------------------------------------------------------- * 2 * 3 * Copyright 2000 H. Peter Anvin - All Rights Reserved 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, 8 * USA; either version 2 of the License, or (at your option) any later --- 100 unchanged lines hidden (view full) --- 109 } 110 111 return tmp - buf; 112} 113 114static int cpuid_open(struct inode *inode, struct file *file) 115{ 116 unsigned int cpu = iminor(file->f_path.dentry->d_inode); | 1/* ----------------------------------------------------------------------- * 2 * 3 * Copyright 2000 H. Peter Anvin - All Rights Reserved 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, 8 * USA; either version 2 of the License, or (at your option) any later --- 100 unchanged lines hidden (view full) --- 109 } 110 111 return tmp - buf; 112} 113 114static int cpuid_open(struct inode *inode, struct file *file) 115{ 116 unsigned int cpu = iminor(file->f_path.dentry->d_inode); |
117 struct cpuinfo_x86 *c = &(cpu_data)[cpu]; | 117 struct cpuinfo_x86 *c = &cpu_data(cpu); |
118 119 if (cpu >= NR_CPUS || !cpu_online(cpu)) 120 return -ENXIO; /* No such CPU */ 121 if (c->cpuid_level < 0) 122 return -EIO; /* CPUID not supported */ 123 124 return 0; 125} --- 107 unchanged lines hidden --- | 118 119 if (cpu >= NR_CPUS || !cpu_online(cpu)) 120 return -ENXIO; /* No such CPU */ 121 if (c->cpuid_level < 0) 122 return -EIO; /* CPUID not supported */ 123 124 return 0; 125} --- 107 unchanged lines hidden --- |