Rev 1026 | Rev 1070 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1026 | Rev 1048 | ||
---|---|---|---|
Line 191... | Line 191... | ||
191 | memsetb((__address) (segment + entry->p_filesz), segment_size - entry->p_filesz, 0); |
191 | memsetb((__address) (segment + entry->p_filesz), segment_size - entry->p_filesz, 0); |
192 | memcpy(segment, (void *) (((__address) elf) + entry->p_offset), entry->p_filesz); |
192 | memcpy(segment, (void *) (((__address) elf) + entry->p_offset), entry->p_filesz); |
193 | } else /* Map identically original data */ |
193 | } else /* Map identically original data */ |
194 | segment = ((void *) elf) + entry->p_offset; |
194 | segment = ((void *) elf) + entry->p_offset; |
195 | 195 | ||
196 | a = as_area_create(as, flags, SIZE2FRAMES(entry->p_memsz), entry->p_vaddr); |
196 | a = as_area_create(as, flags, entry->p_memsz, entry->p_vaddr); |
197 | if (!a) |
197 | if (!a) |
198 | return EE_IRRECOVERABLE; |
198 | return EE_IRRECOVERABLE; |
199 | 199 | ||
200 | for (i = 0; i < SIZE2FRAMES(entry->p_filesz); i++) { |
200 | for (i = 0; i < SIZE2FRAMES(entry->p_filesz); i++) { |
201 | as_set_mapping(as, entry->p_vaddr + i*PAGE_SIZE, KA2PA(((__address) segment) + i*PAGE_SIZE)); |
201 | as_set_mapping(as, entry->p_vaddr + i*PAGE_SIZE, KA2PA(((__address) segment) + i*PAGE_SIZE)); |