Changeset 406 for trunk/kernel/libk/elf.c
- Timestamp:
- Aug 29, 2017, 12:03:37 PM (7 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.