0658 nwnss: fix CSA userspace message carrier casts
This commit is contained in:
@@ -36,6 +36,10 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef MARS_NWE_NWNSS_USERSPACE
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include <omni.h>
|
||||
#include <latch.h>
|
||||
#include <msgGen.h>
|
||||
@@ -54,6 +58,14 @@
|
||||
#include "csaLease.h"
|
||||
#include "xMsg.h"
|
||||
|
||||
#ifdef MARS_NWE_NWNSS_USERSPACE
|
||||
/* cSA userspace status bridge: Msg_s.sys.where is a QUAD carrier here. */
|
||||
#undef SetErrnoFromStatus
|
||||
#define SetErrnoFromStatus(_genMsg, _msg) \
|
||||
((_genMsg)->errStatus = (_msg)->sys.status, \
|
||||
((_genMsg)->errStatusSetter = (char *)(uintptr_t)((_msg)->sys.where)))
|
||||
#endif
|
||||
|
||||
NINT XLSSArrayIndex;
|
||||
#if NSS_DEBUG IS_ENABLED
|
||||
/* Our xMsg_s must not be bigger than a Msg_s */
|
||||
@@ -184,9 +196,12 @@ void CSA_VOL_GetBeastFromVolumeMsg(
|
||||
csaPacket->CGBM_beastLeaseID = beastLeaseID;
|
||||
csaPacket->CGBM_dataSeqNum = zlssBeast->csaBeast->CB_dataSeqNum;
|
||||
|
||||
NINT xlssPackedSize = (NINT)msg->sys.data[0].length;
|
||||
|
||||
status = CSA_VOL_GetBeastFromVolume(&genMsg, zlssBeast,
|
||||
msg->sys.data[0].start,
|
||||
&msg->sys.data[0].length);
|
||||
(void *)(uintptr_t)msg->sys.data[0].start,
|
||||
&xlssPackedSize);
|
||||
msg->sys.data[0].length = (QUAD)xlssPackedSize;
|
||||
if (status != zOK)
|
||||
{
|
||||
CSA_BeastLeaseToss( &genMsg, (CsaVolumeDoor_s *)msg->sys.door,
|
||||
@@ -247,10 +262,11 @@ void CSA_VOL_LookupByNameInDirectoryMsg(
|
||||
csaPacket->CLBM_zid = CSA_VOL_LookupByNameInDirectory(&genMsg,
|
||||
(File_s *)directory, nameSpace,
|
||||
xlssPacket->XLBM_nameType,
|
||||
(unicode_t *)msg->sys.data[0].start, /* name */
|
||||
(unicode_t *)(uintptr_t)msg->sys.data[0].start, /* name */
|
||||
// cnt xlssPacket->XLBM_nameUniquifier,
|
||||
// cnt &nameUniquifier,
|
||||
(msg->sys.numDataAreas == 2 ? msg->sys.data[1].start : NULL));
|
||||
(msg->sys.numDataAreas == 2 ?
|
||||
(void *)(uintptr_t)msg->sys.data[1].start : NULL));
|
||||
|
||||
// cnt csaPacket->CLBM_nameUniquifier = nameUniquifier;
|
||||
|
||||
@@ -381,7 +397,8 @@ void CSA_VOL_GetFileBlkMsg(
|
||||
csaPacket->CGFM_volBlk = buffer->volBlk;
|
||||
zASSERT(msg->sys.data[0].length == PAGE_SIZE);
|
||||
mapBufferPage(buffer);
|
||||
memcpy(msg->sys.data[0].start, buffer->pBuf.data, msg->sys.data[0].length);
|
||||
memcpy((void *)(uintptr_t)msg->sys.data[0].start,
|
||||
buffer->pBuf.data, msg->sys.data[0].length);
|
||||
unmapBufferPage(buffer);
|
||||
|
||||
CACHE_RELEASE(buffer);
|
||||
@@ -461,7 +478,8 @@ void CSA_VOL_AsyncReadFileBlkMsg(
|
||||
csaPacket->CARM_volBlk = buffer->volBlk;
|
||||
zASSERT(msg->sys.data[0].length == PAGE_SIZE);
|
||||
mapBufferPage(buffer);
|
||||
memcpy(msg->sys.data[0].start, buffer->pBuf.data, msg->sys.data[0].length);
|
||||
memcpy((void *)(uintptr_t)msg->sys.data[0].start,
|
||||
buffer->pBuf.data, msg->sys.data[0].length);
|
||||
unmapBufferPage(buffer);
|
||||
|
||||
CACHE_RELEASE(buffer);
|
||||
@@ -511,7 +529,7 @@ void CSA_VOL_GetExtentListMsg(
|
||||
status = CSA_VOL_GetExtentList(&genMsg, beast,
|
||||
xlssPacket->XGEM_startingBlk,
|
||||
msg->sys.data[0].length / sizeof(Blknum_t),
|
||||
(Blknum_t *)msg->sys.data[0].start,
|
||||
(Blknum_t *)(uintptr_t)msg->sys.data[0].start,
|
||||
&retNumExtents,
|
||||
&csaPacket->CGEM_retNextBlock);
|
||||
|
||||
@@ -594,8 +612,8 @@ void CSA_VOL_GetPhysicalExtentMsg(
|
||||
}
|
||||
|
||||
zMsg.sys.status = zOK;
|
||||
zMsg.sys.owner = NULL;
|
||||
zMsg.sys.door = NULL;
|
||||
zMsg.sys.owner = 0;
|
||||
zMsg.sys.door = 0;
|
||||
zMsg.sys.numDataAreas = 1;
|
||||
zMsg.sys.data[MAP_DATA].start = xMsg->sys.data[MAP_DATA].start;
|
||||
zMsg.sys.data[MAP_DATA].length = xMsg->sys.data[MAP_DATA].length;
|
||||
@@ -666,12 +684,12 @@ void CSA_VOL_DioReadUnitsMsg(
|
||||
}
|
||||
|
||||
msg.sys.status = zOK;
|
||||
msg.sys.owner = NULL;
|
||||
msg.sys.door = NULL;
|
||||
msg.sys.owner = 0;
|
||||
msg.sys.door = 0;
|
||||
msg.sys.numDataAreas = 1;
|
||||
// msg.sys.data[DIO_DATA].start = csaPacket->CDRM_retData;
|
||||
msg.sys.data[DIO_DATA].length = xlssPacket->XDRM_length;
|
||||
msg.sys.callback = NULL;
|
||||
msg.sys.callback = 0;
|
||||
msg.body.id.sa = xlssPacket->XDRM_saID;
|
||||
msg.body.dio.unitOffset = xlssPacket->XDRM_startSector;
|
||||
|
||||
@@ -787,10 +805,11 @@ void CSA_VOL_WildcardLookupMsg(
|
||||
csaPacket->CWLM_zid = CSA_VOL_WildcardLookup(&genMsg,
|
||||
(File_s *)directory, nameSpace,
|
||||
xlssPacket->XWLM_nameType,
|
||||
(unicode_t *)msg->sys.data[0].start, /* pattern */
|
||||
(unicode_t *)(uintptr_t)msg->sys.data[0].start, /* pattern */
|
||||
smap,
|
||||
// cnt &retNameUniquifier,
|
||||
(msg->sys.numDataAreas == 2 ? msg->sys.data[1].start : NULL));
|
||||
(msg->sys.numDataAreas == 2 ?
|
||||
(void *)(uintptr_t)msg->sys.data[1].start : NULL));
|
||||
|
||||
if (csaPacket->CWLM_zid == zINVALID_ZID)
|
||||
{
|
||||
@@ -894,7 +913,7 @@ void CSA_SearchMapCleanupMsg(
|
||||
SMapCleanupWork.SMCW_workScheduled = TRUE;
|
||||
FSMLITE_INIT(&SMapCleanupWork.SMCW_fsm, MSGNot("SmapCleanupWork"), 0);
|
||||
WORK_Schedule( &SMapCleanupWork.SMCW_fsm,
|
||||
CSA_SearchMapCleanupMsgWork, NULL);
|
||||
(voidfunc_t)CSA_SearchMapCleanupMsgWork, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -939,7 +958,7 @@ void CSA_SearchMapCleanupAll(
|
||||
SMapCleanupWork.SMCW_workScheduled = TRUE;
|
||||
FSMLITE_INIT(&SMapCleanupWork.SMCW_fsm, MSGNot("SmapCleanupWork"), 0);
|
||||
WORK_Schedule( &SMapCleanupWork.SMCW_fsm,
|
||||
CSA_SearchMapCleanupMsgWork, NULL);
|
||||
(voidfunc_t)CSA_SearchMapCleanupMsgWork, 0);
|
||||
}
|
||||
PERIODIC_YIELD();
|
||||
}
|
||||
@@ -1158,7 +1177,8 @@ void CSA_SendVolumeStatsCheck(
|
||||
sizeof(volInfo)) != 0)
|
||||
{
|
||||
COMN_USE_BEAST(&volume->VOLroot);
|
||||
WORK_Schedule(&csaVolInfo->CVI_fsm, CSA_SendVolumeStats, (ADDR)volume);
|
||||
WORK_Schedule(&csaVolInfo->CVI_fsm,
|
||||
(voidfunc_t)CSA_SendVolumeStats, (ADDR)volume);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user