Changeset 406 for trunk/kernel/libk
- Timestamp:
- Aug 29, 2017, 12:03:37 PM (7 years ago)
- Location:
- trunk/kernel/libk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/elf.c
r401 r406 24 24 #include <kernel_config.h> 25 25 #include <hal_types.h> 26 #include <hal_special.h> 26 27 #include <hal_uspace.h> 27 28 #include <printk.h> 28 29 #include <process.h> 30 #include <thread.h> 31 #include <mapper.h> 29 32 #include <vseg.h> 30 33 #include <kmem.h> … … 165 168 type = VSEG_TYPE_CODE; 166 169 process->vmm.code_vpn_base = vbase >> CONFIG_PPM_PAGE_SHIFT; 167 168 elf_dmsg("\n[INFO] %s : found CODE vseg / base = %x / size = %x\n",169 __FUNCTION__ , vbase , mem_size );170 170 } 171 171 else // found DATA segment … … 173 173 type = VSEG_TYPE_DATA; 174 174 process->vmm.data_vpn_base = vbase >> CONFIG_PPM_PAGE_SHIFT; 175 176 elf_dmsg("\n[INFO] %s : found DATA vseg / base = %x / size = %x\n",177 __FUNCTION__, vbase , mem_size );178 175 } 179 176 … … 194 191 vfs_file_t * file_ptr = (vfs_file_t *)GET_PTR( file_xp ); 195 192 193 // get local pointer on .elf file mapper 194 mapper_t * mapper_ptr = (mapper_t *)hal_remote_lpt( XPTR( file_cxy , 195 &file_ptr->mapper ) ); 196 196 197 // initialize "file_mapper", "file_offset", "file_size" fields in vseg 197 vseg->mapper_xp = (xptr_t)hal_remote_lwd( XPTR( file_cxy , &file_ptr->mapper ));198 vseg->mapper_xp = XPTR( file_cxy , mapper_ptr ); 198 199 vseg->file_offset = file_offset; 199 200 vseg->file_size = file_size; … … 201 202 // update reference counter in file descriptor 202 203 vfs_file_count_up( file_xp ); 204 205 elf_dmsg("\n[DMSG] %s : found %s vseg / base = %x / size = %x\n" 206 " file_size = %x / file_offset = %x / mapper_xp = %l\n", 207 __FUNCTION__ , vseg_type_str(vseg->type) , vseg->min , vseg->max - vseg->min , 208 vseg->file_size , vseg->file_offset , vseg->mapper_xp ); 203 209 } 204 210 … … 219 225 error_t error; 220 226 221 elf_dmsg("\n[ INFO] %s : core[%x,%d] enter for <%s>\n",227 elf_dmsg("\n[DMSG] %s : core[%x,%d] enter for <%s>\n", 222 228 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname ); 223 229 … … 239 245 } 240 246 241 elf_dmsg("\n[ INFO] %s : open file <%s>\n", __FUNCTION__ , pathname );247 elf_dmsg("\n[DMSG] %s : open file <%s>\n", __FUNCTION__ , pathname ); 242 248 243 249 // load header in local buffer … … 252 258 } 253 259 254 elf_dmsg("\n[ INFO] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );260 elf_dmsg("\n[DMSG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname ); 255 261 256 262 if( header.e_phnum == 0 ) … … 289 295 } 290 296 291 elf_dmsg("\n[ INFO] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );297 elf_dmsg("\n[DMSG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname ); 292 298 293 299 // load seg descriptors array to local buffer … … 306 312 } 307 313 308 elf_dmsg("\n[ INFO] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );314 elf_dmsg("\n[DMSG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname ); 309 315 310 316 // register loadable segments in process VMM … … 331 337 kmem_free(&req); 332 338 333 elf_dmsg("\n[ INFO] %s : core[%x,%d] exit for <%s> / entry_point = %x\n",339 elf_dmsg("\n[DMSG] %s : core[%x,%d] exit for <%s> / entry_point = %x\n", 334 340 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname , header.e_entry ); 335 341 -
trunk/kernel/libk/grdxt.c
r396 r406 26 26 #include <errno.h> 27 27 #include <printk.h> 28 #include <vseg.h> 28 29 #include <kmem.h> 29 30 #include <grdxt.h> … … 125 126 intptr_t value; 126 127 127 printk(" *** %s : n1 = %d / n2 = %d / n3 = %d\n",128 printk("\n***** Generic Radix tree %s : n1 = %d / n2 = %d / n3 = %d\n\n", 128 129 name, 1<<w1 , 1<<w2 , 1<<w3 ); 129 130 -
trunk/kernel/libk/grdxt.h
r1 r406 36 36 * Memory for the second and third levels arrays is dynamically allocated by the 37 37 * grdxt_insert() function and is only released by grdxt_destroy(). 38 * - It used to by the VMM to retrieve a vseg descriptor: key is the virtual address. 39 * - It is used by the mapper to implement the file cache: key is the page index in file. 38 * It is used by the MAPPER to implement the file cache: key is the page index in file. 40 39 ******************************************************************************************/ 41 40 … … 48 47 } 49 48 grdxt_t; 50 51 49 52 50 /******************************************************************************************* … … 122 120 123 121 /******************************************************************************************* 124 * This function displays the c ontent of theradix_tree.122 * This function displays the current content of a radix_tree. 125 123 ******************************************************************************************* 126 124 * @ rt : pointer on the radix-tree descriptor. 127 * @ name : string identifying the radix-tree.125 * @ string : radix tree identifier. 128 126 ******************************************************************************************/ 129 127 void grdxt_print( grdxt_t * rt, 130 char * name);128 char * string ); 131 129 132 130
Note: See TracChangeset
for help on using the changeset viewer.