Commit ffab9115 authored by claes's avatar claes

Added new parameter in qdb_Get function

parent 65b2eed3
/* /*
* Proview $Id: rt_qmon.c,v 1.7 2006-02-10 14:53:03 claes Exp $ * Proview $Id: rt_qmon.c,v 1.8 2006-02-14 05:28:09 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -761,7 +761,7 @@ export_thread () ...@@ -761,7 +761,7 @@ export_thread ()
while (qdb->g->up) { while (qdb->g->up) {
sched_yield(); sched_yield();
qdb_ScopeLock { qdb_ScopeLock {
bp = qdb_Get(&sts, qp, qcom_cTmoEternal, NULL, NO); bp = qdb_Get(&sts, qp, qcom_cTmoEternal, NULL, 0);
if (bp != NULL) if (bp != NULL)
bp = qdb_DetachBuffer(&sts, bp); bp = qdb_DetachBuffer(&sts, bp);
} qdb_ScopeUnlock; } qdb_ScopeUnlock;
......
/* /*
* Proview $Id: rt_cmvolc.c,v 1.9 2006-02-10 14:40:45 claes Exp $ * Proview $Id: rt_cmvolc.c,v 1.10 2006-02-14 05:27:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "rt_net.h" #include "rt_net.h"
#include "rt_cmvolc.h" #include "rt_cmvolc.h"
#include "rt_errh.h" #include "rt_errh.h"
#include "rt_qdb.h"
...@@ -229,7 +230,7 @@ cmvolc_GetCachedClass ( ...@@ -229,7 +230,7 @@ cmvolc_GetCachedClass (
smp->time = time; smp->time = time;
smp->aidx = nextIdx; smp->aidx = nextIdx;
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getCclassR, NO); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getCclassR, 0);
if (rmp == NULL || EVEN(rmp->sts)) if (rmp == NULL || EVEN(rmp->sts))
goto netError; goto netError;
...@@ -393,7 +394,7 @@ cmvolc_GetNonExistingClass ( ...@@ -393,7 +394,7 @@ cmvolc_GetNonExistingClass (
smp->cid = cid; smp->cid = cid;
smp->aidx = nextIdx; smp->aidx = nextIdx;
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getGclassR, YES); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getGclassR, qdb_mGet_multipleGet);
if (rmp == NULL || EVEN(rmp->sts)) if (rmp == NULL || EVEN(rmp->sts))
goto netError; goto netError;
......
/* /*
* Proview $Id: rt_cvolc.c,v 1.6 2006-02-10 14:40:45 claes Exp $ * Proview $Id: rt_cvolc.c,v 1.7 2006-02-14 05:27:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -75,7 +75,7 @@ fetch ( ...@@ -75,7 +75,7 @@ fetch (
gdb_Unlock; gdb_Unlock;
rsp = net_Request(&lsts, &tgt, put, &get, net_eMsg_objectR, NO); rsp = net_Request(&lsts, &tgt, put, &get, net_eMsg_objectR, 0);
gdb_Lock; gdb_Lock;
...@@ -146,7 +146,7 @@ cvolc_GetObjectInfo ( ...@@ -146,7 +146,7 @@ cvolc_GetObjectInfo (
tgt.qix = net_cProcHandler; tgt.qix = net_cProcHandler;
smp->aref = *rarp; smp->aref = *rarp;
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getObjectInfoR, NO); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getObjectInfoR, 0);
if (rmp == NULL) { if (rmp == NULL) {
return NULL; return NULL;
...@@ -240,7 +240,7 @@ cvolc_GetObjectInfo ( ...@@ -240,7 +240,7 @@ cvolc_GetObjectInfo (
tgt.qix = net_cProcHandler; tgt.qix = net_cProcHandler;
smp->aref = *arp; smp->aref = *arp;
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getObjectInfoR, NO); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getObjectInfoR, 0);
if (rmp == NULL) { if (rmp == NULL) {
return NULL; return NULL;
...@@ -441,7 +441,7 @@ cvolc_SetObjectInfo ( ...@@ -441,7 +441,7 @@ cvolc_SetObjectInfo (
} }
} }
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_setObjectInfoR, NO); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_setObjectInfoR, 0);
if (rmp == NULL) { if (rmp == NULL) {
return NO; return NO;
......
/* /*
* Proview $Id: rt_mh_appl.c,v 1.6 2006-02-10 14:40:45 claes Exp $ * Proview $Id: rt_mh_appl.c,v 1.7 2006-02-14 05:27:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB. * Copyright (C) 2005 SSAB Oxelösund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -361,7 +361,7 @@ sendAndReceive ( ...@@ -361,7 +361,7 @@ sendAndReceive (
get.data = NULL; get.data = NULL;
rvoid = qcom_Request(&sts, &lAppl.handler, &put, &lAppl.head.qid, &get, 1000*3600, NO); rvoid = qcom_Request(&sts, &lAppl.handler, &put, &lAppl.head.qid, &get, 1000*3600, 0);
if (EVEN(sts)) { if (EVEN(sts)) {
errh_Error("mhAppl, sendAndReceive, qcom_Get failed\n%m", sts); errh_Error("mhAppl, sendAndReceive, qcom_Get failed\n%m", sts);
qcom_Free(NULL, put.data); qcom_Free(NULL, put.data);
......
/* /*
* Proview $Id: rt_net.c,v 1.6 2006-02-10 14:40:45 claes Exp $ * Proview $Id: rt_net.c,v 1.7 2006-02-14 05:27:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -147,7 +147,7 @@ Request ( ...@@ -147,7 +147,7 @@ Request (
qcom_sPut *put, qcom_sPut *put,
qcom_sGet *get, qcom_sGet *get,
net_eMsg subtype, net_eMsg subtype,
pwr_tBoolean multipleReq pwr_tBitMask flags
); );
typedef bool_t (*tFuncXdr)(XDR*, void*); typedef bool_t (*tFuncXdr)(XDR*, void*);
...@@ -486,7 +486,7 @@ Request ( ...@@ -486,7 +486,7 @@ Request (
qcom_sPut *put, qcom_sPut *put,
qcom_sGet *get, qcom_sGet *get,
net_eMsg subtype, net_eMsg subtype,
pwr_tBoolean multipleReq pwr_tBitMask flags
) )
{ {
void *gmp; void *gmp;
...@@ -505,7 +505,7 @@ Request ( ...@@ -505,7 +505,7 @@ Request (
if (!ConvertPut(sts, tgt, put, put->data)) if (!ConvertPut(sts, tgt, put, put->data))
return NULL; return NULL;
gmp = qcom_Request(sts, tgt, put, &gdbroot->my_qid, get, net_cSendRcvTmo, multipleReq); gmp = qcom_Request(sts, tgt, put, &gdbroot->my_qid, get, net_cSendRcvTmo, flags);
if (gmp == NULL) if (gmp == NULL)
return NULL; return NULL;
...@@ -666,7 +666,7 @@ net_Request ( ...@@ -666,7 +666,7 @@ net_Request (
qcom_sPut *put, qcom_sPut *put,
qcom_sGet *get, qcom_sGet *get,
net_eMsg gtype, net_eMsg gtype,
pwr_tBoolean multipleReq pwr_tBitMask flags
) )
{ {
void *p; void *p;
...@@ -678,7 +678,7 @@ net_Request ( ...@@ -678,7 +678,7 @@ net_Request (
((net_sMessage *)put->data)->nid = gdbroot->db->nid; ((net_sMessage *)put->data)->nid = gdbroot->db->nid;
NET_LOCK; NET_LOCK;
p = Request(sts, tgt, put, get, gtype, multipleReq); p = Request(sts, tgt, put, get, gtype, flags);
NET_UNLOCK; NET_UNLOCK;
return p; return p;
......
#ifdef RPC_HDR #ifdef RPC_HDR
%/* %/*
% * Proview $Id: rt_net.x,v 1.8 2006-02-10 14:40:45 claes Exp $ % * Proview $Id: rt_net.x,v 1.9 2006-02-14 05:27:43 claes Exp $
% * Copyright (C) 2005 SSAB Oxelsund AB. % * Copyright (C) 2005 SSAB Oxelsund AB.
% * % *
% * This program is free software; you can redistribute it and/or % * This program is free software; you can redistribute it and/or
...@@ -1305,7 +1305,7 @@ struct net_sGetCclass { ...@@ -1305,7 +1305,7 @@ struct net_sGetCclass {
% qcom_sPut *put, % qcom_sPut *put,
% qcom_sGet *get, % qcom_sGet *get,
% net_eMsg gtype, % net_eMsg gtype,
% pwr_tBoolean multipleReq % pwr_tBitMask flags
%); %);
% %
%pwr_tBoolean %pwr_tBoolean
......
/* /*
* Proview $Id: rt_qcom.c,v 1.6 2006-02-10 14:40:45 claes Exp $ * Proview $Id: rt_qcom.c,v 1.7 2006-02-14 05:27:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -404,7 +404,7 @@ qcom_Get ( ...@@ -404,7 +404,7 @@ qcom_Get (
if (qp->aid.aix != qdb->my_aix) pwr_StatusBreak(*sts, QCOM__NOTOWNED); if (qp->aid.aix != qdb->my_aix) pwr_StatusBreak(*sts, QCOM__NOTOWNED);
if (qp->type != qdb_eQue_private) pwr_StatusBreak(*sts, QCOM__NOTOWNED); if (qp->type != qdb_eQue_private) pwr_StatusBreak(*sts, QCOM__NOTOWNED);
bp = qdb_Get(sts, qp, tmo, gp, NO); bp = qdb_Get(sts, qp, tmo, gp, 0);
if (bp != NULL) { if (bp != NULL) {
qdb->ap->get_count++; qdb->ap->get_count++;
...@@ -949,7 +949,7 @@ qcom_Request ( ...@@ -949,7 +949,7 @@ qcom_Request (
const qcom_sQid *gqid, const qcom_sQid *gqid,
qcom_sGet *gp, qcom_sGet *gp,
int tmo, int tmo,
pwr_tBoolean multipleReq pwr_tBitMask flags
) )
{ {
qdb_sBuffer *pbp; qdb_sBuffer *pbp;
...@@ -1009,7 +1009,7 @@ qcom_Request ( ...@@ -1009,7 +1009,7 @@ qcom_Request (
pbp->b.noderef = pool_Reference(sts, &qdb->pool, np); pbp->b.noderef = pool_Reference(sts, &qdb->pool, np);
} }
gbp = qdb_Request(sts, pbp, pqp, gqp, tmo, gp, multipleReq); gbp = qdb_Request(sts, pbp, pqp, gqp, tmo, gp, flags);
if (ODD(sts)) qdb->ap->request_count++; if (ODD(sts)) qdb->ap->request_count++;
} qdb_ScopeUnlock; } qdb_ScopeUnlock;
......
/* /*
* Proview $Id: rt_qcom.h,v 1.7 2006-02-10 14:40:45 claes Exp $ * Proview $Id: rt_qcom.h,v 1.8 2006-02-14 05:27:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -414,7 +414,7 @@ void* qcom_Request ( ...@@ -414,7 +414,7 @@ void* qcom_Request (
const qcom_sQid *myQ, const qcom_sQid *myQ,
qcom_sGet *get, qcom_sGet *get,
int tmo_ms, int tmo_ms,
pwr_tBoolean multipleReq pwr_tBitMask flags
); );
pwr_tBoolean qcom_Unbind ( pwr_tBoolean qcom_Unbind (
......
/* /*
* Proview $Id: rt_qdb.c,v 1.9 2006-02-10 14:40:45 claes Exp $ * Proview $Id: rt_qdb.c,v 1.10 2006-02-14 05:27:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -930,7 +930,7 @@ qdb_Get ( ...@@ -930,7 +930,7 @@ qdb_Get (
qdb_sQue *qp, qdb_sQue *qp,
int tmo, int tmo,
qcom_sGet *gp, qcom_sGet *gp,
pwr_tBoolean multipleGet pwr_tBitMask flags
) )
{ {
pwr_tStatus csts; pwr_tStatus csts;
...@@ -938,10 +938,13 @@ qdb_Get ( ...@@ -938,10 +938,13 @@ qdb_Get (
qdb_sBuffer *sbp; /* pointer to source buffer */ qdb_sBuffer *sbp; /* pointer to source buffer */
qdb_sBuffer *nbp; qdb_sBuffer *nbp;
pwr_dStatus (sts, status, QCOM__SUCCESS); pwr_dStatus (sts, status, QCOM__SUCCESS);
qdb_mGet lflags;
lflags.m = flags;
qdb_AssumeLocked; qdb_AssumeLocked;
if (!multipleGet && !pool_QisEmpty(sts, &qdb->pool, &qp->read_lh)) if (!lflags.b.multipleGet && !pool_QisEmpty(sts, &qdb->pool, &qp->read_lh))
pwr_Return(NULL, sts, QCOM__ALLOCQUOTA); pwr_Return(NULL, sts, QCOM__ALLOCQUOTA);
bp = qdb_Deque(sts, qp, tmo); bp = qdb_Deque(sts, qp, tmo);
...@@ -1163,7 +1166,7 @@ qdb_Request ( ...@@ -1163,7 +1166,7 @@ qdb_Request (
qdb_sQue *gqp, qdb_sQue *gqp,
int tmo, int tmo,
qcom_sGet *gp, qcom_sGet *gp,
pwr_tBoolean multipleReq pwr_tBitMask flags
) )
{ {
qdb_sBuffer *gbp = NULL; qdb_sBuffer *gbp = NULL;
...@@ -1193,7 +1196,7 @@ qdb_Request ( ...@@ -1193,7 +1196,7 @@ qdb_Request (
gqp->flags.b.reply = 1; gqp->flags.b.reply = 1;
if (!qdb_Enque(sts, pbp, pqp)) if (!qdb_Enque(sts, pbp, pqp))
return NULL; return NULL;
gbp = qdb_Get(sts, gqp, tmo, gp, multipleReq); gbp = qdb_Get(sts, gqp, tmo, gp, flags);
gqp->flags.b.reply = 0; gqp->flags.b.reply = 0;
if (!pbp->c.flags.b.remote) if (!pbp->c.flags.b.remote)
return gbp; return gbp;
......
/* /*
* Proview $Id: rt_qdb.h,v 1.7 2006-02-10 14:40:45 claes Exp $ * Proview $Id: rt_qdb.h,v 1.8 2006-02-14 05:27:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -212,6 +212,20 @@ typedef union { ...@@ -212,6 +212,20 @@ typedef union {
} qdb_mAdd; } qdb_mAdd;
typedef union {
pwr_tBitMask m;
pwr_32Bits (
pwr_Bits( multipleGet , 1),
pwr_Bits( fill , 31),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
) b;
#define qdb_mGet__ 0
#define qdb_mGet_multipleGet pwr_Bit(0)
#define qdb_mGet_ (~qdb_mGet__)
} qdb_mGet;
typedef union { typedef union {
pwr_tBitMask m; pwr_tBitMask m;
pwr_32Bits ( pwr_32Bits (
...@@ -753,7 +767,7 @@ void qdb_Eput (pwr_tStatus*, qdb_sQue*); ...@@ -753,7 +767,7 @@ void qdb_Eput (pwr_tStatus*, qdb_sQue*);
pwr_tBoolean qdb_Signal (pwr_tStatus*, qdb_sQue*); pwr_tBoolean qdb_Signal (pwr_tStatus*, qdb_sQue*);
int qdb_Wait (pwr_tStatus*, qdb_sQue*, qdb_sQue*, int); int qdb_Wait (pwr_tStatus*, qdb_sQue*, qdb_sQue*, int);
void qdb_Free (pwr_tStatus*, qdb_sBuffer*); void qdb_Free (pwr_tStatus*, qdb_sBuffer*);
qdb_sBuffer * qdb_Get (pwr_tStatus*, qdb_sQue*, int, qcom_sGet*, pwr_tBoolean multipleGet); qdb_sBuffer * qdb_Get (pwr_tStatus*, qdb_sQue*, int, qcom_sGet*, pwr_tBitMask);
qdb_sQbond * qdb_GetBond (pwr_tStatus*, qdb_sQue*, qdb_sQue*); qdb_sQbond * qdb_GetBond (pwr_tStatus*, qdb_sQue*, qdb_sQue*);
void qdb_GetInfo (qcom_sGet*, qdb_sBuffer*); void qdb_GetInfo (qcom_sGet*, qdb_sBuffer*);
qdb_sLocal * qdb_MapDb (pwr_tStatus*); qdb_sLocal * qdb_MapDb (pwr_tStatus*);
...@@ -765,7 +779,7 @@ void qdb_RemoveAppl (pwr_tStatus*, qdb_sAppl*); ...@@ -765,7 +779,7 @@ void qdb_RemoveAppl (pwr_tStatus*, qdb_sAppl*);
void qdb_PutInfo (qdb_sBuffer*, qcom_sPut *, const qcom_sQid*, qcom_tRid); void qdb_PutInfo (qdb_sBuffer*, qcom_sPut *, const qcom_sQid*, qcom_tRid);
pwr_tBoolean qdb_RemoveQue (pwr_tStatus*, qdb_sQue*); pwr_tBoolean qdb_RemoveQue (pwr_tStatus*, qdb_sQue*);
qdb_sQue * qdb_Que (pwr_tStatus*, const qcom_sQid*, qdb_sNode**); qdb_sQue * qdb_Que (pwr_tStatus*, const qcom_sQid*, qdb_sNode**);
void * qdb_Request (pwr_tStatus*, qdb_sBuffer*, qdb_sQue*, qdb_sQue*, int, qcom_sGet*, pwr_tBoolean); void * qdb_Request (pwr_tStatus*, qdb_sBuffer*, qdb_sQue*, qdb_sQue*, int, qcom_sGet*, pwr_tBitMask);
void qdb_DumpPool (); void qdb_DumpPool ();
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment