package.c revision 25cf1a301a396c38e8adf52c15f537b80d2483f7
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <fcdriver/fcdriver.h>
#define MIN_VALUES 100
static void
{
if (!MYSELF)
}
{
device_t *d;
static char func_name[] = "get_number_of_parent_address_cells";
return (2);
ncells = d->parent_adr_cells;
if (ncells == 0) {
2);
if (ncells > MAX_MY_ADDR) {
" ncells (%d) > MAX_MY_ADDR (%d)\n", func_name,
}
d->parent_adr_cells = ncells;
}
return (ncells);
}
{
int i;
return (ihandle);
}
device_t *
{
return (phandle);
}
static void
{
if (d != NULL) {
}
}
static void
{
device_t *d;
do_push_package(env, d);
}
static void
{
}
static void
{
TODO; /* interpose - not yet implemented */
}
void
{
env->current_device = d;
do_push_package(env, d);
}
void
{
env->current_device = d;
if (d != NULL) {
}
}
/*
* Starfire hack to set '/' device_type to 'upa'
*/
#include <sys/systeminfo.h>
static void
{
char platform[100];
}
}
void
{
}
void
{
device_t *d;
}
void
{
device_t *d;
}
void
{
/* Insert new child at end of peer list */
;
} else
}
void
{
int n;
/*
* Paranoia.. reserve a little more instance data than we need
*/
}
static void
{
if (token) {
}
}
static void
{
}
static void
{
}
void
{
while (--ncells) {
adr_ptr++;
}
}
void
{
}
static void
{
}
int
{
return (env->last_error);
}
void
{
int args_len;
/*
* Handle args argument of set-args.
*/
}
/*
* Kludge: For GP2, my-space comes from decode-unit hi.address.
* for PCI, my-space from decode-unit won't have the bus#, so we need
* to get it from config_address. Unfortunately, there is no easy
* way to figure out here which one we're looking at. We take the
* expediant of or'ing the two values together.
*/
while (--ncells) {
}
}
void
{
}
{
if (!phandle)
return (NULL);
}
void
{
if (ihandle) {
}
}
void
{
char *name;
if (ok) {
} else {
}
}
void
{
int len;
}
void
{
if (ok) {
} else {
}
}
void
{
}
static void (*find_method_hook)(fcode_env_t *);
void
{
}
void
{
fstack_t d;
if (find_method_hook) {
(*find_method_hook)(env);
if (TOS) /* Found it */
return;
}
if (acf) {
}
}
/*
* 'call-package' Fcode
*/
void
{
}
void
{
instance_t *i;
i = (instance_t *)TOS;
}
char *
{
char *name;
name = "<Unnamed>";
} else {
}
return (name);
}
static char *package_search_path = "/packages:/openprom";
device_t *
{
device_t *d;
char *name;
int len;
if (*path == '/') {
path++;
} else
d = env->current_device;
if (*path == '\0') {
return (d);
}
/* skip the '/' */
if (*path++ != '/')
break;
d = d->child;
} else {
d = d->peer;
}
}
return (NULL);
}
device_t *
{
device_t *d;
char *p, *next_p;
return (d);
/*
* ignore starting '/'
*/
if (*start == '/')
*start++;
*next_p++ = '\0';
return (d);
}
}
return (NULL);
}
void
{
char *path;
else
}
if (package)
}
static void
{
int hi, i;
for (i = 0; i < ncells; i++)
}
void
{
char *method;
old_myself = MYSELF;
if (old_myself && !myself) {
/* We hit the root of our tree */
return;
}
if (TOS) {
} else {
}
MYSELF = old_myself;
}
void
{
}
#ifdef DEBUG
void
{
}
char *
{
int n;
if (d->parent)
else
return (path);
}
static void
{
if (env->current_device)
else
}
void
{
if (env->current_device) {
} else {
}
}
void
{
device_t *d;
return;
}
while (d) {
char *name;
d = d->peer;
}
}
void
{
char *str;
device_t *p;
return;
}
return;
}
else {
p = NULL;
while (n) {
char *name;
p = n;
break;
}
n = n->peer;
}
}
if (p) {
activate_device(env, p);
} else {
}
}
void
{
}
void
{
}
void
{
if (TOS) {
} else {
}
}
void
{
if (env->current_device) {
}
}
void
{
}
void
{
char *method;
fstack_t d;
old_myself = MYSELF;
if (d) {
} else {
" not found\n", method);
}
MYSELF = old_myself;
}
void
{
int i;
for (i = 0; i < MAX_MY_ADDR; i++)
}
}
void
{
int i;
for (i = 0; i < MAX_MY_ADDR; i++)
}
}
}
}
}
#endif
#ifdef CONVERT_HANDLES
static device_t *
{
return ((device_t *)d);
}
static fstack_t
{
return ((fstack_t)d);
}
static void
{
}
#endif
static void
_init(void)
{
char *name = "/";
device_t *d;
#ifdef CONVERT_HANDLES
#endif
/* build the root node */
env->current_device = d;
/* Fcode 0x103 "my-space" is created using create_internal_value */
/* Fcode 0x203 "my-self" is created using create_internal_value */
}