]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/rm-lld.git/blobdiff - include/rm_allocatorloc.h
Moved allocators from linked list to binary tree
[keystone-rtos/rm-lld.git] / include / rm_allocatorloc.h
index fae62d8a46a39b465b8cfe5b3cbbda1ae6577ee6..e4735b9aa186eb5a40f1755bbc2dc07ede3866f8 100644 (file)
@@ -4,7 +4,7 @@
  *  Private data structures and APIS for Resource Manager allocators.
  *
  *  ============================================================================
- *      (C) Copyright 2012-2013, Texas Instruments, Inc.
+ *      (C) Copyright 2012-2015, Texas Instruments, Inc.
  * 
  *  Redistribution and use in source and binary forms, with or without 
  *  modification, are permitted provided that the following conditions 
@@ -61,8 +61,8 @@ typedef struct {
     /* Pointer to a resource's NameServer assignment data within the GRL DTB.
      * Will be NULL if not defined for the resource node. */
     const void *nsAssignData;
-    /* Length in bytes of a resource's NameServer assignment data in the GRL DTB.
-     * Will be zero if not defined for the resource node. */
+    /* Length in bytes of a resource's NameServer assignment data in the
+     * GRL DTB.  Will be zero if not defined for the resource node. */
     int32_t     nsAssignLen;
     /* Pointer to a resource's Linux alias data within the GRL DTB.  Will be
      * NULL if not defined for the resource node. */
@@ -100,27 +100,20 @@ typedef struct {
     Rm_ResourceInfo        *resourceInfo;
 } Rm_AllocatorOpInfo;
 
-/* RM allocator linked list node */
-typedef struct Rm_Allocator_s {
-    /* Resource name for which the allocator was created.  The resource name
-     * must match a resource node defined in both the GRL and the Policy */
-    char                   resourceName[RM_NAME_MAX_CHARS];
-    /* Pointer to the root entry of the allocator resource tree */
-    Rm_ResourceTree       *allocatorRootEntry;
-    /* Pointer to next resource allocator node */
-    struct Rm_Allocator_s *nextAllocator;
-} Rm_Allocator;
-
-int32_t rmAllocatorCreate(Rm_Handle rmHandle, const char *resourceName, Rm_ResourceRange *range);
-Rm_Allocator *rmAllocatorGetAllocatorList(Rm_Handle rmHandle);
-Rm_Allocator *rmAllocatorFind(Rm_Handle rmHandle, const char *resourceName);
+int32_t rmAllocatorCreate(Rm_Handle rmHandle, const char *resourceName,
+                          Rm_ResourceRange *range);
+Rm_AllocatorTree *rmAllocatorGetTree(Rm_Handle rmHandle);
+Rm_AllocatorNode *rmAllocatorFind(Rm_Handle rmHandle, const char *resourceName);
 int rmAllocatorGetNodeLocalization(Rm_Handle rmHandle, char *resourceName,
                                    int32_t *resBase, uint32_t *resLen);
 int32_t rmAllocatorOperation(Rm_Handle rmHandle, Rm_AllocatorOpInfo *opInfo);
-int32_t rmAllocatorInitializeResources(Rm_Handle rmHandle, void *globalResourceDtb, void *linuxDtb);
-void rmAllocatorDeleteNode(Rm_Handle rmHandle, const char *resName, int32_t resBase, uint32_t resLen);
+int32_t rmAllocatorInitTree(Rm_Handle rmHandle);
+int32_t rmAllocatorPopulateTree(Rm_Handle rmHandle, void *globalResourceDtb,
+                                void *linuxDtb);
+void rmAllocatorDeleteResNode(Rm_Handle rmHandle, Rm_AllocatorNode *allocator,
+                              int32_t resBase, uint32_t resLen);
 int32_t rmAllocatorDelete(Rm_Handle rmHandle, const char *resourceName);
-void rmAllocatorDeleteResources(Rm_Handle rmHandle);
+void rmAllocatorDeleteTree(Rm_Handle rmHandle);
 
 #ifdef __cplusplus
 }