/*
* 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 1990-2002 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/starfire.h>
/*
* Interrupt target translation data for
* Starfire's Port controller asics
*/
struct pc_ittrans_data {
};
/*
* Setup and initialize the soft table that
* represent the Starfire interrupt target translation
* registers in the Port controller asics. There is one
*/
void
{
int i;
/*
* Allocate the data structure to support starfire's
* interrupt target translations
*/
tmpptr = (struct pc_ittrans_data *)
kmem_zalloc(sizeof (struct pc_ittrans_data),
KM_SLEEP);
/* Initialize the ittrans lock */
/*
* Construct the base physical address of the
* ITTR registers associated with this PC asics
*/
/*
* Initialize the ITTR table
* This soft table is used to represent the interrupt
* target translation hardware registers in the Starfire's
* PC asics. There are 32 slots and each slot consists of
* a mondovec regaddr entry and the physical address of
* the that ITT register. A empty slot is one whose
* particular intr mapping reg, we simply find
* a empty slot and write in the mondovec mapping
* regaddr into the mondovec field.
*/
for (i = 0; i < 32; i++) {
}
}
void
{
}
/*
* This routine searches for a slot in the soft ITTR table
* that was reserved earlier by matching the mondovec
* mapping regaddr argument with the corresponding field in
* the table. Note that the soft ITTR table mirrors the
* corresponding hw table in the starfire port controller(PC)
* asics. A new slot will be obtained if the slot cannot
* be found. (not reserved previously). The routine then programs
* in the target cpu id into the PC ITTR hardware, updates the
* soft table and return the index to this slot as the target
* id cookie.
*/
int
volatile uint64_t *mondovec_addr)
{
int i;
/*
* Search the mondovec addrlist to see if we
* mondovec mapping regaddr.
*/
for (i = 0; i < 32; i++) {
/*
* found the slot that matches the
* mondo vec in question
*/
foundslot = i;
break;
}
/* keep track of a empty slot */
foundslot = i;
}
if (foundslot != -1) {
/* We found a slot for this mondo vec, let's use it */
} else {
}
return (foundslot);
}
/*
* This routine searches the interrupt target translation table
* matching the mondovec_addr input argument with the mondovec
* field in the table. The routine then free the found slot by
* resetting it to zero.
*/
void
volatile uint64_t *mondovec_addr)
{
int i;
/*
* slot associated with this particular mondo vector.
*/
for (i = 0; i < 32; i++) {
/*
* found the slot that matches the
* mondo vec in question
*/
foundslot = i;
break;
}
}
if (foundslot != -1) {
/* We found a slot for this mondo vec, clear it */
}
}
int
{
register int i;
/*
* First write with Presence bit disabled
* and then with it enabled.
*/
for (i = 0; i < 20; i++) {
break;
}
"pc_madr_add: (1) failed to update "
"PC MADR (%d, %d, %d, 0x%x)\n",
return (-1);
}
/*
* Caller wanted to write value out there
* with presence bit turned off, which is
* what we just completed. So, we're finished.
*/
return (0);
}
/*
* Now write with Presence bit enabled.
*/
for (i = 0; i < 20; i++) {
break;
}
"pc_madr_add: (2) failed to update "
"PC MADR (%d, %d, %d, 0x%x)\n",
return (-1);
}
return (0);
}