Changeset 188 for trunk/kernel/mm
- Timestamp:
- Jul 12, 2017, 8:12:41 PM (7 years ago)
- Location:
- trunk/kernel/mm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/kcm.h
r161 r188 98 98 99 99 /**************************************************************************************** 100 * This function allocates one single object ina Kernel Cache Manager100 * This function allocates one single object from a Kernel Cache Manager 101 101 * The object size must be smaller than one page size. 102 102 **************************************************************************************** -
trunk/kernel/mm/kmem.c
r181 r188 82 82 uint32_t kmem_type_size( uint32_t type ) 83 83 { 84 if ( type == KMEM_PAGE ) return CONFIG_PPM_PAGE_SIZE; 85 else if( type == KMEM_GENERIC ) return 0; 86 else if( type == KMEM_KCM ) return sizeof( kcm_t ); 87 else if( type == KMEM_VSEG ) return sizeof( vseg_t ); 88 else if( type == KMEM_DEVICE ) return sizeof( chdev_t ); 89 else if( type == KMEM_MAPPER ) return sizeof( mapper_t ); 90 else if( type == KMEM_PROCESS ) return sizeof( process_t ); 91 else if( type == KMEM_CPU_CTX ) return sizeof( hal_cpu_context_t ); 92 else if( type == KMEM_FPU_CTX ) return sizeof( hal_fpu_context_t ); 93 else if( type == KMEM_BARRIER ) return sizeof( remote_barrier_t ); 94 95 else if( type == KMEM_FATFS_INODE ) return sizeof( fatfs_inode_t ); 96 else if( type == KMEM_FATFS_CTX ) return sizeof( fatfs_ctx_t ); 97 else if( type == KMEM_DEVFS_INODE ) return sizeof( devfs_inode_t ); 98 else if( type == KMEM_MUTEX ) return sizeof( remote_mutex_t ); 99 else if( type == KMEM_VFS_CTX ) return sizeof( vfs_ctx_t ); 100 else if( type == KMEM_VFS_INODE ) return sizeof( vfs_inode_t ); 101 else if( type == KMEM_VFS_DENTRY ) return sizeof( vfs_dentry_t ); 102 else if( type == KMEM_VFS_FILE ) return sizeof( vfs_file_t ); 103 else if( type == KMEM_SEM ) return sizeof( remote_sem_t ); 104 else if( type == KMEM_CONDVAR ) return sizeof( remote_condvar_t ); 105 84 if ( type == KMEM_PAGE ) return CONFIG_PPM_PAGE_SIZE; 85 else if( type == KMEM_GENERIC ) return 0; 86 else if( type == KMEM_KCM ) return sizeof( kcm_t ); 87 else if( type == KMEM_VSEG ) return sizeof( vseg_t ); 88 else if( type == KMEM_DEVICE ) return sizeof( chdev_t ); 89 else if( type == KMEM_MAPPER ) return sizeof( mapper_t ); 90 else if( type == KMEM_PROCESS ) return sizeof( process_t ); 91 else if( type == KMEM_CPU_CTX ) return CONFIG_CPU_CTX_SIZE; 92 else if( type == KMEM_FPU_CTX ) return CONFIG_FPU_CTX_SIZE; 93 else if( type == KMEM_BARRIER ) return sizeof( remote_barrier_t ); 94 95 else if( type == KMEM_DEVFS_CTX ) return sizeof( fatfs_ctx_t ); 96 else if( type == KMEM_FATFS_CTX ) return sizeof( fatfs_ctx_t ); 97 else if( type == KMEM_VFS_CTX ) return sizeof( vfs_ctx_t ); 98 else if( type == KMEM_VFS_INODE ) return sizeof( vfs_inode_t ); 99 else if( type == KMEM_VFS_DENTRY ) return sizeof( vfs_dentry_t ); 100 else if( type == KMEM_VFS_FILE ) return sizeof( vfs_file_t ); 101 else if( type == KMEM_SEM ) return sizeof( remote_sem_t ); 102 else if( type == KMEM_CONDVAR ) return sizeof( remote_condvar_t ); 103 else if( type == KMEM_MUTEX ) return sizeof( remote_mutex_t ); 106 104 else if( type == KMEM_512_BYTES ) return 512; 107 105 … … 123 121 else if( type == KMEM_BARRIER ) return "KMEM_BARRIER"; 124 122 125 else if( type == KMEM_FATFS_INODE ) return "KMEM_FATFS_INODE"; 126 else if( type == KMEM_FATFS_CTX ) return "KMEM_FATFS_CTX"; 127 else if( type == KMEM_DEVFS_INODE ) return "KMEM_DEVFS_INODE"; 128 else if( type == KMEM_MUTEX ) return "KMEM_MUTEX"; 129 else if( type == KMEM_VFS_CTX ) return "KMEM_VFS_CTX"; 130 else if( type == KMEM_VFS_INODE ) return "KMEM_VFS_INODE"; 131 else if( type == KMEM_VFS_DENTRY ) return "KMEM_VFS_DENTRY"; 132 else if( type == KMEM_VFS_FILE ) return "KMEM_VFS_FILE"; 133 else if( type == KMEM_SEM ) return "KMEM_SEM"; 134 else if( type == KMEM_SEM ) return "KMEM_CONDVAR"; 135 123 else if( type == KMEM_DEVFS_CTX ) return "KMEM_DEVFS_CTX"; 124 else if( type == KMEM_FATFS_CTX ) return "KMEM_FATFS_CTX"; 125 else if( type == KMEM_VFS_CTX ) return "KMEM_VFS_CTX"; 126 else if( type == KMEM_VFS_INODE ) return "KMEM_VFS_INODE"; 127 else if( type == KMEM_VFS_DENTRY ) return "KMEM_VFS_DENTRY"; 128 else if( type == KMEM_VFS_FILE ) return "KMEM_VFS_FILE"; 129 else if( type == KMEM_SEM ) return "KMEM_SEM"; 130 else if( type == KMEM_CONDVAR ) return "KMEM_CONDVAR"; 131 else if( type == KMEM_MUTEX ) return "KMEM_MUTEX"; 136 132 else if( type == KMEM_512_BYTES ) return "KMEM_512_BYTES"; 137 133 -
trunk/kernel/mm/kmem.h
r159 r188 48 48 KMEM_BARRIER = 9, /*! remote_barrier_t */ 49 49 50 KMEM_ FATFS_INODE= 10, /*! fatfs_inode_t */50 KMEM_DEVFS_CTX = 10, /*! fatfs_inode_t */ 51 51 KMEM_FATFS_CTX = 11, /*! fatfs_ctx_t */ 52 KMEM_DEVFS_INODE = 12, /* devfs_inode_t */ 53 KMEM_MUTEX = 13, /*! remote_mutex_t */ 54 KMEM_VFS_CTX = 14, /*! vfs_context_t */ 55 KMEM_VFS_INODE = 15, /*! vfs_inode_t */ 56 KMEM_VFS_DENTRY = 16, /*! vfs_dentry_t */ 57 KMEM_VFS_FILE = 17, /*! vfs_file_t */ 58 KMEM_SEM = 18, /*! remote_sem_t */ 59 KMEM_CONDVAR = 19, /*! remote_condvar_t */ 60 61 KMEM_512_BYTES = 20, /*! 512 bytes aligned */ 52 KMEM_VFS_CTX = 12, /*! vfs_context_t */ 53 KMEM_VFS_INODE = 13, /*! vfs_inode_t */ 54 KMEM_VFS_DENTRY = 14, /*! vfs_dentry_t */ 55 KMEM_VFS_FILE = 15, /*! vfs_file_t */ 56 KMEM_SEM = 16, /*! remote_sem_t */ 57 KMEM_CONDVAR = 17, /*! remote_condvar_t */ 58 KMEM_MUTEX = 18, /*! remote_mutex_t */ 59 KMEM_512_BYTES = 19, /*! 512 bytes aligned */ 62 60 63 61 KMEM_TYPES_NR = 21,
Note: See TracChangeset
for help on using the changeset viewer.