]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/rm-lld.git/blobdiff - include/rm_loc.h
Completed and tested routines that automatically reserve linux resources
[keystone-rtos/rm-lld.git] / include / rm_loc.h
index 18717972c76af0f180fcaef4c60691ca239fc741..32077e31b9ce869fe323cc7a0241c6c83372fec9 100644 (file)
@@ -56,6 +56,9 @@ extern "C" {
  *  resource is allocated the allocatedTo field will be populated with the RM instance
  *  name it was allocated to. */
 #define RM_NOT_ALLOCATED_STRING "\0"
+/** String stored for resource elements that are reserved by the Linux kernel.  These
+ *  resources will be in use for the lifetime of the system */
+#define RM_ALLOCATED_TO_LINUX "Linux-Kernel"
 
 /** Maximum size of a transmittable RM policy in bytes */
 #define RM_MAX_POLICY_SIZE_BYTES (64)  // Placeholder: This will change 
@@ -92,8 +95,8 @@ typedef struct {
     /** If applicable, start of resource range affected by command.  If
      *  RM_RESOURCE_UNSPECIFIED is assigned the higher level RM agent*/
     int32_t base;
-    /** If applicable, range of specified resource, starting from base, affected by command */
-    uint32_t range;
+    /** If applicable, number of specified resource, starting from base, affected by command */
+    uint32_t length;
     /** If applicable, the alignment of the resource affected by the command */
     int32_t alignment;
     /** If applicable, the NameServer name assigned to the specified
@@ -139,6 +142,8 @@ typedef struct {
     int32_t rangeLen;
     const void *nsAssignData;
     int32_t nsAssignLen;
+    const void *linuxAliasData;
+    int32_t linuxAliasLen;
 } Rm_ResourceProperties;
 
 typedef enum {
@@ -155,6 +160,13 @@ typedef enum {
 typedef struct {
     char *srcInstName;
     Rm_AllocatorOp operation;
+    /* When pre-allocating, the policy's ranges and alignment for the resource
+     * for the RM instance will be copied to the following three variables.  These
+     * variables will be used as the basis for pre-allocating a resource. */
+    uint32_t policyBase;
+    uint32_t policyLength;
+    uint32_t policyAlignment;
+    /* Will contain the actual allocation/free values */
     Rm_ResourceInfo *resourceInfo;
 } Rm_AllocatorOpInfo;
 
@@ -213,12 +225,13 @@ typedef struct _Rm_ResourceTreeNode {
     char allocatedTo[RM_INSTANCE_NAME_MAX_CHARS];
 } Rm_ResourceTreeNode;
 
-/* Will need to malloc a tree of type Rm_ResourceTree for each tree i want to create */
-/* Declare the tree head structure */
+/* Declare the tree head structure.  A structure of type Rm_ResourceTree will need to be
+ * malloc'd for each tree that is to be created. */
 typedef RB_HEAD(_Rm_ResourceTree, _Rm_ResourceTreeNode) Rm_ResourceTree;
 
 /* Prototype for function that allocates new tree nodes */
-Rm_ResourceTreeNode *Rm_newResourceTreeNode(uint32_t resourceBase, uint32_t resourceLength);
+Rm_ResourceTreeNode *Rm_newResourceTreeNode(uint32_t resourceBase, uint32_t resourceLength, 
+                                            char *allocatedTo);
 /* Prototype for function that frees new tree nodes */
 void Rm_freeResourceTreeNode(Rm_ResourceTreeNode *treeNode);
 /* Prototype for tree node comparison function