lpad.c revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f
/*
* 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 <sys/machsystm.h>
#include <sys/machparam.h>
#include <sys/hypervisor_api.h>
typedef struct {
} lpad_t;
/*
* A global pool of landing pad memory. Currently, CPUs are only
* brought into the system one at a time, so the pool is only a
* single landing pad. In the future, it may be desirable to bring
* CPUs into the systems in parallel. At that time, the size of
* the pool can be increased by changing the pool size constant.
*/
#define LPAD_POOL_SIZE 1
#ifdef DEBUG
static int lpad_dbg = 0;
#define LPAD_DUMP_DATA lpad_dump_data
#else /* DEBUG */
#define LPAD_DUMP_DATA
#endif /* DEBUG */
extern void mach_cpu_startup_end(void);
extern int promif_in_cif(void);
static lpad_t *lpad_alloc(void);
uint64_t *
{
/* external parameters */
extern caddr_t mmu_fault_status_area;
LPAD_DBG("lpad_setup...\n");
}
/* allocate our landing pad */
}
/* calculate the size of our text */
/* copy over text section */
/*
* List of mappings:
*
* - permanent data mapping for kernel data
* - non-permanent inst mapping for kernel data,
* required for landing pad text
*/
/* verify the lpad has enough room for the data */
datasz = sizeof (lpad_data_t);
/*
* Kernel Text Mapping
*/
lpm++;
/*
* Kernel Data Mapping
*/
lpm++;
/*
* Landing Pad Text Mapping
*
* Because this mapping should not be permanent,
* the permanent mapping above cannot be used.
*/
lpm++;
}
static lpad_t *
lpad_alloc(void)
{
int idx;
/*
* No locking is required for the global lpad pool since
* it should only be accessed while in the CIF which is
* single threaded. If this assumption changes, locking
* would be required.
*/
ASSERT(promif_in_cif());
/*
* Wait until an lpad buffer becomes available.
*/
for (;;) {
LPAD_DBG("checking lpad pool:\n");
/* walk the lpad buffer array */
/* mark the buffer as busy */
}
}
}
}
#ifdef DEBUG
static void
{
if (lpad_dbg == 0)
return;
printf("lpad data:\n");
}
}
#endif /* DEBUG */