x86pi.c revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * x86 Generic FMA Topology Enumerator 2N/A * Entry point called by libtopo when enumeration is required 2N/A * Top level chassis node in a multiple chassis system; or the chassis 2N/A * node in a single chassis system. 2N/A/* base board ID counts */ 2N/A * Declare the operations vector and information structure used during 2N/A * module registration 2N/A * Used to pass SMBIOS' FM compatibility to the 2N/A * Called by libtopo when the topo module is loaded. 2N/A /* Debugging is requested for this module */ 2N/A /* see if we're being called to only generate authority */ 2N/A /* Verify that this is a i86pc architecture machine */ 2N/A /* module errno already set */ 2N/A * Clean up any data used by the module before it is unloaded. 2N/A /* Unregister from libtopo */ 2N/A * Enumeration entry point for the x86 Generic topology enumerator 2N/A /* Begin enumeration */ 2N/A /* initialize base board counts */ 2N/A * Let's do some enumeration. 2N/A /* Complete enumeration */ 2N/A char *f =
"x86pi_enum_start";
2N/A * Verify BIOS compliance. 2N/A /* fall back to legacy enumeration */ 2N/A "%s: Calling legacy enumeration\n", f);
2N/A * Create the topology. 2N/A * Create the i86pc topology 2N/A * walk them creating the topo. 2N/A char *f =
"x86pi_enum_gentopo";
2N/A /* Type 3 structs */ 2N/A * Expect SMBIOS to set the first Chassis Structure to be the 2N/A "%s: Failed to create chassis %d\n", f,
nch);
2N/A /* enumerate disk bays */ 2N/A /* Type 2 structs */ 2N/A * We have reached end of the array due to the 2N/A * parent-child relationship, without visiting all 2N/A * baseboards! so re-iterate.. 2N/A * All baseboards are visited and their contained 2N/A * processors are enumerated 2N/A * More baseboards pending a visit 2N/A * Get the Top-most Parent Baseboard, irrespective 2N/A * of its index in the array of Type-2s 2N/A * If this Baseboard has no Baseboard parents 2N/A * place it under the chassis that contains it 2N/A "Failed to get BaseBoard node (%d): parent\n",
2N/A "Failed to create BaseBoard node (%d)\n",
nbb);
2N/A * Look for contained handles here and if there are 2N/A * make sure the chip handle below is part of it. 2N/A /* make sure the chip enum is loaded */ 2N/A "%s: Failed to load %s module: %s\n", f,
2N/A /* create node range */ 2N/A "%s: chip range %d to %d\n",
2N/A "%s: Failed to create node range: " 2N/A /* call the chip enumerator */ 2N/A "enumeration failed: \n",
2N/A /* enumerate the hostbridge node */ 2N/A "%s: Failed to create %s range: %s\n",
2N/A "smbios_info_pciexrc failed: " 2N/A "couldn't create hostbridge=%d\n",
hbri);