diff options
Diffstat (limited to 'arch')
32 files changed, 534 insertions, 530 deletions
diff --git a/arch/arm/config.in b/arch/arm/config.in index 4271d12a6..3e0bcd0f3 100644 --- a/arch/arm/config.in +++ b/arch/arm/config.in @@ -123,7 +123,7 @@ fi endmenu -if [ "$CONFIG_CPU_32" = "y" -a "$CONFIG_ARCH_EBSA110" != "y" -a "$CONFIG_EXPERIMENTAL" ]; then +if [ "$CONFIG_CPU_32" = "y" -a "$CONFIG_ARCH_EBSA110" != "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then bool 'Enable kernel-mode alignment trap handler (EXPERIMENTAL)' CONFIG_ALIGNMENT_TRAP fi #bool 'Split text into discardable sections' CONFIG_TEXT_SECTIONS diff --git a/arch/i386/config.in b/arch/i386/config.in index b8f081e65..47b2fce5a 100644 --- a/arch/i386/config.in +++ b/arch/i386/config.in @@ -125,7 +125,6 @@ fi endmenu -source drivers/i2o/Config.in source drivers/pnp/Config.in @@ -145,6 +144,8 @@ if [ "$CONFIG_SCSI" != "n" ]; then fi endmenu +source drivers/i2o/Config.in + if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment comment 'Network device support' diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 8b6370667..a2d091cae 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -70,16 +70,6 @@ CONFIG_BINFMT_MISC=y # CONFIG_APM is not set # -# I2O device support -# -# CONFIG_I2O is not set -# CONFIG_I2O_PCI is not set -# CONFIG_I2O_BLOCK is not set -# CONFIG_I2O_LAN is not set -# CONFIG_I2O_SCSI is not set -# CONFIG_I2O_PROC is not set - -# # Plug and Play configuration # CONFIG_PNP=y @@ -125,6 +115,7 @@ CONFIG_BLK_DEV_PIIX=y # CONFIG_BLK_DEV_MD is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_XD is not set +# CONFIG_BLK_DEV_DAC960 is not set CONFIG_PARIDE_PARPORT=y # CONFIG_PARIDE is not set CONFIG_BLK_DEV_IDE_MODES=y @@ -230,6 +221,16 @@ CONFIG_SCSI_NCR53C8XX_SYNC=20 # CONFIG_SCSI_ULTRASTOR is not set # +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# # Network device support # CONFIG_NETDEVICES=y diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c index 043132b8e..d9aa5ce58 100644 --- a/arch/i386/kernel/i386_ksyms.c +++ b/arch/i386/kernel/i386_ksyms.c @@ -37,6 +37,7 @@ EXPORT_SYMBOL(dump_thread); EXPORT_SYMBOL(dump_fpu); EXPORT_SYMBOL(__ioremap); EXPORT_SYMBOL(iounmap); +EXPORT_SYMBOL(__io_virt_debug); EXPORT_SYMBOL(local_bh_count); EXPORT_SYMBOL(local_irq_count); EXPORT_SYMBOL(enable_irq); diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 4937efec2..225246d97 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c @@ -47,8 +47,6 @@ #include <linux/irq.h> -spinlock_t semaphore_wake_lock = SPIN_LOCK_UNLOCKED; - asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); int hlt_counter=0; @@ -341,70 +339,6 @@ void show_regs(struct pt_regs * regs) } /* - * Allocation and freeing of basic task resources. - * - * NOTE! The task struct and the stack go together - * - * The task structure is a two-page thing, and as such - * not reliable to allocate using the basic page alloc - * functions. We have a small cache of structures for - * when the allocations fail.. - * - * This extra buffer essentially acts to make for less - * "jitter" in the allocations.. - * - * On SMP we don't do this right now because: - * - we aren't holding any locks when called, and we might - * as well just depend on the generic memory management - * to do proper locking for us instead of complicating it - * here. - * - if you use SMP you have a beefy enough machine that - * this shouldn't matter.. - */ -#ifndef __SMP__ -#define EXTRA_TASK_STRUCT 16 -static struct task_struct * task_struct_stack[EXTRA_TASK_STRUCT]; -static int task_struct_stack_ptr = -1; -#endif - -struct task_struct * alloc_task_struct(void) -{ -#ifndef EXTRA_TASK_STRUCT - return (struct task_struct *) __get_free_pages(GFP_KERNEL,1); -#else - int index; - struct task_struct *ret; - - index = task_struct_stack_ptr; - if (index >= EXTRA_TASK_STRUCT/2) - goto use_cache; - ret = (struct task_struct *) __get_free_pages(GFP_KERNEL,1); - if (!ret) { - index = task_struct_stack_ptr; - if (index >= 0) { -use_cache: - ret = task_struct_stack[index]; - task_struct_stack_ptr = index-1; - } - } - return ret; -#endif -} - -void free_task_struct(struct task_struct *p) -{ -#ifdef EXTRA_TASK_STRUCT - int index = task_struct_stack_ptr+1; - - if (index < EXTRA_TASK_STRUCT) { - task_struct_stack[index] = p; - task_struct_stack_ptr = index; - } else -#endif - free_pages((unsigned long) p, 1); -} - -/* * No need to lock the MM as we are the last user */ void release_segments(struct mm_struct *mm) @@ -421,19 +355,6 @@ void release_segments(struct mm_struct *mm) } } -void forget_segments(void) -{ - /* forget local segments */ - __asm__ __volatile__("movl %w0,%%fs ; movl %w0,%%gs" - : /* no outputs */ - : "r" (0)); - - /* - * Load the LDT entry of init_task. - */ - load_LDT(&init_mm); -} - /* * Create a kernel thread */ diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 31c77bb1d..029c79334 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -29,6 +29,8 @@ * Cleaned up cache-detection code * Dave Jones <dave@powertweak.com>, October 1999 * + * Added proper L2 cache detection for Coppermine + * Dragan Stancevic <visitor@valinux.com>, October 1999 */ /* @@ -695,14 +697,18 @@ void __init setup_arch(char **cmdline_p) #endif #ifdef CONFIG_BLK_DEV_INITRD -// FIXME needs to do the new bootmem alloc stuff if (LOADER_TYPE) { - initrd_start = INITRD_START ? INITRD_START + PAGE_OFFSET : 0; - initrd_end = initrd_start+INITRD_SIZE; - if (initrd_end > (max_low_pfn << PAGE_SHIFT)) { + if (INITRD_START + INITRD_SIZE < (max_low_pfn << PAGE_SHIFT)) { + reserve_bootmem(INITRD_START, INITRD_SIZE); + initrd_start = + INITRD_START ? INITRD_START + PAGE_OFFSET : 0; + initrd_end = initrd_start+INITRD_SIZE; + } + else { printk("initrd extends beyond end of memory " "(0x%08lx > 0x%08lx)\ndisabling initrd\n", - initrd_end,memory_end); + INITRD_START + INITRD_SIZE, + max_low_pfn << PAGE_SHIFT); initrd_start = 0; } } @@ -1233,6 +1239,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c) break; case 0x42: + case 0x82: /*Detect 256-Kbyte cache on Coppermine*/ c->x86_cache_size = 256; break; diff --git a/arch/mips/config.in b/arch/mips/config.in index 9fc20b48e..14256b262 100644 --- a/arch/mips/config.in +++ b/arch/mips/config.in @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.34 2000/01/23 21:12:56 ralf Exp $ +# $Id: config.in,v 1.35 2000/01/26 00:07:44 ralf Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # @@ -150,8 +150,6 @@ if [ "$CONFIG_DECSTATION" = "y" ]; then endmenu fi -source drivers/i2o/Config.in - source drivers/pnp/Config.in source drivers/block/Config.in @@ -196,6 +194,8 @@ if [ "$CONFIG_SCSI" != "n" ]; then fi endmenu +source drivers/i2o/Config.in + if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment comment 'Network device support' diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 20ff288ce..182024ce8 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.21 2000/01/27 01:05:23 ralf Exp $ +/* $Id: init.c,v 1.22 2000/01/27 23:21:57 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -259,7 +259,7 @@ extern int page_is_ram(unsigned long pagenr); void __init mem_init(void) { unsigned long codesize, reservedpages, datasize, initsize; - unsigned long tmp, nonram; + unsigned long tmp, ram; max_mapnr = num_physpages = max_low_pfn; high_memory = (void *) __va(max_mapnr << PAGE_SHIFT); @@ -267,10 +267,10 @@ void __init mem_init(void) totalram_pages += free_all_bootmem(); totalram_pages -= setup_zero_pages(); /* Setup zeroed pages. */ - reservedpages = nonram = 0; + reservedpages = ram = 0; for (tmp = 0; tmp < max_low_pfn; tmp++) if (page_is_ram(tmp)) { - nonram++; + ram++; if (PageReserved(mem_map+tmp)) reservedpages++; } @@ -282,7 +282,7 @@ void __init mem_init(void) printk("Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, " "%ldk data, %ldk init)\n", (unsigned long) nr_free_pages << (PAGE_SHIFT-10), - (max_mapnr - nonram) << (PAGE_SHIFT-10), + ram << (PAGE_SHIFT-10), codesize >> 10, reservedpages << (PAGE_SHIFT-10), datasize >> 10, diff --git a/arch/mips64/config.in b/arch/mips64/config.in index ead24edff..823c375a6 100644 --- a/arch/mips64/config.in +++ b/arch/mips64/config.in @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.6 2000/01/17 23:32:46 ralf Exp $ +# $Id: config.in,v 1.7 2000/01/20 23:50:27 ralf Exp $ # # For a description of the syntax of this configuration file, # see the Configure script. @@ -111,6 +111,8 @@ if [ "$CONFIG_SCSI" != "n" ]; then fi endmenu +source drivers/i2o/Config.in + if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment comment 'Network device support' diff --git a/arch/mips64/defconfig b/arch/mips64/defconfig index 028845a25..ab794d555 100644 --- a/arch/mips64/defconfig +++ b/arch/mips64/defconfig @@ -66,6 +66,7 @@ CONFIG_BINFMT_ELF=y # CONFIG_BLK_DEV_MD is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_XD is not set +# CONFIG_BLK_DEV_DAC960 is not set CONFIG_PARIDE_PARPORT=m # CONFIG_BLK_DEV_IDE_MODES is not set # CONFIG_BLK_DEV_HD is not set @@ -107,6 +108,16 @@ CONFIG_SKB_LARGE=y # CONFIG_SCSI is not set # +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# # Network device support # CONFIG_NETDEVICES=y diff --git a/arch/mips64/defconfig-ip22 b/arch/mips64/defconfig-ip22 index 1a987ef90..b270cb5dd 100644 --- a/arch/mips64/defconfig-ip22 +++ b/arch/mips64/defconfig-ip22 @@ -104,6 +104,16 @@ CONFIG_SKB_LARGE=y # CONFIG_SCSI is not set # +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# # Network device support # CONFIG_NETDEVICES=y diff --git a/arch/mips64/defconfig-ip27 b/arch/mips64/defconfig-ip27 index 028845a25..ab794d555 100644 --- a/arch/mips64/defconfig-ip27 +++ b/arch/mips64/defconfig-ip27 @@ -66,6 +66,7 @@ CONFIG_BINFMT_ELF=y # CONFIG_BLK_DEV_MD is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_XD is not set +# CONFIG_BLK_DEV_DAC960 is not set CONFIG_PARIDE_PARPORT=m # CONFIG_BLK_DEV_IDE_MODES is not set # CONFIG_BLK_DEV_HD is not set @@ -107,6 +108,16 @@ CONFIG_SKB_LARGE=y # CONFIG_SCSI is not set # +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# # Network device support # CONFIG_NETDEVICES=y diff --git a/arch/mips64/mm/init.c b/arch/mips64/mm/init.c index 473e798e8..d4da03f56 100644 --- a/arch/mips64/mm/init.c +++ b/arch/mips64/mm/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.7 2000/01/27 01:05:24 ralf Exp $ +/* $Id: init.c,v 1.8 2000/01/27 23:21:57 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -354,7 +354,7 @@ extern int page_is_ram(unsigned long pagenr); void __init mem_init(void) { unsigned long codesize, reservedpages, datasize, initsize; - unsigned long tmp, nonram; + unsigned long tmp, ram; max_mapnr = num_physpages = max_low_pfn; high_memory = (void *) __va(max_mapnr << PAGE_SHIFT); @@ -362,10 +362,10 @@ void __init mem_init(void) totalram_pages += free_all_bootmem(); totalram_pages -= setup_zero_pages(); /* Setup zeroed pages. */ - reservedpages = nonram = 0; + reservedpages = ram = 0; for (tmp = 0; tmp < max_low_pfn; tmp++) if (page_is_ram(tmp)) { - nonram++; + ram++; if (PageReserved(mem_map+tmp)) reservedpages++; } @@ -377,7 +377,7 @@ void __init mem_init(void) printk("Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, " "%ldk data, %ldk init)\n", (unsigned long) nr_free_pages << (PAGE_SHIFT-10), - (max_mapnr - nonram) << (PAGE_SHIFT-10), + ram << (PAGE_SHIFT-10), codesize >> 10, reservedpages << (PAGE_SHIFT-10), datasize >> 10, diff --git a/arch/mips64/sgi-ip27/ip27-setup.c b/arch/mips64/sgi-ip27/ip27-setup.c index ace1d7b8f..c97eeb8b6 100644 --- a/arch/mips64/sgi-ip27/ip27-setup.c +++ b/arch/mips64/sgi-ip27/ip27-setup.c @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: ip27-setup.c,v 1.3 2000/01/21 22:34:03 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -23,7 +23,7 @@ /* Check against user dumbness. */ #ifdef CONFIG_VT -#error "CONFIG_VT not allowed for IP27." +#error CONFIG_VT not allowed for IP27. #endif /* diff --git a/arch/ppc/boot/misc.c b/arch/ppc/boot/misc.c index aee407542..6724a8130 100644 --- a/arch/ppc/boot/misc.c +++ b/arch/ppc/boot/misc.c @@ -1,7 +1,7 @@ /* * misc.c * - * $Id: misc.c,v 1.67 1999/08/10 22:53:57 cort Exp $ + * $Id: misc.c,v 1.68 1999/10/20 22:08:08 cort Exp $ * * Adapted for PowerPC by Gary Thomas * @@ -462,6 +462,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, puts(" "); puthex((unsigned long)zimage_size+(unsigned long)zimage_start); puts("\n"); + avail_ram += zimage_size; } /* relocate initrd */ @@ -469,15 +470,19 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, { puts("initrd at: "); puthex(initrd_start); puts(" "); puthex(initrd_end); puts("\n"); -#ifdef OMIT - avail_ram = (char *)PAGE_ALIGN( - (unsigned long)zimage_size+(unsigned long)zimage_start); - memcpy ((void *)avail_ram, (void *)initrd_start, INITRD_SIZE ); - initrd_start = (unsigned long)avail_ram; - initrd_end = initrd_start + INITRD_SIZE; - puts("relocated to: "); puthex(initrd_start); - puts(" "); puthex(initrd_end); puts("\n"); -#endif + if ( (unsigned long)initrd_start <= 0x00800000 ) + { + memcpy( (void *)avail_ram, + (void *)initrd_start, initrd_end-initrd_start ); + puts("relocated to: "); + initrd_end = (unsigned long) avail_ram + (initrd_end-initrd_start); + initrd_start = (unsigned long)avail_ram; + puthex((unsigned long)initrd_start); + puts(" "); + puthex((unsigned long)initrd_end); + puts("\n"); + } + avail_ram = (char *)PAGE_ALIGN((unsigned long)initrd_end); } avail_ram = (char *)0x00400000; diff --git a/arch/ppc/defconfig b/arch/ppc/defconfig index 0bcbf06aa..cebd77dfe 100644 --- a/arch/ppc/defconfig +++ b/arch/ppc/defconfig @@ -1,5 +1,5 @@ # -# Automatically generated by make menuconfig: don't edit +# Automatically generated make config: don't edit # # @@ -8,15 +8,27 @@ CONFIG_PPC=y CONFIG_6xx=y # CONFIG_PPC64 is not set +# CONFIG_82xx is not set # CONFIG_8xx is not set +# CONFIG_MPC821 is not set +# CONFIG_MPC823 is not set +# CONFIG_MPC850 is not set +# CONFIG_MPC855 is not set +# CONFIG_MPC860 is not set +# CONFIG_MPC860T is not set +# CONFIG_RPXLITE is not set +# CONFIG_RPXCLASSIC is not set +# CONFIG_BSEIP is not set +# CONFIG_MBX is not set +# CONFIG_WINCEPT is not set # CONFIG_PMAC is not set # CONFIG_PREP is not set # CONFIG_CHRP is not set -CONFIG_ALL_PPC=y -# CONFIG_GEMINI is not set +# CONFIG_ALL_PPC is not set +CONFIG_GEMINI=y # CONFIG_APUS is not set -# CONFIG_MBX is not set # CONFIG_SMP is not set +CONFIG_MACH_SPECIFIC=y CONFIG_6xx=y # @@ -35,63 +47,45 @@ CONFIG_BINFMT_ELF=y CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set # CONFIG_PARPORT is not set -CONFIG_VGA_CONSOLE=y -CONFIG_FB=y -CONFIG_FB_COMPAT_XPMAC=y -CONFIG_PMAC_PBOOK=y -CONFIG_MAC_FLOPPY=y -CONFIG_MAC_SERIAL=y -# CONFIG_SERIAL_CONSOLE is not set -CONFIG_ADB=y -CONFIG_ADB_CUDA=y -CONFIG_ADB_MACIO=y -CONFIG_ADB_PMU=y -CONFIG_ADB_KEYBOARD=y -CONFIG_PROC_DEVICETREE=y +# CONFIG_VGA_CONSOLE is not set +# CONFIG_FB is not set +# CONFIG_PMAC_PBOOK is not set +# CONFIG_MAC_FLOPPY is not set +# CONFIG_MAC_SERIAL is not set +# CONFIG_ADB is not set +# CONFIG_PROC_DEVICETREE is not set # CONFIG_TOTALMP is not set -CONFIG_BOOTX_TEXT=y +# CONFIG_BOOTX_TEXT is not set # CONFIG_MOTOROLA_HOTSWAP is not set -# CONFIG_CMDLINE_BOOL is not set # # Plug and Play configuration # # CONFIG_PNP is not set -# CONFIG_ISAPNP is not set # # Block devices # -CONFIG_BLK_DEV_FD=y -CONFIG_BLK_DEV_IDE=y -# CONFIG_BLK_DEV_HD_IDE is not set -CONFIG_BLK_DEV_IDEDISK=y -# CONFIG_IDEDISK_MULTI_MODE is not set -CONFIG_BLK_DEV_IDECD=y -# CONFIG_IDECD_SLOTS is not set -# CONFIG_BLK_DEV_IDETAPE is not set -CONFIG_BLK_DEV_IDEFLOPPY=y -# CONFIG_BLK_DEV_IDESCSI is not set -# CONFIG_BLK_DEV_CMD640 is not set -# CONFIG_BLK_DEV_RZ1000 is not set -# CONFIG_BLK_DEV_IDEPCI is not set -CONFIG_BLK_DEV_SL82C105=y -CONFIG_BLK_DEV_IDE_PMAC=y -CONFIG_BLK_DEV_IDEDMA_PMAC=y -CONFIG_IDEDMA_PMAC_AUTO=y -CONFIG_BLK_DEV_IDEDMA=y -CONFIG_IDEDMA_AUTO=y -# CONFIG_IDE_CHIPSETS is not set +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_IDE is not set + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_ONLY is not set # CONFIG_BLK_CPQ_DA is not set -CONFIG_BLK_DEV_LOOP=y + +# +# Additional Block Devices +# +# CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_XD is not set CONFIG_PARIDE_PARPORT=y # CONFIG_PARIDE is not set -CONFIG_BLK_DEV_IDE_MODES=y +# CONFIG_BLK_DEV_IDE_MODES is not set # CONFIG_BLK_DEV_HD is not set # @@ -115,12 +109,20 @@ CONFIG_IP_MULTICAST=y # CONFIG_IP_MROUTE is not set CONFIG_IP_ALIAS=y CONFIG_SYN_COOKIES=y + +# +# (it is safe to leave these untouched) +# CONFIG_SKB_LARGE=y # CONFIG_IPV6 is not set # CONFIG_KHTTPD is not set # CONFIG_ATM is not set + +# +# +# # CONFIG_IPX is not set -CONFIG_ATALK=m +# CONFIG_ATALK is not set # CONFIG_DECNET is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set @@ -140,11 +142,19 @@ CONFIG_ATALK=m # SCSI support # CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# CONFIG_BLK_DEV_SD=y -CONFIG_CHR_DEV_ST=y +# CONFIG_CHR_DEV_ST is not set CONFIG_BLK_DEV_SR=y CONFIG_BLK_DEV_SR_VENDOR=y # CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set @@ -157,11 +167,7 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set -CONFIG_SCSI_AIC7XXX=y -# CONFIG_AIC7XXX_TCQ_ON_BY_DEFAULT is not set -CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 -CONFIG_AIC7XXX_PROC_STATS=y -CONFIG_AIC7XXX_RESET_DELAY=15 +# CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set @@ -175,6 +181,8 @@ CONFIG_AIC7XXX_RESET_DELAY=15 # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_G_NCR5380_PORT is not set +# CONFIG_SCSI_G_NCR5380_MEM is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_NCR53C406A is not set @@ -202,9 +210,8 @@ CONFIG_SCSI_NCR53C8XX_SYNC=20 # CONFIG_SCSI_U14_34F is not set # CONFIG_SCSI_ULTRASTOR is not set # CONFIG_SCSI_DEBUG is not set -CONFIG_SCSI_MESH=y -CONFIG_SCSI_MESH_SYNC_RATE=5 -CONFIG_SCSI_MAC53C94=y +# CONFIG_SCSI_MESH is not set +# CONFIG_SCSI_MAC53C94 is not set # # Network device support @@ -224,8 +231,9 @@ CONFIG_NETDEVICES=y # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -CONFIG_MACE=y -CONFIG_BMAC=y +# CONFIG_MACE is not set +# CONFIG_BMAC is not set +CONFIG_NCR885E=y # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set @@ -235,38 +243,11 @@ CONFIG_BMAC=y # CONFIG_YELLOWFIN is not set # CONFIG_ACENIC is not set # CONFIG_NET_ISA is not set -CONFIG_NET_EISA=y -CONFIG_PCNET32=y -# CONFIG_AC3200 is not set -# CONFIG_APRICOT is not set -# CONFIG_CS89x0 is not set -CONFIG_DE4X5=y -# CONFIG_DEC_ELCP is not set -# CONFIG_DGRS is not set -# CONFIG_EEXPRESS_PRO100 is not set -# CONFIG_LNE390 is not set -# CONFIG_NE3210 is not set -# CONFIG_NE2K_PCI is not set -# CONFIG_TLAN is not set -# CONFIG_VIA_RHINE is not set -# CONFIG_ES3210 is not set -# CONFIG_EPIC100 is not set -# CONFIG_ZNET is not set -# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_NET_EISA is not set # CONFIG_NET_POCKET is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set - -# -# Appletalk devices -# -# CONFIG_LTPC is not set -# CONFIG_COPS is not set -# CONFIG_IPDDP is not set -CONFIG_PPP=y -# CONFIG_PPP_ASYNC is not set -# CONFIG_PPP_DEFLATE is not set -# CONFIG_PPP_BSDCOMP is not set +# CONFIG_PPP is not set # CONFIG_SLIP is not set # CONFIG_NET_RADIO is not set @@ -287,13 +268,6 @@ CONFIG_PPP=y # CONFIG_DLCI is not set # -# PCMCIA network devices -# -# CONFIG_PCMCIA_PCNET is not set -# CONFIG_PCMCIA_3C589 is not set -# CONFIG_PCMCIA_RAYCS is not set - -# # Amateur Radio support # # CONFIG_HAMRADIO is not set @@ -311,45 +285,14 @@ CONFIG_PPP=y # # Console drivers # -CONFIG_DUMMY_CONSOLE=y -# CONFIG_FB_CLGEN is not set -# CONFIG_FB_PM2 is not set -CONFIG_FB_OF=y -CONFIG_FB_CONTROL=y -CONFIG_FB_PLATINUM=y -CONFIG_FB_VALKYRIE=y -CONFIG_FB_IMSTT=y -CONFIG_FB_CT65550=y -# CONFIG_FB_S3TRIO is not set -# CONFIG_FB_VGA16 is not set -CONFIG_FB_MATROX=y -# CONFIG_FB_MATROX_MILLENIUM is not set -CONFIG_FB_MATROX_MYSTIQUE=y -CONFIG_FB_MATROX_G100=y -# CONFIG_FB_MATROX_MULTIHEAD is not set -CONFIG_FB_ATY=y -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FBCON_ADVANCED is not set -CONFIG_FBCON_CFB8=y -CONFIG_FBCON_CFB16=y -CONFIG_FBCON_CFB24=y -CONFIG_FBCON_CFB32=y -# CONFIG_FBCON_FONTWIDTH8_ONLY is not set -CONFIG_FBCON_FONTS=y -# CONFIG_FONT_8x8 is not set -CONFIG_FONT_8x16=y -CONFIG_FONT_SUN8x16=y -CONFIG_FONT_SUN12x22=y -# CONFIG_FONT_6x11 is not set -# CONFIG_FONT_PEARL_8x8 is not set -# CONFIG_FONT_ACORN_8x8 is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -CONFIG_SERIAL=m +CONFIG_SERIAL=y +CONFIG_SERIAL_CONSOLE=y # CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set CONFIG_UNIX98_PTYS=y @@ -362,14 +305,13 @@ CONFIG_BUSMOUSE=y # CONFIG_ATIXL_BUSMOUSE is not set # CONFIG_LOGIBUSMOUSE is not set # CONFIG_MS_BUSMOUSE is not set -# CONFIG_ADB_MOUSE is not set CONFIG_MOUSE=y CONFIG_PSMOUSE=y # CONFIG_82C710_MOUSE is not set # CONFIG_PC110_PAD is not set # CONFIG_QIC02_TAPE is not set # CONFIG_WATCHDOG is not set -CONFIG_NVRAM=y +# CONFIG_NVRAM is not set # CONFIG_RTC is not set # @@ -389,6 +331,14 @@ CONFIG_NVRAM=y # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set +# CONFIG_FT_NORMAL_DEBUG is not set +# CONFIG_FT_FULL_DEBUG is not set +# CONFIG_FT_NO_TRACE is not set +# CONFIG_FT_NO_TRACE_AT_ALL is not set +# CONFIG_FT_STD_FDC is not set +# CONFIG_FT_MACH2 is not set +# CONFIG_FT_PROBE_FC10 is not set +# CONFIG_FT_ALT_FDC is not set # CONFIG_DRM is not set # @@ -400,14 +350,11 @@ CONFIG_NVRAM=y # Filesystems # # CONFIG_QUOTA is not set -CONFIG_AUTOFS_FS=y +# CONFIG_AUTOFS_FS is not set # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_FAT_FS is not set -# CONFIG_MSDOS_FS is not set -# CONFIG_UMSDOS_FS is not set -# CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set @@ -427,11 +374,10 @@ CONFIG_EXT2_FS=y # Network File Systems # # CONFIG_CODA_FS is not set -CONFIG_NFS_FS=y -CONFIG_NFSD=y -# CONFIG_NFSD_SUN is not set -CONFIG_SUNRPC=y -CONFIG_LOCKD=y +# CONFIG_NFS_FS is not set +# CONFIG_NFSD is not set +# CONFIG_SUNRPC is not set +# CONFIG_LOCKD is not set # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set @@ -451,49 +397,11 @@ CONFIG_MSDOS_PARTITION=y # # Sound # -CONFIG_SOUND=y -CONFIG_DMASOUND=y -# CONFIG_SOUND_CMPCI is not set -# CONFIG_SOUND_ES1370 is not set -# CONFIG_SOUND_ES1371 is not set -# CONFIG_SOUND_ESSSOLO1 is not set -# CONFIG_SOUND_MAESTRO is not set -# CONFIG_SOUND_SONICVIBES is not set -# CONFIG_SOUND_MSNDCLAS is not set -# CONFIG_SOUND_MSNDPIN is not set -CONFIG_SOUND_OSS=y -# CONFIG_SOUND_DMAP is not set -# CONFIG_SOUND_PAS is not set -# CONFIG_SOUND_SB is not set -# CONFIG_SOUND_ADLIB is not set -# CONFIG_SOUND_GUS is not set -# CONFIG_SOUND_MPU401 is not set -# CONFIG_SOUND_PSS is not set -# CONFIG_SOUND_MSS is not set -# CONFIG_SOUND_SSCAPE is not set -# CONFIG_SOUND_TRIX is not set -# CONFIG_SOUND_VIA82CXXX is not set -# CONFIG_SOUND_MAD16 is not set -# CONFIG_SOUND_WAVEFRONT is not set -CONFIG_SOUND_CS4232=m -# CONFIG_SOUND_OPL3SA2 is not set -# CONFIG_SOUND_MAUI is not set -# CONFIG_SOUND_SGALAXY is not set -# CONFIG_SOUND_AD1816 is not set -# CONFIG_SOUND_OPL3SA1 is not set -# CONFIG_SOUND_SOFTOSS is not set -# CONFIG_SOUND_YM3812 is not set -# CONFIG_SOUND_VMIDI is not set -# CONFIG_SOUND_UART6850 is not set - -# -# Additional low level sound drivers -# -# CONFIG_LOWLEVEL_SOUND is not set +# CONFIG_SOUND is not set # # Kernel hacking # -CONFIG_MAGIC_SYSRQ=y +# CONFIG_MAGIC_SYSRQ is not set # CONFIG_KGDB is not set -CONFIG_XMON=y +# CONFIG_XMON is not set diff --git a/arch/ppc/kernel/chrp_pci.c b/arch/ppc/kernel/chrp_pci.c index 983a9f2eb..88686acc4 100644 --- a/arch/ppc/kernel/chrp_pci.c +++ b/arch/ppc/kernel/chrp_pci.c @@ -286,9 +286,6 @@ chrp_pcibios_fixup(void) { if ( dev->irq ) dev->irq = openpic_to_irq( dev->irq ); - /* adjust the io_port for the NCR cards for busses other than 0 -- Cort */ - if ( (dev->bus->number > 0) && (dev->vendor == PCI_VENDOR_ID_NCR) ) - dev->resource[0].start += (dev->bus->number*0x08000000); /* these need to be absolute addrs for OF and Matrox FB -- Cort */ if ( dev->vendor == PCI_VENDOR_ID_MATROX ) { @@ -305,6 +302,10 @@ chrp_pcibios_fixup(void) pcibios_write_config_word(dev->bus->number, dev->devfn, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD); } + if ( (dev->bus->number > 0) && + ((dev->vendor == PCI_VENDOR_ID_NCR) || + (dev->vendor == PCI_VENDOR_ID_AMD))) + dev->resource[0].start += (dev->bus->number*0x08000000); } } diff --git a/arch/ppc/kernel/chrp_setup.c b/arch/ppc/kernel/chrp_setup.c index 58d2003c4..e70ba4dca 100644 --- a/arch/ppc/kernel/chrp_setup.c +++ b/arch/ppc/kernel/chrp_setup.c @@ -28,7 +28,6 @@ #include <linux/reboot.h> #include <linux/init.h> #include <linux/blk.h> -#include <linux/ide.h> #include <linux/ioport.h> #include <linux/console.h> #include <linux/pci.h> @@ -37,6 +36,7 @@ #include <linux/adb.h> #include <linux/module.h> #include <linux/delay.h> +#include <linux/ide.h> #include <asm/mmu.h> #include <asm/processor.h> @@ -127,7 +127,7 @@ chrp_get_cpuinfo(char *buffer) len = sprintf(buffer,"machine\t\t: CHRP %s\n", model); /* longtrail (goldengate) stuff */ - if ( !strncmp( model, "IBM,LongTrail", 9 ) ) + if ( !strncmp( model, "IBM,LongTrail", 13 ) ) { /* VLSI VAS96011/12 `Golden Gate 2' */ /* Memory banks */ @@ -198,21 +198,27 @@ static void __init sio_fixup_irq(const char *name, u8 device, u8 level, u8 type) { u8 level0, type0, active; - - /* select logical device */ - sio_write(device, 0x07); - active = sio_read(0x30); - level0 = sio_read(0x70); - type0 = sio_read(0x71); - printk("sio: %s irq level %d, type %d, %sactive: ", name, level0, type0, - !active ? "in" : ""); - if (level0 == level && type0 == type && active) - printk("OK\n"); - else { - printk("remapping to level %d, type %d, active\n", level, type); - sio_write(0x01, 0x30); - sio_write(level, 0x70); - sio_write(type, 0x71); + struct device_node *root; + + root = find_path_device("/"); + if (root && + !strncmp(get_property(root, "model", NULL), "IBM,LongTrail", 13 ) ) + { + /* select logical device */ + sio_write(device, 0x07); + active = sio_read(0x30); + level0 = sio_read(0x70); + type0 = sio_read(0x71); + printk("sio: %s irq level %d, type %d, %sactive: ", name, level0, type0, + !active ? "in" : ""); + if (level0 == level && type0 == type && active) + printk("OK\n"); + else { + printk("remapping to level %d, type %d, active\n", level, type); + sio_write(0x01, 0x30); + sio_write(level, 0x70); + sio_write(type, 0x71); + } } } diff --git a/arch/ppc/kernel/gemini_setup.c b/arch/ppc/kernel/gemini_setup.c index 23060ba26..aee01f105 100644 --- a/arch/ppc/kernel/gemini_setup.c +++ b/arch/ppc/kernel/gemini_setup.c @@ -332,9 +332,12 @@ void __init gemini_init_IRQ(void) /* gemini has no 8259 */ open_pic.irq_offset = 0; - for( i=0; i < 16; i++ ) + for( i=0; i < OPENPIC_VEC_SPURIOUS; i++ ) irq_desc[i].ctl = &open_pic; openpic_init(1); +#ifdef __SMP__ + request_irq(OPENPIC_VEC_IPI, openpic_ipi_action, 0, "IPI0", 0); +#endif /* __SMP__ */ } #define gemini_rtc_read(x) (readb(GEMINI_RTC+(x))) diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c index 42ebfd9f4..8dda6ad6b 100644 --- a/arch/ppc/kernel/idle.c +++ b/arch/ppc/kernel/idle.c @@ -40,10 +40,10 @@ unsigned long zero_paged_on = 0; unsigned long powersave_nap = 0; unsigned long *zero_cache; /* head linked list of pre-zero'd pages */ -unsigned long zero_sz; /* # currently pre-zero'd pages */ -unsigned long zeropage_hits; /* # zero'd pages request that we've done */ -unsigned long zeropage_calls; /* # zero'd pages request that've been made */ -unsigned long zerototal; /* # pages zero'd over time */ +atomic_t zerototal; /* # pages zero'd over time */ +atomic_t zeropage_hits; /* # zero'd pages request that we've done */ +atomic_t zero_sz; /* # currently pre-zero'd pages */ +atomic_t zeropage_calls; /* # zero'd pages request that've been made */ int idled(void) { @@ -57,7 +57,7 @@ int idled(void) check_pgt_cache(); - if ( !current->need_resched && zero_paged_on ) zero_paged(); + /*if ( !current->need_resched && zero_paged_on ) zero_paged();*/ if ( !current->need_resched && htab_reclaim_on ) htab_reclaim(); if ( !current->need_resched ) power_save(); @@ -141,6 +141,7 @@ out: #endif /* CONFIG_8xx */ } +#if 0 /* * Returns a pre-zero'd page from the list otherwise returns * NULL. @@ -149,7 +150,7 @@ unsigned long get_zero_page_fast(void) { unsigned long page = 0; - atomic_inc((atomic_t *)&zero_cache_calls); + atomic_inc(&zero_cache_calls); if ( zero_quicklist ) { /* atomically remove this page from the list */ @@ -194,9 +195,9 @@ void zero_paged(void) unsigned long bytecount = 0; pte_t *pte; - if ( zero_cache_sz >= zero_cache_water[0] ) + if ( atomic_read(&zero_cache_sz) >= zero_cache_water[0] ) return; - while ( (zero_cache_sz < zero_cache_water[1]) && (!current->need_resched) ) + while ( (atomic_read(&zero_cache_sz) < zero_cache_water[1]) && (!current->need_resched) ) { /* * Mark a page as reserved so we can mess with it @@ -272,6 +273,7 @@ void zero_paged(void) atomic_inc((atomic_t *)&zero_cache_total); } } +#endif void power_save(void) { diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c index 9ab3589f6..d851569d5 100644 --- a/arch/ppc/kernel/irq.c +++ b/arch/ppc/kernel/irq.c @@ -241,6 +241,8 @@ int get_irq_list(char *buf) #endif /* __SMP__ */ if ( irq_desc[i].ctl ) len += sprintf(buf+len, " %s ", irq_desc[i].ctl->typename ); + else + len += sprintf(buf+len, " None "); len += sprintf(buf+len, " %s",action->name); for (action=action->next; action; action = action->next) { len += sprintf(buf+len, ", %s", action->name); @@ -297,7 +299,8 @@ asmlinkage void do_IRQ(struct pt_regs *regs, int isfake) if ( irq < 0 ) { /* -2 means ignore, already handled */ - if (irq != -2) { + if (irq != -2) + { printk(KERN_DEBUG "Bogus interrupt %d from PC = %lx\n", irq, regs->nip); ppc_spurious_interrupts++; diff --git a/arch/ppc/kernel/open_pic.c b/arch/ppc/kernel/open_pic.c index 2b5493747..9f3f58a38 100644 --- a/arch/ppc/kernel/open_pic.c +++ b/arch/ppc/kernel/open_pic.c @@ -85,6 +85,7 @@ static void no_action(int ir1, void *dev, struct pt_regs *regs) #ifdef __SMP__ void openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *regs) { +printk("openpic_ipi_action\n"); smp_message_recv(); } #endif /* __SMP__ */ diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c index 518446bf9..8863a9940 100644 --- a/arch/ppc/kernel/setup.c +++ b/arch/ppc/kernel/setup.c @@ -311,18 +311,16 @@ int get_cpuinfo(char *buffer) /* * Ooh's and aah's info about zero'd pages in idle task */ - { - len += sprintf(buffer+len,"zero pages\t: total %lu (%luKb) " - "current: %lu (%luKb) hits: %lu/%lu (%lu%%)\n", - zero_cache_total, - (zero_cache_total*PAGE_SIZE)>>10, - zero_cache_sz, - (zero_cache_sz*PAGE_SIZE)>>10, - zero_cache_hits,zero_cache_calls, - /* : 1 below is so we don't div by zero */ - (zero_cache_hits*100) / - ((zero_cache_calls)?zero_cache_calls:1)); - } + len += sprintf(buffer+len,"zero pages\t: total: %u (%luKb) " + "current: %u (%luKb) hits: %u/%u (%u%%)\n", + atomic_read(&zero_cache_total), + (atomic_read(&zero_cache_total)*PAGE_SIZE)>>10, + atomic_read(&zero_cache_sz), + (atomic_read(&zero_cache_sz)*PAGE_SIZE)>>10, + atomic_read(&zero_cache_hits),atomic_read(&zero_cache_calls), + /* : 1 below is so we don't div by zero */ + (atomic_read(&zero_cache_hits)*100) / + ((atomic_read(&zero_cache_calls))?atomic_read(&zero_cache_calls):1)); if (ppc_md.get_cpuinfo != NULL) { diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c index 638e06b26..a21361340 100644 --- a/arch/ppc/kernel/smp.c +++ b/arch/ppc/kernel/smp.c @@ -159,6 +159,12 @@ void smp_message_recv(void) void smp_send_reschedule(int cpu) { + /* + * This isn't the case anymore since the other CPU could be + * sleeping and won't reschedule until the next interrupt (such + * as the timer). + * -- Cort + */ /* This is only used if `cpu' is running an idle task, so it will reschedule itself anyway... */ /*smp_message_pass(cpu, MSG_RESCHEDULE, 0, 0);*/ @@ -173,7 +179,7 @@ spinlock_t mesg_pass_lock = SPIN_LOCK_UNLOCKED; void smp_message_pass(int target, int msg, unsigned long data, int wait) { int i; - if ( !(_machine & (_MACH_Pmac|_MACH_chrp)) ) + if ( !(_machine & (_MACH_Pmac|_MACH_chrp|_MACH_gemini)) ) return; spin_lock(&mesg_pass_lock); @@ -216,24 +222,29 @@ void smp_message_pass(int target, int msg, unsigned long data, int wait) { /* * There has to be some way of doing this better - - * perhaps a sent-to-all or send-to-all-but-self + * perhaps a send-to-all or send-to-all-but-self * in the openpic. This gets us going for now, though. * -- Cort */ switch ( target ) { case MSG_ALL: - for ( i = 0 ; i < smp_num_cpus ; i++ ) - openpic_cause_IPI(i, 0, 0xffffffff ); + openpic_cause_IPI(smp_processor_id(), 0, 0x0 ); + openpic_cause_IPI(smp_processor_id(), 0, 0xffffffff ); break; case MSG_ALL_BUT_SELF: for ( i = 0 ; i < smp_num_cpus ; i++ ) if ( i != smp_processor_id () ) - openpic_cause_IPI(i, 0, - 0xffffffff & ~(1 << smp_processor_id())); + { + openpic_cause_IPI(smp_processor_id(), 0, + 0x0 ); + openpic_cause_IPI(smp_processor_id(), 0, + 0xffffffff & ~(1 << smp_processor_id())); + } break; default: - openpic_cause_IPI(target, 0, 1U << target); + openpic_cause_IPI(smp_processor_id(), 0, 0x0 ); + openpic_cause_IPI(target, 0, 1U << target ); break; } } @@ -251,8 +262,7 @@ void __init smp_boot_cpus(void) struct task_struct *p; unsigned long a; - printk("Entering SMP Mode...\n"); - /* let other processors know to not do certain initialization */ + printk("Entering SMP Mode...\n"); smp_num_cpus = 1; smp_store_cpu_info(0); @@ -290,15 +300,13 @@ void __init smp_boot_cpus(void) cpu_nr = 2; break; case _MACH_chrp: - /* openpic doesn't report # of cpus, just # possible -- Cort */ -#if 0 - cpu_nr = ((openpic_read(&OpenPIC->Global.Feature_Reporting0) - & OPENPIC_FEATURE_LAST_PROCESSOR_MASK) >> - OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT)+1; -#endif + for ( i = 0; i < 4 ; i++ ) + openpic_enable_IPI(i); cpu_nr = smp_chrp_cpu_nr; break; case _MACH_gemini: + for ( i = 0; i < 4 ; i++ ) + openpic_enable_IPI(i); cpu_nr = (readb(GEMINI_CPUSTAT) & GEMINI_CPU_COUNT_MASK)>>2; cpu_nr = (cpu_nr == 0) ? 4 : cpu_nr; break; @@ -350,19 +358,6 @@ void __init smp_boot_cpus(void) case _MACH_chrp: *(unsigned long *)KERNELBASE = i; asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory"); -#if 0 - device = find_type_devices("cpu"); - /* assume cpu device list is in order, find the ith cpu */ - for ( a = i; device && a; device = device->next, a-- ) - ; - if ( !device ) - break; - printk( "Starting %s (%lu): ", device->full_name, - *(ulong *)get_property(device, "reg", NULL) ); - call_rtas( "start-cpu", 3, 1, NULL, - *(ulong *)get_property(device, "reg", NULL), - __pa(__secondary_start_chrp), i); -#endif break; case _MACH_gemini: openpic_init_processor( 1<<i ); @@ -428,6 +423,7 @@ void __init smp_callin(void) smp_store_cpu_info(current->processor); set_dec(decrementer_count); + init_idle(); #if 0 current->mm->mmap->vm_page_prot = PAGE_SHARED; current->mm->mmap->vm_start = PAGE_OFFSET; diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index d38fa7a22..e21c30e14 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c @@ -1,5 +1,5 @@ /* - * $Id: time.c,v 1.55 1999/08/31 06:54:09 davem Exp $ + * $Id: time.c,v 1.57 1999/10/21 03:08:16 cort Exp $ * Common time routines among all ppc machines. * * Written by Cort Dougan (cort@cs.nmt.edu) to merge @@ -95,37 +95,48 @@ void timer_interrupt(struct pt_regs * regs) } #endif /* __SMP__ */ - while ((dval = get_dec()) < 0) { + dval = get_dec(); + /* + * Wait for the decrementer to change, then jump + * in and add decrementer_count to its value + * (quickly, before it changes again!) + */ + while ((d = get_dec()) == dval) + ; + /* + * Don't play catchup between the call to time_init() + * and sti() in init/main.c. + * + * This also means if we're delayed for > HZ + * we lose those ticks. If we're delayed for > HZ + * then we have something wrong anyway, though. + * + * -- Cort + */ + if ( d < (-1*decrementer_count) ) + d = 0; + set_dec(d + decrementer_count); + if ( !smp_processor_id() ) + { + do_timer(regs); /* - * Wait for the decrementer to change, then jump - * in and add decrementer_count to its value - * (quickly, before it changes again!) + * update the rtc when needed */ - while ((d = get_dec()) == dval) - ; - set_dec(d + decrementer_count); - if ( !smp_processor_id() ) + if ( (time_status & STA_UNSYNC) && + ((xtime.tv_sec > last_rtc_update + 60) || + (xtime.tv_sec < last_rtc_update)) ) { - do_timer(regs); - /* - * update the rtc when needed - */ - if ( (time_status & STA_UNSYNC) && - ((xtime.tv_sec > last_rtc_update + 60) || - (xtime.tv_sec < last_rtc_update)) ) - { - if (ppc_md.set_rtc_time(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else - /* do it again in 60 s */ - last_rtc_update = xtime.tv_sec; - } + if (ppc_md.set_rtc_time(xtime.tv_sec) == 0) + last_rtc_update = xtime.tv_sec; + else + /* do it again in 60 s */ + last_rtc_update = xtime.tv_sec; } } #ifdef __SMP__ smp_local_timer_interrupt(regs); #endif - + if ( ppc_md.heartbeat && !ppc_md.heartbeat_count--) ppc_md.heartbeat(); diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c index 7ccbe656f..34a32fe8c 100644 --- a/arch/ppc/mm/init.c +++ b/arch/ppc/mm/init.c @@ -204,9 +204,8 @@ pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset) if (pmd_none(*pmd)) { if (!mem_init_done) pte = (pte_t *) MMU_get_page(); - else if ((pte = (pte_t *) get_zero_page_fast()) == NULL) - if ((pte = (pte_t *) __get_free_page(GFP_KERNEL))) - clear_page(pte); + else if ((pte = (pte_t *) __get_free_page(GFP_KERNEL))) + clear_page(pte); if (pte) { pmd_val(*pmd) = (unsigned long)pte; return pte + offset; @@ -1156,8 +1155,7 @@ void __init do_init_bootmem(void) __pa(end_of_DRAM) >> PAGE_SHIFT); /* remove the bootmem bitmap from the available memory */ - remove_mem_piece(&phys_avail, start, start + boot_mapsize, 1); - + remove_mem_piece(&phys_avail, start, boot_mapsize, 1); /* add everything in phys_avail into the bootmem map */ for (i = 0; i < phys_avail.n_regions; ++i) free_bootmem(phys_avail.regions[i].address, @@ -1509,10 +1507,10 @@ static void __init hash_init(void) ramsize >> 20, Hash_size >> 10, Hash); if ( Hash_size ) { + if ( ppc_md.progress ) ppc_md.progress("hash:patch", 0x345); Hash_end = (PTE *) ((unsigned long)Hash + Hash_size); __clear_user(Hash, Hash_size); - - if ( ppc_md.progress ) ppc_md.progress("hash:patch", 0x345); + /* * Patch up the instructions in head.S:hash_page */ diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S index bd9c7bb39..ac5a075c0 100644 --- a/arch/sh/kernel/entry.S +++ b/arch/sh/kernel/entry.S @@ -149,7 +149,7 @@ initial_page_write: /* Unwind the stack and jmp to the debug entry */ debug: add #4,r15 ! skip syscall number - ldc.l @r15+,ssr + mov.l @r15+,r11 ! SSR mov.l @r15+,r10 ! original stack mov.l @r15+,r0 mov.l @r15+,r1 @@ -164,6 +164,7 @@ debug: or r9,r14 ldc r14,sr ! here, change the register bank mov r10,k0 + mov r11,k1 mov.l @r15+,r8 mov.l @r15+,r9 mov.l @r15+,r10 @@ -180,7 +181,7 @@ debug: ! mov.l 9f,k0 jmp @k0 - nop + ldc k1,ssr .balign 4 8: .long 0x300000f0 9: .long 0xa0000100 @@ -371,7 +372,7 @@ ret_with_reschedule: ! restore_all: add #4,r15 ! skip syscall number - ldc.l @r15+,ssr + mov.l @r15+,r11 ! SSR mov.l @r15+,r10 ! original stack mov.l @r15+,r0 mov.l @r15+,r1 @@ -386,6 +387,7 @@ restore_all: or r9,r14 ldc r14,sr ! here, change the register bank mov r10,k0 + mov r11,k1 mov.l @r15+,r8 mov.l @r15+,r9 mov.l @r15+,r10 @@ -399,6 +401,7 @@ restore_all: lds.l @r15+,pr ldc.l @r15+,spc mov k0,r15 + ldc k1,ssr rte nop @@ -515,7 +518,7 @@ none: .data ENTRY(exception_handling_table) - .long none /* XXX: Avoid spurious interrupt */ + .long error .long error .long tlb_miss_load .long tlb_miss_store diff --git a/arch/sh/kernel/irq_onchip.c b/arch/sh/kernel/irq_onchip.c index b4ba54f31..0ed3400ef 100644 --- a/arch/sh/kernel/irq_onchip.c +++ b/arch/sh/kernel/irq_onchip.c @@ -89,29 +89,33 @@ static struct hw_interrupt_type onChip_irq_type = { void disable_onChip_irq(unsigned int irq) { + unsigned long val, flags; /* Set priority in IPR to 0 */ int offset = ipr_data[irq-TIMER_IRQ].offset; unsigned long intc_ipr_address = INTC_IPR + (offset/16*INTC_SIZE); unsigned short mask = 0xffff ^ (0xf << (offset%16)); - unsigned long val; + save_and_cli(flags); val = ctrl_inw(intc_ipr_address); val &= mask; ctrl_outw(val, intc_ipr_address); + restore_flags(flags); } static void enable_onChip_irq(unsigned int irq) { + unsigned long val, flags; /* Set priority in IPR back to original value */ int offset = ipr_data[irq-TIMER_IRQ].offset; int priority = ipr_data[irq-TIMER_IRQ].priority; unsigned long intc_ipr_address = INTC_IPR + (offset/16*INTC_SIZE); unsigned short value = (priority << (offset%16)); - unsigned long val; + save_and_cli(flags); val = ctrl_inw(intc_ipr_address); val |= value; ctrl_outw(val, intc_ipr_address); + restore_flags(flags); } void make_onChip_irq(unsigned int irq) diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 59c97a66b..deb532300 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -28,14 +28,17 @@ #ifdef CONFIG_BLK_DEV_RAM #include <linux/blk.h> #endif -#include <asm/processor.h> +#include <linux/bootmem.h> #include <linux/console.h> +#include <asm/processor.h> +#include <asm/page.h> #include <asm/pgtable.h> #include <asm/uaccess.h> #include <asm/system.h> #include <asm/io.h> #include <asm/smp.h> + /* * Machine setup.. */ @@ -62,7 +65,6 @@ extern int _text, _etext, _edata, _end; #define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c)) #define INITRD_START (*(unsigned long *) (PARAM+0x010)) #define INITRD_SIZE (*(unsigned long *) (PARAM+0x014)) -#define MEMORY_END (*(unsigned long *) (PARAM+0x018)) /* ... */ #define COMMAND_LINE ((char *) (PARAM+0x100)) #define COMMAND_LINE_SIZE 256 @@ -105,11 +107,67 @@ static struct resource rom_resources[MAXROMS] = { { "Video ROM", 0xc0000, 0xc7fff } }; -void __init setup_arch(char **cmdline_p, - unsigned long * memory_start_p, - unsigned long * memory_end_p) +static unsigned long memory_start, memory_end; + +unsigned long __init memparse(char *ptr, char **retptr) { - unsigned long memory_start, memory_end; + unsigned long ret; + + ret = simple_strtoul(ptr, retptr, 0); + + if (**retptr == 'K' || **retptr == 'k') { + ret <<= 10; + (*retptr)++; + } + else if (**retptr == 'M' || **retptr == 'm') { + ret <<= 20; + (*retptr)++; + } + return ret; +} /* memparse */ + +static inline void parse_mem_cmdline (char ** cmdline_p) +{ + char c = ' ', *to = command_line, *from = COMMAND_LINE; + int len = 0; + + /* Save unparsed command line copy for /proc/cmdline */ + memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + + memory_start = (unsigned long)__va(0)+__MEMORY_START; + /* Default is 4Mbyte. */ + memory_end = (unsigned long)__va(0x00400000)+__MEMORY_START; + + for (;;) { + /* + * "mem=XXX[kKmM]" defines a size of memory. + */ + if (c == ' ' && !memcmp(from, "mem=", 4)) { + if (to != command_line) + to--; + { + unsigned long mem_size; + + mem_size = memparse(from+4, &from); + memory_end = memory_start + mem_size; + } + } + c = *(from++); + if (!c) + break; + if (COMMAND_LINE_SIZE <= ++len) + break; + *(to++) = c; + } + *to = '\0'; + *cmdline_p = command_line; +} + +void __init setup_arch(char **cmdline_p) +{ + unsigned long bootmap_size; + unsigned long start_pfn, max_pfn, max_low_pfn; ROOT_DEV = to_kdev_t(ORIG_ROOT_DEV); @@ -118,12 +176,9 @@ void __init setup_arch(char **cmdline_p, rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0); rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0); #endif + if (!MOUNT_ROOT_RDONLY) root_mountflags &= ~MS_RDONLY; - - memory_start = (unsigned long) &_end; - memory_end = MEMORY_END; - init_mm.start_code = (unsigned long)&_text; init_mm.end_code = (unsigned long) &_etext; init_mm.end_data = (unsigned long) &_edata; @@ -134,21 +189,73 @@ void __init setup_arch(char **cmdline_p, data_resource.start = virt_to_bus(&_etext); data_resource.end = virt_to_bus(&_edata)-1; - /* Save unparsed command line copy for /proc/cmdline */ - memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + parse_mem_cmdline(cmdline_p); - memcpy(command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - command_line[COMMAND_LINE_SIZE-1] = '\0'; +#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) +#define PFN_DOWN(x) ((x) >> PAGE_SHIFT) +#define PFN_PHYS(x) ((x) << PAGE_SHIFT) - /* Not support "mem=XXX[kKmM]" command line option. */ - *cmdline_p = command_line; + /* + * partially used pages are not usable - thus + * we are rounding upwards: + */ + start_pfn = PFN_UP(__pa(&_end)-__MEMORY_START); - memory_end &= PAGE_MASK; - ram_resources[1].end = memory_end-1; + /* + * Find the highest page frame number we have available + */ + max_pfn = PFN_DOWN(__pa(memory_end)-__MEMORY_START); - *memory_start_p = memory_start; - *memory_end_p = memory_end; + /* + * Determine low and high memory ranges: + */ + max_low_pfn = max_pfn; + + /* + * Initialize the boot-time allocator (with low memory only): + */ + bootmap_size = init_bootmem(start_pfn, max_low_pfn); + + /* + * FIXME: what about high memory? + */ + ram_resources[1].end = PFN_PHYS(max_low_pfn) + __MEMORY_START; + + /* + * Register fully available low RAM pages with the bootmem allocator. + */ + { + unsigned long curr_pfn, last_pfn, size; + + /* + * We are rounding up the start address of usable memory: + */ + curr_pfn = PFN_UP(0); + /* + * ... and at the end of the usable range downwards: + */ + last_pfn = PFN_DOWN(memory_end-__MEMORY_START); + + if (last_pfn > max_low_pfn) + last_pfn = max_low_pfn; + + size = last_pfn - curr_pfn; + free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size)); + } + /* + * Reserve the kernel text and + * Reserve the bootmem bitmap itself as well. We do this in two + * steps (first step was init_bootmem()) because this catches + * the (very unlikely) case of us accidentally initializing the + * bootmem allocator with an invalid RAM area. + */ + reserve_bootmem(PAGE_SIZE, PFN_PHYS(start_pfn) + bootmap_size); + + /* + * reserve physical page 0 - it's a special BIOS page on many boxes, + * enabling clean reboots, SMP operation, laptop functions. + */ + reserve_bootmem(0, PAGE_SIZE); #ifdef CONFIG_BLK_DEV_INITRD if (LOADER_TYPE) { @@ -156,10 +263,12 @@ void __init setup_arch(char **cmdline_p, initrd_end = initrd_start+INITRD_SIZE; if (initrd_end > memory_end) { printk("initrd extends beyond end of memory " - "(0x%08lx > 0x%08lx)\ndisabling initrd\n", - initrd_end,memory_end); + "(0x%08lx > 0x%08lx)\ndisabling initrd\n", + initrd_end,memory_end); initrd_start = 0; - } + } else + reserve_bootmem(__pa(initrd_start)-__MEMORY_START, + INITRD_SIZE); } #endif diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index 934c84744..5f7d68755 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile @@ -6,7 +6,7 @@ $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o L_TARGET = lib.a -L_OBJS = delay.o memcpy.o memset.o memmove.o old-checksum.o \ +L_OBJS = delay.o memcpy.o memset.o memmove.o memchr.o old-checksum.o \ checksum.o include $(TOPDIR)/Rules.make diff --git a/arch/sh/lib/memchr.S b/arch/sh/lib/memchr.S new file mode 100644 index 000000000..d5f9ba2e3 --- /dev/null +++ b/arch/sh/lib/memchr.S @@ -0,0 +1,26 @@ +/* $Id: memchr.S,v 1.1 1999/10/17 11:32:38 gniibe Exp $ + * + * "memchr" implementation of SuperH + * + * Copyright (C) 1999 Niibe Yutaka + * + */ + +/* + * void *memchr(const void *s, int c, size_t n); + */ + +#include <linux/linkage.h> +ENTRY(memchr) + tst r6,r6 + bt/s 2f + exts.b r5,r5 +1: mov.b @r4,r1 + cmp/eq r1,r5 + bt/s 3f + dt r6 + bf/s 1b + add #1,r4 +2: mov #0,r4 +3: rts + mov r4,r0 diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 4c602a385..2dc194a77 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -24,6 +24,7 @@ #ifdef CONFIG_BLK_DEV_INITRD #include <linux/blk.h> #endif +#include <linux/bootmem.h> #include <asm/processor.h> #include <asm/system.h> @@ -37,21 +38,53 @@ */ unsigned long mmu_context_cache; -static unsigned long totalram = 0; +static unsigned long totalram_pages = 0; +static unsigned long totalhigh_pages = 0; extern void show_net_buffers(void); extern unsigned long init_smp_mappings(unsigned long); -void __bad_pte_kernel(pmd_t *pmd) +/* + * BAD_PAGE is the page that is used for page faults when linux + * is out-of-memory. Older versions of linux just did a + * do_exit(), but using this instead means there is less risk + * for a process dying in kernel mode, possibly leaving an inode + * unused etc.. + * + * BAD_PAGETABLE is the accompanying page-table: it is initialized + * to point to BAD_PAGE entries. + * + * ZERO_PAGE is a special page that is used for zero-initialized + * data and COW. + */ + +unsigned long empty_bad_page[1024]; +pte_t empty_bad_pte_table[PTRS_PER_PTE]; +extern unsigned long empty_zero_page[1024]; + +static pte_t * get_bad_pte_table(void) +{ + pte_t v; + int i; + + v = pte_mkdirty(mk_pte_phys(__pa(empty_bad_page), PAGE_SHARED)); + + for (i = 0; i < PAGE_SIZE/sizeof(pte_t); i++) + empty_bad_pte_table[i] = v; + + return empty_bad_pte_table; +} + +void __handle_bad_pmd(pmd_t *pmd) { - printk("Bad pmd in pte_alloc: %08lx\n", pmd_val(*pmd)); - pmd_val(*pmd) = _KERNPG_TABLE + __pa(BAD_PAGETABLE); + pmd_ERROR(*pmd); + pmd_val(*pmd) = _PAGE_TABLE + __pa(get_bad_pte_table()); } -void __bad_pte(pmd_t *pmd) +void __handle_bad_pmd_kernel(pmd_t *pmd) { - printk("Bad pmd in pte_alloc: %08lx\n", pmd_val(*pmd)); - pmd_val(*pmd) = _PAGE_TABLE + __pa(BAD_PAGETABLE); + pmd_ERROR(*pmd); + pmd_val(*pmd) = _KERNPG_TABLE + __pa(get_bad_pte_table()); } pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long offset) @@ -61,16 +94,16 @@ pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long offset) pte = (pte_t *) __get_free_page(GFP_KERNEL); if (pmd_none(*pmd)) { if (pte) { - clear_page((unsigned long)pte); + clear_page(pte); pmd_val(*pmd) = _KERNPG_TABLE + __pa(pte); return pte + offset; } - pmd_val(*pmd) = _KERNPG_TABLE + __pa(BAD_PAGETABLE); + pmd_val(*pmd) = _KERNPG_TABLE + __pa(get_bad_pte_table()); return NULL; } free_page((unsigned long)pte); if (pmd_bad(*pmd)) { - __bad_pte_kernel(pmd); + __handle_bad_pmd_kernel(pmd); return NULL; } return (pte_t *) pmd_page(*pmd) + offset; @@ -83,19 +116,19 @@ pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset) pte = (unsigned long) __get_free_page(GFP_KERNEL); if (pmd_none(*pmd)) { if (pte) { - clear_page(pte); + clear_page((void *)pte); pmd_val(*pmd) = _PAGE_TABLE + __pa(pte); - return (pte_t *)(pte + offset); + return (pte_t *)pte + offset; } - pmd_val(*pmd) = _PAGE_TABLE + __pa(BAD_PAGETABLE); + pmd_val(*pmd) = _PAGE_TABLE + __pa(get_bad_pte_table()); return NULL; } free_page(pte); if (pmd_bad(*pmd)) { - __bad_pte(pmd); + __handle_bad_pmd(pmd); return NULL; } - return (pte_t *) (pmd_page(*pmd) + offset); + return (pte_t *) pmd_page(*pmd) + offset; } int do_check_pgt_cache(int low, int high) @@ -114,37 +147,6 @@ int do_check_pgt_cache(int low, int high) return freed; } -/* - * BAD_PAGE is the page that is used for page faults when linux - * is out-of-memory. Older versions of linux just did a - * do_exit(), but using this instead means there is less risk - * for a process dying in kernel mode, possibly leaving an inode - * unused etc.. - * - * BAD_PAGETABLE is the accompanying page-table: it is initialized - * to point to BAD_PAGE entries. - * - * ZERO_PAGE is a special page that is used for zero-initialized - * data and COW. - */ -pte_t * __bad_pagetable(void) -{ - extern unsigned long empty_bad_page_table[PAGE_SIZE]; - unsigned long page = (unsigned long)empty_bad_page_table; - - clear_page(page); - return (pte_t *)empty_bad_page_table; -} - -pte_t __bad_page(void) -{ - extern char empty_bad_page[PAGE_SIZE]; - unsigned long page = (unsigned long)empty_bad_page; - - clear_page(page); - return pte_mkdirty(mk_pte(page, PAGE_SHARED)); -} - void show_mem(void) { int i,free = 0,total = 0,reserved = 0; @@ -170,13 +172,12 @@ void show_mem(void) printk("%d pages shared\n",shared); printk("%d pages swap cached\n",cached); printk("%ld pages in page table cache\n",pgtable_cache_size); + show_buffers(); #ifdef CONFIG_NET show_net_buffers(); #endif } -extern unsigned long free_area_init(unsigned long, unsigned long); - /* References to section boundaries */ extern char _text, _etext, _edata, __bss_start, _end; @@ -190,13 +191,10 @@ pgd_t swapper_pg_dir[1024]; * This routines also unmaps the page at virtual kernel address 0, so * that we can trap those pesky NULL-reference errors in the kernel. */ -unsigned long __init -paging_init(unsigned long start_mem, unsigned long end_mem) +void __init paging_init(void) { pgd_t * pg_dir; - start_mem = PAGE_ALIGN(start_mem); - /* We don't need kernel mapping as hardware support that. */ pg_dir = swapper_pg_dir; @@ -209,61 +207,25 @@ paging_init(unsigned long start_mem, unsigned long end_mem) mmu_context_cache = MMU_CONTEXT_FIRST_VERSION; set_asid(mmu_context_cache & MMU_CONTEXT_ASID_MASK); - return free_area_init(start_mem, end_mem); + free_area_init(max_low_pfn); } -unsigned long empty_bad_page[1024]; -unsigned long empty_bad_page_table[1024]; -extern unsigned long empty_zero_page[1024]; - -void __init mem_init(unsigned long start_mem, unsigned long end_mem) +void __init mem_init(void) { int codepages = 0; int reservedpages = 0; int datapages = 0; int initpages = 0; - unsigned long tmp; - end_mem &= PAGE_MASK; - high_memory = (void *) end_mem; - max_mapnr = num_physpages = MAP_NR(end_mem); + max_mapnr = num_physpages = max_low_pfn; + high_memory = (void *) ((unsigned long)__va(max_low_pfn * PAGE_SIZE)+__MEMORY_START); /* clear the zero-page */ memset(empty_zero_page, 0, PAGE_SIZE); - /* Mark (clear "reserved" bit) usable pages in the mem_map[] */ - /* Note that all are marked reserved already. */ - tmp = start_mem = PAGE_ALIGN(start_mem); - while (tmp < end_mem) { - clear_bit(PG_reserved, &mem_map[MAP_NR(tmp)].flags); - clear_bit(PG_DMA, &mem_map[MAP_NR(tmp)].flags); - tmp += PAGE_SIZE; - } + /* this will put all low memory onto the freelists */ + totalram_pages += free_all_bootmem(); - for (tmp = PAGE_OFFSET; tmp < end_mem; tmp += PAGE_SIZE) { - if (PageReserved(mem_map+MAP_NR(tmp))) { - if (tmp >= (unsigned long) &_text && tmp < (unsigned long) &_edata) { - if (tmp < (unsigned long) &_etext) - codepages++; - else - datapages++; - } else if (tmp >= (unsigned long) &__init_begin - && tmp < (unsigned long) &__init_end) - initpages++; - else if (tmp >= (unsigned long) &__bss_start - && tmp < (unsigned long) start_mem) - datapages++; - else - reservedpages++; - continue; - } - set_page_count(mem_map+MAP_NR(tmp), 1); - totalram += PAGE_SIZE; -#ifdef CONFIG_BLK_DEV_INITRD - if (!initrd_start || (tmp < initrd_start || tmp >= initrd_end)) -#endif - free_page(tmp); - } printk("Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n", (unsigned long) nr_free_pages << (PAGE_SHIFT-10), max_mapnr << (PAGE_SHIFT-10), @@ -279,19 +241,22 @@ void free_initmem(void) addr = (unsigned long)(&__init_begin); for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { - mem_map[MAP_NR(addr)].flags &= ~(1 << PG_reserved); + ClearPageReserved(mem_map + MAP_NR(addr)); set_page_count(mem_map+MAP_NR(addr), 1); free_page(addr); - totalram += PAGE_SIZE; + totalram_pages++; } printk ("Freeing unused kernel memory: %dk freed\n", (&__init_end - &__init_begin) >> 10); } void si_meminfo(struct sysinfo *val) { - val->totalram = totalram; + val->totalram = totalram_pages; val->sharedram = 0; - val->freeram = nr_free_pages << PAGE_SHIFT; - val->bufferram = atomic_read(&buffermem); + val->freeram = nr_free_pages; + val->bufferram = atomic_read(&buffermem_pages); + val->totalhigh = totalhigh_pages; + val->freehigh = nr_free_highpages; + val->mem_unit = PAGE_SIZE; return; } |