Use pmap_steal_memory() for the msgbuf instead of trying to squeeze

it in the last chunk (phys_avail block). The last chunk very often is
not larger than one or two pages, resulting in a msgbuf that's too
small to hold a complete verbose boot.
Note that pmap_steal_memory() will bzero the memory it "allocates".
Consequently, ia64 will never preserve previous msgbufs. This is not
a noticable difference in practice. If the msgbuf could be reused,
it was invariably too small to have anything preserved anyway.
This commit is contained in:
Marcel Moolenaar 2003-09-01 07:06:57 +00:00
parent d61a976bc5
commit f02e8e8122
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=119649

View file

@ -719,31 +719,8 @@ ia64_init(void)
/*
* Initialize error message buffer (at end of core).
*/
{
size_t sz = round_page(MSGBUF_SIZE);
int i = phys_avail_cnt - 2;
/* shrink so that it'll fit in the last segment */
if (phys_avail[i+1] - phys_avail[i] < sz)
sz = phys_avail[i+1] - phys_avail[i];
phys_avail[i+1] -= sz;
msgbufp = (struct msgbuf*) IA64_PHYS_TO_RR7(phys_avail[i+1]);
msgbufinit(msgbufp, sz);
/* Remove the last segment if it now has no pages. */
if (phys_avail[i] == phys_avail[i+1]) {
phys_avail[i] = 0;
phys_avail[i+1] = 0;
}
/* warn if the message buffer had to be shrunk */
if (sz != round_page(MSGBUF_SIZE))
printf("WARNING: %ld bytes not available for msgbuf in last cluster (%ld used)\n",
round_page(MSGBUF_SIZE), sz);
}
msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE);
msgbufinit(msgbufp, MSGBUF_SIZE);
proc_linkup(&proc0, &ksegrp0, &kse0, &thread0);
/*