/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1996-1998 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stddef.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <sys/openpromio.h>
#include "mema_prom.h"
#include <config_admin.h>
/*
* PROM access routines to get and set disabled lists
*/
/*
* 128 is the size of the largest (currently) property name
* 8192 - MAXPROPSIZE - sizeof (int) is the size of the largest
* (currently) property value, viz. nvramrc.
* the sizeof(u_int) is from struct openpromio
*/
typedef union {
} Oppbuf;
int
{
int prom_fd;
int ret;
if (prom_fd == -1) {
return (0);
}
return (ret);
}
int
{
int prom_fd;
int ret;
if (prom_fd == -1) {
return (0);
}
return (ret);
}
static int
int bd,
int prom_fd,
char *var,
{
int ret;
ret = 0;
} else
if (opp->oprom_size == 0) {
/* Not a failure - just not set to anything */
ret = 1;
} else {
char *cp;
int board;
ret = 1;
switch (*cp) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
break;
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
break;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
break;
default:
/* Ignore bad characters. */
/* TODO: maybe should set ret to 0? */
board = -1;
break;
}
}
}
return (ret);
}
static int
int bd,
int prom_fd,
char *var,
{
int ret;
char *cp;
/* Setup output buffer. */
/*
* First read the existing list, filtering out 'bd' if 'bit'
* not set.
*/
in_opp->oprom_size != 0) {
char *icp;
int board;
switch (*icp) {
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9':
break;
case 'a': case 'b': case 'c':
case 'd': case 'e': case 'f':
break;
case 'A': case 'B': case 'C':
case 'D': case 'E': case 'F':
break;
default:
/* Ignore bad characters. */
continue;
}
/* If enabling this board ... */
continue;
opp->oprom_size++;
}
}
opp->oprom_size++;
}
ret = 0;
} else {
ret = 1;
}
return (ret);
}
/*
* The PROM only has board-level disable of memory. If two banks are present
* on the board, both are either enabled or disabled at boot.
* The caller of this routine must set the PROM_MEMORY_PRESENT bits
* before calling this function.
*/
/*ARGSUSED*/
int
{
#ifdef XXX
int board;
return (0);
}
}
#endif
return (1);
}