Executable image segments.
Definition in file segment.c.
Prepare segment for loading.
- Parameters
-
segment | Segment start |
filesz | Size of the "allocated bytes" portion of the segment |
memsz | Size of the segment |
- Return values
-
Definition at line 60 of file segment.c.
70 if ( filesz > memsz ) {
82 for ( i = 0 ; i < memmap.count ; i++ ) {
83 if ( (
start >= memmap.regions[i].start ) &&
84 (
end <= memmap.regions[i].end ) ) {
92 DBG (
"Segment [%lx,%lx,%lx) does not fit into available memory\n",
#define EINVAL
Invalid argument.
uint16_t segment
Code segment.
void get_memmap(struct memory_map *memmap)
Get memory map.
uint16_t mid
Middle 16 bits of address.
unsigned long user_to_phys(userptr_t userptr, off_t offset)
Convert user pointer to physical address.
uint32_t start
Starting offset.
void memset_user(userptr_t userptr, off_t offset, int c, size_t len)
Fill user buffer with a constant byte.
#define ERANGE_SEGMENT
Segment-specific error messages.
uint32_t end
Ending offset.
#define DBG(...)
Print a debugging message.
References memory_map::count, DBG, EINVAL, end, memory_region::end, ERANGE_SEGMENT, get_memmap(), memset_user(), mid, memory_map::regions, segment, start, memory_region::start, and user_to_phys().
Referenced by bzimage_exec(), com32_load_image(), com32_prepare_bounce_buffer(), comboot_prepare_segment(), elf_load_segment(), multiboot_add_modules(), multiboot_load_raw(), nbi_prepare_segment(), and pxe_exec().