summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1dde3ae)
raw | patch | inline | side by side (parent: 1dde3ae)
author | Justin Sobota <jsobota@ti.com> | |
Tue, 28 May 2013 20:56:48 +0000 (16:56 -0400) | ||
committer | Justin Sobota <jsobota@ti.com> | |
Tue, 28 May 2013 20:56:48 +0000 (16:56 -0400) |
diff --git a/include/rm_internal.h b/include/rm_internal.h
index 44ec8c420097ed92d56d40af42d10192dee758c2..40a56e0d2520f3bb61d5416813a699ebc07c3189 100644 (file)
--- a/include/rm_internal.h
+++ b/include/rm_internal.h
#include <rm_osal.h>
/* RM true/false definitions */
-#define RM_FALSE 0
-#define RM_TRUE 1
+#define RM_BOOL_UNDEF (-1)
+#define RM_FALSE 0
+#define RM_TRUE 1
/* RM cache alignment */
#define RM_MAX_CACHE_ALIGN 128
diff --git a/src/rm_allocator.c b/src/rm_allocator.c
index 241df5dce2d5d8f92fa366dc46e9b7b126e2918d..50beaa526e7e087301b410d7915894d0ce2cb8ed 100644 (file)
--- a/src/rm_allocator.c
+++ b/src/rm_allocator.c
@@ -503,11 +503,11 @@ static int32_t allocatorPreAllocate(Rm_Handle rmHandle, Rm_Allocator *allocator,
if (matchingNode) {
matchingEnd = matchingNode->base + matchingNode->length - 1;
findEnd = findNode.base + findNode.length - 1;
+ nodePassesPolicy = RM_BOOL_UNDEF;
if ((matchingNode->allocationCount == 0) &&
(findNode.base >= matchingNode->base) && (findEnd <= matchingEnd)) {
/* Attempt to preallocate from node only if not owned by anyone and sits
* within a matching node. */
- nodePassesPolicy = RM_FALSE;
policyCheckCfg.type = policyCheckType;
policyCheckCfg.validInstNode = opInfo->serviceSrcInstNode;
policyCheckCfg.resourceBase = findNode.base;
@@ -567,11 +567,17 @@ static int32_t allocatorPreAllocate(Rm_Handle rmHandle, Rm_Allocator *allocator,
findNode.base = matchingNode->base;
}
else {
- if (nextNode = RB_NEXT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode)) {
- findNode.base = nextNode->base;
+ if (!nodePassesPolicy) {
+ findNode.base += findNode.length;
}
else {
- retVal = RM_SERVICE_DENIED_RES_ALLOC_REQS_NOT_MET;
+ /* Matching node allocated, move to next node */
+ if (nextNode = RB_NEXT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode)) {
+ findNode.base = nextNode->base;
+ }
+ else {
+ retVal = RM_SERVICE_DENIED_RES_ALLOC_REQS_NOT_MET;
+ }
}
}
}
diff --git a/src/rm_policy.c b/src/rm_policy.c
index d83b4bc7273c9fb26248a80f52a8fd99b7dd3895..ca62fce38bf6085ac11137203b88d0a5e29f4040 100644 (file)
--- a/src/rm_policy.c
+++ b/src/rm_policy.c
@@ -676,7 +676,7 @@ uint32_t rmPolicyGetResourceBase(void *policyDtb, Rm_PolicyValidInstNode *validI
Rm_PolicyAssignment *assignmentStart = NULL;
Rm_PolicyPermission *permission = NULL;
Rm_PolicyPermission *permissionStart = NULL;
- int32_t resourceBase = 0;
+ int32_t resourceBase = RM_RESOURCE_BASE_UNSPECIFIED;
*result = RM_OK;
index 0903cb6102630dfe5030422873284128a995198c..304c4352de3f5e35c418944c3e710cda1a8476c1 100644 (file)
0x00,
0x00,
0x0a,
-0xd4,
+0xfc,
0x00,
0x00,
0x00,
0x00,
0x00,
0x0a,
-0x90,
+0xb8,
0x00,
0x00,
0x00,
0x00,
0x00,
0x0a,
-0x58,
+0x80,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
-0x12,
+0x3c,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
-0x09,
+0x01,
+0x28,
+0x2a,
+0x29,
+0x00,
+0x00,
+0x00,
+0x02,
+0x81,
+0x00,
+0x00,
+0x00,
+0x01,
0x69,
0x75,
0x78,
0x00,
0x00,
0x00,
+0x02,
+0x82,
+0x00,
+0x00,
+0x00,
+0x01,
+0x28,
+0x2a,
+0x29,
+0x00,
+0x00,
+0x00,
+0x02,
+0x83,
+0x00,
+0x00,
+0x00,
+0x06,
+0x69,
+0x75,
+0x78,
+0x20,
+0x3d,
+0x20,
+0x28,
+0x2a,
+0x29,
+0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
-0x00,
};
index 8d1b7cd53e79271b5555f75623f2dd5afcc76bf9..1e4c4d26daed0608914578447f6638b3bb250fe6 100644 (file)
Binary files a/test/dts_files/server-policy.dtb and b/test/dts_files/server-policy.dtb differ
Binary files a/test/dts_files/server-policy.dtb and b/test/dts_files/server-policy.dtb differ
index 78592d9c641dd6373d1a7601a64758c31f036c0a..e6faf97997cd1b482db669ca62b18fed1e3910ed 100644 (file)
<526 114>, "iux = (*)";
};
pass-queue {
- assignments = <640 9>, "iux = (*)";
+ assignments = <640 1>, "(*)",
+ <641 1>, "iux = (*)",
+ <642 1>, "(*)",
+ <643 6>, "iux = (*)";
};
intc-queue {
assignments = <662 10>, "iux = (*)";
diff --git a/test/src/rm_test.c b/test/src/rm_test.c
index e1b87868ce842f88fe250e2565a876cd942aa06a..a24954e46f1c14245e007b1d4cc031bf1e236dd4 100644 (file)
--- a/test/src/rm_test.c
+++ b/test/src/rm_test.c
char resourceNameAifRxCh[RM_NAME_MAX_CHARS] = "aif-rx-ch";
char resourceNameInfraQ[RM_NAME_MAX_CHARS] = "infra-queue";
char resourceNameLowPrioQ[RM_NAME_MAX_CHARS] = "low-prio-queue";
+char resourceNamePassQ[RM_NAME_MAX_CHARS] = "pass-queue";
/* Test RM NameServer name */
char nameServerNameFavQ[RM_NAME_MAX_CHARS] = "My_Favorite_Queue";
POSITIVE_PASS_CHECK("---------- Use Allocation w/ UNSPECIFIED Base -----------",
coreNum, rmServerName, resourceNameGpQ,
RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength,
- requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);
+ requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);
+
+ setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNamePassQ,
+ RM_RESOURCE_BASE_UNSPECIFIED, 1, 0, NULL, RM_TEST_TRUE, &responseInfo);
+ rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+ POSITIVE_PASS_CHECK("- UNSPECIFIED Allocation Avoiding Policy Denial (Part 1)-",
+ coreNum, rmServerName, resourceNameGpQ,
+ RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength,
+ requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);
+
+ setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNamePassQ,
+ RM_RESOURCE_BASE_UNSPECIFIED, 1, 0, NULL, RM_TEST_TRUE, &responseInfo);
+ rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+ POSITIVE_PASS_CHECK("- UNSPECIFIED Allocation Avoiding Policy Denial (Part 2)-",
+ coreNum, rmServerName, resourceNameGpQ,
+ RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength,
+ requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);
+
+ setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNamePassQ,
+ RM_RESOURCE_BASE_UNSPECIFIED, 1, 0, NULL, RM_TEST_TRUE, &responseInfo);
+ rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+ POSITIVE_PASS_CHECK("- UNSPECIFIED Allocation Avoiding Policy Denial (Part 3)-",
+ coreNum, rmServerName, resourceNameGpQ,
+ RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength,
+ requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);
+
+ setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNamePassQ,
+ RM_RESOURCE_BASE_UNSPECIFIED, 1, 0, NULL, RM_TEST_TRUE, &responseInfo);
+ rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+ POSITIVE_PASS_CHECK("- UNSPECIFIED Allocation Avoiding Policy Denial (Part 4)-",
+ coreNum, rmServerName, resourceNameGpQ,
+ RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength,
+ requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);
/* END testing UNSPECIFIED base and alignment requests on Server */
/* Create new NameServer object */