zulumod.h revision b0fc0e77220f1fa4c933fd58a4e1dedcd650b0f1
/*
* 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.
*/
#ifndef _ZULUMOD_H
#define _ZULUMOD_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/int_const.h>
#ifndef _ASM
#include <sys/zulu_hat.h>
#include <sys/sysmacros.h>
#define ZULUVM_VERSION_STR(a) #a
#define ZULUVM_VERSION(a) ZULUVM_VERSION_STR(a)
#define ZULUVM_MOD_VERSION \
#endif
#define ZULUVM_DATA0_IDX 0
#define ZULUVM_DATA1_IDX 1
#define ZULUVM_DATA2_IDX 2
#define ZULUVM_DATA3_IDX 3
#define ZULUVM_DATA4_IDX 4
#define ZULUVM_DATA5_IDX 5
#define ZULUVM_DATA6_IDX 6
#define ZULUVM_DATA7_IDX 7
#define ZULUVM_TLB_ADDR_IDX ZULUVM_DATA0_IDX
#define ZULUVM_TLB_TYPE_IDX ZULUVM_DATA1_IDX
#define ZULUVM_TLB_TTE_IDX ZULUVM_DATA2_IDX
#define ZULUVM_DATA_FLAGS (ZULUVM_DATA1_FLAG | \
#define ZULUVM_GET_TLB_TTE(devp) \
#define ZULUVM_GET_TLB_ADDR(devp) \
#define ZULUVM_MAX_DEV 2
#define ZULUVM_PIL PIL_2
#define ZULUVM_NUM_PGSZS 4
#define ZULUVM_STATE_IDLE 0
#define ZULUVM_STATE_STOPPED 1
#define ZULUVM_STATE_CANCELED 2
#define ZULUVM_STATE_TLB_PENDING 3
#define ZULUVM_STATE_INTR_QUEUED 4
#define ZULUVM_STATE_INTR_PENDING 5
#define ZULUVM_STATE_WRITE_TTE 6
#ifndef _ASM
typedef struct {
void *arg; /* arg for device calls */
struct zuluvm_proc *proc1;
struct zuluvm_proc *proc2;
short dmv_intr; /* dmv interrupt handle */
#ifdef ZULUVM_STATS
int cancel;
int tlb_miss[ZULUVM_NUM_PGSZS];
int pagefault;
int no_mapping;
int preload;
int migrate;
int pagesize;
int itlb1miss;
int dtlb1miss;
int itlb2miss;
int dtlb2miss;
int demap_page;
int demap_ctx;
#endif
int pfncnt;
#ifdef ZULUVM_STATS
#else
#define ZULUVM_STATS_PAGEFAULT(devp)
#define ZULUVM_STATS_NOMAP(devp)
#define ZULUVM_STATS_PRELOAD(devp)
#define ZULUVM_STATS_MIGRATE(devp)
#define ZULUVM_STATS_PAGEZISE(devp)
#define ZULUVM_STATS_CANCEL(devp)
#define ZULUVM_STATS_DEMAP_PAGE(devp)
#define ZULUVM_STATS_DEMAP_CTX(devp)
#endif
#define ZULUVM_MAX_INTR 32
typedef struct {
short offset;
short ino;
/*
* This structure contains per device data.
* It is protected by dev_lck.
*/
typedef struct {
int intr_flags;
int in_intr;
int parking;
int agentid; /* zulu's agent id */
#define ZULUVM_INTR2ZDEV(addr) \
sizeof (zuluvm_intr_t)) - ZULUVM_INTR_OFFSET)
typedef struct zuluvm_proc {
unsigned short refcnt; /* keep this until ref == 0 */
short valid; /* if valid is 0 then don't use */
struct zuluvm_proc *next;
struct zuluvm_proc *prev;
void zuluvm_demap_ctx(void *, short);
void zuluvm_dmv_tlbmiss_tl1(void);
#endif
/*
* The following defines are copied from the ZFB and ZULU
* workspaces. We re-define them here since we can't have
* a dependency onto files outside our consolidation
*/
#define ZULUVM_ZFB_MMU_TLB_D_V_MASK 0x8000000000000000
#define ZULUVM_ZFB_MMU_TLB_D_C_MASK 0x20
#define ZULUVM_ZFB_MMU_TLB_D_SZ_MASK 0x6000000000000000
#define ZULUVM_ZFB_MMU_TLB_D_W_MASK 0x2
#define ZULUVM_ZFB_MMU_TLB_CR_IMISS_MASK 0x2
#define ZULUVM_ZFB_MMU_TLB_CR_DMISS_MASK 0x1
#define ZULUVM_ZFB_MMU_DTLB_PAGE_SZ_2_SHIFT 2
#define ZULUVM_DTLB_PAGE_SZ 0x8
#define ZULUVM_ITLB_DATA_IN 0x18
#define ZULUVM_DTLB_DATA_IN 0x28
#define ZULUVM_TLB_CONTROL 0
#define ZULUVM_ITLB_MISS_ICR 0x0
#define ZULUVM_DTLB_MISS_ICR 0x8
#define ZULUVM_DMA1_TSB_BASE 0x50
#define ZULUVM_DMA2_TSB_BASE 0x68
#ifdef __cplusplus
}
#endif
#endif /* _ZULUMOD_H */