diff --git a/src/rm_services.c b/src/rm_services.c
index edfdd5a8e7b686bf479c44184fa0980dbfbe63f2..6d413246b2b2fb29f45f8993439bff3057462cd3 100644 (file)
--- a/src/rm_services.c
+++ b/src/rm_services.c
{
Rm_Inst *rmInst = (Rm_Inst *)rmHandle;
Rm_Transaction *transaction;
- void *key;
-
- /* Prevent another component using the same instance from wiping out the current
- * service request */
- key = Rm_osalCsEnter();
/* Make sure serviceType is valid and that a callback function has been provided */
if ((serviceRequest->type < Rm_service_FIRST) ||
(serviceRequest->type > Rm_service_LAST))
{
serviceResponse->serviceState = RM_SERVICE_ERROR_INVALID_SERVICE_TYPE;
- Rm_osalCsExit(key);
return;
}
else if (serviceRequest->callback.serviceCallback == NULL)
* through the callback function provided by the component. Return an error
* if the component does not provide a callback function. */
serviceResponse->serviceState = RM_SERVICE_ERROR_CALLBACK_NOT_PROVIDED;
- Rm_osalCsExit(key);
return;
}
transaction->state = RM_SERVICE_PROCESSING;
strcpy(&(transaction->resourceInfo.name)[0], serviceRequest->resourceName);
transaction->resourceInfo.base = serviceRequest->resourceBase;
- transaction->resourceInfo.range = serviceRequest->resourceRange;
+ transaction->resourceInfo.length = serviceRequest->resourceLength;
transaction->resourceInfo.alignment = serviceRequest->resourceAlignment;
strcpy(&(transaction->resourceInfo.nsName)[0], serviceRequest->resourceNsName);
* via the provided callback function */
serviceResponse->serviceId = transaction->localId;
}
- else if (serviceResponse->serviceState == RM_SERVICE_APPROVED)
+ else if (serviceResponse->serviceState == RM_SERVICE_APPROVED_AND_COMPLETED)
{
/* Service was approved and service was an allocate request the resource
* data is passed back to the component */
(transaction->type == Rm_service_RESOURCE_ALLOCATE_BY_NAME))
{
serviceResponse->resourceBase = transaction->resourceInfo.base;
- serviceResponse->resourceRange = transaction->resourceInfo.range;
+ serviceResponse->resourceLength = transaction->resourceInfo.length;
}
/* Delete the transaction since a response was received immediately */
- Rm_transactionQueueDelete(rmInst, transaction->id);
+ Rm_transactionQueueDelete(rmInst, transaction->localId);
}
else if ((serviceResponse->serviceState >= RM_SERVICE_DENIED_BEGIN) &&
(serviceResponse->serviceState <= RM_SERVICE_DENIED_END))
/* The serviceState field will contain information regarding why the
* service was denied. Just delete the transaction since a response was
* received immediately */
- Rm_transactionQueueDelete(rmInst, transaction->id);
+ Rm_transactionQueueDelete(rmInst, transaction->localId);
}
}
- Rm_osalCsExit(key);
return;
}
/* Service was approved and service was an allocate request. The resource
* data is passed back to the component */
- if ((serviceResponse.serviceState == RM_SERVICE_APPROVED) &&
+ if ((serviceResponse.serviceState == RM_SERVICE_APPROVED_AND_COMPLETED) &&
((transaction->type == Rm_service_RESOURCE_ALLOCATE) ||
(transaction->type == Rm_service_RESOURCE_BLOCK_ALLOCATE) ||
(transaction->type == Rm_service_RESOURCE_ALLOCATE_BY_NAME)))
{
serviceResponse.resourceBase = transaction->resourceInfo.base;
- serviceResponse.resourceRange = transaction->resourceInfo.range;
+ serviceResponse.resourceLength = transaction->resourceInfo.length;
}
/* Issue the callback to the requesting component with the response information */
/* Create a new service handle for the specified RM instance */
/* Get memory for a new service port from local memory */
- newServicePort = Rm_osalMalloc (sizeof(Rm_ServicePort), false);
+ newServicePort = Rm_osalMalloc (sizeof(Rm_ServicePort));
/* Return NULL immediately if malloc returned NULL */
if (newServicePort == NULL)