Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2984 → Rev 2985

/branches/dynload/uspace/app/iloader/elf_load.c
293,7 → 293,7
}
}
 
/* if (entry->p_flags & PF_X)
if (entry->p_flags & PF_X)
flags |= AS_AREA_EXEC;
if (entry->p_flags & PF_W)
flags |= AS_AREA_WRITE;
300,9 → 300,8
if (entry->p_flags & PF_R)
flags |= AS_AREA_READ;
flags |= AS_AREA_CACHEABLE;
*/
/* FIXME: Kernel won't normally allow this, unless you "patch" it */
// flags = AS_AREA_READ | AS_AREA_WRITE | AS_AREA_EXEC | AS_AREA_CACHEABLE;
 
/* Final flags for the memory area */
flags = AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE;
 
/*
318,8 → 317,12
printf("map to p_vaddr=0x%x-0x%x...\n", entry->p_vaddr + bias,
entry->p_vaddr + bias + ALIGN_UP(entry->p_memsz, PAGE_SIZE));
 
/*
* For the course of loading, the area needs to be readable
* and writeable.
*/
a = as_area_create((uint8_t *)entry->p_vaddr + bias,
entry->p_memsz, flags);
entry->p_memsz, AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
if (a == (void *)(-1)) {
printf("memory mapping failed\n");
return EE_MEMORY;
355,6 → 358,13
dp += now;
}
 
printf("set area flags to %d\n", flags);
rc = as_area_change_flags((uint8_t *)entry->p_vaddr + bias, flags);
if (rc != 0) {
printf("failed to set memory area flags\n");
return EE_MEMORY;
}
 
return EE_OK;
}