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

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

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

revision 1.6 by marcus, Mon Sep 15 18:09:45 2003 UTC revision 1.7 by marcus, Mon Sep 15 18:45:16 2003 UTC
# Line 91  unsigned int Line 91  unsigned int
91  make_fpages (l4_word_t start, l4_word_t size, l4_fpage_t *fpages)  make_fpages (l4_word_t start, l4_word_t size, l4_fpage_t *fpages)
92  {  {
93    l4_word_t min_page_size = getpagesize ();    l4_word_t min_page_size = getpagesize ();
94    l4_word_t end = (start + size + min_page_size - 1) & ~(min_page_size - 1);    l4_word_t end = start + size;
95    unsigned int nr_fpages = 0;    unsigned int nr_fpages = 0;
   
96    if (!size)    if (!size)
97      return 0;      return 0;
98    
99    if (start & ~(min_page_size - 1))        if (start & (min_page_size - 1))
     panic ("make_fpages: START is not aligned to minimum page size");  
   if (end & ~(min_page_size - 1))      
100      panic ("make_fpages: START is not aligned to minimum page size");      panic ("make_fpages: START is not aligned to minimum page size");
101      if (size & (min_page_size - 1))
102        panic ("make_fpages: SIZE is not aligned to minimum page size");
103    
104      debug ("Make fpages from 0x%x (size 0x%x): ", start, size);
105    /* END is at least one MIN_PAGE_SIZE larger than START.  */    /* END is at least one MIN_PAGE_SIZE larger than START.  */
106    nr_fpages = 0;    nr_fpages = 0;
107    while (start < end)    while (start < end)
108      {      {
109        fpages[nr_fpages] = l4_fpage (start, end - start);        fpages[nr_fpages] = l4_fpage (start, end - start);
110          debug ("0x%x/%u ", start, l4_size_log2 (fpages[nr_fpages]));
111        start += l4_size (fpages[nr_fpages]);        start += l4_size (fpages[nr_fpages]);
112        nr_fpages++;        nr_fpages++;
113      }      }
114      debug ("\n");
115    return nr_fpages;    return nr_fpages;
116  }  }
117    
# Line 216  start_components (void) Line 218  start_components (void)
218            panic ("Could not find suitable fpage");            panic ("Could not find suitable fpage");
219    
220          fpage = l4_fpage_add_rights (fpages[i], l4_fully_accessible);          fpage = l4_fpage_add_rights (fpages[i], l4_fully_accessible);
221          debug ("Granting Fpage: 0x%x - 0x%x\n", l4_address (fpage),          debug ("Granting Fpage: 0x%x/%u\n", l4_address (fpage),
222                 l4_address (fpage) + l4_size (fpage));                 l4_size_log2 (fpage));
223    
224          if (i != 0)          if (i != 0)
225            fpages[i] = fpages[nr_fpages - 1];            fpages[i] = fpages[nr_fpages - 1];

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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