Commit 334c8b07 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (7/14) resync

ROOT_DEV converted to dev_t.  There's no reason for it to be kdev_t -
it's both used as a number and set as a number.
parent 92ca434d
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
#include <linux/blk.h> #include <linux/blk.h>
...@@ -608,7 +609,7 @@ setup_arch(char **cmdline_p) ...@@ -608,7 +609,7 @@ setup_arch(char **cmdline_p)
#endif #endif
/* Default root filesystem to sda2. */ /* Default root filesystem to sda2. */
ROOT_DEV = to_kdev_t(0x0802); ROOT_DEV = Root_SDA2;
/* /*
* Check ASN in HWRPB for validity, report if bad. * Check ASN in HWRPB for validity, report if bad.
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/root_dev.h>
#include <asm/elf.h> #include <asm/elf.h>
#include <asm/hardware.h> #include <asm/hardware.h>
...@@ -438,7 +439,7 @@ static int __init parse_tag_core(const struct tag *tag) ...@@ -438,7 +439,7 @@ static int __init parse_tag_core(const struct tag *tag)
if (tag->hdr.size > 2) { if (tag->hdr.size > 2) {
if ((tag->u.core.flags & 1) == 0) if ((tag->u.core.flags & 1) == 0)
root_mountflags &= ~MS_RDONLY; root_mountflags &= ~MS_RDONLY;
ROOT_DEV = to_kdev_t(tag->u.core.rootdev); ROOT_DEV = tag->u.core.rootdev;
} }
return 0; return 0;
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/root_dev.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <asm/e820.h> #include <asm/e820.h>
#include <asm/mpspec.h> #include <asm/mpspec.h>
...@@ -602,7 +603,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -602,7 +603,7 @@ void __init setup_arch(char **cmdline_p)
visws_get_board_type_and_rev(); visws_get_board_type_and_rev();
#endif #endif
ROOT_DEV = to_kdev_t(ORIG_ROOT_DEV); ROOT_DEV = ORIG_ROOT_DEV;
drive_info = DRIVE_INFO; drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO; screen_info = SCREEN_INFO;
apm_info.bios = APM_BIOS_INFO; apm_info.bios = APM_BIOS_INFO;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/root_dev.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/machvec.h> #include <asm/machvec.h>
...@@ -44,7 +45,7 @@ dig_setup (char **cmdline_p) ...@@ -44,7 +45,7 @@ dig_setup (char **cmdline_p)
* is physical disk 1 partition 1 and the Linux root disk is * is physical disk 1 partition 1 and the Linux root disk is
* physical disk 1 partition 2. * physical disk 1 partition 2.
*/ */
ROOT_DEV = to_kdev_t(0x0802); /* default to second partition on first drive */ ROOT_DEV = Root_SDA2; /* default to second partition on first drive */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
init_smp_config(); init_smp_config();
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/kdev_t.h> #include <linux/kdev_t.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/root_dev.h>
#include <asm/delay.h> #include <asm/delay.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -52,7 +53,7 @@ ia64_ctl_trace (long on) ...@@ -52,7 +53,7 @@ ia64_ctl_trace (long on)
void __init void __init
hpsim_setup (char **cmdline_p) hpsim_setup (char **cmdline_p)
{ {
ROOT_DEV = to_kdev_t(0x0801); /* default to first SCSI drive */ ROOT_DEV = Root_SDA1; /* default to first SCSI drive */
register_console (&hpsim_cons); register_console (&hpsim_cons);
} }
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/mmzone.h> #include <linux/mmzone.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/root_dev.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/sal.h> #include <asm/sal.h>
...@@ -259,7 +260,7 @@ sn1_setup(char **cmdline_p) ...@@ -259,7 +260,7 @@ sn1_setup(char **cmdline_p)
* we set the default root device to /dev/hda * we set the default root device to /dev/hda
* to make simulation easy * to make simulation easy
*/ */
ROOT_DEV = to_kdev_t(0x0301); ROOT_DEV = Root_HDA1;
/* /*
* Create the PDAs and NODEPDAs for all the cpus. * Create the PDAs and NODEPDAs for all the cpus.
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/mc146818rtc.h> #include <linux/mc146818rtc.h>
#include <linux/root_dev.h>
#include <asm/cpu.h> #include <asm/cpu.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
...@@ -104,7 +105,7 @@ void __init au1000_setup(void) ...@@ -104,7 +105,7 @@ void __init au1000_setup(void)
ioport_resource.end = au1000_resources.lcd.end; ioport_resource.end = au1000_resources.lcd.end;
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
#endif #endif
outl(PC_CNTRL_E0 | PC_CNTRL_EN0 | PC_CNTRL_EN0, PC_COUNTER_CNTRL); outl(PC_CNTRL_E0 | PC_CNTRL_EN0 | PC_CNTRL_EN0, PC_COUNTER_CNTRL);
......
...@@ -23,9 +23,10 @@ ...@@ -23,9 +23,10 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/fs.h> /* for ROOT_DEV */ #include <linux/fs.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/param.h> /* for HZ */ #include <linux/param.h> /* for HZ */
#include <linux/root_dev.h>
#include <asm/addrspace.h> #include <asm/addrspace.h>
#include <asm/time.h> #include <asm/time.h>
...@@ -152,7 +153,7 @@ void __init ddb_setup(void) ...@@ -152,7 +153,7 @@ void __init ddb_setup(void)
ddb5477_board_init(); ddb5477_board_init();
#if defined(CONFIG_BLK_DEV_INITRD) #if defined(CONFIG_BLK_DEV_INITRD)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
initrd_start = (unsigned long)&__rd_start; initrd_start = (unsigned long)&__rd_start;
initrd_end = (unsigned long)&__rd_end; initrd_end = (unsigned long)&__rd_end;
#endif #endif
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/mc146818rtc.h> #include <linux/mc146818rtc.h>
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <linux/root_dev.h>
#include <asm/cpu.h> #include <asm/cpu.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
...@@ -149,7 +150,7 @@ void __init it8172_setup(void) ...@@ -149,7 +150,7 @@ void __init it8172_setup(void)
#endif #endif
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
#endif #endif
/* /*
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/root_dev.h>
#include <asm/asm.h> #include <asm/asm.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
...@@ -724,7 +725,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -724,7 +725,7 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
/* Board specific code should have set up initrd_start and initrd_end */ /* Board specific code should have set up initrd_start and initrd_end */
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
if( __rd_start != __rd_end ) { if( __rd_start != __rd_end ) {
initrd_start = (unsigned long)&__rd_start; initrd_start = (unsigned long)&__rd_start;
initrd_end = (unsigned long)&__rd_end; initrd_end = (unsigned long)&__rd_end;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/processor.h> #include <asm/processor.h>
...@@ -76,12 +77,12 @@ m8xx_setup_arch(void) ...@@ -76,12 +77,12 @@ m8xx_setup_arch(void)
#endif #endif
#ifdef notdef #ifdef notdef
ROOT_DEV = to_kdev_t(0x0301); /* hda1 */ ROOT_DEV = Root_HDA1; /* hda1 */
#endif #endif
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
#if 0 #if 0
ROOT_DEV = to_kdev_t(0x0200); /* floppy */ ROOT_DEV = Root_FD0; /* floppy */
rd_prompt = 1; rd_prompt = 1;
rd_doload = 1; rd_doload = 1;
rd_image_start = 0; rd_image_start = 0;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/residual.h> #include <asm/residual.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -431,7 +432,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -431,7 +432,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
r3 += KERNELBASE; r3 += KERNELBASE;
initrd_start = r3; initrd_start = r3;
initrd_end = r3 + r4; initrd_end = r3 + r4;
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
initrd_below_start_ok = 1; initrd_below_start_ok = 1;
} }
#endif #endif
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -111,13 +112,13 @@ adir_setup_arch(void) ...@@ -111,13 +112,13 @@ adir_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00FF); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0801); /* /dev/sda1 */ ROOT_DEV = Root_SDA1;
#endif #endif
/* Identify the system */ /* Identify the system */
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -232,10 +233,10 @@ chrp_setup_arch(void) ...@@ -232,10 +233,10 @@ chrp_setup_arch(void)
initrd_below_start_ok = 1; initrd_below_start_ok = 1;
if (initrd_start) if (initrd_start)
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
else else
#endif #endif
ROOT_DEV = to_kdev_t(0x0802); /* sda2 (sda1 is for the kernel) */ ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
/* Lookup PCI host bridges */ /* Lookup PCI host bridges */
chrp_find_bridges(); chrp_find_bridges();
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#if !defined(CONFIG_GT64260_CONSOLE) #if !defined(CONFIG_GT64260_CONSOLE)
#include <linux/serial.h> #include <linux/serial.h>
#endif #endif
...@@ -195,13 +196,13 @@ ev64260_setup_arch(void) ...@@ -195,13 +196,13 @@ ev64260_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00FF); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0802); /* /dev/sda2 SCSI disk */ ROOT_DEV = Root_SDA2;
#endif #endif
if ( ppc_md.progress ) if ( ppc_md.progress )
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -174,10 +175,10 @@ void __init gemini_setup_arch(void) ...@@ -174,10 +175,10 @@ void __init gemini_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
/* bootable off CDROM */ /* bootable off CDROM */
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(SCSI_CDROM_MAJOR, 0); ROOT_DEV = Root_SR0;
else else
#endif #endif
ROOT_DEV = to_kdev_t(0x0801); ROOT_DEV = Root_SDA1;
/* nothing but serial consoles... */ /* nothing but serial consoles... */
sprintf(cmd_line, "%s console=ttyS0", cmd_line); sprintf(cmd_line, "%s console=ttyS0", cmd_line);
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/root_dev.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <asm/processor.h> #include <asm/processor.h>
...@@ -154,7 +155,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -154,7 +155,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
initrd_start = xNaca.xRamDisk + KERNELBASE; initrd_start = xNaca.xRamDisk + KERNELBASE;
initrd_end = initrd_start + xNaca.xRamDiskSize * PAGE_SIZE; initrd_end = initrd_start + xNaca.xRamDiskSize * PAGE_SIZE;
initrd_below_start_ok = 1; // ramdisk in kernel space initrd_below_start_ok = 1; // ramdisk in kernel space
ROOT_DEV = MKDEV( RAMDISK_MAJOR, 0 ); ROOT_DEV = Root_RAM0;
if ( ((rd_size*1024)/PAGE_SIZE) < xNaca.xRamDiskSize ) if ( ((rd_size*1024)/PAGE_SIZE) < xNaca.xRamDiskSize )
rd_size = (xNaca.xRamDiskSize*PAGE_SIZE)/1024; rd_size = (xNaca.xRamDiskSize*PAGE_SIZE)/1024;
...@@ -163,7 +164,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -163,7 +164,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
#if CONFIG_VIODASD_IDE #if CONFIG_VIODASD_IDE
{ {
ROOT_DEV = MKDEV( IDE0_MAJOR, 1 ); ROOT_DEV = Root_HDA1;
} }
#elif defined(CONFIG_VIODASD) #elif defined(CONFIG_VIODASD)
{ {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -178,13 +179,13 @@ k2_setup_arch(void) ...@@ -178,13 +179,13 @@ k2_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00FF); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x1601); /* /dev/hdc1 */ ROOT_DEV = Root_HDC1;
#endif #endif
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/root_dev.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/open_pic.h> #include <asm/open_pic.h>
...@@ -319,14 +320,14 @@ lopec_setup_arch(void) ...@@ -319,14 +320,14 @@ lopec_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
else else
#elif defined(CONFIG_ROOT_NFS) #elif defined(CONFIG_ROOT_NFS)
ROOT_DEV = to_kdev_t(0x00ff); ROOT_DEV = Root_NFS;
#elif defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #elif defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ROOT_DEV = to_kdev_t(0x0301); ROOT_DEV = Root_HDA1;
#else #else
ROOT_DEV = to_kdev_t(0x0801); ROOT_DEV = Root_SDA1;
#endif #endif
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -92,13 +93,13 @@ mcpn765_setup_arch(void) ...@@ -92,13 +93,13 @@ mcpn765_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00FF); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0802); /* /dev/sda2 SCSI disk */ ROOT_DEV = Root_SDA2;
#endif #endif
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -69,13 +70,13 @@ menf1_setup_arch(void) ...@@ -69,13 +70,13 @@ menf1_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00ff); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0302); /* /dev/hda2 */ ROOT_DEV = Root_HDA2;
#endif #endif
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -77,13 +78,13 @@ mvme5100_setup_arch(void) ...@@ -77,13 +78,13 @@ mvme5100_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00FF); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0802); /* /dev/sda2 */ ROOT_DEV = Root_SDA2;
#endif #endif
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -118,13 +119,13 @@ pcore_setup_arch(void) ...@@ -118,13 +119,13 @@ pcore_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00ff); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0802); /* /dev/sda2 */ ROOT_DEV = Root_SDA2;
#endif #endif
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include <linux/pmu.h> #include <linux/pmu.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/sections.h> #include <asm/sections.h>
...@@ -348,10 +349,10 @@ pmac_setup_arch(void) ...@@ -348,10 +349,10 @@ pmac_setup_arch(void)
#endif #endif
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
else else
#endif #endif
ROOT_DEV = to_kdev_t(DEFAULT_ROOT_DEVICE); ROOT_DEV = DEFAULT_ROOT_DEVICE;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* Check for Core99 */ /* Check for Core99 */
...@@ -475,7 +476,7 @@ note_bootable_part(kdev_t dev, int part, int goodness) ...@@ -475,7 +476,7 @@ note_bootable_part(kdev_t dev, int part, int goodness)
if (!initializing) if (!initializing)
return; return;
if ((goodness <= current_root_goodness) && if ((goodness <= current_root_goodness) &&
!kdev_same(ROOT_DEV, to_kdev_t(DEFAULT_ROOT_DEVICE))) ROOT_DEV != DEFAULT_ROOT_DEVICE)
return; return;
p = strstr(saved_command_line, "root="); p = strstr(saved_command_line, "root=");
if (p != NULL && (p == saved_command_line || p[-1] == ' ')) if (p != NULL && (p == saved_command_line || p[-1] == ' '))
...@@ -486,7 +487,7 @@ note_bootable_part(kdev_t dev, int part, int goodness) ...@@ -486,7 +487,7 @@ note_bootable_part(kdev_t dev, int part, int goodness)
found_boot = 1; found_boot = 1;
} }
if (kdev_same(boot_dev, NODEV) || kdev_same(dev, boot_dev)) { if (kdev_same(boot_dev, NODEV) || kdev_same(dev, boot_dev)) {
ROOT_DEV = mk_kdev(major(dev), minor(dev) + part); ROOT_DEV = MKDEV(major(dev), minor(dev) + part);
boot_dev = NODEV; boot_dev = NODEV;
current_root_goodness = goodness; current_root_goodness = goodness;
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/root_dev.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -81,13 +82,13 @@ powerpmc250_setup_arch(void) ...@@ -81,13 +82,13 @@ powerpmc250_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00ff); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0802); /* /dev/sda2 */ ROOT_DEV = Root_SDA2;
#endif #endif
printk("Force PowerPMC250 port (C) 2001 MontaVista Software, Inc. (source@mvista.com)\n"); printk("Force PowerPMC250 port (C) 2001 MontaVista Software, Inc. (source@mvista.com)\n");
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/kdev_t.h> #include <linux/kdev_t.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/mmu.h> #include <asm/mmu.h>
...@@ -131,13 +132,13 @@ pplus_setup_arch(void) ...@@ -131,13 +132,13 @@ pplus_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00ff); /* /dev/nfs */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0802); /* /dev/sda2 */ ROOT_DEV = Root_SDA2;
#endif #endif
printk("PowerPlus port (C) 2001 MontaVista Software, Inc. (source@mvista.com)\n"); printk("PowerPlus port (C) 2001 MontaVista Software, Inc. (source@mvista.com)\n");
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/mmu.h> #include <asm/mmu.h>
...@@ -346,20 +347,20 @@ prep_setup_arch(void) ...@@ -346,20 +347,20 @@ prep_setup_arch(void)
case _PREP_IBM: case _PREP_IBM:
/* Enable L2. Assume we don't need to flush -- Cort*/ /* Enable L2. Assume we don't need to flush -- Cort*/
*(unsigned char *)(0x8000081c) |= 3; *(unsigned char *)(0x8000081c) |= 3;
ROOT_DEV = to_kdev_t(0x0301); /* hda1 */ ROOT_DEV = Root_HDA1;
break; break;
case _PREP_Motorola: case _PREP_Motorola:
/* Enable L2. Assume we don't need to flush -- Cort*/ /* Enable L2. Assume we don't need to flush -- Cort*/
*(unsigned char *)(0x8000081c) |= 3; *(unsigned char *)(0x8000081c) |= 3;
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00ff); /* /dev/nfs */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0802); /* /dev/sda2 */ ROOT_DEV = Root_SDA2;
#endif #endif
break; break;
} }
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -85,13 +86,13 @@ prpmc750_setup_arch(void) ...@@ -85,13 +86,13 @@ prpmc750_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00ff); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0802); /* /dev/sda2 */ ROOT_DEV = Root_SDA2;
#endif #endif
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -92,13 +93,13 @@ prpmc800_setup_arch(void) ...@@ -92,13 +93,13 @@ prpmc800_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00ff); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0802); /* /dev/sda2 */ ROOT_DEV = Root_SDA2;
#endif #endif
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -162,13 +163,13 @@ sandpoint_setup_arch(void) ...@@ -162,13 +163,13 @@ sandpoint_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00FF); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0301); /* /dev/hda1 IDE disk */ ROOT_DEV = Root_HDA1;
#endif #endif
/* Lookup PCI host bridges */ /* Lookup PCI host bridges */
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/root_dev.h>
#include <asm/keyboard.h> #include <asm/keyboard.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -143,13 +144,13 @@ spruce_setup_arch(void) ...@@ -143,13 +144,13 @@ spruce_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); /* /dev/ram */ ROOT_DEV = Root_RAM0;
else else
#endif #endif
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
ROOT_DEV = to_kdev_t(0x00FF); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0801); /* /dev/sda1 */ ROOT_DEV = Root_SDA1;
#endif #endif
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -95,13 +96,13 @@ zx4500_setup_arch(void) ...@@ -95,13 +96,13 @@ zx4500_setup_arch(void)
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
else else
#endif #endif
#if defined(CONFIG_ROOT_NFS) #if defined(CONFIG_ROOT_NFS)
ROOT_DEV = to_kdev_t(0x00FF); /* /dev/nfs pseudo device */ ROOT_DEV = Root_NFS;
#else #else
ROOT_DEV = to_kdev_t(0x0801); /* /dev/sda1 SCSI disk */ ROOT_DEV = Root_SDA1;
#endif #endif
/* Get boot string from flash */ /* Get boot string from flash */
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/processor.h> #include <asm/processor.h>
...@@ -148,10 +149,10 @@ chrp_setup_arch(void) ...@@ -148,10 +149,10 @@ chrp_setup_arch(void)
initrd_below_start_ok = 1; initrd_below_start_ok = 1;
if (initrd_start) if (initrd_start)
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
else else
#endif #endif
ROOT_DEV = to_kdev_t(0x0802); /* sda2 (sda1 is for the kernel) */ ROOT_DEV = Root_SDA2;
printk("Boot arguments: %s\n", cmd_line); printk("Boot arguments: %s\n", cmd_line);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/machdep.h> #include <asm/machdep.h>
...@@ -295,7 +296,7 @@ iSeries_init_early(void) ...@@ -295,7 +296,7 @@ iSeries_init_early(void)
initrd_start = (unsigned long)__va(naca->xRamDisk); initrd_start = (unsigned long)__va(naca->xRamDisk);
initrd_end = initrd_start + naca->xRamDiskSize * PAGE_SIZE; initrd_end = initrd_start + naca->xRamDiskSize * PAGE_SIZE;
initrd_below_start_ok = 1; // ramdisk in kernel space initrd_below_start_ok = 1; // ramdisk in kernel space
ROOT_DEV = mk_kdev( RAMDISK_MAJOR, 0 ); ROOT_DEV = Root_RAM0;
if ( ((rd_size*1024)/PAGE_SIZE) < naca->xRamDiskSize ) if ( ((rd_size*1024)/PAGE_SIZE) < naca->xRamDiskSize )
rd_size = (naca->xRamDiskSize*PAGE_SIZE)/1024; rd_size = (naca->xRamDiskSize*PAGE_SIZE)/1024;
...@@ -304,7 +305,7 @@ iSeries_init_early(void) ...@@ -304,7 +305,7 @@ iSeries_init_early(void)
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
{ {
/* ROOT_DEV = mk_kdev( VIODASD_MAJOR, 1 ); */ /* ROOT_DEV = MKDEV( VIODASD_MAJOR, 1 ); */
} }
iSeries_recal_tb = get_tb(); iSeries_recal_tb = get_tb();
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/root_dev.h>
#include <asm/init.h> #include <asm/init.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/prom.h> #include <asm/prom.h>
...@@ -373,7 +374,7 @@ void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -373,7 +374,7 @@ void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5,
if ((initrd_start == 0) && r3 && r4 && r4 != 0xdeadbeef) { if ((initrd_start == 0) && r3 && r4 && r4 != 0xdeadbeef) {
initrd_start = (r3 >= KERNELBASE) ? r3 : (unsigned long)__va(r3); initrd_start = (r3 >= KERNELBASE) ? r3 : (unsigned long)__va(r3);
initrd_end = initrd_start + r4; initrd_end = initrd_start + r4;
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
initrd_below_start_ok = 1; initrd_below_start_ok = 1;
} }
#endif #endif
...@@ -464,7 +465,7 @@ int parse_bootinfo(void) ...@@ -464,7 +465,7 @@ int parse_bootinfo(void)
case BI_INITRD: case BI_INITRD:
initrd_start = (unsigned long)__va(rec->data[0]); initrd_start = (unsigned long)__va(rec->data[0]);
initrd_end = initrd_start + rec->data[1]; initrd_end = initrd_start + rec->data[1];
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
initrd_below_start_ok = 1; initrd_below_start_ok = 1;
break; break;
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/blk.h> #include <linux/blk.h>
#endif #endif
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/root_dev.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -321,7 +322,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -321,7 +322,7 @@ void __init setup_arch(char **cmdline_p)
"This machine has an IEEE fpu\n" : "This machine has an IEEE fpu\n" :
"This machine has no IEEE fpu\n"); "This machine has no IEEE fpu\n");
ROOT_DEV = to_kdev_t(0x0100); ROOT_DEV = Root_RAM0;
memory_start = (unsigned long) &_end; /* fixit if use $CODELO etc*/ memory_start = (unsigned long) &_end; /* fixit if use $CODELO etc*/
memory_end = memory_size & ~0x400000UL; /* align memory end to 4MB */ memory_end = memory_size & ~0x400000UL; /* align memory end to 4MB */
/* /*
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/blk.h> #include <linux/blk.h>
#endif #endif
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/root_dev.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -318,7 +319,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -318,7 +319,7 @@ void __init setup_arch(char **cmdline_p)
"We are running under VM (64 bit mode)\n" : "We are running under VM (64 bit mode)\n" :
"We are running native (64 bit mode)\n"); "We are running native (64 bit mode)\n");
ROOT_DEV = to_kdev_t(0x0100); ROOT_DEV = Root_RAM0;
memory_start = (unsigned long) &_end; /* fixit if use $CODELO etc*/ memory_start = (unsigned long) &_end; /* fixit if use $CODELO etc*/
memory_end = memory_size & ~0x200000UL; /* detected in head.s */ memory_end = memory_size & ~0x200000UL; /* detected in head.s */
init_mm.start_code = PAGE_OFFSET; init_mm.start_code = PAGE_OFFSET;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -275,7 +276,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -275,7 +276,7 @@ void __init setup_arch(char **cmdline_p)
sh_console_init(); sh_console_init();
#endif #endif
ROOT_DEV = to_kdev_t(ORIG_ROOT_DEV); ROOT_DEV = ORIG_ROOT_DEV;
#ifdef CONFIG_BLK_DEV_RAM #ifdef CONFIG_BLK_DEV_RAM
rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/root_dev.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -377,7 +378,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -377,7 +378,7 @@ void __init setup_arch(char **cmdline_p)
if (!root_flags) if (!root_flags)
root_mountflags &= ~MS_RDONLY; root_mountflags &= ~MS_RDONLY;
ROOT_DEV = to_kdev_t(root_dev); ROOT_DEV = root_dev;
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK; rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK;
rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0); rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0);
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/inet.h> #include <linux/inet.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/root_dev.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -537,7 +538,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -537,7 +538,7 @@ void __init setup_arch(char **cmdline_p)
if (!root_flags) if (!root_flags)
root_mountflags &= ~MS_RDONLY; root_mountflags &= ~MS_RDONLY;
ROOT_DEV = to_kdev_t(root_dev); ROOT_DEV = root_dev;
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK; rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK;
rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0); rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0);
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/mtrr.h> #include <asm/mtrr.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -550,7 +551,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -550,7 +551,7 @@ void __init setup_arch(char **cmdline_p)
unsigned long bootmap_size, low_mem_size; unsigned long bootmap_size, low_mem_size;
int i; int i;
ROOT_DEV = to_kdev_t(ORIG_ROOT_DEV); ROOT_DEV = ORIG_ROOT_DEV;
drive_info = DRIVE_INFO; drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO; screen_info = SCREEN_INFO;
aux_device_present = AUX_DEVICE_INFO; aux_device_present = AUX_DEVICE_INFO;
......
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
#include <linux/major.h> #include <linux/major.h>
#include <linux/utsname.h> #include <linux/utsname.h>
#include <linux/inet.h> #include <linux/inet.h>
#include <linux/root_dev.h>
#include <net/ipconfig.h> #include <net/ipconfig.h>
/* Define this to allow debugging output */ /* Define this to allow debugging output */
...@@ -335,7 +336,7 @@ int __init root_nfs_init(void) ...@@ -335,7 +336,7 @@ int __init root_nfs_init(void)
*/ */
int __init nfs_root_setup(char *line) int __init nfs_root_setup(char *line)
{ {
ROOT_DEV = mk_kdev(UNNAMED_MAJOR, 255); ROOT_DEV = Root_NFS;
if (line[0] == '/' || line[0] == ',' || (line[0] >= '0' && line[0] <= '9')) { if (line[0] == '/' || line[0] == ',' || (line[0] >= '0' && line[0] <= '9')) {
strncpy(nfs_root_name, line, sizeof(nfs_root_name)); strncpy(nfs_root_name, line, sizeof(nfs_root_name));
nfs_root_name[sizeof(nfs_root_name)-1] = '\0'; nfs_root_name[sizeof(nfs_root_name)-1] = '\0';
......
...@@ -1257,8 +1257,6 @@ extern int vfs_fstat(unsigned int, struct kstat *); ...@@ -1257,8 +1257,6 @@ extern int vfs_fstat(unsigned int, struct kstat *);
extern struct file_system_type *get_fs_type(const char *name); extern struct file_system_type *get_fs_type(const char *name);
extern struct super_block *get_super(kdev_t); extern struct super_block *get_super(kdev_t);
extern void drop_super(struct super_block *sb); extern void drop_super(struct super_block *sb);
extern kdev_t ROOT_DEV;
extern char root_device_name[];
extern int dcache_dir_open(struct inode *, struct file *); extern int dcache_dir_open(struct inode *, struct file *);
extern int dcache_dir_close(struct inode *, struct file *); extern int dcache_dir_close(struct inode *, struct file *);
......
#ifndef _ROOT_DEV_H_
#define _ROOT_DEV_H_
enum {
Root_NFS = MKDEV(UNNAMED_MAJOR, 255),
Root_RAM0 = MKDEV(RAMDISK_MAJOR, 0),
Root_RAM1 = MKDEV(RAMDISK_MAJOR, 1),
Root_FD0 = MKDEV(FLOPPY_MAJOR, 0),
Root_HDA1 = MKDEV(IDE0_MAJOR, 1),
Root_HDA2 = MKDEV(IDE0_MAJOR, 2),
Root_SDA1 = MKDEV(SCSI_DISK0_MAJOR, 1),
Root_SDA2 = MKDEV(SCSI_DISK0_MAJOR, 2),
Root_HDC1 = MKDEV(IDE1_MAJOR, 1),
Root_SR0 = MKDEV(SCSI_CDROM_MAJOR, 0),
};
extern dev_t ROOT_DEV;
#endif
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/root_dev.h>
#include <linux/nfs_fs.h> #include <linux/nfs_fs.h>
#include <linux/nfs_fs_sb.h> #include <linux/nfs_fs_sb.h>
...@@ -55,7 +56,7 @@ int root_mountflags = MS_RDONLY | MS_VERBOSE; ...@@ -55,7 +56,7 @@ int root_mountflags = MS_RDONLY | MS_VERBOSE;
static char root_device_name[64]; static char root_device_name[64];
/* this is initialized in init/main.c */ /* this is initialized in init/main.c */
kdev_t ROOT_DEV; dev_t ROOT_DEV;
static int do_devfs = 0; static int do_devfs = 0;
...@@ -239,7 +240,7 @@ static int __init root_dev_setup(char *line) ...@@ -239,7 +240,7 @@ static int __init root_dev_setup(char *line)
int i; int i;
char ch; char ch;
ROOT_DEV = name_to_kdev_t(line); ROOT_DEV = kdev_t_to_nr(name_to_kdev_t(line));
memset (root_device_name, 0, sizeof root_device_name); memset (root_device_name, 0, sizeof root_device_name);
if (strncmp (line, "/dev/", 5) == 0) line += 5; if (strncmp (line, "/dev/", 5) == 0) line += 5;
for (i = 0; i < sizeof root_device_name - 1; ++i) for (i = 0; i < sizeof root_device_name - 1; ++i)
...@@ -319,16 +320,16 @@ static void __init mount_block_root(char *name, int flags) ...@@ -319,16 +320,16 @@ static void __init mount_block_root(char *name, int flags)
* and bad superblock on root device. * and bad superblock on root device.
*/ */
printk ("VFS: Cannot open root device \"%s\" or %s\n", printk ("VFS: Cannot open root device \"%s\" or %s\n",
root_device_name, kdevname (ROOT_DEV)); root_device_name, kdevname (to_kdev_t(ROOT_DEV)));
printk ("Please append a correct \"root=\" boot option\n"); printk ("Please append a correct \"root=\" boot option\n");
panic("VFS: Unable to mount root fs on %s", panic("VFS: Unable to mount root fs on %s",
kdevname(ROOT_DEV)); kdevname(to_kdev_t(ROOT_DEV)));
} }
panic("VFS: Unable to mount root fs on %s", kdevname(ROOT_DEV)); panic("VFS: Unable to mount root fs on %s", kdevname(to_kdev_t(ROOT_DEV)));
out: out:
putname(fs_names); putname(fs_names);
sys_chdir("/root"); sys_chdir("/root");
ROOT_DEV = current->fs->pwdmnt->mnt_sb->s_dev; ROOT_DEV = kdev_t_to_nr(current->fs->pwdmnt->mnt_sb->s_dev);
printk("VFS: Mounted root (%s filesystem)%s.\n", printk("VFS: Mounted root (%s filesystem)%s.\n",
current->fs->pwdmnt->mnt_sb->s_type->name, current->fs->pwdmnt->mnt_sb->s_type->name,
(current->fs->pwdmnt->mnt_sb->s_flags & MS_RDONLY) ? " readonly" : ""); (current->fs->pwdmnt->mnt_sb->s_flags & MS_RDONLY) ? " readonly" : "");
...@@ -345,7 +346,7 @@ static int __init mount_nfs_root(void) ...@@ -345,7 +346,7 @@ static int __init mount_nfs_root(void)
} }
#endif #endif
static int __init create_dev(char *name, kdev_t dev, char *devfs_name) static int __init create_dev(char *name, dev_t dev, char *devfs_name)
{ {
void *handle; void *handle;
char path[64]; char path[64];
...@@ -353,10 +354,10 @@ static int __init create_dev(char *name, kdev_t dev, char *devfs_name) ...@@ -353,10 +354,10 @@ static int __init create_dev(char *name, kdev_t dev, char *devfs_name)
sys_unlink(name); sys_unlink(name);
if (!do_devfs) if (!do_devfs)
return sys_mknod(name, S_IFBLK|0600, kdev_t_to_nr(dev)); return sys_mknod(name, S_IFBLK|0600, dev);
handle = devfs_find_handle(NULL, kdev_none(dev) ? devfs_name : NULL, handle = devfs_find_handle(NULL, !dev ? devfs_name : NULL,
major(dev), minor(dev), DEVFS_SPECIAL_BLK, 1); MAJOR(dev), MINOR(dev), DEVFS_SPECIAL_BLK, 1);
if (!handle) if (!handle)
return -1; return -1;
n = devfs_generate_path(handle, path + 5, sizeof (path) - 5); n = devfs_generate_path(handle, path + 5, sizeof (path) - 5);
...@@ -634,7 +635,7 @@ static int __init rd_load_disk(int n) ...@@ -634,7 +635,7 @@ static int __init rd_load_disk(int n)
#ifdef CONFIG_BLK_DEV_RAM #ifdef CONFIG_BLK_DEV_RAM
if (rd_prompt) if (rd_prompt)
change_floppy("root floppy disk to be loaded into RAM disk"); change_floppy("root floppy disk to be loaded into RAM disk");
create_dev("/dev/ram", mk_kdev(RAMDISK_MAJOR, n), NULL); create_dev("/dev/ram", MKDEV(RAMDISK_MAJOR, n), NULL);
#endif #endif
return rd_load_image("/dev/root"); return rd_load_image("/dev/root");
} }
...@@ -699,25 +700,25 @@ static void __init devfs_make_root(char *name) ...@@ -699,25 +700,25 @@ static void __init devfs_make_root(char *name)
static void __init mount_root(void) static void __init mount_root(void)
{ {
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
if (major(ROOT_DEV) == UNNAMED_MAJOR) { if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) {
if (mount_nfs_root()) { if (mount_nfs_root()) {
sys_chdir("/root"); sys_chdir("/root");
ROOT_DEV = current->fs->pwdmnt->mnt_sb->s_dev; ROOT_DEV = kdev_t_to_nr(current->fs->pwdmnt->mnt_sb->s_dev);
printk("VFS: Mounted root (nfs filesystem).\n"); printk("VFS: Mounted root (nfs filesystem).\n");
return; return;
} }
printk(KERN_ERR "VFS: Unable to mount root fs via NFS, trying floppy.\n"); printk(KERN_ERR "VFS: Unable to mount root fs via NFS, trying floppy.\n");
ROOT_DEV = mk_kdev(FLOPPY_MAJOR, 0); ROOT_DEV = Root_FD0;
} }
#endif #endif
devfs_make_root(root_device_name); devfs_make_root(root_device_name);
create_dev("/dev/root", ROOT_DEV, root_device_name); create_dev("/dev/root", ROOT_DEV, root_device_name);
#ifdef CONFIG_BLK_DEV_FD #ifdef CONFIG_BLK_DEV_FD
if (major(ROOT_DEV) == FLOPPY_MAJOR) { if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) {
/* rd_doload is 2 for a dual initrd/ramload setup */ /* rd_doload is 2 for a dual initrd/ramload setup */
if (rd_doload==2) { if (rd_doload==2) {
if (rd_load_disk(1)) { if (rd_load_disk(1)) {
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 1); ROOT_DEV = Root_RAM1;
create_dev("/dev/root", ROOT_DEV, NULL); create_dev("/dev/root", ROOT_DEV, NULL);
} }
} else } else
...@@ -752,11 +753,10 @@ static int do_linuxrc(void * shell) ...@@ -752,11 +753,10 @@ static int do_linuxrc(void * shell)
static void __init handle_initrd(void) static void __init handle_initrd(void)
{ {
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
kdev_t ram0 = mk_kdev(RAMDISK_MAJOR,0);
int error; int error;
int i, pid; int i, pid;
create_dev("/dev/root.old", ram0, NULL); create_dev("/dev/root.old", Root_RAM0, NULL);
mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY); mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY);
sys_mkdir("/old", 0700); sys_mkdir("/old", 0700);
sys_chdir("/old"); sys_chdir("/old");
...@@ -770,12 +770,12 @@ static void __init handle_initrd(void) ...@@ -770,12 +770,12 @@ static void __init handle_initrd(void)
sys_mount("..", ".", NULL, MS_MOVE, NULL); sys_mount("..", ".", NULL, MS_MOVE, NULL);
sys_umount("/old/dev", 0); sys_umount("/old/dev", 0);
if (real_root_dev == kdev_t_to_nr(ram0)) { if (real_root_dev == Root_RAM0) {
sys_chdir("/old"); sys_chdir("/old");
return; return;
} }
ROOT_DEV = to_kdev_t(real_root_dev); ROOT_DEV = real_root_dev;
mount_root(); mount_root();
printk(KERN_NOTICE "Trying to move old root to /initrd ... "); printk(KERN_NOTICE "Trying to move old root to /initrd ... ");
...@@ -802,8 +802,8 @@ static void __init handle_initrd(void) ...@@ -802,8 +802,8 @@ static void __init handle_initrd(void)
static int __init initrd_load(void) static int __init initrd_load(void)
{ {
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
create_dev("/dev/ram", mk_kdev(RAMDISK_MAJOR, 0), NULL); create_dev("/dev/ram", MKDEV(RAMDISK_MAJOR, 0), NULL);
create_dev("/dev/initrd", mk_kdev(RAMDISK_MAJOR, INITRD_MINOR), NULL); create_dev("/dev/initrd", MKDEV(RAMDISK_MAJOR, INITRD_MINOR), NULL);
#endif #endif
return rd_load_image("/dev/initrd"); return rd_load_image("/dev/initrd");
} }
...@@ -813,11 +813,11 @@ static int __init initrd_load(void) ...@@ -813,11 +813,11 @@ static int __init initrd_load(void)
*/ */
void prepare_namespace(void) void prepare_namespace(void)
{ {
int is_floppy = major(ROOT_DEV) == FLOPPY_MAJOR; int is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (!initrd_start) if (!initrd_start)
mount_initrd = 0; mount_initrd = 0;
real_root_dev = kdev_t_to_nr(ROOT_DEV); real_root_dev = ROOT_DEV;
#endif #endif
sys_mkdir("/dev", 0700); sys_mkdir("/dev", 0700);
sys_mkdir("/root", 0700); sys_mkdir("/root", 0700);
...@@ -834,12 +834,12 @@ void prepare_namespace(void) ...@@ -834,12 +834,12 @@ void prepare_namespace(void)
software_resume(); software_resume();
if (mount_initrd) { if (mount_initrd) {
if (initrd_load() && !kdev_same(ROOT_DEV, mk_kdev(RAMDISK_MAJOR, 0))) { if (initrd_load() && ROOT_DEV != Root_RAM0) {
handle_initrd(); handle_initrd();
goto out; goto out;
} }
} else if (is_floppy && rd_doload && rd_load_disk(0)) } else if (is_floppy && rd_doload && rd_load_disk(0))
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); ROOT_DEV = Root_RAM0;
mount_root(); mount_root();
out: out:
sys_umount("/dev", 0); sys_umount("/dev", 0);
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <linux/binfmts.h> #include <linux/binfmts.h>
#include <linux/namei.h> #include <linux/namei.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/root_dev.h>
#include <asm/checksum.h> #include <asm/checksum.h>
#if defined(CONFIG_PROC_FS) #if defined(CONFIG_PROC_FS)
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <linux/udp.h> #include <linux/udp.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/root_dev.h>
#include <net/arp.h> #include <net/arp.h>
#include <net/ip.h> #include <net/ip.h>
#include <net/ipconfig.h> #include <net/ipconfig.h>
...@@ -1145,7 +1146,7 @@ static int __init ip_auto_config(void) ...@@ -1145,7 +1146,7 @@ static int __init ip_auto_config(void)
*/ */
if (ic_myaddr == INADDR_NONE || if (ic_myaddr == INADDR_NONE ||
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
(major(ROOT_DEV) == UNNAMED_MAJOR (MAJOR(ROOT_DEV) == UNNAMED_MAJOR
&& root_server_addr == INADDR_NONE && root_server_addr == INADDR_NONE
&& ic_servaddr == INADDR_NONE) || && ic_servaddr == INADDR_NONE) ||
#endif #endif
...@@ -1172,7 +1173,7 @@ static int __init ip_auto_config(void) ...@@ -1172,7 +1173,7 @@ static int __init ip_auto_config(void)
* -- Chip * -- Chip
*/ */
#ifdef CONFIG_ROOT_NFS #ifdef CONFIG_ROOT_NFS
if (kdev_same(ROOT_DEV, mk_kdev(UNNAMED_MAJOR, 255))) { if (ROOT_DEV == Root_NFS) {
printk(KERN_ERR printk(KERN_ERR
"IP-Config: Retrying forever (NFS root)...\n"); "IP-Config: Retrying forever (NFS root)...\n");
goto try_try_again; goto try_try_again;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment