blob: 4654086114d5f4ca6fdd6953ca4cc4485a9e8134 [file] [log] [blame]
Martin Roth6add44b2017-02-09 17:51:20 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
Kyösti Mälkki5a5c8862014-01-26 14:41:54 +020014#include <smp/node.h>
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000015#include <cpu/x86/msr.h>
Elyes HAOUASa9473ec2018-10-24 15:55:53 +020016#include <cpu/x86/lapic_def.h>
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000017
Martin Roth0fa92b32017-06-24 13:53:20 -060018#if IS_ENABLED(CONFIG_SMP)
Stefan Reinauer00093a82011-11-02 16:12:34 -070019int boot_cpu(void)
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000020{
21 int bsp;
22 msr_t msr;
Elyes HAOUASa9473ec2018-10-24 15:55:53 +020023 msr = rdmsr(LAPIC_BASE_MSR);
Eric Biedermanfcd5ace2004-10-14 19:29:29 +000024 bsp = !!(msr.lo & (1 << 8));
25 return bsp;
26}
Kyösti Mälkkieafb18b2011-11-22 19:44:45 +020027#endif