summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 23c8476)
raw | patch | inline | side by side (parent: 23c8476)
author | Justin Sobota <jsobota@ti.com> | |
Tue, 13 Nov 2012 22:03:32 +0000 (17:03 -0500) | ||
committer | Justin Sobota <jsobota@ti.com> | |
Tue, 13 Nov 2012 22:03:32 +0000 (17:03 -0500) |
27 files changed:
diff --git a/Settings.xdc.xdt b/Settings.xdc.xdt
index 1ce5c1ba1bfa86e7d8703c9cb5c6b8378c332436..a56b44d6037aa6a766767722c6cd0a7bbff295ad 100644 (file)
--- a/Settings.xdc.xdt
+++ b/Settings.xdc.xdt
\r
module Settings\r
{\r
- config string rmlldVersionString = `packageVersion`;\r
+ config string rmVersionString = `packageVersion`;\r
}\r
\r
diff --git a/docs/Module.xs b/docs/Module.xs
index fd48d4b1ae20ad0e672470edb979e0480261d212..d72e3b5c7e6208cfffecb48c2d7c11212592a3d0 100644 (file)
--- a/docs/Module.xs
+++ b/docs/Module.xs
/******************************************************************************\r
- * FILE PURPOSE: RM LLD DOCS Module specification file.\r
+ * FILE PURPOSE: RM DOCS Module specification file.\r
******************************************************************************\r
* FILE NAME: module.xs\r
*\r
* DESCRIPTION: \r
- * This file contains the module specification for the RM LLD Documentation.\r
+ * This file contains the module specification for the RM Documentation.\r
*\r
* Copyright (C) 2012, Texas Instruments, Inc.\r
*****************************************************************************/\r
function modBuild() \r
{\r
/* Create the actual PROLOGUE Section for the Documentation.*/\r
- Pkg.makePrologue += "release: rm_lld_document_generation\n";\r
- Pkg.makePrologue += "rm_lld_document_generation:\n";\r
+ Pkg.makePrologue += "release: rm_document_generation\n";\r
+ Pkg.makePrologue += "rm_document_generation:\n";\r
Pkg.makePrologue += "\t @echo -------------------------------------------------------\n";\r
- Pkg.makePrologue += "\t @echo Generating RM LLD Documentation\n";\r
+ Pkg.makePrologue += "\t @echo Generating RM Documentation\n";\r
Pkg.makePrologue += "\t doxygen docs/Doxyfile\n";\r
- Pkg.makePrologue += "\t @echo RM LLD Documentation Generated \n";\r
+ Pkg.makePrologue += "\t @echo RM Documentation Generated \n";\r
Pkg.makePrologue += "\t @echo -------------------------------------------------------\n";\r
\r
/* Add the documentation file to the package. */\r
- Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/rmlldDocs.chm";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/rmDocs.chm";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tifooter.htm";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tiheader.htm";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tilogo.gif";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/titagline.gif";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxygen";\r
- Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/RM_LLD_SoftwareManifest.pdf";\r
- Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/ReleaseNotes_RM_LLD.pdf";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/RM_SoftwareManifest.pdf";\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/ReleaseNotes_RM.pdf";\r
\r
if (lldInstallType == "SETUP")\r
{\r
Pkg.makePrologue += "all: eclipse_plugin_generation\n";\r
Pkg.makePrologue += "eclipse_plugin_generation:\n";\r
Pkg.makePrologue += "\t @echo -------------------------------------------------------\n";\r
- Pkg.makePrologue += "\t @echo RM LLD Eclipse Plugin Generation\n";\r
+ Pkg.makePrologue += "\t @echo RM Eclipse Plugin Generation\n";\r
Pkg.makePrologue += "\t xs xdc.tools.eclipsePluginGen -o . -x ./eclipseDocs/sample.xml -c ./eclipseDocs/toc_cdoc_sample.xml\n";\r
- Pkg.makePrologue += "\t @echo RM LLD Eclipse Plugin Generated \n";\r
+ Pkg.makePrologue += "\t @echo RM Eclipse Plugin Generated \n";\r
Pkg.makePrologue += "\t @echo -------------------------------------------------------\n";\r
} \r
}\r
similarity index 100%
rename from docs/RM_LLD_SoftwareManifest.doc
rename to docs/RM_SoftwareManifest.doc
rename from docs/RM_LLD_SoftwareManifest.doc
rename to docs/RM_SoftwareManifest.doc
similarity index 100%
rename from docs/RM_LLD_SoftwareManifest.pdf
rename to docs/RM_SoftwareManifest.pdf
rename from docs/RM_LLD_SoftwareManifest.pdf
rename to docs/RM_SoftwareManifest.pdf
diff --git a/docs/doxyfile.xdt b/docs/doxyfile.xdt
index 82b4e192450795a538ea75c9b84b5f5f0798b8ac..0c3666584a1bc33f0ff3ddb8153995815dfdf5ac 100644 (file)
--- a/docs/doxyfile.xdt
+++ b/docs/doxyfile.xdt
#---------------------------------------------------------------------------\r
# Project related configuration options\r
#---------------------------------------------------------------------------\r
-DOXYFILE_ENCODING = UTF-8\r
PROJECT_NAME = "RM Low Level Driver"\r
PROJECT_NUMBER = `packageVersion`\r
OUTPUT_DIRECTORY = ./docs/doxygen\r
STRIP_FROM_INC_PATH = \r
SHORT_NAMES = NO\r
JAVADOC_AUTOBRIEF = NO\r
-QT_AUTOBRIEF = NO\r
MULTILINE_CPP_IS_BRIEF = NO\r
DETAILS_AT_TOP = NO\r
INHERIT_DOCS = YES\r
ALIASES = \r
OPTIMIZE_OUTPUT_FOR_C = YES\r
OPTIMIZE_OUTPUT_JAVA = NO\r
-OPTIMIZE_FOR_FORTRAN = NO\r
-OPTIMIZE_OUTPUT_VHDL = NO\r
BUILTIN_STL_SUPPORT = NO\r
-CPP_CLI_SUPPORT = NO\r
-SIP_SUPPORT = NO\r
-IDL_PROPERTY_SUPPORT = YES\r
DISTRIBUTE_GROUP_DOC = NO\r
SUBGROUPING = YES\r
-TYPEDEF_HIDES_STRUCT = NO\r
#---------------------------------------------------------------------------\r
# Build related configuration options\r
#---------------------------------------------------------------------------\r
EXTRACT_STATIC = YES\r
EXTRACT_LOCAL_CLASSES = YES\r
EXTRACT_LOCAL_METHODS = NO\r
-EXTRACT_ANON_NSPACES = NO\r
HIDE_UNDOC_MEMBERS = YES\r
HIDE_UNDOC_CLASSES = YES\r
HIDE_FRIEND_COMPOUNDS = NO\r
INLINE_INFO = YES\r
SORT_MEMBER_DOCS = YES\r
SORT_BRIEF_DOCS = NO\r
-SORT_GROUP_NAMES = NO\r
SORT_BY_SCOPE_NAME = NO\r
GENERATE_TODOLIST = YES\r
GENERATE_TESTLIST = YES\r
MAX_INITIALIZER_LINES = 30\r
SHOW_USED_FILES = YES\r
SHOW_DIRECTORIES = NO\r
-SHOW_FILES = YES\r
-SHOW_NAMESPACES = YES\r
FILE_VERSION_FILTER = \r
#---------------------------------------------------------------------------\r
# configuration options related to warning and progress messages\r
# configuration options related to the input files\r
#---------------------------------------------------------------------------\r
INPUT = \r
-INPUT_ENCODING = UTF-8\r
FILE_PATTERNS = *.c \\r
*.cc \\r
*.cxx \\r
./packages\r
EXCLUDE_SYMLINKS = NO\r
EXCLUDE_PATTERNS = cslr_*.h\r
-EXCLUDE_SYMBOLS = \r
EXAMPLE_PATH = \r
EXAMPLE_PATTERNS = *\r
EXAMPLE_RECURSIVE = NO\r
HTML_STYLESHEET = \r
HTML_ALIGN_MEMBERS = YES\r
GENERATE_HTMLHELP = YES\r
-GENERATE_DOCSET = NO\r
-DOCSET_FEEDNAME = "Doxygen generated docs"\r
-DOCSET_BUNDLE_ID = org.doxygen.Project\r
-HTML_DYNAMIC_SECTIONS = NO\r
-CHM_FILE = ..\..\rmlldDocs.chm\r
+CHM_FILE = ..\..\rmDocs.chm\r
HHC_LOCATION = hhc.exe\r
-GENERATE_CHI = NO\r
-CHM_INDEX_ENCODING = \r
+GENERATE_CHI = NO \r
BINARY_TOC = NO\r
TOC_EXPAND = NO\r
DISABLE_INDEX = NO\r
ENUM_VALUES_PER_LINE = 4\r
-GENERATE_TREEVIEW = NONE\r
+GENERATE_TREEVIEW = NO\r
TREEVIEW_WIDTH = 250\r
-FORMULA_FONTSIZE = 10\r
#---------------------------------------------------------------------------\r
# configuration options related to the LaTeX output\r
#---------------------------------------------------------------------------\r
# Configuration options related to the dot tool \r
#---------------------------------------------------------------------------\r
CLASS_DIAGRAMS = NO\r
-MSCGEN_PATH = \r
HIDE_UNDOC_RELATIONS = YES\r
HAVE_DOT = NO\r
-DOT_FONTNAME = FreeSans\r
-DOT_FONTPATH = \r
CLASS_GRAPH = YES\r
COLLABORATION_GRAPH = YES\r
GROUP_GRAPHS = YES\r
DOT_IMAGE_FORMAT = png\r
DOT_PATH = \r
DOTFILE_DIRS = \r
-DOT_GRAPH_MAX_NODES = 50\r
MAX_DOT_GRAPH_DEPTH = 1000\r
DOT_TRANSPARENT = YES\r
DOT_MULTI_TARGETS = NO\r
diff --git a/include/Module.xs b/include/Module.xs
index 517a6021cfbb33e818747d0de10e493ecc8e5f05..e246743ef9261fe06023f1f98bc7957f42fed397 100644 (file)
--- a/include/Module.xs
+++ b/include/Module.xs
/******************************************************************************
- * FILE PURPOSE: RM LLD include files.
+ * FILE PURPOSE: RM include files.
******************************************************************************
* FILE NAME: module.xs
*
* DESCRIPTION:
- * This file contains the module specification for RM LLD include directory
+ * This file contains the module specification for RM include directory
*
* Copyright (C) 2012, Texas Instruments, Inc.
*****************************************************************************/
diff --git a/include/rmloc.h b/include/rm_loc.h
similarity index 91%
rename from include/rmloc.h
rename to include/rm_loc.h
index 3347a36cd7acc051505c3133f31dca9a55902a55..2dff7571588bafdf5e27c754a8a94692afc0db3a 100644 (file)
rename from include/rmloc.h
rename to include/rm_loc.h
index 3347a36cd7acc051505c3133f31dca9a55902a55..2dff7571588bafdf5e27c754a8a94692afc0db3a 100644 (file)
--- a/include/rmloc.h
+++ b/include/rm_loc.h
extern "C" {
#endif
-/* Device Include */
-#include <c6x.h>
-
/* RM external includes */
-#include <ti/drv/rm/rmservices.h>
-#include <ti/drv/rm/rmpolicy.h>
-#include <ti/drv/rm/rmtransport.h>
-
-/* RM internal includes */
-#include <ti/drv/rm/include/rmtransportloc.h>
+#include <ti/drv/rm/rm_services.h>
+#include <ti/drv/rm/rm_policy.h>
+#include <ti/drv/rm/rm_transport.h>
+#if 0
/* RM permissions structure for CPPI DMA channels and flows */
typedef struct
{
uint8_t pad[RM_MAX_CACHE_ALIGN -
(sizeof(Rm_Sync_Obj_Unpadded) % RM_MAX_CACHE_ALIGN)];
} Rm_Sync_Obj;
-
-/** Maximum number of characters allowed for instance names */
-#define RM_INSTANCE_NAME_MAX_CHARS 24
+#endif
/** Maximum size of a transmittable RM policy in bytes */
#define RM_MAX_POLICY_SIZE_BYTES (64) // Placeholder: This will change
// during development
+/** Pointer to RM instance's transport routing map */
+typedef void *Rm_TransportRouteMap;
+
/** Pointer to RM instance's transaction queue */
typedef void *Rm_TransactionQueue;
*/
typedef struct {
/** Resource name of resource affected by command */
- char name[RM_MAX_RESOURCE_NAME_SIZE_BYTES];
+ char name[RM_RESOURCE_NAME_MAX_CHARS];
/** If applicable, start of resource range affected by command. If
* RM_RESOURCE_UNSPECIFIED is assigned the higher level RM agent*/
int32_t base;
int32_t alignment;
/** If applicable, the NameServer name assigned to the specified
* resource. Used for commands centering on RM NameServer actions */
- char nsName[RM_MAX_RESOURCE_NAME_SIZE_BYTES];
+ char nsName[RM_RESOURCE_NAME_MAX_CHARS];
} Rm_ResourceInfo;
/**
uint32_t id;
/** Name of the RM instance the transaction originated from */
char sourceInstName[RM_INSTANCE_NAME_MAX_CHARS];
- /** Transaction's associated callback function is the transaction originated
- * from a registered component */
- void *callback;
+ /** Transaction's associated callback function */
+ Rm_ServiceCallback callback;
/** Transaction state */
Rm_TransactionState state;
/** Transaction details. Provides detailed request/response codes such as
/** Resource information */
Rm_ResourceInfo resourceInfo;
/** Link to the next transaction in the queue */
- Rm_Transaction *nextTransaction;
+ void *nextTransaction;
} Rm_Transaction;
/**
/** running */
RM_state_IDLE = 0,
/** handling request */
- RM_state_HANDLING_REQUEST = 1,
+ RM_state_HANDLING_REQUEST = 1
/** etc...flesh all these out later will need states for the different alloc, free, request/response handlers */
} Rm_State;
typedef struct {
char name[RM_INSTANCE_NAME_MAX_CHARS];
Rm_InstType instType;
- Rm_State instState;
+ Rm_State instState; // IS THIS NEEDED???
bool registeredWithDelegateOrServer;
Rm_PolicyHandle instPolicy; /* Client Delegate only? */
-
/* RM instance transport parameters */
- Rm_TransRouteMap routeMap;
+ Rm_TransportRouteMap routeMap;
+ /* RM Transaction sequence number counter */
+ uint32_t transactionSeqNum;
/* RM transaction queue */
Rm_TransactionQueue transactionQueue;
/* Transport API function pointers - not global in case application wants to
* hook up different transports to RM */
Rm_TransportCallouts transport;
- /* Most of the time will be NULL. Will be NULL if a service request has been made and a callback function
- * has been specified. In that case this variable will be populated until the callback is made */
- void *serviceCallback;
} Rm_Inst;
Rm_Transaction *Rm_transactionQueueAdd(Rm_Inst *rmInst, uint32_t transactionId);
Rm_Transaction *Rm_transactionQueueFind(Rm_Inst *rmInst, uint32_t transactionId);
int32_t Rm_transactionQueueDelete(Rm_Inst *rmInst, uint32_t transactionId);
+uint32_t Rm_transactionGetSequenceNum(Rm_Inst *rmInst);
+
+void Rm_transactionProcessor (Rm_Inst *rmInst, Rm_Transaction *transaction,
+ Rm_TransactionReceipt *receipt);
+
#ifdef __cplusplus
}
diff --git a/include/rm_nameserverloc.h b/include/rm_nameserverloc.h
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * file rmnameserverloc.h
+ *
+ * Private data structures of Resource Manager NameServer.
+ *
+ * ============================================================================
+ * (C) Copyright 2012, Texas Instruments, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * \par
+*/
+
+#ifndef RMNAMESERVERLOC_H_
+#define RMNAMESERVERLOC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RM external includes */
+#include <ti/drv/rm/rm.h>
+
+/* RM internal includes */
+#include <ti/drv/rm/include/rm_loc.h>
+
+void Rm_nsAddObject(Rm_Inst *rmInst, Rm_Transaction *transaction,
+ Rm_TransactionReceipt *receipt);
+void Rm_nsDeleteObject(Rm_Inst *rmInst, Rm_Transaction *transaction,
+ Rm_TransactionReceipt *receipt);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RMNAMESERVERLOC_H_ */
+
diff --git a/include/rm_servicesloc.h b/include/rm_servicesloc.h
--- /dev/null
+++ b/include/rm_servicesloc.h
@@ -0,0 +1,65 @@
+/*
+ * file rmservicesloc.h
+ *
+ * Private data structures of Resource Manager services layer.
+ *
+ * ============================================================================
+ * (C) Copyright 2012, Texas Instruments, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * \par
+*/
+
+#ifndef RMSERVICESLOC_H_
+#define RMSERVICESLOC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RM external includes */
+#include <ti/drv/rm/rm.h>
+
+/* RM internal includes */
+#include <ti/drv/rm/include/rm_loc.h>
+
+
+/* This function is executed when a RM instance receives a response to one of its requests
+ * and the information in the request must be provided to the original requesting component */
+void Rm_serviceResponder (Rm_Inst *rmInst, Rm_Transaction *responseTransaction,
+ Rm_Transaction *requestTransaction, Rm_TransactionReceipt *receipt);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RMSERVICESLOC_H_ */
+
similarity index 84%
rename from include/rmtransportloc.h
rename to include/rm_transportloc.h
index 9550b543df53fe15e3e908e9b5763152dd401440..8b5f655e55b282339c47db5de17c9312fcc7ee67 100644 (file)
rename from include/rmtransportloc.h
rename to include/rm_transportloc.h
index 9550b543df53fe15e3e908e9b5763152dd401440..8b5f655e55b282339c47db5de17c9312fcc7ee67 100644 (file)
--- a/include/rmtransportloc.h
extern "C" {
#endif
-/* Device Include */
-#include <c6x.h>
-
/* RM external includes */
#include <ti/drv/rm/rm.h>
/* RM internal includes */
-#include <ti/drv/rm/include/rmloc.h>
-
-/** Pointer to RM instance's transport routing map */
-typedef void *Rm_TransRouteMap;
+#include <ti/drv/rm/include/rm_loc.h>
/**
* @brief RM transport routing map linked list node. The created
/** The remote RM instance name */
char remoteInstName[RM_INSTANCE_NAME_MAX_CHARS];
/** Link to the next route node in the route map list */
- Rm_TransportNode *nextNode;
+ void *nextNode;
} Rm_TransportNode;
/**********************************************************************
/** Name of RM instance that is issuing the resource request. The instance
* name will be used to validate the request against the RM policy defined
* for the instance. */
- char instName[RM_INST_NAME_MAX_CHARS];
+ char instName[RM_INSTANCE_NAME_MAX_CHARS];
/** Resource request information */
Rm_ResourceInfo resourceInfo;
} Rm_ResourceRequestPkt;
Rm_NsReqPktType nsRequestType;
/** RM instance name making the request. Policies may restrict who
* can and cannot map and unmap resources via the RM NameServer */
- char instName[RM_INST_NAME_MAX_CHARS];
+ char instName[RM_INSTANCE_NAME_MAX_CHARS];
/** Resource request information */
Rm_ResourceInfo resourceInfo;
} Rm_NsRequestPkt;
* name will be used to validate the request against the RM policy defined
* for the instance in the global policy.
* WARNING: Only Client Delegates and Servers can request policy updates */
- char instName[RM_INST_NAME_MAX_CHARS];
+ char instName[RM_INSTANCE_NAME_MAX_CHARS];
} Rm_PolicyRequestPkt;
/**
/** Name of RM Client Delegate instance that is issuing the resource pool
* modification request. The instance name will be used to validate the
* request against the RM policy defined for the instance. */
- char instName[RM_INST_NAME_MAX_CHARS];
+ char instName[RM_INSTANCE_NAME_MAX_CHARS];
/** Resource pool resource request information */
Rm_ResourceInfo resourceInfo;
} Rm_ResourcePoolModRequestPkt;
Rm_ResourceInfo resourceInfo;
} Rm_ResourcePoolModResponsePkt;
+Rm_TransportNode *Rm_transportNodeAdd(Rm_Inst *rmInst, Rm_TransportCfg *transportCfg);
+Rm_TransportNode *Rm_transportNodeFindTransportHandle(Rm_Inst *rmInst,
+ Rm_TransportHandle transportHandle);
+Rm_TransportNode *Rm_transportNodeFindRemoteName(Rm_Inst *rmInst, char *remoteName);
+Rm_TransportNode *Rm_transportNodeFindRemoteInstType(Rm_Inst *rmInst,
+ Rm_InstType remoteInstType);
+Rm_TransportResult Rm_transportNodeDelete(Rm_Inst *rmInst,
+ Rm_TransportHandle transportHandle);
+Rm_Packet *Rm_transportCreateResourceReqPkt(Rm_Inst *rmInst, Rm_TransportNode *dstTransportNode,
+ Rm_Transaction *transaction, Rm_TransactionReceipt *receipt);
+Rm_Packet *Rm_transportCreateResourceResponsePkt(Rm_Inst *rmInst, Rm_TransportNode *dstTransportNode,
+ Rm_Transaction *transaction, Rm_TransactionReceipt *receipt);
+Rm_Packet *Rm_transportCreateNsRequestPkt(Rm_Inst *rmInst, Rm_TransportNode *dstTransportNode,
+ Rm_Transaction *transaction, Rm_TransactionReceipt *receipt);
+Rm_Packet *Rm_transportCreateNsResponsePkt(Rm_Inst *rmInst, Rm_TransportNode *dstTransportNode,
+ Rm_Transaction *transaction, Rm_TransactionReceipt *receipt);
+
#ifdef __cplusplus
}
#endif
diff --git a/package.bld b/package.bld
index 39e8dfb146bc2e6064492596a861fec1d4302cdd..2b3810237c36868927ea95fd8dab9a153dd76809 100644 (file)
--- a/package.bld
+++ b/package.bld
*****************************************************************************/\r
\r
/* List of all subdirectories that combine to make the RM Package. */\r
-var subDirectories = [ "src", "docs", "include", "test", "resource_table"];\r
+var subDirectories = [ "src", "docs", "include", "test"];\r
\r
/* Determine if we need to create the InstallJammer Application or not? \r
* RM Deliverables be either of the following formats:\r
* of the RTSC Build. Here we determine the name of the TAR Ball Package\r
* Format is as follows:\r
* lld_<version> */\r
-var lldRTSCFileName = "rmlld" + "_" + lldPartNumber + "_" +\r
+var lldRTSCFileName = "rm" + "_" + lldPartNumber + "_" +\r
lldReleaseVersion[0] + "_" + lldReleaseVersion[1] + "_" + \r
lldReleaseVersion[2] + "_" + lldReleaseVersion[3];\r
\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "rm.h";\r
-Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_public_lld.h";\r
-Pkg.otherFiles[Pkg.otherFiles.length++] = "resource_table_defs.h";\r
+Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_policy.h";\r
+Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_services.h";\r
+Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_transport.h";\r
+Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_types.h";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_osal.h";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "rmver.h";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = "rmver.h.xdt";\r
/* Create the Install Jammer Version Variable. This is used inside the \r
* MPI File to create the Final executable. \r
* The format supported is as follows:-\r
- * - setupwin32_rmlld_<part_number>_<version>.exe \r
+ * - setupwin32_rm_<part_number>_<version>.exe \r
* This is for RM Libraries and Header files\r
*/\r
var InstallJammerVersion = "-DVersion " + lldPartNumber + "_" + lldReleaseVersion[0] + "_" +\r
var PackageBaseDir = " -DPackageBaseDir " + lldPath + "./tmp";\r
\r
/* This is the location where the RM will be installed by default. */\r
- var WinInstallDir = " -DWinInstallDir C:/Program Files/Texas Instruments/rmlld" + "_" + \r
+ var WinInstallDir = " -DWinInstallDir C:/Program Files/Texas Instruments/rm" + "_" + \r
lldPartNumber + "_" + \r
lldReleaseVersion[0] + "_" + lldReleaseVersion[1] + "_" + \r
lldReleaseVersion[2] + "_" + lldReleaseVersion[3];\r
Pkg.makeEpilogue += "\t -$(CP) -R eclipse tmp\n";\r
Pkg.makeEpilogue += "\t tar -xf ./packages/" + lldRTSCFileName + ".tar" + " -Ctmp/packages \n";\r
Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir + \r
- " --output-dir packages/ --build install/rmlld.mpi\n";\r
+ " --output-dir packages/ --build install/rm.mpi\n";\r
Pkg.makeEpilogue += "\t -$(RMDIR) /S /Q tmp\n\n";\r
\r
/* We need to clean after ourselves; extend the 'clean' target to take care of this. */\r
index c7495276d003200f696aba55bfe5cd36c68b2f7a..29cdba13991a538a5ce8e3e2dcb37dd07fb638a9 100644 (file)
--- a/rm.h
+++ b/rm.h
/* RM version */
#include <ti/drv/rm/rmver.h>
-/* RM component services include */
-#include <ti/drv/rm/rm_services.h>
-/* RM transport include */
-#include <ti/drv/rm/rm_transport.h>
-/* RM policy include */
-#include <ti/drv/rm/rm_policy.h>
/** @mainpage Resource Manager
*
@ingroup RM_LLD_API
*/
-
-/**
-@addtogroup RM_LLD_SYMBOL
-@{
-*/
-
-/** RM LLD Return And Error Codes */
-/** RM Resource Okay Return Base */
-#define RM_OK 0
-
-/** RM LLD Error Base */
-#define RM_ERROR (-64)
-/** RM LLD failed to populate internal permission tables */
-#define RM_ERROR_PERMISSION_TABLE_POPULATION_FAILED (RM_ERROR-1)
-/** RM LLD Table entry population failure */
-#define RM_ERROR_PERMISSION_TABLE_ENTRY_FAILURE (RM_ERROR-2)
-
-/** Master/Slave synchronization defines */
-/** Permissions table not valid */
-#define RM_PERMISSION_TABLE_NOT_VALID 0
-/** Permissions table valid */
-#define RM_PERMISSION_TABLE_VALID 1
-
-/**
-@}
-*/
-
-/** @addtogroup RM_LLD_DATASTRUCT
-@{
-*/
-
-
-/**
-@}
-*/
-
/**
* @brief Maximum number of characters in a RM instance name
*/
-#define RM_INST_NAME_MAX_CHARS (16)
+#define RM_INSTANCE_NAME_MAX_CHARS (24)
/**
* @brief RM Handle provided to application. The RM Handle is used by the
Rm_instType_CLIENT
} Rm_InstType;
-/**
- * @brief RM transport verification return value
- */
-typedef enum {
- /** RM transport paths verified as working. */
- Rm_transVerify_VERIFIED = 0,
- /** RM transport path verification error. See Rm_TransFailData structure
- * for more information */
- Rm_transVerify_ERROR
-} Rm_TransVerifyResult;
-
-/**
- * @brief If the RM transport path verification tests fail this structure
- * will be returned with specifics as to the error
- */
-typedef struct {
- /** Failing RM Instance Handle */
- Rm_Handle failingRmHandle;
- /** Failing transport handle */
- Rm_TransHandle failingTransHandle;
- /** If applicable: error codes received from failing transport */
- uint32_t transErrorCode;
-} Rm_TransFailData;
-
-/**
- * @brief RM pre-main allocation request information provided by the pre-main
- * startup function requesting the resource */
-typedef struct {
- /** Pointer to the requested pre-main allocation resource name. The
- * name provided by the component must match the resource names
- * provided in the global resource table and allocation policies */
- char *resourceName;
- /** The pre-main allocation request resource index. Typically this is the
- * resource value. For example, queue number or semaphore number */
- uint32_t resourceIndex;
-} Rm_PreMainAllocInfo;
-
/**
* @brief RM instance initialization structure
*/
* Client
*/
void *startupPolicy;
- /** Pointer to application implemented rmAllocPkt API. The API for the
- * provided function must match the rmAllocPkt function pointer API
- * described in rm.h */
- void *rmAllocPktFuncPtr;
- /** Pointer to application implemented rmFreePkt API. The API for the
- * provided function must match the rmFreePkt function pointer API
- * described in rm.h */
- void *rmFreePktFuncPtr;
- /** Pointer to application implemented rmSend API. The API for the
- * provided function must match the rmSend function pointer API
- * described in rm.h */
- void *rmSendFuncPtr;
- /** Pointer to application implemented rmReceive API. The API for the
- * provided function must match the rmReceive function pointer API
- * described in rm.h */
- void *rmReceiveFuncPtr;
- /** Pointer to application implemented rmNumPktsReceived API. The API for
- * the provided function must match the rmNumPktsReceived function
- * pointer API described in rm.h */
- void *rmNumPktsReceivedFuncPtr;
} Rm_InitCfg;
-
/**
* @b Description
* @n
*/
Rm_Handle Rm_init(Rm_InitCfg *initCfg);
-/**
- * @b Description
- * @n
- * Non-blocking function used by RTSC pre-main startup functions to
- * allocate RM resources for usage. Pre-main allocated resources will be
- * validated by RM against a memory-mapped startup resource policy.
- * Pre-main allocation of unauthorized resources will result in a system
- * exception.
- *
- * Note: Resource pre-main allocations can only occur on a core that is
- * running a RM Server or Client Delegate that has a startup policy
- * allowing the allocation of pre-main resources
- *
- * @param[in] preMainAllocInfo
- * Resource pre-main allocation structure that provides details of the
- * resource requested from RM for preallocation
- *
- * @retval
- * Success - 0 - Resource pre-main allocation request okay.
- * @retval
- * Failure - non-zero - Resource pre-main allocation request error.
- */
-Rm_Result Rm_preMainAllocResource(Rm_PreMainAllocInfo
- *preMainAllocInfo);
-
-
-/**
- * @b Description
- * @n
- * This function returns a RM service handle to the application to
- * provide to software components (LLDs, BIOS, etc) that want to use RM.
- *
- * @param[in] rmHandle
- * RM instance handle. Used to return a ServiceHandle from the proper
- * RM instance in cases where there are multiple RM instances running on
- * a single core.
- *
- * @retval
- * Success - RM Service Handle. Used as an input parameter for
- * component startCfg functions.
- * @retval
- * Failure - NULL
- */
-Rm_ServiceHandle Rm_getServiceHandle(Rm_Handle rmHandle);
-
/**
* @b Description
* @n
diff --git a/rmpolicy.h b/rm_policy.h
similarity index 98%
rename from rmpolicy.h
rename to rm_policy.h
index c95d66781af75fc72951014ac12e8ff65d14dd92..a976779a5c82c52b020477af13c76bf93b876da5 100644 (file)
rename from rmpolicy.h
rename to rm_policy.h
index c95d66781af75fc72951014ac12e8ff65d14dd92..a976779a5c82c52b020477af13c76bf93b876da5 100644 (file)
--- a/rmpolicy.h
+++ b/rm_policy.h
extern "C" {
#endif
+/* RM includes */
+#include <ti/drv/rm/rm.h>
+
/**
@addtogroup RM_POLICY_API
@{
*/
Rm_PolicyResult Rm_listPolicies(Rm_Handle serverHandle, Rm_PolicyInfo *policyInfoArray);
+#if 0
The following API input parameters are not finalized yet as they are a wrapper around the DTB modification APIs provided in the dtc library. The input parameters will be finalized as the operation of the dtc API is better understood.
/* Policy create/delete APIs */
Rm_PolicyResult Rm_listInstResources(Rm_PolicyHandle, instName, ...);
Rm_PolicyResult Rm_listPolicyResourceProperties(Rm_PolicyHandle, instName,
resourceName, ...);
-
+#endif
/**
@}
diff --git a/rmservices.h b/rm_services.h
similarity index 80%
rename from rmservices.h
rename to rm_services.h
index f4f8227f7e891b1bc285a23b70635b542e15565a..9561425fd3870b66c7cdf0fbde8792f97a7f1b65 100644 (file)
rename from rmservices.h
rename to rm_services.h
index f4f8227f7e891b1bc285a23b70635b542e15565a..9561425fd3870b66c7cdf0fbde8792f97a7f1b65 100644 (file)
--- a/rmservices.h
+++ b/rm_services.h
extern "C" {
#endif
+/* RM includes */
+#include <ti/drv/rm/rm.h>
+
/**
@addtogroup RMSERVICES_API
@{
/** Invalid NameServer object delete on non-Server instance */
#define RM_SERVICE_ERROR_NAMESERVER_OBJECT_DELETE_ON_INVALID_INSTANCE (RM_SERVICE_ERROR_BASE-16)
-/** RM Transport Error Code Base */
-#define RM_TRANSPORT_ERROR_BASE (-128)
-/** The transport handle provided to the RM instance was not registered with the RM instance */
-#define RM_TRANSPORT_ERROR_TRANSPORT_HANDLE_NOT_REGISTERED_WITH_INSTANCE (RM_TRANSPORT_ERROR_BASE)
-/** RM received a packet with an unknown RM packet type */
-#define RM_TRANSPORT_ERROR_INVALID_PACKET_TYPE (RM_TRANSPORT_ERROR_BASE-1)
+/**
+ * @brief Maximum number of characters in the resource names
+ */
+#define RM_RESOURCE_NAME_MAX_CHARS (24)
/**
* @brief RM service types
Rm_service_LAST = 7
} Rm_ServiceType;
+/**
+ * @brief RM pre-main allocation request information provided by the pre-main
+ * startup function requesting the resource */
+typedef struct {
+ /** Pointer to the requested pre-main allocation resource name. The
+ * name provided by the component must match the resource names
+ * provided in the global resource table and allocation policies */
+ char *resourceName;
+ /** The pre-main allocation request resource base value. For example,
+ * queue number or semaphore number */
+ uint32_t resourceBase;
+ /** Range of resource starting at resourceBase */
+ uint32_t resourceRange;
+} Rm_PreMainAllocInfo;
+
/**
* @brief RM service response information provided by RM back to the
* requesting component
uint32_t resourceRange;
} Rm_ServiceRespInfo;
+typedef struct {
+ /** Component callback function. RM will call this function when the
+ * resource service request is completed. The callback function supplied
+ * for this parameter must match this function pointer prototype. */
+ void (*serviceCallback) (Rm_ServiceRespInfo *serviceResponse);
+} Rm_ServiceCallback;
+
/**
* @brief RM service request information provided by the requesting component
*/
/** The name server name associated with the resource. Used only for
* allocate and free by name service requests */
char *resourceNsName;
- /** Component callback function. RM will call this function when the
- * resource service request is completed. The callback function supplied
- * for this parameter must match this function pointer prototype. */
- void (*serviceCallback) (Rm_ServiceRespInfo *serviceResponse);
+ /** Component specified callback function used by RM to inform components
+ * of service requst results */
+ Rm_ServiceCallback callback;
} Rm_ServiceReqInfo;
/**
Rm_ServiceRespInfo *serviceResponse);
} Rm_ServicesPort;
+/**
+ * @b Description
+ * @n
+ * Non-blocking function used by RTSC pre-main startup functions to
+ * allocate RM resources for usage. Pre-main allocated resources will be
+ * validated by RM against a memory-mapped startup resource policy.
+ * Pre-main allocation of unauthorized resources will result in a system
+ * exception.
+ *
+ * Note: Resource pre-main allocations can only occur on a core that is
+ * running a RM Server or Client Delegate that has a startup policy
+ * allowing the allocation of pre-main resources
+ *
+ * @param[in] preMainAllocInfo
+ * Resource pre-main allocation structure that provides details of the
+ * resource requested from RM for preallocation
+ *
+ * @param[out] serviceResponse
+ * Contains the result information regarding the pre-main allocation request
+ *
+ * @retval
+ * Success - 0 - Resource pre-main allocation request okay.
+ * @retval
+ * Failure - non-zero - Resource pre-main allocation request error.
+ */
+void Rm_preMainAllocService (Rm_PreMainAllocInfo *preMainAllocInfo,
+ Rm_ServiceRespInfo *serviceResponse);
+
+/**
+ * @b Description
+ * @n
+ * This function returns a RM service port to the application to
+ * provide to software components (LLDs, BIOS, etc) that want to use RM
+ * for resource management.
+ *
+ * @param[in] rmHandle
+ * RM instance handle. Used to return a Rm_ServicesPort from an RM
+ * instance.
+ *
+ * @retval
+ * Success - RM Service Port. Used by an application or component to
+ * request a service from RM.
+ * @retval
+ * Failure - NULL
+ */
+Rm_ServicesPort *Rm_getServicePort(Rm_Handle rmHandle);
+
/**
@}
*/
diff --git a/rmtransport.h b/rm_transport.h
similarity index 82%
rename from rmtransport.h
rename to rm_transport.h
index 8d12fa5d9648d537788caa481ee9bd050684d4da..8b736d4a63ba1a81292d810fb3551f740dad339c 100644 (file)
rename from rmtransport.h
rename to rm_transport.h
index 8d12fa5d9648d537788caa481ee9bd050684d4da..8b736d4a63ba1a81292d810fb3551f740dad339c 100644 (file)
--- a/rmtransport.h
+++ b/rm_transport.h
extern "C" {
#endif
+/* RM includes */
+#include <ti/drv/rm/rm.h>
+
/**
@addtogroup RMTRANSPORT_API
@{
#define RM_TRANSPORT_ERROR_NO_TRANSPORTS_REGISTERED (RM_TRANSPORT_ERROR_BASE-2)
/** RM packets are available but an error was encountered during reception */
#define RM_TRANSPORT_ERROR_PACKET_RECEPTION_ERROR (RM_TRANSPORT_ERROR_BASE-3)
+/** RM received a packet with an unknown RM packet type */
+#define RM_TRANSPORT_ERROR_INVALID_PACKET_TYPE (RM_TRANSPORT_ERROR_BASE-4)
+
/**
* @brief Result of RM transport layer operations
*/
typedef int32_t Rm_TransportResult;
-
-
/** Maximum size of the RM transport packet */
#define RM_TRANSPORT_PACKET_MAX_SIZE_BYTES (128) // Placeholder: This will
// change during development
*/
typedef void *Rm_TransportHandle;
-/**
- * @brief RM transport registration configuration structure
- */
-typedef struct {
- /** The transport's remote RM instance type */
- Rm_InstType remoteInstType;
- /** Pointer to the transport's remote RM instance name */
- char *remoteInstName;
-} Rm_TransportCfg;
-
/**
* @brief RM packet types that can be sent between RM instances
*/
int32_t (*rmNumPktsReceived)(Rm_TransportHandle transportHandle);
} Rm_TransportCallouts;
-/**
- * @b Description
- * @n
- * This is the RM transport layer function available for application
- * transport code callbacks. This API can be called if the application
- * transport wants to report a received RM packet to the RM instance.
- * This API can be used if RM polling the application code for received
- * packets is not desired.
- *
- * @param[in] transportHandle
- * Transport handle. Used to distinguish which RM instance the packet
- * was received from and how to internally route the packet if more than
- * one RM instance exists on the core.
- *
- * @param[in] pkt
- * Pointer to received resource packet.
- *
- * @retval
- * Success - 0
- * @retval
- * Failure - Non-zero RM error
+/**
+ * @brief RM transport registration configuration structure
*/
-Rm_Result rmTransportCallback(Rm_TransHandle transportHandle, Rm_Packet *pkt);
-
+typedef struct {
+ /** The transport's remote RM instance type */
+ Rm_InstType remoteInstType;
+ /** Pointer to the transport's remote RM instance name */
+ char *remoteInstName;
+ /** Used to specify whether the transport callouts are valid.
+ * TRUE - Transport callouts are valid and will be stored by the RM
+ * instance.
+ * FALSE - Transport callouts are not valid and will not be stored by
+ * the RM instance. */
+ bool transportCalloutsValid;
+ /** Pointers to application implemented transport APIs. The APIs for the
+ * provided functions must match the prototypes defined in the
+ * Rm_TransportCallouts structure. Callouts will typically only be defined
+ * for the first transport registered with an RM instance. The
+ * transportCalloutsValid field can be used to disable RM instance's from
+ * reading in new callout values are they're specified once. */
+ Rm_TransportCallouts transportCallouts;
+} Rm_TransportCfg;
/**
* @b Description
@@ -288,38 +280,13 @@ Rm_Result rmTransportCallback(Rm_TransHandle transportHandle, Rm_Packet *pkt);
Rm_TransportHandle Rm_transportRegister (Rm_Handle rmHandle,
Rm_TransportCfg *transportCfg);
-/**
- * @b Description
- * @n
- * This function places the selected RM instance into the transport
- * verification state. When all RM instances in the tree are placed
- * in the transport verification state a transport path verification
- * test will take place to verify the application transport paths between
- * all RM tree nodes are connected correctly.
- *
- * Note: This API should not be called until all transport have been
- * registered with RM
- *
- * @param[in] rmHandle
- * Which RM instance to begin the transport verification process
- *
- * @param[in] timeout
- * Number of ______ (cycles, usec, msec???) to wait before signaling a
- * transport path verification timeout
- *
- * @param[in] failData
- * Pointer to an empty Rm_TransFailData structure. If the transport
- * verification process fails this structure will return with transport
- * failure data
- *
- * @retval
- * Success - 0 - Transport Verification succeeded
- * @retval
- * Failure - non-0 - Transport Verification failed
- */
-Rm_TransVerifyResult Rm_transportVerify (Rm_Handle, uint32_t timeout,
- Rm_TransFailData *failData);
+Rm_TransportResult Rm_transportUnregister (Rm_Handle rmHandle,
+ Rm_TransportHandle transportHandle);
+
+int32_t Rm_receivePktIsr(Rm_Handle rmHandle, Rm_TransportHandle transportHandle,
+ Rm_Packet *pkt);
+int32_t Rm_receivePktPolling(Rm_Handle rmHandle, Rm_TransportHandle transportHandle);
/**
diff --git a/rmtypes.h b/rm_types.h
similarity index 98%
rename from rmtypes.h
rename to rm_types.h
index 5886f03e2dbf3fb1d84024fa2fadff8c52cde2c9..4829424e856864e671e2b7d7397e6d1c5f33d5c6 100644 (file)
rename from rmtypes.h
rename to rm_types.h
index 5886f03e2dbf3fb1d84024fa2fadff8c52cde2c9..4829424e856864e671e2b7d7397e6d1c5f33d5c6 100644 (file)
--- a/rmtypes.h
+++ b/rm_types.h
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <stdbool.h>
#endif /* __RMTYPES_H__ */
diff --git a/setupenv.bat b/setupenv.bat
index cc9f1a9ca7d2ea32d7f3ca5410cb4a27c99b471d..5840ad2835a376b58b7a22968a6cc1310c9b94e9 100644 (file)
--- a/setupenv.bat
+++ b/setupenv.bat
@REM ******************************************************************************\r
-@REM * FILE PURPOSE: Environment Setup for building RM LLD\r
+@REM * FILE PURPOSE: Environment Setup for building RM\r
@REM ******************************************************************************\r
@REM * FILE NAME: setupenv.bat\r
@REM *\r
@REM *****************************************************************************\r
\r
@echo ---------------------------------------\r
-@echo Configuring RM LLD Build Environment\r
+@echo Configuring RM Build Environment\r
@echo off\r
\r
IF DEFINED PARTNO GOTO partno_defined\r
:partno_Defined\r
\r
IF DEFINED PDK_INSTALL_PATH GOTO pdk_defined\r
-set PDK_INSTALL_PATH=C:/Program Files/Texas Instruments/pdk_TCI6614_1_0_0_0/packages\r
+set PDK_INSTALL_PATH=C:/ti/pdk_tci6614_1_00_00_10/packages\r
:pdk_defined\r
\r
@REM ---------------------------------\r
@echo MINI PACKAGE is set to %MINI_PACKAGE%\r
\r
@REM This is the base location for the various tools. \r
-set XDCCGROOT=t:/c6xx/cgen7_2_04/c6000/cgtools\r
-set C6X_GEN_INSTALL_PATH=T:\c6xx\cgen7_2_04\c6000\cgtools\r
+set XDCCGROOT=C:/ti/ccsv5/tools/compiler/c6000_7.3.4\r
+set C6X_GEN_INSTALL_PATH=C:/ti/ccsv5/tools/compiler/c6000_7.3.4\r
\r
REM *******************************************************************************\r
REM *************************** XDC PATH Configuration ****************************\r
REM - None\r
\r
@REM Specify the XDC Tool Path\r
-set XDC_INSTALL_PATH=t:/gen/xdc/xdctools_3_22_01_21\r
+set XDC_INSTALL_PATH=C:/ti/xdctools_3_23_03_53\r
set XDCPATH=../../..;%XDC_INSTALL_PATH%/packages\r
\r
@REM Configure the XDCPATH\r
diff --git a/setupenv.sh b/setupenv.sh
--- a/setupenv.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-# Output directory for generated libraries
-export LIBDIR=./lib
-
-# PDK install path
-export PDK_INSTALL_PATH=/sim/scratch_a0875039/user-space/pdk
-
-# ARM cross tool executable path
-export CROSS_TOOL_INSTALL_PATH=/apps/codesourcery/arm-2009q1/bin
-
-# ARM cross tool prefix
-export CROSS_TOOL_PRFX=arm-none-linux-gnueabi-
-
diff --git a/src/Module.xs b/src/Module.xs
index a9b672f62a5e1899ee40f5517789a1d48a13498e..36c3c96e119f19e2b80dd985757f1ca520f6860e 100644 (file)
--- a/src/Module.xs
+++ b/src/Module.xs
/******************************************************************************
- * FILE PURPOSE: RM LLD Source module specification file.
+ * FILE PURPOSE: RM Source module specification file.
******************************************************************************
* FILE NAME: module.xs
*
* DESCRIPTION:
- * This file contains the module specification for the RM LLD source directory.
+ * This file contains the module specification for the RM source directory.
*
* Copyright (C) 2012, Texas Instruments, Inc.
*****************************************************************************/
var rmlldFile = [
"src/rm.c",
+ "src/rm_nameserver.c",
+ "src/rm_policy.c",
+ "src/rm_services.c",
+ "src/rm_transport.c",
];
/**************************************************************************
diff --git a/src/rm.c b/src/rm.c
index 2e8c7904baf172bc55d66460b8ba41b26ba96f53..5472ec790958fbf95c763cd3819e6f2d1461098d 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
\r
/* RM external includes */\r
#include <ti/drv/rm/rm.h>\r
-#include <ti/drv/rm/rmservices.h>\r
-#include <ti/drv/rm/rmtransport.h>\r
-#include <ti/drv/rm/rmpolicy.h>\r
+#include <ti/drv/rm/rm_services.h>\r
+#include <ti/drv/rm/rm_transport.h>\r
+#include <ti/drv/rm/rm_policy.h>\r
\r
/* RM internal includes */\r
-#include <ti/drv/rm/include/rmloc.h>\r
+#include <ti/drv/rm/include/rm_loc.h>\r
+#include <ti/drv/rm/include/rm_transportloc.h>\r
+#include <ti/drv/rm/include/rm_servicesloc.h>\r
+#include <ti/drv/rm/include/rm_nameserverloc.h>\r
\r
/* RM OSAL layer */\r
#include <rm_osal.h>\r
/**********************************************************************\r
************************** Globals ***********************************\r
**********************************************************************/\r
-\r
+#if 0\r
/* Place QMSS PDSP permissions array */\r
#pragma DATA_SECTION (rmQmssPdspFirmwarePerms, ".rm");\r
#pragma DATA_ALIGN (rmQmssPdspFirmwarePerms, 128)\r
Rm_Perms rmQmssPdspFirmwarePerms[RM_ALIGN_PERMISSIONS_ARRAY(RM_QMSS_FIRMWARE_PDSPS, Rm_Perms)];\r
-\r
+#endif\r
\r
/** @brief Global Variable which describes the RM Version Information */\r
const char rmVersionStr[] = RM_VERSION_STR ":" __DATE__ ":" __TIME__;\r
Rm_Transaction *Rm_transactionQueueFind(Rm_Inst *rmInst, uint32_t transactionId)\r
{\r
Rm_Transaction *transaction = (Rm_Transaction *)rmInst->transactionQueue;\r
- void *key;\r
\r
/* Make sure there is at least one transaction in the transaction queue */\r
if (transaction != NULL)\r
@@ -137,7 +139,7 @@ Rm_Transaction *Rm_transactionQueueFind(Rm_Inst *rmInst, uint32_t transactionId)
* transaction pointer will be NULL */\r
while (transaction != NULL)\r
{\r
- if (transaction->transactionId == transactionId)\r
+ if (transaction->id == transactionId)\r
{\r
/* Match: break out of loop and return the transaction */\r
break; \r
/* Find the transaction ID within the specified RM instance's transaction queue. */\r
while (transaction != NULL)\r
{\r
- if (transaction->transactionId == transactionId)\r
+ if (transaction->id == transactionId)\r
{\r
/* Match: break out of loop and delete the transaction */\r
break; \r
}\r
\r
prevTransaction = transaction;\r
- transaction = transaction->nextEntry;\r
+ transaction = transaction->nextTransaction;\r
}\r
\r
/* Traversed entire queue but did not find transaction */\r
return (RM_SERVICE_ACTION_OKAY);\r
}\r
\r
+uint32_t Rm_transactionGetSequenceNum(Rm_Inst *rmInst)\r
+{\r
+ uint32_t sequenceNum = 0;\r
+ void *key;\r
+\r
+ /* Lock access to the RM instance */\r
+ key = Rm_osalLocalCsEnter();\r
+\r
+ /* Get the next sequence number and then incement. Overflow is okay since\r
+ * it just restarts the sequence number count. */\r
+ sequenceNum = rmInst->transactionSeqNum++;\r
+\r
+ Rm_osalLocalCsExit(key);\r
+ return (sequenceNum);\r
+}\r
+\r
/* Function used to send RM response transactions to lower level agents */\r
void Rm_transactionResponder (Rm_Inst *rmInst, Rm_Transaction *transaction,\r
Rm_TransactionReceipt *receipt)\r
void Rm_allocationHandler (Rm_Inst *rmInst, Rm_Transaction *transaction,\r
Rm_TransactionReceipt *receipt)\r
{\r
+ if (rmInst->instType == Rm_instType_CLIENT_DELEGATE)\r
+ {\r
+#if 0 \r
+ /* Check local policy to see if the request can be satisfied with the\r
+ * resources stored locally */\r
+ Rm_policy...API()\r
+\r
+ if (policy check approves the resource)\r
+ {\r
+ /* call the allocator to allocate the resource */\r
+ if (allocator returns resource)\r
+ {\r
+ /* Populate the receipt with the allocated resources and the result */\r
+ receipt->serviceResult = approve reason;\r
+ receipt->serviceId = transaction->id;\r
+ return ...\r
+ }\r
+ else\r
+ {\r
+ /* allocator ran out of resources, need to contact Server for more\r
+ * resources */\r
+ Rm_resourcePoolModRequest(...);\r
+ }\r
+ }\r
+ else if (policy check denies resource)\r
+ {\r
+ /* Policy check denied resource. */\r
+ receipt->serviceResult = deny reason;\r
+ receipt->serviceId = transaction->id;\r
+ return ...\r
+ }\r
+ else if (policy check says forward to Server for validation)\r
+ {\r
+ /* Forward the transaction to the Server */\r
+ Rm_transactionForwarder(rmInst, transaction, receipt);\r
+ }\r
+#endif \r
+ }\r
+ else if (rmInst->instType == Rm_instType_SERVER)\r
+ {\r
+#if 0 \r
+ /* Check global policy to see if resource can be allocated. return result\r
+ * no matter what */\r
+ Rm_policy...API()\r
+\r
+ if (policy approves)\r
+ {\r
+ /* call allocator to allocate resource */\r
+ }\r
+\r
+ receipt->serviceResult = approve or deny reason;\r
+ receipt->serviceId = transaction->id;\r
+ receipt->resourceBase = ...;\r
+ receipt->resourceRange = ...;\r
\r
+ /* If source instance name does not match the current instance\r
+ * name the allocation request came from a client. The result\r
+ * must be sent back to the Client */\r
+ if (strcmp(transaction->sourceInstName, rmInst->name))\r
+ {\r
+ /* Names don't match. Copy the allocation response resource data \r
+ * into the original transaction and send it back to the Client */\r
+ transaction->details = transaction->details;\r
+ transaction->resourceInfo.base = receipt->resourceBase;\r
+ transaction->resourceInfo.range = receipt->resourceRange;\r
+ Rm_transactionResponder(rmInst, transaction, receipt);\r
+ }\r
+ else\r
+ {\r
+ /* Resource allocation request originated locally on the active\r
+ * instance. Send the response via the service responder. */\r
+ transaction->details = transaction->details;\r
+ transaction->resourceInfo.base = receipt->resourceBase;\r
+ transaction->resourceInfo.range = receipt->resourceRange; \r
+ Rm_serviceResponder(rmInst, transaction, NULL, receipt); \r
+ }\r
+#endif \r
+ } \r
}\r
\r
void Rm_freeHandler (Rm_Inst *rmInst, Rm_Transaction *transaction,\r
Rm_TransactionReceipt *receipt)\r
{\r
+ if (rmInst->instType == Rm_instType_CLIENT_DELEGATE)\r
+ {\r
+#if 0 \r
+ /* Check local policy to see if the request can be satisfied with the\r
+ * resources stored locally */\r
+ Rm_policy...API()\r
\r
+ if (policy check approves the free)\r
+ {\r
+ /* call the allocator to free the resource */\r
+ /* Run a resource pool check to see if the free combined a resource block\r
+ * that can be returned to the server */\r
+ if (resource block has been combined)\r
+ {\r
+ /* allocator ran out of resources, need to contact Server for more\r
+ * resources */\r
+ Rm_resourcePoolModRequest(free pool block to server...);\r
+ }\r
+ else\r
+ {\r
+ /* Populate the receipt with the freed resources and the result */\r
+ receipt->serviceResult = approve reason;\r
+ receipt->serviceId = transaction->id;\r
+ return ...\r
+ }\r
+ }\r
+ else if (policy check denies resource free)\r
+ {\r
+ /* Policy check denied resource. */\r
+ receipt->serviceResult = deny reason;\r
+ receipt->serviceId = transaction->id;\r
+ return ...\r
+ }\r
+ else if (policy check says forward to Server for validation)\r
+ {\r
+ /* Forward the transaction to the Server */\r
+ Rm_transactionForwarder(rmInst, transaction, receipt);\r
+ }\r
+#endif \r
+ }\r
+ else if (rmInst->instType == Rm_instType_SERVER)\r
+ {\r
+#if 0 \r
+ /* Check global policy to see if resource can be freed. return result\r
+ * no matter what */\r
+ Rm_policy...API()\r
+ if (policy approves)\r
+ {\r
+ /* call allocator to free resources */\r
+ }\r
+ \r
+ receipt->serviceResult = approve or deny reason;\r
+ receipt->serviceId = transaction->id;\r
+ receipt->resourceBase = ...;\r
+ receipt->resourceRange = ...;\r
+\r
+ /* If source instance name does not match the current instance\r
+ * name the allocation request came from a client. The result\r
+ * must be sent back to the Client */\r
+ if (strcmp(transaction->sourceInstName, rmInst->name))\r
+ {\r
+ /* Names don't match. Copy the free response resource data \r
+ * into the original transaction and send it back to the Client Delegate or Client */\r
+ transaction->details = transaction->details;\r
+ transaction->resourceInfo.base = receipt->resourceBase;\r
+ transaction->resourceInfo.range = receipt->resourceRange;\r
+ Rm_transactionResponder(rmInst, transaction, receipt);\r
+ }\r
+ else\r
+ {\r
+ /* Resource allocation request originated locally on the active\r
+ * instance. Send the response via the service responder. */\r
+ transaction->details = transaction->details;\r
+ transaction->resourceInfo.base = receipt->resourceBase;\r
+ transaction->resourceInfo.range = receipt->resourceRange;\r
+ Rm_serviceResponder(rmInst, transaction, NULL, receipt); \r
+ }\r
+#endif \r
+ } \r
}\r
\r
-\r
/* Function used to forward RM transactions to higher level agents */\r
void Rm_transactionForwarder (Rm_Inst *rmInst, Rm_Transaction *transaction,\r
Rm_TransactionReceipt *receipt)\r
/* Client Delegate found a NameServer transaction awaiting a response. Send the \r
* response to either the transaction or service responder based on the \r
* source instance */\r
- if (strcmp(queuedTransaction->sourceInstName, rmInst->name)\r
+ if (strcmp(queuedTransaction->sourceInstName, rmInst->name))\r
{\r
/* NameServer transaction originated from another instance. Use the \r
* transaction responder to send the NameServer result to the source instance.\r
rmInst->instType = initCfg->instType;\r
rmInst->instState = RM_state_IDLE;\r
rmInst->registeredWithDelegateOrServer = false;\r
- rmInst->serviceCallback = NULL;\r
-\r
- /* The transport APIs must be provided */\r
- if ((initCfg->rmAllocPktFuncPtr == NULL) ||\r
- (initCfg->rmFreePktFuncPtr == NULL) ||\r
- (initCfg->rmSendFuncPtr == NULL) ||\r
- (initCfg->rmReceiveFuncPtr == NULL) ||\r
- (initCfg->rmNumPktsReceivedFuncPtr == NULL))\r
- {\r
- return (NULL);\r
- }\r
- \r
- /* Populate the instance transport callouts */\r
- rmInst->transport.rmAllocPkt = initCfg->rmAllocPktFuncPtr;\r
- rmInst->transport.rmFreePkt = initCfg->rmFreePktFuncPtr;\r
- rmInst->transport.rmSend = initCfg->rmSendFuncPtr;\r
- rmInst->transport.rmReceive = initCfg->rmReceiveFuncPtr;\r
- rmInst->transport.rmNumPktsReceived = initCfg->rmNumPktsReceivedFuncPtr;\r
\r
/* Initialize the transport routing map linked list pointer to NULL. The linked list\r
* nodes will be created when the application registers transports */\r
rmInst->routeMap = NULL;\r
\r
- /* Initialize the transaction queue linked list pointer to NULL. The linked list\r
- * nodes will be created when the transactions are forwarded to higher level RM\r
- * agents. */\r
+ /* Initialize the transaction queue elements. The linked list pointer is set to NULL\r
+ * and the transaction sequence number is initialized to 0. */\r
+ rmInst->transactionSeqNum = 0;\r
rmInst->transactionQueue= NULL;\r
\r
/* RM Server specific actions */\r
diff --git a/src/rmnameserver.c b/src/rm_nameserver.c
similarity index 94%
rename from src/rmnameserver.c
rename to src/rm_nameserver.c
index fe52b8ca2da53aa0bb786796b77ded5b17bf0bee..935951323f892ad314d7a1d6e705c102efffc23a 100644 (file)
rename from src/rmnameserver.c
rename to src/rm_nameserver.c
index fe52b8ca2da53aa0bb786796b77ded5b17bf0bee..935951323f892ad314d7a1d6e705c102efffc23a 100644 (file)
--- a/src/rmnameserver.c
+++ b/src/rm_nameserver.c
*/
/* RM Types */
-#include <ti/drv/rm/rmtypes.h>
+#include <ti/drv/rm/rm_types.h>
/* RM external API includes */
-
+#include <ti/drv/rm/rm_services.h>
/* RM internal API includes */
-#include <ti/drv/rm/include/rmloc.h>
-#include <ti/drv/rm/include/rmnameserverloc.h>
+#include <ti/drv/rm/include/rm_loc.h>
+#include <ti/drv/rm/include/rm_nameserverloc.h>
/* RM OSAL layer */
#include <rm_osal.h>
diff --git a/src/rmpolicy.c b/src/rm_policy.c
similarity index 94%
rename from src/rmpolicy.c
rename to src/rm_policy.c
index db4d0bdb4a97a9f07f78365fedeea954ccc22c34..f2b11a58d10cfee01059a50a2095b535baf52e74 100644 (file)
rename from src/rmpolicy.c
rename to src/rm_policy.c
index db4d0bdb4a97a9f07f78365fedeea954ccc22c34..f2b11a58d10cfee01059a50a2095b535baf52e74 100644 (file)
--- a/src/rmpolicy.c
+++ b/src/rm_policy.c
*/
/* RM Types */
-#include <ti/drv/rm/rmtypes.h>
+#include <ti/drv/rm/rm_types.h>
/* RM external API includes */
-#include <ti/drv/rm/include/rmpolicy.h>
+#include <ti/drv/rm/rm_policy.h>
/* RM internal API includes */
-#include <ti/drv/rm/include/rmpolicyloc.h>
+//#include <ti/drv/rm/include/rm_policyloc.h>
/* RM OSAL layer */
#include <rm_osal.h>
diff --git a/src/rmservices.c b/src/rm_services.c
similarity index 86%
rename from src/rmservices.c
rename to src/rm_services.c
index 43368246b13d1315a0e66c185d7b044240a75a18..7e42870d817879d72127040048d652f93c5ae497 100644 (file)
rename from src/rmservices.c
rename to src/rm_services.c
index 43368246b13d1315a0e66c185d7b044240a75a18..7e42870d817879d72127040048d652f93c5ae497 100644 (file)
--- a/src/rmservices.c
+++ b/src/rm_services.c
*/
/* RM Types */
-#include <ti/drv/rm/rmtypes.h>
+#include <ti/drv/rm/rm_types.h>
/* RM external API includes */
-#include <ti/drv/rm/rmservices.h>
+#include <ti/drv/rm/rm_services.h>
/* RM internal API includes */
-#include <ti/drv/rm/include/rmloc.h>
+#include <ti/drv/rm/include/rm_loc.h>
/* RM OSAL layer */
#include <rm_osal.h>
key = Rm_osalLocalCsEnter();
/* Make sure serviceType is valid and that a callback function has been provided */
- if ((serviceRequest->serviceType < Rm_service_FIRST) ||
- (serviceRequest->serviceType > Rm_service_LAST))
+ if ((serviceRequest->type < Rm_service_FIRST) ||
+ (serviceRequest->type > Rm_service_LAST))
{
serviceResponse->serviceResult = RM_SERVICE_ERROR_INVALID_SERVICE_TYPE;
Rm_osalLocalCsExit(key);
return;
}
- else if (serviceRequest->serviceCallback == NULL)
+ else if (serviceRequest->callback.serviceCallback == NULL)
{
/* The RM Client and Client Delegate use blocking transports to consult with a
* high-level RM agent prior to providing a response to the component. It is
/* Create an ID for this transaction. The ID will be used for two purposes:
* 1) Matching responses from higher level RM agents to requests
- * 2) Provided to the entity that requested the service so that it can match its
+ * 2) Provided to the component that requested the service so that it can match its
* request with the response it receives via its callback function it provided */
- transactionId = ...; /* NEED SCHEME FOR CREATING A MUTUALLY EXCLUSIVE PKT ID. CAN'T
- * CONFLICT WITH PCKT IDS CREATED ON OTHER RM INSTANCES */
+ transactionId = Rm_transactionGetSequenceNum(rmInst);
/* Create a new transaction */
transaction = Rm_transactionQueueAdd(rmInst, transactionId);
memset((void *) &receipt, 0, sizeof(Rm_TransactionReceipt));
/* Transfer request information into the transaction */
- transaction->type = serviceRequest->serviceType;
- strcpy((transaction->sourceInstName, rmInst->name);
- transaction->callback = serviceRequest->serviceCallback;
+ transaction->type = serviceRequest->type;
+ strcpy(transaction->sourceInstName, rmInst->name);
+ transaction->callback.serviceCallback = serviceRequest->callback.serviceCallback;
transaction->state = Rm_transactionState_PROCESSING;
transaction->details = RM_SERVICE_PROCESSING;
strcpy(&(transaction->resourceInfo.name)[0], serviceRequest->resourceName);
/* Copy transaction receipt information into the response info fields for the
* component based on the result of the transaction. Denied service requests
* will have only a valid serviceResult field */
- serviceResponse->serviceResult = receipt->serviceResult;
+ serviceResponse->serviceResult = receipt.serviceResult;
/* Service was approved and service was an allocate request the resource
* data is passed back to the component */
@@ -174,13 +173,13 @@ void Rm_serviceResponder (Rm_Inst *rmInst, Rm_Transaction *responseTransaction,
/* Service was approved and service was an allocate request. The resource
* data is passed back to the component */
- if ((serviceResponse->serviceResult == RM_SERVICE_APPROVED) &&
- ((responseTransaction.type == Rm_service_RESOURCE_ALLOCATE) ||
- (responseTransaction.type == Rm_service_RESOURCE_BLOCK_ALLOCATE) ||
- (responseTransaction.type == Rm_service_RESOURCE_ALLOCATE_BY_NAME)))
+ if ((serviceResponse.serviceResult == RM_SERVICE_APPROVED) &&
+ ((responseTransaction->type == Rm_service_RESOURCE_ALLOCATE) ||
+ (responseTransaction->type == Rm_service_RESOURCE_BLOCK_ALLOCATE) ||
+ (responseTransaction->type == Rm_service_RESOURCE_ALLOCATE_BY_NAME)))
{
- serviceResponse->resourceBase = receipt.resourceBase;
- serviceResponse->resourceRange = receipt.resourceRange;
+ serviceResponse.resourceBase = receipt->resourceBase;
+ serviceResponse.resourceRange = receipt->resourceRange;
}
/* Issue the callback to the requesting component with the response information */
@@ -191,11 +190,11 @@ void Rm_serviceResponder (Rm_Inst *rmInst, Rm_Transaction *responseTransaction,
* Client Delegate and RM Server instances. In these cases the response
* transaction will be a copy of the request transaction, meaning it will contain
* the proper callback information */
- requestTransaction->callback(&serviceResponse);
+ requestTransaction->callback.serviceCallback(&serviceResponse);
}
else
{
- responseTransaction->callback(&serviceResponse);
+ responseTransaction->callback.serviceCallback(&serviceResponse);
}
/* Delete both transactions from the transaction queue */
}
/* Response to component completed */
- receipt.serviceResult = RM_SERVICE_ACTION_OKAY;
+ receipt->serviceResult = RM_SERVICE_ACTION_OKAY;
return;
}
}
-
Rm_ServicesPort *Rm_getServicePort(Rm_Handle rmHandle)
{
- Rm_Inst *rmInst = (Rm_Inst *) rmHandle;
Rm_ServicesPort *newServicePort = NULL;
/* Create a new service handle for the specified RM instance */
diff --git a/src/rmtransport.c b/src/rm_transport.c
similarity index 80%
rename from src/rmtransport.c
rename to src/rm_transport.c
index ab503df2caaafe0a252adbd08534837ea265c9e3..e0b09f7b14d03453af46d4cc31a4a99aaad0dcdb 100644 (file)
rename from src/rmtransport.c
rename to src/rm_transport.c
index ab503df2caaafe0a252adbd08534837ea265c9e3..e0b09f7b14d03453af46d4cc31a4a99aaad0dcdb 100644 (file)
--- a/src/rmtransport.c
+++ b/src/rm_transport.c
\r
/* RM external includes */\r
#include <ti/drv/rm/rm.h>\r
-#include <ti/drv/rm/rmtransport.h>\r
+#include <ti/drv/rm/rm_transport.h>\r
\r
/* RM internal includes */\r
-#include <ti/drv/rm/rmloc.h>\r
-#include <ti/drv/rm/rmtransportloc.h>\r
+#include <ti/drv/rm/include/rm_loc.h>\r
+#include <ti/drv/rm/include/rm_transportloc.h>\r
\r
/* RM OSAL layer */\r
#include <rm_osal.h>\r
@@ -70,34 +70,32 @@ Rm_TransportNode *Rm_transportNodeAdd(Rm_Inst *rmInst, Rm_TransportCfg *transpor
newTransportNode = Rm_osalMalloc (sizeof(Rm_TransportNode), false);\r
\r
/* Return if the memory allocated for the transport node is NULL */\r
- if (newTransportNode == NULL)\r
+ if (newTransportNode != NULL)\r
{\r
- return;\r
- }\r
+ /* Populate the new entry. */\r
+ newTransportNode->remoteInstType = transportCfg->remoteInstType;\r
+ strcpy(&(newTransportNode->remoteInstName)[0], transportCfg->remoteInstName);\r
+ newTransportNode->nextNode = NULL; /* New node will always be NULL */\r
\r
- /* Populate the new entry. */\r
- newTransportNode->remoteInstType = transportCfg->remoteInstType;\r
- strcpy(&(newTransportNode->remoteInstName)[0], transportCfg->remoteInstName);\r
- newTransportNode->nextNode = NULL; /* New node will always be NULL */\r
+ /* Check if there are any nodes in the transport routing map */\r
+ if (routeMap)\r
+ {\r
+ /* At least one node in the routing map. Add the new node to the end of the\r
+ * routing map */\r
+ while (routeMap->nextNode != NULL)\r
+ {\r
+ /* Traverse the list until arriving at the last node */\r
+ routeMap = (Rm_TransportNode *)routeMap->nextNode;\r
+ }\r
\r
- /* Check if there are any nodes in the transport routing map */\r
- if (routeMap)\r
- {\r
- /* At least one node in the routing map. Add the new node to the end of the\r
- * routing map */\r
- while (routeMap->nextNode != NULL)\r
+ /* Add the new node to the end of the list */\r
+ routeMap->nextNode = (void *)newTransportNode;\r
+ }\r
+ else\r
{\r
- /* Traverse the list until arriving at the last node */\r
- routeMap = routeMap->nextNode;\r
+ /* The transport routing map does not currently exist. The new node is the first node */\r
+ rmInst->routeMap = (void *)newTransportNode;\r
}\r
-\r
- /* Add the new node to the end of the list */\r
- routeMap->nextNode = newTransportNode;\r
- }\r
- else\r
- {\r
- /* The transport routing map does not currently exist. The new node is the first node */\r
- rmInst->routeMap = newTransportNode;\r
}\r
\r
Rm_osalLocalCsExit(key);\r
while (transportNode != NULL)\r
{\r
/* The transport handle is the address of the transport node */\r
- if (transportNode == ((Rm_TransportNode *)transportHandle)\r
+ if (transportNode == ((Rm_TransportNode *)transportHandle))\r
{\r
/* Match: break out of loop and return the node */\r
break; \r
}\r
- transportNode = transportNode->nextNode;\r
+ transportNode = (Rm_TransportNode *)transportNode->nextNode;\r
}\r
}\r
\r
@@ -149,7 +147,7 @@ Rm_TransportNode *Rm_transportNodeFindRemoteName(Rm_Inst *rmInst, char *remoteNa
/* Match: break out of loop and return the node */\r
break; \r
}\r
- transportNode = transportNode->nextNode;\r
+ transportNode = (Rm_TransportNode *)transportNode->nextNode;\r
}\r
}\r
\r
/* Match: break out of loop and return the node */\r
break; \r
}\r
- transportNode = transportNode->nextNode;\r
+ transportNode = (Rm_TransportNode *)transportNode->nextNode;\r
}\r
}\r
\r
@@ -207,7 +205,7 @@ Rm_TransportResult Rm_transportNodeDelete(Rm_Inst *rmInst, Rm_TransportHandle tr
}\r
\r
prevNode = transportNode;\r
- transportNode = transportNode->nextNode;\r
+ transportNode = (Rm_TransportNode *)transportNode->nextNode;\r
}\r
\r
/* Traversed entire queue but did not find transaction */\r
@@ -253,15 +251,15 @@ Rm_Packet *Rm_transportCreateResourceReqPkt(Rm_Inst *rmInst, Rm_TransportNode *d
NULL)\r
{\r
receipt->serviceResult = RM_SERVICE_ERROR_TRANSPORT_ALLOC_PKT_ERROR;\r
- return;\r
+ return (NULL);\r
}\r
\r
/* Make sure allocated buffer is large enough to fit the request packet plus the \r
* rmPktLen and Rm_PktType fields */\r
- if (rmPkt->rmPktLen < (sizeof(Rm_ResourceRequestPkt) + sizeof(uint32_t) + sizeof(Rm_pktType))\r
+ if (rmPkt->pktLenBytes < (sizeof(Rm_ResourceRequestPkt) + sizeof(uint32_t) + sizeof(Rm_pktType)))\r
{ \r
receipt->serviceResult = RM_SERVICE_ERROR_TRANSPORT_PKT_BUF_TOO_SMALL;\r
- return;\r
+ return (NULL);\r
}\r
\r
/* Set the Rm Packet type */ \r
@@ -287,7 +285,7 @@ Rm_Packet *Rm_transportCreateResourceReqPkt(Rm_Inst *rmInst, Rm_TransportNode *d
{\r
resourceReqPkt->resourceReqType = Rm_resReqPktType_FREE;\r
}\r
- else if (transaction->type == case Rm_service_RESOURCE_BLOCK_FREE)\r
+ else if (transaction->type == Rm_service_RESOURCE_BLOCK_FREE)\r
{\r
resourceReqPkt->resourceReqType = Rm_resReqPktType_BLOCK_FREE;\r
}\r
@@ -314,22 +312,22 @@ Rm_Packet *Rm_transportCreateResourceResponsePkt(Rm_Inst *rmInst, Rm_TransportNo
NULL)\r
{\r
receipt->serviceResult = RM_SERVICE_ERROR_TRANSPORT_ALLOC_PKT_ERROR;\r
- return;\r
+ return (NULL);\r
}\r
\r
/* Make sure allocated buffer is large enough to fit the request packet plus the \r
* rmPktLen and Rm_PktType fields */\r
- if (rmPkt->rmPktLen < (sizeof(Rm_ResourceResponsePkt) + sizeof(uint32_t) + sizeof(Rm_pktType))\r
+ if (rmPkt->pktLenBytes < (sizeof(Rm_ResourceResponsePkt) + sizeof(uint32_t) + sizeof(Rm_pktType)))\r
{ \r
receipt->serviceResult = RM_SERVICE_ERROR_TRANSPORT_PKT_BUF_TOO_SMALL;\r
- return;\r
+ return (NULL);\r
}\r
\r
/* Set the Rm Packet type */ \r
rmPkt->pktType = Rm_pktType_RESOURCE_RESPONSE;\r
\r
/* Assign the packet's data field to be the start of the resource response packet */\r
- resourceRespPkt = (Rm_ResourceResponsePkt *)rmPkt->data);\r
+ resourceRespPkt = (Rm_ResourceResponsePkt *)rmPkt->data;\r
/* Populate the resource response packet using the transaction information */\r
resourceRespPkt->responseId = transaction->id;\r
resourceRespPkt->requestResult = transaction->details;\r
@@ -351,15 +349,15 @@ Rm_Packet *Rm_transportCreateNsRequestPkt(Rm_Inst *rmInst, Rm_TransportNode *dst
NULL)\r
{\r
receipt->serviceResult = RM_SERVICE_ERROR_TRANSPORT_ALLOC_PKT_ERROR;\r
- return;\r
+ return (NULL);\r
}\r
\r
/* Make sure allocated buffer is large enough to fit the request packet plus the \r
* rmPktLen and Rm_PktType fields */\r
- if (rmPkt->rmPktLen < (sizeof(Rm_NsRequestPkt) + sizeof(uint32_t) + sizeof(Rm_pktType))\r
+ if (rmPkt->pktLenBytes < (sizeof(Rm_NsRequestPkt) + sizeof(uint32_t) + sizeof(Rm_pktType)))\r
{ \r
receipt->serviceResult = RM_SERVICE_ERROR_TRANSPORT_PKT_BUF_TOO_SMALL;\r
- return;\r
+ return (NULL);\r
}\r
\r
/* Set the Rm Packet type */ \r
@@ -396,15 +394,15 @@ Rm_Packet *Rm_transportCreateNsResponsePkt(Rm_Inst *rmInst, Rm_TransportNode *ds
NULL)\r
{\r
receipt->serviceResult = RM_SERVICE_ERROR_TRANSPORT_ALLOC_PKT_ERROR;\r
- return;\r
+ return (NULL);\r
}\r
\r
/* Make sure allocated buffer is large enough to fit the response packet plus the \r
* rmPktLen and Rm_PktType fields */\r
- if (rmPkt->rmPktLen < (sizeof(Rm_NsResponsePkt) + sizeof(uint32_t) + sizeof(Rm_pktType))\r
+ if (rmPkt->pktLenBytes < (sizeof(Rm_NsResponsePkt) + sizeof(uint32_t) + sizeof(Rm_pktType)))\r
{ \r
receipt->serviceResult = RM_SERVICE_ERROR_TRANSPORT_PKT_BUF_TOO_SMALL;\r
- return;\r
+ return (NULL);\r
}\r
\r
/* Set the Rm Packet type */ \r
@@ -420,7 +418,7 @@ Rm_Packet *Rm_transportCreateNsResponsePkt(Rm_Inst *rmInst, Rm_TransportNode *ds
}\r
\r
/**********************************************************************\r
- *********************** Application visible APIs ***************************\r
+ ********************* Application visible APIs ***********************\r
**********************************************************************/\r
\r
Rm_TransportHandle Rm_transportRegister (Rm_Handle rmHandle, Rm_TransportCfg *transportCfg)\r
@@ -432,9 +430,12 @@ Rm_TransportHandle Rm_transportRegister (Rm_Handle rmHandle, Rm_TransportCfg *tr
/* Lock access to the RM instance */\r
key = Rm_osalLocalCsEnter();\r
\r
- /* RM Servers cannot connect to other Servers */\r
- if ((rmInst->instType == Rm_instType_SERVER) &&\r
- (transportCfg->rmRemoteInstType == Rm_instType_SERVER))\r
+ /* RM Servers cannot connect to other Servers. RM Client Delegates cannot\r
+ * connect to other Client Delegates. */\r
+ if (((rmInst->instType == Rm_instType_SERVER) &&\r
+ (transportCfg->remoteInstType == Rm_instType_SERVER)) ||\r
+ ((rmInst->instType == Rm_instType_CLIENT_DELEGATE) &&\r
+ (transportCfg->remoteInstType == Rm_instType_CLIENT_DELEGATE)))\r
{\r
Rm_osalLocalCsExit(key);\r
return (NULL); /* Error - return null */\r
@@ -453,6 +454,29 @@ Rm_TransportHandle Rm_transportRegister (Rm_Handle rmHandle, Rm_TransportCfg *tr
return (NULL); /* Error - return null */\r
} \r
\r
+ /* Copy the transport callout function pointers into the RM instance as long as they're\r
+ * valid or not NULL */\r
+ if (transportCfg->transportCalloutsValid)\r
+ {\r
+ /* The transport APIs must not be NULL */\r
+ if ((transportCfg->transportCallouts.rmAllocPkt == NULL) ||\r
+ (transportCfg->transportCallouts.rmFreePkt == NULL) ||\r
+ (transportCfg->transportCallouts.rmSend == NULL) ||\r
+ (transportCfg->transportCallouts.rmReceive == NULL) ||\r
+ (transportCfg->transportCallouts.rmNumPktsReceived == NULL))\r
+ {\r
+ Rm_osalLocalCsExit(key);\r
+ return (NULL); /* Error - return null */\r
+ }\r
+ \r
+ /* Populate the instance transport callouts */\r
+ rmInst->transport.rmAllocPkt = transportCfg->transportCallouts.rmAllocPkt;\r
+ rmInst->transport.rmFreePkt = transportCfg->transportCallouts.rmFreePkt;\r
+ rmInst->transport.rmSend = transportCfg->transportCallouts.rmSend;\r
+ rmInst->transport.rmReceive = transportCfg->transportCallouts.rmReceive;\r
+ rmInst->transport.rmNumPktsReceived = transportCfg->transportCallouts.rmNumPktsReceived;\r
+ }\r
+\r
/* Error checks passed - Create a new transport handle for the specified RM instance and\r
* create a new node in the RM instance's routing map. */\r
transportNode = Rm_transportNodeAdd(rmInst, transportCfg);\r
@@ -465,7 +489,6 @@ Rm_TransportHandle Rm_transportRegister (Rm_Handle rmHandle, Rm_TransportCfg *tr
}\r
\r
Rm_osalLocalCsExit(key);\r
-\r
return ((Rm_TransportHandle) transportNode);\r
}\r
\r
@@ -511,17 +534,15 @@ Rm_TransportResult Rm_transportUnregister (Rm_Handle rmHandle, Rm_TransportHandl
int32_t Rm_receivePktIsr(Rm_Handle rmHandle, Rm_TransportHandle transportHandle, Rm_Packet *pkt)\r
{\r\r\r
Rm_Inst *rmInst = (Rm_Inst *)rmHandle;\r
- Rm_TransportNode *transportNode = (Rm_TransportNode *)transportHandle;\r
Rm_Transaction *transaction;\r
Rm_TransactionReceipt receipt;\r
- void *key;\r
\r
/* Make sure the transport handle is registered with the provided RM instance */\r
if (Rm_transportNodeFindTransportHandle(rmInst, transportHandle) == NULL)\r
{\r
/* Transport is not registered with the RM instance. Return an error.\r
* The packet cannot be freed since the transport handle is not valid. */\r
- return (RM_TRANSPORT_ERROR_TRANSPORT_HANDLE_NOT_REGISTERED_WITH_INSTANCE);\r
+ return (RM_TRANSPORT_ERROR_HANDLE_HAS_NOT_BEEN_REGISTERED);\r
}\r
\r
/* Clear the transaction receipt */\r
@@ -531,6 +552,7 @@ int32_t Rm_receivePktIsr(Rm_Handle rmHandle, Rm_TransportHandle transportHandle,
switch (pkt->pktType)\r
{\r
case Rm_pktType_RESOURCE_REQUEST:\r
+ {\r
Rm_ResourceRequestPkt *resourceReqPkt = (Rm_ResourceRequestPkt *)pkt->data;\r
\r
/* The transaction ID will be the request ID. The request ID\r
@@ -539,27 +561,27 @@ int32_t Rm_receivePktIsr(Rm_Handle rmHandle, Rm_TransportHandle transportHandle,
transaction = Rm_transactionQueueAdd(rmInst, resourceReqPkt->requestId);\r
\r
/* Transfer the rest of the data into the transaction */\r
- if (resourceReqPkt->resourceReqType = Rm_resReqPktType_ALLOCATE)\r
+ if (resourceReqPkt->resourceReqType == Rm_resReqPktType_ALLOCATE)\r
{\r
transaction->type = Rm_service_RESOURCE_ALLOCATE;\r
}\r
- else if (resourceReqPkt->resourceReqType = Rm_resReqPktType_BLOCK_ALLOCATE)\r
+ else if (resourceReqPkt->resourceReqType == Rm_resReqPktType_BLOCK_ALLOCATE)\r
{\r
transaction->type = Rm_service_RESOURCE_BLOCK_ALLOCATE;\r
}\r
- else if (resourceReqPkt->resourceReqType = Rm_resReqPktType_ALLOCATE_NAMED)\r
+ else if (resourceReqPkt->resourceReqType == Rm_resReqPktType_ALLOCATE_NAMED)\r
{\r
transaction->type = Rm_service_RESOURCE_ALLOCATE_BY_NAME;\r
}\r
- else if (resourceReqPkt->resourceReqType = Rm_resReqPktType_FREE)\r
+ else if (resourceReqPkt->resourceReqType == Rm_resReqPktType_FREE)\r
{\r
transaction->type = Rm_service_RESOURCE_FREE;\r
}\r
- else if (resourceReqPkt->resourceReqType = Rm_resReqPktType_BLOCK_FREE)\r
+ else if (resourceReqPkt->resourceReqType == Rm_resReqPktType_BLOCK_FREE)\r
{\r
- transaction->type = case Rm_service_RESOURCE_BLOCK_FREE;\r
+ transaction->type = Rm_service_RESOURCE_BLOCK_FREE;\r
}\r
- else if (resourceReqPkt->resourceReqType = Rm_resReqPktType_FREE_NAMED)\r
+ else if (resourceReqPkt->resourceReqType == Rm_resReqPktType_FREE_NAMED)\r
{\r
transaction->type = Rm_service_RESOURCE_FREE_BY_NAME;\r
}\r
@@ -572,19 +594,21 @@ int32_t Rm_receivePktIsr(Rm_Handle rmHandle, Rm_TransportHandle transportHandle,
/* Process the transaction */\r
Rm_transactionProcessor(rmInst, transaction, &receipt);\r
break;\r
+ }\r
case Rm_pktType_RESOURCE_RESPONSE:\r
+ {\r
Rm_ResourceResponsePkt *resourceRespPkt = (Rm_ResourceResponsePkt *)pkt->data;\r
\r
/* If the packet is a response packet the transaction ID should match a queued \r
* request transaction's ID */\r
transaction = Rm_transactionQueueAdd(rmInst, resourceRespPkt->responseId);\r
\r
- if (resourceRespPkt->requestResult = RM_SERVICE_APPROVED)\r
+ if (resourceRespPkt->requestResult == RM_SERVICE_APPROVED)\r
{\r
transaction->state = Rm_transactionState_RESOURCE_APPROVED;\r
}\r
else if ((resourceRespPkt->requestResult >= RM_SERVICE_DENIED_BEGIN) &&\r
- (resourceRespPkt->requestResult <= RM_SERVICE_DENIED_END)\r
+ (resourceRespPkt->requestResult <= RM_SERVICE_DENIED_END))\r
{\r
transaction->state = Rm_transactionState_RESOURCE_DENIED;\r
} \r
@@ -597,7 +621,9 @@ int32_t Rm_receivePktIsr(Rm_Handle rmHandle, Rm_TransportHandle transportHandle,
/* Process the transaction */\r
Rm_transactionProcessor(rmInst, transaction, &receipt);\r
break;\r
+ }\r
case Rm_pktType_NAMESERVER_REQUEST:\r
+ {\r
Rm_NsRequestPkt *nsRequestPkt = (Rm_NsRequestPkt *)pkt->data;\r
\r
transaction = Rm_transactionQueueAdd(rmInst, nsRequestPkt->requestId);\r
@@ -619,18 +645,20 @@ int32_t Rm_receivePktIsr(Rm_Handle rmHandle, Rm_TransportHandle transportHandle,
/* Process the transaction */\r
Rm_transactionProcessor(rmInst, transaction, &receipt); \r
break;\r
+ }\r
case Rm_pktType_NAMESERVER_RESPONSE:\r
+ {\r
Rm_NsResponsePkt *nsResponsePkt = (Rm_NsResponsePkt *)pkt->data;\r
\r
transaction = Rm_transactionQueueAdd(rmInst, nsResponsePkt->responseId);\r
transaction->details = nsResponsePkt->requestResult;\r
\r
- if (nsResponsePkt->requestResult = RM_SERVICE_APPROVED)\r
+ if (nsResponsePkt->requestResult == RM_SERVICE_APPROVED)\r
{\r
transaction->state = Rm_transactionState_RESOURCE_APPROVED;\r
}\r
else if ((nsResponsePkt->requestResult >= RM_SERVICE_DENIED_BEGIN) &&\r
- (nsResponsePkt->requestResult <= RM_SERVICE_DENIED_END)\r
+ (nsResponsePkt->requestResult <= RM_SERVICE_DENIED_END))\r
{\r
transaction->state = Rm_transactionState_RESOURCE_DENIED;\r
}\r
@@ -638,26 +666,40 @@ int32_t Rm_receivePktIsr(Rm_Handle rmHandle, Rm_TransportHandle transportHandle,
/* Process the transaction */\r
Rm_transactionProcessor(rmInst, transaction, &receipt);\r
break;\r
+ }\r
case Rm_pktType_POLICY_REQUEST:\r
+ {\r
Rm_PolicyRequestPkt *policyRequestPkt = (Rm_PolicyRequestPkt *)pkt->data;\r
\r
/* FILL IN POLICY API INFORMATION */\r
- break; \r
+ break; \r
+ }\r
case Rm_pktType_POLICY_CHANGE:\r
+ {\r
Rm_PolicyChangePkt *policyChangePkt = (Rm_PolicyChangePkt *)pkt->data;\r
\r
/* FILL IN POLICY API INFORMATION */\r
break;\r
+ }\r
case Rm_pktType_RESOURCE_POOL_MODIFICATION_REQUEST:\r
+ {\r
Rm_ResourcePoolModRequestPkt *resPoolModReqPkt = (Rm_ResourcePoolModRequestPkt *)pkt->data;\r
\r
/* FILL IN RESOURCE POOL MODIFICATION API */\r
+ /* Rm_resourcePoolModRequestHandler(...); Server only - needs to allocate resources to\r
+ * the Client Delegate based on the policy and return those resources to the Client Delegate */\r
break;\r
+ }\r
case Rm_pktType_RESOURCE_POOL_MODIFICATION_RESPONSE:\r
+ {\r
Rm_ResourcePoolModResponsePkt *resPoolModRespPkt = (Rm_ResourcePoolModResponsePkt *)pkt->data;\r
\r
/* FILL IN RESOURCE POOL MODIFICAITON API */\r
+ /* Rm_resourcePoolModResponseHandler(...); Handler needs to populate allocator with\r
+ * new resources provided in the response and then handle any request transactions waiting on\r
+ * the resource pool modification */\r
break;\r
+ }\r
default:\r
/* Invalid packet type. Free the packet and return */\r
rmInst->transport.rmFreePkt(transportHandle, pkt);\r
@@ -669,7 +711,7 @@ int32_t Rm_receivePktIsr(Rm_Handle rmHandle, Rm_TransportHandle transportHandle,
\r
/* Return the receipt's service result which contains the result return code\r
* for the receive packet */\r
- return (receipt->serviceResult);\r
+ return (receipt.serviceResult);\r
}\r
\r
/* Application can call this API so that RM handles reception of packets based on\r
@@ -685,7 +727,7 @@ int32_t Rm_receivePktPolling(Rm_Handle rmHandle, Rm_TransportHandle transportHan
{\r
/* Transport is not registered with the RM instance. Return an error.\r
* The packet cannot be freed since the transport handle is not valid. */\r
- return (RM_TRANSPORT_ERROR_TRANSPORT_HANDLE_NOT_REGISTERED_WITH_INSTANCE);\r
+ return (RM_TRANSPORT_ERROR_HANDLE_HAS_NOT_BEEN_REGISTERED);\r
}\r
\r
/* Check to see if any RM packets are available. Process any available packets. */\r
diff --git a/test/Module.xs b/test/Module.xs
index 325c6cd720a8f4de5b5a62e42e948edfa1849a76..7a4b78e06dadc295d5baa39defd8b1d35ceed048 100644 (file)
--- a/test/Module.xs
+++ b/test/Module.xs
/******************************************************************************
- * FILE PURPOSE: RM LLD unit test files.
+ * FILE PURPOSE: RM unit test files.
******************************************************************************
* FILE NAME: module.xs
*
* DESCRIPTION:
- * This file contains the module specification for RM LLD test files.
+ * This file contains the module specification for RM test files.
*
* Copyright (C) 2012, Texas Instruments, Inc.
*****************************************************************************/