Changeset 7 for trunk/kernel/mm/kmem.h


Ignore:
Timestamp:
Apr 26, 2017, 2:15:50 PM (5 years ago)
Author:
alain
Message:

Various bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/kmem.h

    r1 r7  
    3131
    3232/*************************************************************************************
    33  * This enum defines the Kernel Memory Types for dynamically allocated objects.
     33 * This enum defines the Kernel Memory Types for dynamically allocated objectsn.
    3434 ************************************************************************************/
    3535
     
    4343  KMEM_MAPPER           = 5,   /*! mapper_t                                         */
    4444  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                                */
    4747  KMEM_TBD_9            = 9,
    4848
     
    5858  KMEM_TBD_19           = 19,
    5959
    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,
    6861};
    6962
     
    9386 * This generic function allocates physical memory in the local cluster
    9487 * 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:
    9689 * - PPM (Physical Pages Manager) allocates N contiguous physical pages,
    9790 *       N must be a power of 2.
     
    10194 *       handling a dedicated cache for each object type.
    10295 *************************************************************************************
    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.
    105100 ************************************************************************************/
    106101void * kmem_alloc( kmem_req_t * req );
     
    114109void  kmem_free ( kmem_req_t * req );
    115110
     111/*************************************************************************************
     112 * This function returns a printable string for a kmem object type.
     113 *************************************************************************************
     114 * @ type   : kmem object type.
     115 ************************************************************************************/
     116char * 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 ************************************************************************************/
     123uint32_t kmem_type_size( uint32_t type );
     124
     125/*************************************************************************************
     126 * This functions display the content of the KCM pointers Table
     127 ************************************************************************************/
     128void kmem_print_kcm_table();
     129
    116130
    117131#endif  /* _KMEM_H_ */
Note: See TracChangeset for help on using the changeset viewer.