--- Gnu-Mach/linux/dev/drivers/block/genhd.c 2020/09/02 04:43:27 1.1.1.2 +++ Gnu-Mach/linux/dev/drivers/block/genhd.c 2020/09/02 04:48:33 1.1.1.4 @@ -27,6 +27,8 @@ #ifdef CONFIG_BLK_DEV_INITRD #include #endif +#include +#include #include @@ -39,6 +41,7 @@ #ifdef MACH #include +#include #endif #define SYS_IND(p) get_unaligned(&p->sys_ind) @@ -111,7 +114,7 @@ static void add_partition (struct gendis printk(" %s", disk_name(hd, minor, buf)); } -#ifdef MACH +#if defined (MACH) && defined (CONFIG_BSD_DISKLABEL) static int mach_minor; static void add_bsd_partition (struct gendisk *hd, int minor, int slice, @@ -289,7 +292,7 @@ read_mbr: printk(" unable to read partition table\n"); return -1; } - data = bh->b_data; + data = (unsigned char *)bh->b_data; /* In some cases we modify the geometry */ /* of the drive (below), so ensure that */ /* nobody else tries to re-use this data. */ @@ -767,14 +770,36 @@ static void setup_dev(struct gendisk *de void device_setup(void) { extern void console_map_init(void); + extern char *kernel_cmdline; + char *c, *param, *white; struct gendisk *p; int nr=0; #ifdef MACH - extern int linux_intr_pri; - - linux_intr_pri = SPL5; + linux_intr_pri = SPL6; #endif + for (c = kernel_cmdline; c; ) + { + param = strstr(c, " ide"); + if (!param) + param = strstr(c, " hd"); + if (!param) + break; + if (param) { + param++; + white = strchr(param, ' '); + if (!white) { + ide_setup(param); + c = NULL; + } else { + char *word = alloca(white - param + 1); + strncpy(word, param, white - param); + word[white-param] = '\0'; + ide_setup(word); + c = white + 1; + } + } + } #ifndef MACH chr_dev_init(); #endif