Rev 1196 | Rev 1248 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1196 | Rev 1239 | ||
---|---|---|---|
Line 184... | Line 184... | ||
184 | memsetb((__address) (segment + entry->p_filesz), segment_size - entry->p_filesz, 0); |
184 | memsetb((__address) (segment + entry->p_filesz), segment_size - entry->p_filesz, 0); |
185 | memcpy(segment, (void *) (((__address) elf) + entry->p_offset), entry->p_filesz); |
185 | memcpy(segment, (void *) (((__address) elf) + entry->p_offset), entry->p_filesz); |
186 | } else /* Map identically original data */ |
186 | } else /* Map identically original data */ |
187 | segment = ((void *) elf) + entry->p_offset; |
187 | segment = ((void *) elf) + entry->p_offset; |
188 | 188 | ||
189 | a = as_area_create(as, flags, entry->p_memsz, entry->p_vaddr); |
189 | a = as_area_create(as, flags, entry->p_memsz, entry->p_vaddr, AS_AREA_ATTR_NONE); |
190 | if (!a) |
190 | if (!a) |
191 | return EE_MEMORY; |
191 | return EE_MEMORY; |
192 | 192 | ||
193 | for (i = 0; i < SIZE2FRAMES(entry->p_filesz); i++) { |
193 | for (i = 0; i < SIZE2FRAMES(entry->p_filesz); i++) { |
194 | as_set_mapping(as, entry->p_vaddr + i*PAGE_SIZE, KA2PA(((__address) segment) + i*PAGE_SIZE)); |
194 | as_set_mapping(as, entry->p_vaddr + i*PAGE_SIZE, KA2PA(((__address) segment) + i*PAGE_SIZE)); |