Changeset 7 for trunk/kernel/mm/kmem.h
- Timestamp:
- Apr 26, 2017, 2:15:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/kmem.h
r1 r7 31 31 32 32 /************************************************************************************* 33 * This enum defines the Kernel Memory Types for dynamically allocated objects .33 * This enum defines the Kernel Memory Types for dynamically allocated objectsn. 34 34 ************************************************************************************/ 35 35 … … 43 43 KMEM_MAPPER = 5, /*! mapper_t */ 44 44 KMEM_PROCESS = 6, /*! process_t */ 45 KMEM_ TBD_7 = 7,46 KMEM_ TBD_8 = 8,45 KMEM_CPU_CTX = 7, /*! hal_cpu_context_t */ 46 KMEM_FPU_CTX = 8, /*! hal_fpu_context_t */ 47 47 KMEM_TBD_9 = 9, 48 48 … … 58 58 KMEM_TBD_19 = 19, 59 59 60 KMEM_64_BYTES = 20, /*! fixed size buffer */ 61 KMEM_128_BYTES = 21, /*! fixed size buffer */ 62 KMEM_256_BYTES = 22, /*! fixed size buffer */ 63 KMEM_512_BYTES = 23, /*! fixed size buffer */ 64 KMEM_1024_BYTES = 24, /*! fixed size buffer */ 65 KMEM_2048_BYTES = 25, /*! fixed size buffer */ 66 67 KMEM_TYPES_NR = 26, 60 KMEM_TYPES_NR = 20, 68 61 }; 69 62 … … 93 86 * This generic function allocates physical memory in the local cluster 94 87 * as specified by the request descriptor. 95 * It uses three specialised physical memory allocators :88 * It uses three specialised physical memory allocators, depending on request type: 96 89 * - PPM (Physical Pages Manager) allocates N contiguous physical pages, 97 90 * N must be a power of 2. … … 101 94 * handling a dedicated cache for each object type. 102 95 ************************************************************************************* 103 * @ req : local pointer to allocation request 104 * @ return a local pointer to allocated buffer / NULL otherwise 96 * @ req : local pointer to allocation request. 97 * @ return a local pointer on page descriptor if PPM (i.e. type KMEM_PAGE). 98 * return a local pointer to allocated buffer if KCM or KHM. 99 * return NULL if no physical memory available. 105 100 ************************************************************************************/ 106 101 void * kmem_alloc( kmem_req_t * req ); … … 114 109 void kmem_free ( kmem_req_t * req ); 115 110 111 /************************************************************************************* 112 * This function returns a printable string for a kmem object type. 113 ************************************************************************************* 114 * @ type : kmem object type. 115 ************************************************************************************/ 116 char * kmem_type_str( uint32_t type ); 117 118 /************************************************************************************* 119 * This function returns the size (bytes) for a kmem object type. 120 ************************************************************************************* 121 * @ type : kmem object type. 122 ************************************************************************************/ 123 uint32_t kmem_type_size( uint32_t type ); 124 125 /************************************************************************************* 126 * This functions display the content of the KCM pointers Table 127 ************************************************************************************/ 128 void kmem_print_kcm_table(); 129 116 130 117 131 #endif /* _KMEM_H_ */
Note: See TracChangeset
for help on using the changeset viewer.