1N/A * GRUB -- GRand Unified Bootloader 1N/A * Copyright (C) 1999,2005,2005 Free Software Foundation, Inc. 1N/A * This program is free software; you can redistribute it and/or modify 1N/A * it under the terms of the GNU General Public License as published by 1N/A * the Free Software Foundation; either version 2 of the License, or 1N/A * (at your option) any later version. 1N/A * This program is distributed in the hope that it will be useful, 1N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1N/A * GNU General Public License for more details. 1N/A * You should have received a copy of the GNU General Public License 1N/A * along with this program; if not, write to the Free Software 1N/A * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 1N/A * <Insert copyright here : it must be BSD-like so anyone can use it> 1N/A * Source file implementing Intel MultiProcessor Specification (MPS) 1N/A * version 1.1 and 1.4 SMP hardware control for Intel Architecture CPUs, 1N/A * with hooks for running correctly on a standard PC without the hardware. 1N/A * This file was created from information in the Intel MPS version 1.4 1N/A * document, order number 242016-004, which can be ordered from the 1N/A * Intel literature center. 1N/A * General limitations of this code: 1N/A * (1) : This code has never been tested on an MPS-compatible system with 1N/A * 486 CPUs, but is expected to work. 1N/A * (2) : Presumes "int", "long", and "unsigned" are 32 bits in size, and 1N/A * that 32-bit pointers and memory addressing is used uniformly. 1N/A * XXXXX The following absolutely must be defined!!! 1N/A * The "KERNEL_PRINT" could be made a null macro with no danger, of 1N/A * course, but pretty much nothing would work without the other 1N/Astatic inline unsigned char 1N/Astatic inline unsigned 1N/A * Defines that are here so as not to be in the global header file. 1N/A * Static defines here for SMP use. 1N/A 'E',
'I',
'S',
'A',
' ',
' ' 1N/A 'P',
'C',
'I',
' ',
' ',
' ' 1N/A * Exported globals here. 1N/A * "imps_any_new_apics" is non-zero if any of the APICS (local or I/O) 1N/A * are *not* an 82489DX. This is useful to determine if more than 15 1N/A * CPUs can be supported (true if zero). 1N/A * "imps_enabled" is non-zero if the probe sequence found IMPS 1N/A * information and was successful. 1N/A * This represents the number of CPUs found. 1N/A * This contains the local APIC hardware address. 1N/A * These map from virtual cpu numbers to APIC id's and back. 1N/A * MPS checksum function 1N/A * Function finished. 1N/A * Primary function for booting individual CPUs. 1N/A * This must be modified to perform whatever OS-specific initialization 1N/A * Generic CPU startup sequence starts here. 1N/A /* set BIOS reset vector */ 1N/A /* clear the error register */ 1N/A /* assert INIT IPI */ 1N/A /* %%%%% ESB finish adding startup sequence */ 1N/A /* clean up BIOS reset vector */ 1N/A * Generic CPU startup sequence ends here. 1N/A /* XXXXX add OS-specific initialization here! */ 1N/A * read bios stuff and fill tables 1N/A /* XXXXX add OS-specific setup for secondary CPUs here */ 1N/A /* XXXXX add OS-specific code here */ 1N/A /* XXXXX add OS-specific code here */ 1N/A#
if 0
/* XXXXX uncomment this if "add_io_interrupt" is implemented */ 1N/A#
if 0
/* XXXXX uncomment this if "add_local_interrupt" is implemented */ 1N/A ((
" Bad MP Config Table sig 0x%x and/or checksum 0x%x\n",
1N/A ((
" Bad Extended MP Config Table checksum 0x%x\n",
sum));
1N/A * Do all checking of errors which would definitely 1N/A * lead to failure of the SMP boot here. 1N/A ((
" APIC config: \"%s mode\" Local APIC address: 0x%x\n",
1N/A * Setup primary CPU. 1N/A /* %%%%% ESB read extended entries here */ 1N/A * Given a region to check, this actually looks for the "MP Floating 1N/A * Pointer Structure". The return value indicates if the correct 1N/A * signature and checksum for a floating pointer structure of the 1N/A * appropriate spec revision was found. If so, then do not search 1N/A * NOTE: The memory scan will always be in the bottom 1 MB. 1N/A * This function presumes that "start" will always be aligned to a 16-bit 1N/A * Function finished. 1N/A * This is the primary function for probing for MPS compatible hardware 1N/A * and BIOS information. Call this during the early stages of OS startup, 1N/A * before memory can be messed up. 1N/A * The probe looks for the "MP Floating Pointer Structure" at locations 1N/A * listed at the top of page 4-2 of the spec. 1N/A * Environment requirements from the OS to run: 1N/A * (1) : A non-linear virtual to physical memory mapping is probably OK, 1N/A * as (I think) the structures all fall within page boundaries, 1N/A * but a linear mapping is recommended. Currently assumes that 1N/A * the mapping will remain identical over time (which should be 1N/A * OK since it only accesses memory which shouldn't be munged 1N/A * by the OS anyway). 1N/A * (2) : The OS only consumes memory which the BIOS says is OK to use, 1N/A * and not any of the BIOS standard areas (the areas 0x400 to 1N/A * 0x600, the EBDA, 0xE0000 to 0xFFFFF, and unreported physical 1N/A * RAM). Sometimes a small amount of physical RAM is not 1N/A * reported by the BIOS, to be used to store MPS and other 1N/A * (3) : It must be possible to read the CMOS. 1N/A * (4) : There must be between 512K and 640K of lower memory (this is a 1N/A * Function finished. 1N/A * Determine possible address of the EBDA 1N/A * Determine amount of installed lower memory (not *available* 1N/A * NOTE: This should work reliably as long as we verify the 1N/A * machine is at least a system that could possibly have 1N/A * MPS compatibility to begin with. 1N/A * Sanity check : if this isn't reasonable, it is almost impossibly 1N/A * unlikely to be an MPS compatible machine, so return failure. 1N/A * If no BIOS info on MPS hardware is found, then return failure.