summaryrefslogtreecommitdiffstats
path: root/sys/pc98/i386
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-09-04 08:42:35 +0000
committerpeter <peter@FreeBSD.org>2001-09-04 08:42:35 +0000
commit16c92cf0c3846d3d9884886ece826a1ce88374f3 (patch)
tree14dd50fbae6ad43906dcb878c68cdb3fb18bf189 /sys/pc98/i386
parent119d201aabfc4e86f6217363578198cf5c825e01 (diff)
downloadFreeBSD-src-16c92cf0c3846d3d9884886ece826a1ce88374f3.zip
FreeBSD-src-16c92cf0c3846d3d9884886ece826a1ce88374f3.tar.gz
Zap #if 0'ed map init code that got moved to the MI area.
Convert the powerpc tree to use the common code.
Diffstat (limited to 'sys/pc98/i386')
-rw-r--r--sys/pc98/i386/machdep.c140
1 files changed, 0 insertions, 140 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index c6768ac..f0ba824 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -260,146 +260,6 @@ cpu_startup(dummy)
vm_ksubmap_init(&kmi);
-#if 0
- /*
- * Calculate callout wheel size
- */
- for (callwheelsize = 1, callwheelbits = 0;
- callwheelsize < ncallout;
- callwheelsize <<= 1, ++callwheelbits)
- ;
- callwheelmask = callwheelsize - 1;
-
- /*
- * Allocate space for system data structures.
- * The first available kernel virtual address is in "v".
- * As pages of kernel virtual memory are allocated, "v" is incremented.
- * As pages of memory are allocated and cleared,
- * "firstaddr" is incremented.
- * An index into the kernel page table corresponding to the
- * virtual memory address maintained in "v" is kept in "mapaddr".
- */
-
- /*
- * Make two passes. The first pass calculates how much memory is
- * needed and allocates it. The second pass assigns virtual
- * addresses to the various data structures.
- */
- firstaddr = 0;
-again:
- v = (caddr_t)firstaddr;
-
-#define valloc(name, type, num) \
- (name) = (type *)v; v = (caddr_t)((name)+(num))
-#define valloclim(name, type, num, lim) \
- (name) = (type *)v; v = (caddr_t)((lim) = ((name)+(num)))
-
- valloc(callout, struct callout, ncallout);
- valloc(callwheel, struct callout_tailq, callwheelsize);
-
- /*
- * Discount the physical memory larger than the size of kernel_map
- * to avoid eating up all of KVA space.
- */
- if (kernel_map->first_free == NULL) {
- printf("Warning: no free entries in kernel_map.\n");
- physmem_est = physmem;
- } else {
- physmem_est = min(physmem, btoc(kernel_map->max_offset -
- kernel_map->min_offset));
- }
-
- /*
- * The nominal buffer size (and minimum KVA allocation) is BKVASIZE.
- * For the first 64MB of ram nominally allocate sufficient buffers to
- * cover 1/4 of our ram. Beyond the first 64MB allocate additional
- * buffers to cover 1/20 of our ram over 64MB. When auto-sizing
- * the buffer cache we limit the eventual kva reservation to
- * maxbcache bytes.
- *
- * factor represents the 1/4 x ram conversion.
- */
- if (nbuf == 0) {
- int factor = 4 * BKVASIZE / PAGE_SIZE;
-
- nbuf = 50;
- if (physmem_est > 1024)
- nbuf += min((physmem_est - 1024) / factor,
- 16384 / factor);
- if (physmem_est > 16384)
- nbuf += (physmem_est - 16384) * 2 / (factor * 5);
-
- if (maxbcache && nbuf > maxbcache / BKVASIZE)
- nbuf = maxbcache / BKVASIZE;
- }
-
- /*
- * Do not allow the buffer_map to be more then 1/2 the size of the
- * kernel_map.
- */
- if (nbuf > (kernel_map->max_offset - kernel_map->min_offset) /
- (BKVASIZE * 2)) {
- nbuf = (kernel_map->max_offset - kernel_map->min_offset) /
- (BKVASIZE * 2);
- printf("Warning: nbufs capped at %d\n", nbuf);
- }
-
- nswbuf = max(min(nbuf/4, 256), 16);
-
- valloc(swbuf, struct buf, nswbuf);
- valloc(buf, struct buf, nbuf);
- v = bufhashinit(v);
-
- /*
- * End of first pass, size has been calculated so allocate memory
- */
- if (firstaddr == 0) {
- size = (vm_size_t)(v - firstaddr);
- firstaddr = (int)kmem_alloc(kernel_map, round_page(size));
- if (firstaddr == 0)
- panic("startup: no room for tables");
- goto again;
- }
-
- /*
- * End of second pass, addresses have been assigned
- */
- if ((vm_size_t)(v - firstaddr) != size)
- panic("startup: table size inconsistency");
-
- clean_map = kmem_suballoc(kernel_map, &clean_sva, &clean_eva,
- (nbuf*BKVASIZE) + (nswbuf*MAXPHYS) + pager_map_size);
- buffer_map = kmem_suballoc(clean_map, &buffer_sva, &buffer_eva,
- (nbuf*BKVASIZE));
- buffer_map->system_map = 1;
- pager_map = kmem_suballoc(clean_map, &pager_sva, &pager_eva,
- (nswbuf*MAXPHYS) + pager_map_size);
- pager_map->system_map = 1;
- exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr,
- (16*(ARG_MAX+(PAGE_SIZE*3))));
-
- /*
- * XXX: Mbuf system machine-specific initializations should
- * go here, if anywhere.
- */
-
- /*
- * Initialize callouts
- */
- SLIST_INIT(&callfree);
- for (i = 0; i < ncallout; i++) {
- callout_init(&callout[i], 0);
- callout[i].c_flags = CALLOUT_LOCAL_ALLOC;
- SLIST_INSERT_HEAD(&callfree, &callout[i], c_links.sle);
- }
-
- for (i = 0; i < callwheelsize; i++) {
- TAILQ_INIT(&callwheel[i]);
- }
-
- mtx_init(&callout_lock, "callout", MTX_SPIN | MTX_RECURSE);
-#endif
-
#if defined(USERCONFIG)
userconfig();
cninit(); /* the preferred console may have changed */
OpenPOWER on IntegriCloud