Forgot to 'svn add' src/cpu/x86/name (trivial).
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5880 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
aac8f661f5
commit
17cae3599f
|
@ -0,0 +1,21 @@
|
|||
##
|
||||
## This file is part of the coreboot project.
|
||||
##
|
||||
## Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; version 2 of the License.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
obj-y += name.o
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* This file is part of the coreboot project.
|
||||
*
|
||||
* Copyright (C) 2007-2009 coresystems GmbH
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <device/device.h>
|
||||
#include <cpu/cpu.h>
|
||||
#include <cpu/x86/name.h>
|
||||
|
||||
void fill_processor_name(char *processor_name)
|
||||
{
|
||||
struct cpuid_result regs;
|
||||
char temp_processor_name[49];
|
||||
char *processor_name_start;
|
||||
unsigned int *name_as_ints = (unsigned int *)temp_processor_name;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
regs = cpuid(0x80000002 + i);
|
||||
name_as_ints[i * 4 + 0] = regs.eax;
|
||||
name_as_ints[i * 4 + 1] = regs.ebx;
|
||||
name_as_ints[i * 4 + 2] = regs.ecx;
|
||||
name_as_ints[i * 4 + 3] = regs.edx;
|
||||
}
|
||||
|
||||
temp_processor_name[48] = 0;
|
||||
|
||||
/* Skip leading spaces. */
|
||||
processor_name_start = temp_processor_name;
|
||||
while (*processor_name_start == ' ')
|
||||
processor_name_start++;
|
||||
|
||||
memset(processor_name, 0, 49);
|
||||
strcpy(processor_name, processor_name_start);
|
||||
}
|
Loading…
Reference in New Issue