/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* code, kernel DR, and busra stuff.
*
* NOTE: We are only using the next-> link. The prev-> link is
* not used in the implementation.
*/
#include <sys/pci_impl.h>
extern int pci_boot_debug;
void
{
while (listp) {
dprintf("(0x%x%x, 0x%x%x)",
}
}
struct memlist *
{
KM_SLEEP));
}
void
{
}
void
{
while (next) {
}
*list = 0;
}
/* insert in the order of addresses */
void
{
/* find the location in list */
/*
* Drop if this entry already exists, in whole
* or in part
*/
/* next already contains this entire element; drop */
return;
}
/* Is this a "grow block size" request? */
break;
}
}
if (merge_left && merge_right) {
return;
}
if (merge_left) {
return;
}
if (merge_right) {
return;
}
entry = memlist_alloc();
if (prev == 0) {
} else {
}
}
/*
* Delete memlist entries, assuming list sorted by address
*/
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define IN_RANGE(a, b, e) ((a) >= (b) && (a) <= (e))
int
{
/* ignore removal of zero-length item */
if (size == 0)
return (0);
/* also inherently ignore a zero-length list */
while (chunk) {
/* spans entire chunk - delete chunk */
if (prev == 0)
else
/* skip to start of while-loop */
continue;
} else if (begin_in_chunk && end_in_chunk &&
/* split chunk */
new = memlist_alloc();
/* done - break out of while-loop */
break;
} else if (begin_in_chunk || end_in_chunk) {
/* trim chunk */
if (rem_begin <= chunk_begin) {
break;
}
/* fall-through to next chunk */
}
}
return (0);
}
/*
* find and claim a memory chunk of given size, first fit
*/
{
/* find the chunk with sufficient size */
while (next) {
if (delta != 0)
else
break;
}
if (next == 0)
return (0); /* Not found */
if (delta)
return (paddr);
}
/*
* find and claim a memory chunk of given size, starting
* at a specified address
*/
{
/* find the chunk starting at 'address' */
}
if (next == 0)
return (0); /* Not found */
if (delta != 0)
else
return (0); /* unsufficient size */
if (delta)
return (paddr);
}
/*
* Subsume memlist src into memlist dest
*/
void
{
while (head) {
}
*src = 0;
}
/*
* Merge memlist src into memlist dest; don't destroy src
*/
void
{
struct memlist *p;
p = *src;
while (p) {
p = p->ml_next;
}
}
/*
* Make a copy of memlist
*/
struct memlist *
{
while (listp) {
if (prev)
else
}
return (head);
}
int
{
int count = 0;
while (listp) {
count++;
}
return (count);
}