/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2011, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <unistd.h>
#include <strings.h>
#include <sys/systeminfo.h>
#include "prtconf.h"
#ifdef __x86
#else
static const char *usage =
"%s [ -F | -V | -x | -abcdvpPD ][ <device_path > ]\n";
#endif /* __x86 */
static void
{
char *p;
else
}
/*PRINTFLIKE1*/
void
{
}
}
void
{
}
static void
{
return;
/*LINTED*/
while (1) {
if (len == 0)
break;
/* change substring "//" into "/" */
continue;
}
/* change substring "/./" into "/" */
continue;
}
/* change substring "/<foo>/../" into "/" */
*ptr = '\0';
/* path had a leading "/../" */
}
continue;
}
/* change trailing "/<foo>/.." into "/" */
if ((len >= 3) &&
} else {
/* path was "/.." */
path[0] = '/';
}
continue;
}
/* change trailing "/." into "/" */
if ((len >= 2) &&
continue;
}
/* remove trailing "/" unless it's the root */
continue;
}
break;
}
}
/*
* debug version has two more flags:
* -L force load driver
* -M: print per driver list
*/
#ifdef DEBUG
#else
#endif /* DEBUG */
int
{
int c, ret;
switch (c) {
case 'a':
++opts.o_ancestors;
break;
case 'b':
break;
case 'c':
++opts.o_children;
break;
case 'd':
break;
case 'D':
++opts.o_drv_name;
break;
case 'v':
break;
case 'm':
break;
case 'p':
++opts.o_prominfo;
break;
case 'f':
break;
case 'V':
break;
case 'x':
break;
case 'F':
++opts.o_noheader;
break;
case 'P':
++opts.o_pseudodevs;
break;
case 'C':
++opts.o_forcecache;
break;
#ifdef DEBUG
case 'M':
++dbg.d_bydriver;
break;
case 'L':
++dbg.d_forceload;
break;
#endif /* DEBUG */
default:
return (1);
}
}
return (do_fbname());
if (opts.o_promversion)
return (do_promversion());
if (opts.o_prom_ready64)
return (do_prom_version64());
if (opts.o_productinfo)
return (do_productinfo());
int error;
if (opts.o_prominfo) {
/* PROM tree cannot be used with path */
return (1);
}
return (1);
}
/* an invalid path was specified */
return (1);
error = 0;
/* clean up the path */
/* This is not a valid /devices path */
error = 1;
/* /devices is the root nexus */
error = 0;
/* This is not a valid /devices path */
error = 1;
} else {
/* a /devices/ path was specified */
error = 0;
}
} else {
/* an invalid device path was specified */
error = 1;
}
if (error) {
"invalid device path specified\n",
return (1);
}
}
return (1);
}
return (0);
}
sizeof (hw_provider));
/*
* If 0 bytes are returned (the system returns '1', for the \0),
* we're probably on x86, default to "Unknown Hardware Vendor".
*/
if (ret <= 1) {
sizeof (hw_provider));
}
}
(void) printf("0\n");
return (1);
} else {
(void) printf("Memory size: unable to determine\n");
}
} else {
return (0);
} else {
(void) printf("Memory size: %ld Megabytes\n",
}
}
if (opts.o_prominfo) {
(void) printf("System Peripherals (PROM Nodes):\n\n");
if (do_prominfo() == 0)
return (0);
}
(void) printf("System Peripherals (Software Nodes):\n\n");
(void) prtconf_devinfo();
return (0);
}