diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/alpha/machdep.c | 80 | ||||
-rw-r--r-- | sys/alpha/alpha/pmap.c | 12 | ||||
-rw-r--r-- | sys/alpha/include/param.h | 4 |
3 files changed, 43 insertions, 53 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index feec3f7..4a8fb48 100644 --- a/sys/alpha/alpha/machdep.c +++ b/sys/alpha/alpha/machdep.c @@ -859,57 +859,55 @@ alpha_init(pfn, ptb, bim, bip, biv) * XXX memory after the kernel in the first system segment, * XXX to avoid clobbering prom mapping, data, etc. */ - if (!pmap_uses_prom_console() || physmem == 0) { - physmem += memc->mddt_pg_cnt; - pfn0 = memc->mddt_pfn; - pfn1 = memc->mddt_pfn + memc->mddt_pg_cnt; - if (pfn0 <= kernendpfn && kernstartpfn <= pfn1) { - /* - * Must compute the location of the kernel - * within the segment. - */ -#ifdef DEBUG_CLUSTER - printf("Cluster %d contains kernel\n", i); -#endif - if (!pmap_uses_prom_console()) { - if (pfn0 < kernstartpfn) { - /* - * There is a chunk before the kernel. - */ + physmem += memc->mddt_pg_cnt; + pfn0 = memc->mddt_pfn; + pfn1 = memc->mddt_pfn + memc->mddt_pg_cnt; + if (pfn0 <= kernendpfn && kernstartpfn <= pfn1) { + /* + * Must compute the location of the kernel + * within the segment. + */ #ifdef DEBUG_CLUSTER - printf("Loading chunk before kernel: " - "0x%lx / 0x%lx\n", pfn0, kernstartpfn); + printf("Cluster %d contains kernel\n", i); #endif - phys_avail[phys_avail_cnt] = alpha_ptob(pfn0); - phys_avail[phys_avail_cnt+1] = alpha_ptob(kernstartpfn); - phys_avail_cnt += 2; - } - } - if (kernendpfn < pfn1) { - /* - * There is a chunk after the kernel. - */ + if (!pmap_uses_prom_console()) { + if (pfn0 < kernstartpfn) { + /* + * There is a chunk before the kernel. + */ #ifdef DEBUG_CLUSTER - printf("Loading chunk after kernel: " - "0x%lx / 0x%lx\n", kernendpfn, pfn1); + printf("Loading chunk before kernel: " + "0x%lx / 0x%lx\n", pfn0, kernstartpfn); #endif - phys_avail[phys_avail_cnt] = alpha_ptob(kernendpfn); - phys_avail[phys_avail_cnt+1] = alpha_ptob(pfn1); + phys_avail[phys_avail_cnt] = alpha_ptob(pfn0); + phys_avail[phys_avail_cnt+1] = alpha_ptob(kernstartpfn); phys_avail_cnt += 2; } - } else { + } + if (kernendpfn < pfn1) { /* - * Just load this cluster as one chunk. + * There is a chunk after the kernel. */ #ifdef DEBUG_CLUSTER - printf("Loading cluster %d: 0x%lx / 0x%lx\n", i, - pfn0, pfn1); + printf("Loading chunk after kernel: " + "0x%lx / 0x%lx\n", kernendpfn, pfn1); #endif - phys_avail[phys_avail_cnt] = alpha_ptob(pfn0); + phys_avail[phys_avail_cnt] = alpha_ptob(kernendpfn); phys_avail[phys_avail_cnt+1] = alpha_ptob(pfn1); phys_avail_cnt += 2; - } + } else { + /* + * Just load this cluster as one chunk. + */ +#ifdef DEBUG_CLUSTER + printf("Loading cluster %d: 0x%lx / 0x%lx\n", i, + pfn0, pfn1); +#endif + phys_avail[phys_avail_cnt] = alpha_ptob(pfn0); + phys_avail[phys_avail_cnt+1] = alpha_ptob(pfn1); + phys_avail_cnt += 2; + } } phys_avail[phys_avail_cnt] = 0; @@ -956,16 +954,16 @@ alpha_init(pfn, ptb, bim, bip, biv) phys_avail[i+1] -= sz; msgbufp = (struct msgbuf*) ALPHA_PHYS_TO_K0SEG(phys_avail[i+1]); - msgbufinit(msgbufp, MSGBUF_SIZE); + 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; /* warn if the message buffer had to be shrunk */ - if (sz != round_page(MSGBUFSIZE)) + if (sz != round_page(MSGBUF_SIZE)) printf("WARNING: %ld bytes not available for msgbuf in last cluster (%ld used)\n", - round_page(MSGBUFSIZE), sz); + round_page(MSGBUF_SIZE), sz); } diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 72e3c4b..89c8c6d 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -172,6 +172,7 @@ #include <sys/user.h> #include <machine/md_var.h> +#include <machine/rpb.h> #ifndef PMAP_SHPGPERPROC #define PMAP_SHPGPERPROC 200 @@ -606,19 +607,14 @@ pmap_bootstrap(vm_offset_t ptaddr, u_int maxasn) int pmap_uses_prom_console() { -#if 0 - extern int cputype; + int cputype; -#if defined(NEW_SCC_DRIVER) - return (cputype == ST_DEC_21000); -#else + cputype = hwrpb->rpb_type; return (cputype == ST_DEC_21000 || cputype == ST_DEC_3000_300 || cputype == ST_DEC_3000_500); -#endif /* NEW_SCC_DRIVER */ -#endif - return 1; + return 0; } /* diff --git a/sys/alpha/include/param.h b/sys/alpha/include/param.h index 53a610a..80dce22 100644 --- a/sys/alpha/include/param.h +++ b/sys/alpha/include/param.h @@ -114,10 +114,6 @@ #define UPAGES 2 /* pages of u-area */ #define USPACE (UPAGES * PAGE_SIZE) /* total size of u-area */ -#ifndef MSGBUFSIZE -#define MSGBUFSIZE PAGE_SIZE /* default message buffer size */ -#endif - /* * Constants related to network buffer management. * MCLBYTES must be no larger than CLBYTES (the software page size), and, |