Lines Matching defs:mmp
122 static int idn_mainmbox_flush(int domid, idn_mainmbox_t *mmp);
6383 idn_mainmbox_t *mmp;
6646 mmp = dp->dmbox.m_send;
6649 mutex_enter(&mmp[c].mm_mutex);
6650 mmp[c].mm_smr_mboxp = mbtp;
6651 mutex_exit(&mmp[c].mm_mutex);
6688 mmp = dp->dmbox.m_send;
6691 mutex_enter(&mmp[c].mm_mutex);
6692 mmp[c].mm_smr_mboxp = mbtp;
6693 mutex_exit(&mmp[c].mm_mutex);
7521 idn_mainmbox_t *mmp;
7549 mmp = dp->dmbox.m_recv;
7552 mutex_enter(&mmp[c].mm_mutex);
7553 ASSERT(!mmp[c].mm_smr_mboxp);
7555 mmp[c].mm_smr_mboxp = mtp;
7570 mutex_exit(&mmp[c].mm_mutex);
7589 mutex_exit(&mmp[c].mm_mutex);
7593 mmp[c].mm_smr_activep = (ushort_t *)IDN_OFFSET2ADDR(activeptr);
7594 mmp[c].mm_smr_readyp = (ushort_t *)IDN_OFFSET2ADDR(readyptr);
7595 mutex_exit(&mmp[c].mm_mutex);
7608 mmp = dp->dmbox.m_send;
7609 for (c = 0; c < IDN_MAX_NETS; mmp++, c++) {
7610 mutex_enter(&mmp->mm_mutex);
7611 if ((mtp = mmp->mm_smr_mboxp) == NULL) {
7612 mutex_exit(&mmp->mm_mutex);
7632 mutex_exit(&mmp->mm_mutex);
7651 mutex_exit(&mmp->mm_mutex);
7655 mmp->mm_smr_activep = (ushort_t *)IDN_OFFSET2ADDR(activeptr);
7656 mmp->mm_smr_readyp = (ushort_t *)IDN_OFFSET2ADDR(readyptr);
7658 mutex_exit(&mmp->mm_mutex);
10022 idn_mainmbox_t *mmp;
10035 mmp = &cmp[c];
10036 mmp->mm_channel = (short)c;
10037 mutex_init(&mmp->mm_mutex, NULL, MUTEX_DRIVER, NULL);
10038 mmp->mm_domid = (short)domid;
10039 mmp->mm_type = mbx;
10041 mmp = cmp;
10043 * The actual SMR mailbox (mmp->mm_smr_mboxp) gets setup
10047 return (mmp);
10053 idn_mainmbox_t *mmp;
10063 mmp = &cmp[c];
10065 mmp->mm_channel = (short)c;
10066 mmp->mm_domid = (short)domid;
10067 mmp->mm_count = 0;
10068 mmp->mm_flags = 0;
10069 mmp->mm_qiget = mmp->mm_qiput = 0;
10070 mmp->mm_csp = NULL;
10071 ASSERT(mmp->mm_type == cmp->mm_type);
10076 idn_mainmbox_deinit(int domid, idn_mainmbox_t *mmp)
10083 proc, IDNMBOX_IS_RECV(mmp->mm_type) ? "RECV" : "SEND", domid);
10087 FREESTRUCT(mmp, idn_mainmbox_t, IDN_MAX_NETS);
10284 idn_mainmbox_flush(int domid, idn_mainmbox_t *mmp)
10297 if (mmp == NULL)
10302 mbox_type = mmp->mm_type;
10318 if (mmp[c].mm_smr_mboxp == NULL)
10320 mutex_enter(&mmp[c].mm_mutex);
10321 ASSERT(mmp[c].mm_type == mbox_type);
10327 if (mmp[c].mm_smr_mboxp) {
10331 lost_io = IDN_MMBOXINDEX_DIFF(mmp[c].mm_qiput,
10332 mmp[c].mm_qiget);
10346 mmp[c].mm_qiput = mmp[c].mm_qiget = 0;
10347 mmp[c].mm_smr_mboxp = NULL;
10350 if (mmp[c].mm_smr_mboxp) {
10352 IDN_CKSUM_MBOX(&mmp[c].mm_smr_mboxp->mt_header);
10353 if (!VALID_NWRADDR(mmp[c].mm_smr_mboxp, 4) ||
10354 !VALID_MBOXHDR(&mmp[c].mm_smr_mboxp->mt_header,
10356 lost_io = IDN_MMBOXINDEX_DIFF(mmp[c].mm_qiput,
10357 mmp[c].mm_qiget);
10370 mmp[c].mm_smr_mboxp = NULL;
10371 mmp[c].mm_qiput = mmp[c].mm_qiget = 0;
10375 if (mmp[c].mm_smr_mboxp == NULL) {
10376 mutex_exit(&mmp[c].mm_mutex);
10379 mqp = &mmp[c].mm_smr_mboxp->mt_queue[0];
10396 lost_io = IDN_MMBOXINDEX_DIFF(mmp[c].mm_qiput, mmp[c].mm_qiget);
10399 mmp[c].mm_qiput = mmp[c].mm_qiget = 0;
10400 mmp[c].mm_smr_mboxp = NULL;
10401 mutex_exit(&mmp[c].mm_mutex);
10567 #define CHANSVR_SYNC_CACHE(csp, mmp, chan) \
10576 (mmp)[_d] = \
10579 (mmp)[_d] = NULL; \
10603 idn_mainmbox_t **mmp;
10605 idn_mainmbox_t *mmp[MAX_DOMAINS];
10620 mmp = &Mmp[(*cspp)->ch_id][0];
10621 bzero(mmp, MAX_DOMAINS * sizeof (idn_mainmbox_t *));
10623 bzero(mmp, sizeof (mmp));
10677 CHANSVR_SYNC_CACHE(csp, mmp, channel);
10743 ASSERT(mmp[domid] != NULL);
10745 mutex_enter(&mmp[domid]->mm_mutex);
10746 if ((smr_mboxp = mmp[domid]->mm_smr_mboxp) == NULL) {
10751 mutex_exit(&mmp[domid]->mm_mutex);
10754 ASSERT(mmp[domid]->mm_channel == (short)channel);
10771 qi = mmp[domid]->mm_qiget;
10780 if (!(mmp[domid]->mm_flags & IDNMMBOX_FLAG_CORRUPTED)) {
10785 mmp[domid]->mm_flags |= IDNMMBOX_FLAG_CORRUPTED;
10788 mutex_exit(&mmp[domid]->mm_mutex);
10791 mutex_exit(&mmp[domid]->mm_mutex);
10824 mutex_enter(&mmp[domid]->mm_mutex);
10825 if (!(mmp[domid]->mm_flags &
10832 mmp[domid]->mm_flags |=
10835 mutex_exit(&mmp[domid]->mm_mutex);
10845 mutex_enter(&mmp[domid]->mm_mutex);
10846 if (mmp[domid]->mm_smr_mboxp) {
10848 mmp[domid]->mm_dropped += dropcount;
10849 mmp[domid]->mm_qiget = qi;
10850 mmp[domid]->mm_count += pktcount;
10852 mutex_exit(&mmp[domid]->mm_mutex);
10990 CHANSVR_SYNC_CACHE(csp, mmp, channel);
11469 idn_mainmbox_t *mmp;
11479 mmp = idn_domain[domid].dmbox.m_send;
11480 if (mmp == NULL) {
11486 mmp += channel;
11487 mutex_enter(&mmp->mm_mutex);
11489 if (mmp->mm_smr_mboxp == NULL) {
11496 mbox_csum = IDN_CKSUM_MBOX(&mmp->mm_smr_mboxp->mt_header);
11497 if (mbox_csum != mmp->mm_smr_mboxp->mt_header.mh_cksum) {
11501 mmp->mm_smr_mboxp->mt_header.mh_cksum);
11502 if ((mmp->mm_flags & IDNMMBOX_FLAG_CORRUPTED) == 0) {
11507 mmp->mm_flags |= IDNMMBOX_FLAG_CORRUPTED;
11521 mqp = &mmp->mm_smr_mboxp->mt_queue[0];
11522 qi = mmp->mm_qiput;
11526 proc, mmp->mm_qiput, mmp->mm_qiget);
11580 if (*mmp->mm_smr_readyp == 0) {
11581 mmp->mm_qiput = qi;
11594 mmp->mm_qiput = qi;
11596 mmp->mm_count++;
11598 if ((*mmp->mm_smr_readyp) && !(*mmp->mm_smr_activep)) {
11606 mutex_exit(&mmp->mm_mutex);
11615 mmp->mm_dropped++;
11617 mutex_exit(&mmp->mm_mutex);
11729 idn_mainmbox_t *mmp;
11773 mmp = &dp->dmbox.m_send[mi];
11775 ASSERT(mmp);
11776 if (mutex_tryenter(&mmp->mm_mutex) == 0) {
11784 if (mmp->mm_smr_mboxp == NULL) {
11786 proc, domid, (int)mmp->mm_channel);
11787 ASSERT(mmp->mm_qiget == mmp->mm_qiput);
11788 mutex_exit(&mmp->mm_mutex);
11792 mbox_csum = IDN_CKSUM_MBOX(&mmp->mm_smr_mboxp->mt_header);
11793 if (mbox_csum != mmp->mm_smr_mboxp->mt_header.mh_cksum) {
11796 proc, domid, (int)mmp->mm_channel, mbox_csum,
11797 mmp->mm_smr_mboxp->mt_header.mh_cksum);
11800 mutex_exit(&mmp->mm_mutex);
11804 mqp = &mmp->mm_smr_mboxp->mt_queue[0];
11805 qi = mmp->mm_qiget;
11845 if (!(mmp->mm_flags &
11853 mmp->mm_flags |=
11877 if (qi == mmp->mm_qiget)
11880 mmp->mm_qiget = qi;
11882 mutex_exit(&mmp->mm_mutex);
11956 idn_mainmbox_t *mmp;
12007 if ((mmp = dp->dmbox.m_recv) == NULL) {
12028 mmp += min_chan;
12029 for (c = min_chan; c <= max_chan; mmp++, c++) {
12073 if (mutex_tryenter(&mmp->mm_mutex) == 0) {
12078 if (mmp->mm_csp != csp) {
12082 mutex_exit(&mmp->mm_mutex);
12087 if (mmp->mm_smr_mboxp == NULL) {
12091 mutex_exit(&mmp->mm_mutex);
12095 mutex_exit(&mmp->mm_mutex);