/[hurd]/hurd-l4/wortel/loader.c
ViewVC logotype

Diff of /hurd-l4/wortel/loader.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by marcus, Mon Sep 15 18:09:45 2003 UTC revision 1.3 by marcus, Mon Sep 15 19:24:01 2003 UTC
# Line 26  Line 26 
26    
27    
28    
29  /* Verify that the memory region START to END (inclusive) is valid.  */  /* Verify that the memory region START to END (exclusive) is valid.  */
30  static void  static void
31  mem_check (const char *name, unsigned long start, unsigned long end)  mem_check (const char *name, unsigned long start, unsigned long end)
32  {  {
# Line 49  mem_check (const char *name, unsigned lo Line 49  mem_check (const char *name, unsigned lo
49          {          {
50            /* Check if the region fits into conventional memory.  */            /* Check if the region fits into conventional memory.  */
51            if (start >= (memdesc->low << 10) && start < (memdesc->high << 10)            if (start >= (memdesc->low << 10) && start < (memdesc->high << 10)
52                && end >= (memdesc->low << 10) && end < (memdesc->high << 10))                && end > (memdesc->low << 10) && end <= (memdesc->high << 10))
53              fits = 1;              fits = 1;
54          }          }
55        else        else
# Line 57  mem_check (const char *name, unsigned lo Line 57  mem_check (const char *name, unsigned lo
57            /* Check if the region overlaps with non-conventional            /* Check if the region overlaps with non-conventional
58               memory.  */               memory.  */
59            if ((start >= (memdesc->low << 10) && start < (memdesc->high << 10))            if ((start >= (memdesc->low << 10) && start < (memdesc->high << 10))
60                || (end >= (memdesc->low << 10) && end < (memdesc->high << 10))                || (end > (memdesc->low << 10) && end <= (memdesc->high << 10))
61                || (start < (memdesc->low << 10) && end > (memdesc->high << 10)))                || (start < (memdesc->low << 10) && end > (memdesc->high << 10)))
62              {              {
63                conflicts = 1;                conflicts = 1;
# Line 102  check_region (const char *name, l4_word_ Line 102  check_region (const char *name, l4_word_
102    for (i = 0; i < nr_regions; i++)    for (i = 0; i < nr_regions; i++)
103      {      {
104        if ((start >= used_regions[i].start && start < used_regions[i].end)        if ((start >= used_regions[i].start && start < used_regions[i].end)
105            || (end >= used_regions[i].start && end < used_regions[i].end)            || (end >= used_regions[i].start && end <= used_regions[i].end)
106            || (start < used_regions[i].start && end >= used_regions[i].start))            || (start < used_regions[i].start && end > used_regions[i].start))
107          panic ("%s (0x%x - 0x%x) conflicts with %s (0x%x - 0x%x)",          panic ("%s (0x%x - 0x%x) conflicts with %s (0x%x - 0x%x)",
108                 name, start, end, used_regions[i].name, used_regions[i].start,                 name, start, end, used_regions[i].name, used_regions[i].start,
109                 used_regions[i].end);                 used_regions[i].end);
# Line 153  loader_remove_region (const char *name) Line 153  loader_remove_region (const char *name)
153  }  }
154    
155    
156  /* Load the ELF image from START to END into memory under the name  /* Load the ELF image from START to END (exclusive) into memory under
157     NAME (also used as the name for the region of the resulting ELF     the name NAME (also used as the name for the region of the
158     program).  Return the lowest and highest address used by the     resulting ELF program).  Return the lowest and highest address used
159     program in NEW_START_P and NEW_END_P, and the entry point in     by the program in NEW_START_P and NEW_END_P, and the entry point in
160     ENTRY.  */     ENTRY.  */
161  void  void
162  loader_elf_load (const char *name, l4_word_t start, l4_word_t end,  loader_elf_load (const char *name, l4_word_t start, l4_word_t end,

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26