home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / kernel-s / v1.2 / patch-1.004 / patch-1.2.9
Text File  |  1995-06-01  |  42KB  |  1,248 lines

  1. diff -u --recursive --new-file v1.2.8/linux/Makefile linux/Makefile
  2. --- v1.2.8/linux/Makefile    Mon May 29 11:16:03 1995
  3. +++ linux/Makefile    Thu May  4 20:43:31 1995
  4. @@ -1,6 +1,6 @@
  5.  VERSION = 1
  6.  PATCHLEVEL = 2
  7. -SUBLEVEL = 8
  8. +SUBLEVEL = 9
  9.  
  10.  ARCH = i386
  11.  
  12. diff -u --recursive --new-file v1.2.8/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
  13. --- v1.2.8/linux/arch/i386/kernel/process.c    Wed Mar  1 08:43:07 1995
  14. +++ linux/arch/i386/kernel/process.c    Fri May 26 08:25:32 1995
  15. @@ -45,13 +45,15 @@
  16.  asmlinkage int sys_idle(void)
  17.  {
  18.      int i;
  19. +    pmd_t * pmd;
  20.  
  21.      if (current->pid != 0)
  22.          return -EPERM;
  23.  
  24.      /* Map out the low memory: it's no longer needed */
  25. +    pmd = pmd_offset(swapper_pg_dir, 0);
  26.      for (i = 0 ; i < 768 ; i++)
  27. -        pgd_clear(swapper_pg_dir + i);
  28. +        pmd_clear(pmd++);
  29.  
  30.      /* endless idle loop with no priority at all */
  31.      current->counter = -100;
  32. diff -u --recursive --new-file v1.2.8/linux/arch/i386/kernel/ptrace.c linux/arch/i386/kernel/ptrace.c
  33. --- v1.2.8/linux/arch/i386/kernel/ptrace.c    Sat Feb 25 15:36:18 1995
  34. +++ linux/arch/i386/kernel/ptrace.c    Tue May 30 12:17:18 1995
  35. @@ -1,4 +1,3 @@
  36. -#define THREE_LEVEL
  37.  /* ptrace.c */
  38.  /* By Ross Biro 1/23/92 */
  39.  /* edited by Linus Torvalds */
  40. diff -u --recursive --new-file v1.2.8/linux/drivers/block/README.ide linux/drivers/block/README.ide
  41. --- v1.2.8/linux/drivers/block/README.ide    Sat Mar 18 12:45:45 1995
  42. +++ linux/drivers/block/README.ide    Thu Jun  1 11:23:04 1995
  43. @@ -21,16 +21,34 @@
  44.      - support for interrupt unmasking during I/O (better than hd.c)
  45.      - improved handshaking and error detection/recovery
  46.      - can co-exist with hd.c to control only the secondary interface
  47. +NEW!    - support for reliable operation of buggy CMD-640 interfaces
  48. +        - use kernel command line option:   hda=serialize
  49. +NEW!    - experimental support for DTC-2278D interfaces
  50. +        - use kernel command line option:  hda=dtc2278
  51. +NEW!    - run-time selectible 32bit interface support (using hdparm-2.3)
  52.  
  53.  Under construction:
  54.  
  55. +    - improved CMD support:  tech info is supposedly "in the mail"
  56.      - support for interface speed selection on jumperless interfaces
  57.      - improved detection of non-standard IDE ATAPI cdrom drives
  58.      - support for non-standard 3rd/4th drive interface on Promise cards
  59.  
  60. +***
  61. +
  62. +IMPORTANT NOTICE:  "CMD" EIDE Interfaces will not (by default) work *reliably*
  63. +when drives are attached to the second interface.  To "fix" this, supply the
  64. +special kernel "command line" parameter to LILO:    hda=serialize
  65. +Failure to do so can cause severe data corruption!
  66. +
  67. +***
  68. +
  69.  To access devices on the second interface, device entries must first be
  70.  created in /dev for them.  To create such entries, simply run the included
  71.  shell script:   MAKEDEV.ide1
  72. +
  73. +Apparently the early releases of Slackware 2.2 have incorrect entries
  74. +in /dev for hdc* and hdd* -- this can also be corrected by running MAKEDEV.ide1
  75.  
  76.  ide.c automatically probes for the primary and secondary interfaces,
  77.  for the drives/geometries attached to those interfaces, and for the
  78. diff -u --recursive --new-file v1.2.8/linux/drivers/block/genhd.c linux/drivers/block/genhd.c
  79. --- v1.2.8/linux/drivers/block/genhd.c    Thu Jan  5 13:55:40 1995
  80. +++ linux/drivers/block/genhd.c    Fri May 26 08:23:33 1995
  81. @@ -90,6 +90,7 @@
  82.                  !(hd->part[current_minor].nr_sects = p->nr_sects))
  83.                  goto done;  /* no more logicals in this partition */
  84.              hd->part[current_minor].start_sect = first_sector + p->start_sect;
  85. +            hd->sizes[current_minor] = p->nr_sects >> (BLOCK_SIZE_BITS - 9);
  86.              this_sector = first_sector + p->start_sect;
  87.              dev = ((hd->major) << 8) | current_minor;
  88.              brelse(bh);
  89. diff -u --recursive --new-file v1.2.8/linux/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
  90. --- v1.2.8/linux/drivers/block/ide-cd.c    Sat Apr 29 12:42:21 1995
  91. +++ linux/drivers/block/ide-cd.c    Thu Jun  1 11:23:04 1995
  92. @@ -24,7 +24,7 @@
  93.   *                       Thanks to Nick Saw <cwsaw@pts7.pts.mot.com> for
  94.   *                       help in figuring this out.  Ditto for Acer and
  95.   *                       Aztech drives, which seem to have the same problem.
  96. - *                       
  97. + * 2.04b May 30, 1995 -- Fix to match changes in ide.c version 3.16 -ml
  98.   *
  99.   * ATAPI cd-rom driver.  To be used with ide.c.
  100.   *
  101. @@ -41,8 +41,13 @@
  102.  
  103.  #define MIN(a,b) ((a) < (b) ? (a) : (b))
  104.  
  105. +#if 1    /* "old" method */
  106.  #define OUT_WORDS(b,n)  outsw (IDE_PORT (HD_DATA, dev->hwif), (b), (n))
  107.  #define IN_WORDS(b,n)   insw  (IDE_PORT (HD_DATA, dev->hwif), (b), (n))
  108. +#else    /* "new" method -- should really fix each instance instead of this */
  109. +#define OUT_WORDS(b,n)    output_ide_data(dev,b,(n)/2)
  110. +#define IN_WORDS(b,n)    input_ide_data(dev,b,(n)/2)
  111. +#endif
  112.  
  113.  /* special command codes for strategy routine. */
  114.  #define PACKET_COMMAND 4315
  115. @@ -196,7 +201,7 @@
  116.    stat = GET_STAT (dev->hwif);
  117.    *stat_ret = stat;
  118.  
  119. -  if (OK_STAT (stat, good_stat, BAD_RW_STAT))
  120. +  if (OK_STAT (stat, good_stat, BAD_R_STAT))
  121.      return 0;
  122.  
  123.    /* Got an error. */
  124. diff -u --recursive --new-file v1.2.8/linux/drivers/block/ide.c linux/drivers/block/ide.c
  125. --- v1.2.8/linux/drivers/block/ide.c    Tue Apr  4 09:05:34 1995
  126. +++ linux/drivers/block/ide.c    Thu Jun  1 11:23:04 1995
  127. @@ -1,5 +1,5 @@
  128.  /*
  129. - *  linux/drivers/block/ide.c    Version 3.14  March 7, 1995
  130. + *  linux/drivers/block/ide.c    Version 3.16  May 30, 1995
  131.   *
  132.   *  Copyright (C) 1994, 1995  Linus Torvalds & authors (see below)
  133.   */
  134. @@ -107,8 +107,22 @@
  135.   *  Version 3.14    fix ide_error() handling of BUSY_STAT
  136.   *            fix byte-swapped cdrom strings (again.. arghh!)
  137.   *            ignore INDEX bit when checking the ALTSTATUS reg
  138. + *  Version 3.15    add SINGLE_THREADED flag for use with dual-CMD i/f
  139. + *            ignore WRERR_STAT for non-write operations
  140. + *            added VLB_SYNC support for DC-2000A & others,
  141. + *             (incl. some Promise chips), courtesy of Frank Gockel
  142. + *  Version 3.16    convert VLB_32BIT and VLB_SYNC into runtime flags
  143. + *            add ioctls to get/set VLB flags (HDIO_[SG]ET_CHIPSET)
  144. + *            rename SINGLE_THREADED to SUPPORT_SERIALIZE,
  145. + *            add boot flag to "serialize" operation for CMD i/f
  146. + *            add optional support for DTC2278 interfaces,
  147. + *             courtesy of andy@cercle.cts.com (Dyan Wile).
  148. + *            add boot flag to enable "dtc2278" probe
  149. + *            add probe to avoid EATA (SCSI) interfaces,
  150. + *             courtesy of neuffer@goofy.zdv.uni-mainz.de.
  151.   *
  152.   *  To do:
  153. + *    - improved CMD support:  tech info is supposedly "in the mail"
  154.   *    - special 32-bit controller-type detection & support
  155.   *    - figure out how to support oddball "intelligent" caching cards
  156.   *    - reverse-engineer 3/4 drive support on fancy "Promise" cards
  157. @@ -142,12 +156,15 @@
  158.  #include <asm/io.h>
  159.  
  160.  #undef    REALLY_FAST_IO            /* define if ide ports are perfect */
  161. -#define INITIAL_MULT_COUNT    0    /* use zero to disable block mode */
  162. -#ifndef VLB_32BIT_IDE            /* 0 for safety, 1 for 32-bit chipset:*/
  163. -#define VLB_32BIT_IDE        0    /*   Winbond 83759F or OPTi 82C621 */
  164. +#define INITIAL_MULT_COUNT    0    /* off=0; on=2,4,8,16,32, etc.. */
  165. +#ifndef SUPPORT_VLB_32BIT        /* 1 to support 32bit I/O on VLB */
  166. +#define SUPPORT_VLB_32BIT    1    /* 0 to reduce kernel size */
  167.  #endif
  168. -#ifndef DISK_RECOVERY_TIME        /* min. delay between IO for hardware */
  169. -#define DISK_RECOVERY_TIME    0    /*  that needs it. */
  170. +#ifndef SUPPORT_VLB_SYNC        /* 1 to support weird 32-bit chips */
  171. +#define SUPPORT_VLB_SYNC    1    /* 0 to reduce kernel size */
  172. +#endif
  173. +#ifndef DISK_RECOVERY_TIME        /* off=0; on=access_delay_time */
  174. +#define DISK_RECOVERY_TIME    0    /*  for hardware that needs it */
  175.  #endif
  176.  #ifndef OK_TO_RESET_CONTROLLER        /* 1 needed for good error recovery */
  177.  #define OK_TO_RESET_CONTROLLER    1    /* 0 for use with AH2372A/B interface */
  178. @@ -158,9 +175,15 @@
  179.  #ifndef OPTIMIZE_IRQS            /* 1 for slightly faster code */
  180.  #define OPTIMIZE_IRQS        1    /* 0 to reduce kernel size */
  181.  #endif
  182. +#ifndef SUPPORT_SERIALIZE        /* 1 to support CMD dual interfaces */
  183. +#define SUPPORT_SERIALIZE    1    /* 0 to reduce kernel size */
  184. +#endif
  185.  #ifndef SUPPORT_SHARING_IRQ        /* 1 to allow two IDE i/f on one IRQ */
  186.  #define SUPPORT_SHARING_IRQ    1    /* 0 to reduce kernel size */
  187.  #endif
  188. +#ifndef SUPPORT_DTC2278            /* 1 to support DTC2278 chipset */
  189. +#define SUPPORT_DTC2278        1    /* 0 to reduce kernel size */
  190. +#endif
  191.  #ifndef FANCY_STATUS_DUMPS        /* 1 for human-readable drive errors */
  192.  #define FANCY_STATUS_DUMPS    1    /* 0 to reduce kernel size */
  193.  #endif
  194. @@ -194,10 +217,17 @@
  195.  #undef  SUPPORT_TWO_INTERFACES
  196.  #define SUPPORT_TWO_INTERFACES    0
  197.  #endif    /* CONFIG_BLK_DEV_HD */
  198. +
  199.  #if SUPPORT_TWO_INTERFACES
  200.  #define HWIF            hwif
  201.  #define DEV_HWIF        (dev->hwif)
  202. +#if SUPPORT_SERIALIZE
  203. +#undef    SUPPORT_SHARING_IRQ
  204. +#define    SUPPORT_SHARING_IRQ    1
  205. +#endif
  206.  #else
  207. +#undef    SUPPORT_SERIALIZE
  208. +#define SUPPORT_SERIALIZE        0
  209.  #undef    OPTIMIZE_IRQS
  210.  #define OPTIMIZE_IRQS        0
  211.  #undef    SUPPORT_SHARING_IRQ
  212. @@ -224,19 +254,22 @@
  213.  #define IN_BYTE(p,hwif)        (byte)inb_p(IDE_PORT(p,hwif))
  214.  #endif /* REALLY_FAST_IO */
  215.  
  216. -#if VLB_32BIT_IDE
  217. -#define OUT_SECTORS(b,n)    outsl(IDE_PORT(HD_DATA,DEV_HWIF),(b),(n)<<7)
  218. -#define IN_SECTORS(b,n)        insl(IDE_PORT(HD_DATA,DEV_HWIF),(b),(n)<<7)
  219. -#else
  220. -#define OUT_SECTORS(b,n)    outsw(IDE_PORT(HD_DATA,DEV_HWIF),(b),(n)<<8)
  221. -#define IN_SECTORS(b,n)        insw(IDE_PORT(HD_DATA,DEV_HWIF),(b),(n)<<8)
  222. -#endif    /* VLB_32BIT_IDE */
  223. +#if SUPPORT_VLB_32BIT
  224. +#if SUPPORT_VLB_SYNC
  225. +#define VLB_SYNC __asm__ __volatile__ ("pusha\n movl $0x01f2,%edx\n inb (%dx),%al\n inb (%dx),%al\n inb (%dx),%al\n popa\n")
  226. +#endif    /* SUPPORT_VLB_SYNC */
  227. +#endif    /* SUPPORT_VLB_32BIT */
  228. +
  229. +#if SUPPORT_DTC2278
  230. +static uint probe_dtc2278 = 0;
  231. +#endif
  232.  
  233.  #define GET_ERR(hwif)        IN_BYTE(HD_ERROR,hwif)
  234.  #define GET_STAT(hwif)        IN_BYTE(HD_STATUS,hwif)
  235.  #define OK_STAT(stat,good,bad)    (((stat)&((good)|(bad)))==(good))
  236. -#define BAD_RW_STAT        (BUSY_STAT   | ERR_STAT  | WRERR_STAT)
  237. -#define BAD_STAT        (BAD_RW_STAT | DRQ_STAT)
  238. +#define BAD_R_STAT        (BUSY_STAT   | ERR_STAT)
  239. +#define BAD_W_STAT        (BUSY_STAT   | ERR_STAT | WRERR_STAT)
  240. +#define BAD_STAT        (BAD_R_STAT  | DRQ_STAT)
  241.  #define DRIVE_READY        (READY_STAT  | SEEK_STAT)
  242.  #define DATA_READY        (DRIVE_READY | DRQ_STAT)
  243.  
  244. @@ -248,6 +281,7 @@
  245.  #define PARTN_BITS    6    /* number of minor dev bits for partitions */
  246.  #define PARTN_MASK    ((1<<PARTN_BITS)-1)    /* a useful bit mask */
  247.  #define MAX_DRIVES    2    /* per interface; 2 assumed by lots of code */
  248. +#define SECTOR_WORDS    (512 / 4)    /* number of 32bit words per sector */
  249.  
  250.  /*
  251.   * Timeouts for various operations:
  252. @@ -296,10 +330,12 @@
  253.      unsigned dont_probe     : 1;    /* from:  hdx=noprobe */
  254.      unsigned keep_settings  : 1;    /* restore settings after drive reset */
  255.      unsigned busy        : 1;    /* mutex for ide_open, revalidate_.. */
  256. -    unsigned reserved0    : 3;    /* unused */
  257. +    unsigned vlb_32bit    : 1;    /* use 32bit in/out for data */
  258. +    unsigned vlb_sync    : 1;    /* needed for some 32bit chip sets */
  259. +    unsigned reserved0    : 1;    /* unused */
  260.      special_t special;        /* special action flags */
  261.      select_t  select;        /* basic drive/head select reg value */
  262. -    byte mult_count, reserved1, reserved2;
  263. +    byte mult_count, chipset, reserved2;
  264.      byte usage, mult_req, wpcom, ctl;
  265.      byte head, sect, bios_head, bios_sect;
  266.      unsigned short cyl, bios_cyl;
  267. @@ -329,9 +365,10 @@
  268.      {{HD_NAME "a", HD_NAME "b"}, {HD_NAME "c", HD_NAME "d"}};
  269.  static const char    *unsupported = " not supported by this kernel\n";
  270.  
  271. +static byte        single_threaded    = 0;
  272.  #if SUPPORT_SHARING_IRQ
  273.  static byte        sharing_single_irq = 0;    /* for two i/f on one IRQ */
  274. -static volatile byte     current_hwif = 0;    /* for two i/f on one IRQ */
  275. +static volatile byte     current_hwif = 0;    /* for single_threaded==1 */
  276.  #endif /* SUPPORT_SHARING_IRQ */
  277.  
  278.  /*
  279. @@ -429,6 +466,50 @@
  280.  }
  281.  
  282.  /*
  283. + * This is used for all data transfers *from* the IDE interface
  284. + */
  285. +void input_ide_data (ide_dev_t *dev, void *buffer, uint wcount)
  286. +{
  287. +#if SUPPORT_VLB_32BIT
  288. +    if (dev->vlb_32bit) {
  289. +#if SUPPORT_VLB_SYNC
  290. +        if (dev->vlb_sync) {
  291. +            cli();
  292. +            VLB_SYNC;
  293. +            insl(IDE_PORT(HD_DATA,DEV_HWIF), buffer, wcount);
  294. +            if (dev->unmask)
  295. +                sti();
  296. +        } else
  297. +#endif /* SUPPORT_VLB_SYNC */
  298. +            insl(IDE_PORT(HD_DATA,DEV_HWIF), buffer, wcount);
  299. +    } else
  300. +#endif /* SUPPORT_VLB_32BIT */
  301. +        insw(IDE_PORT(HD_DATA,DEV_HWIF), buffer, wcount<<1);
  302. +}
  303. +
  304. +/*
  305. + * This is used for all data transfers *to* the IDE interface
  306. + */
  307. +void output_ide_data (ide_dev_t *dev, void *buffer, uint wcount)
  308. +{
  309. +#if SUPPORT_VLB_32BIT
  310. +    if (dev->vlb_32bit) {
  311. +#if SUPPORT_VLB_SYNC
  312. +        if (dev->vlb_sync) {
  313. +            cli();
  314. +            VLB_SYNC;
  315. +            outsl(IDE_PORT(HD_DATA,DEV_HWIF), buffer, wcount);
  316. +            if (dev->unmask)
  317. +                sti();
  318. +        } else
  319. +            outsl(IDE_PORT(HD_DATA,DEV_HWIF), buffer, wcount);
  320. +#endif /* SUPPORT_VLB_SYNC */
  321. +    } else
  322. +#endif /* SUPPORT_VLB_32BIT */
  323. +        outsw(IDE_PORT(HD_DATA,DEV_HWIF), buffer, wcount<<1);
  324. +}
  325. +
  326. +/*
  327.   * This should get invoked on every exit path from the driver.
  328.   */
  329.  static inline void start_ide_timer (byte hwif)
  330. @@ -652,7 +733,7 @@
  331.      unsigned int msect, nsect;
  332.      struct request *rq;
  333.  
  334. -    if (!OK_STAT(stat=GET_STAT(DEV_HWIF),DATA_READY,BAD_RW_STAT)) {
  335. +    if (!OK_STAT(stat=GET_STAT(DEV_HWIF),DATA_READY,BAD_R_STAT)) {
  336.          sti();
  337.          ide_error(dev, "read_intr", stat);
  338.          DO_REQUEST;
  339. @@ -667,7 +748,7 @@
  340.          msect -= nsect;
  341.      } else
  342.          nsect = 1;
  343. -    IN_SECTORS(rq->buffer,nsect);
  344. +    input_ide_data(dev, rq->buffer, nsect * SECTOR_WORDS);
  345.  #ifdef DEBUG
  346.      printk("%s:  read: sectors(%ld-%ld), buffer=0x%08lx, remaining=%ld\n",
  347.          dev->name, rq->sector, rq->sector+nsect-1,
  348. @@ -695,7 +776,7 @@
  349.      int i;
  350.      struct request *rq = ide_cur_rq[DEV_HWIF];
  351.  
  352. -    if (OK_STAT(stat=GET_STAT(DEV_HWIF),DRIVE_READY,BAD_RW_STAT)) {
  353. +    if (OK_STAT(stat=GET_STAT(DEV_HWIF),DRIVE_READY,BAD_W_STAT)) {
  354.  #ifdef DEBUG
  355.          printk("%s: write: sector %ld, buffer=0x%08lx, remaining=%ld\n",
  356.              dev->name, rq->sector, (unsigned long) rq->buffer,
  357. @@ -711,7 +792,7 @@
  358.                  end_request(1, DEV_HWIF);
  359.              if (i > 0) {
  360.                  ide_handler[DEV_HWIF] = &write_intr;
  361. -                OUT_SECTORS(rq->buffer,1);
  362. +                output_ide_data(dev, rq->buffer, SECTOR_WORDS);
  363.                  return;
  364.              }
  365.              DO_REQUEST;
  366. @@ -734,7 +815,7 @@
  367.              nsect = mcount;
  368.          mcount -= nsect;
  369.  
  370. -        OUT_SECTORS(rq->buffer,nsect);
  371. +        output_ide_data(dev, rq->buffer, nsect<<7);
  372.  #ifdef DEBUG
  373.          printk("%s: multwrite: sector %ld, buffer=0x%08lx, count=%d, remaining=%ld\n",
  374.              dev->name, rq->sector, (unsigned long) rq->buffer,
  375. @@ -762,7 +843,7 @@
  376.      int i;
  377.      struct request *rq = &ide_write_rq[DEV_HWIF];
  378.  
  379. -    if (OK_STAT(stat=GET_STAT(DEV_HWIF),DRIVE_READY,BAD_RW_STAT)) {
  380. +    if (OK_STAT(stat=GET_STAT(DEV_HWIF),DRIVE_READY,BAD_W_STAT)) {
  381.          if (stat & DRQ_STAT) {
  382.              if (rq->nr_sectors) {
  383.                  if (dev->mult_count)
  384. @@ -814,7 +895,7 @@
  385.              printk ("  %s: enabled %d-sector multiple mode\n",
  386.                  dev->name, dev->mult_count);
  387.          else
  388. -            printk ("  %s: disabled multiple mode\n", dev->name);
  389. +            printk ("  %s: multiple mode turned off\n", dev->name);
  390.      }
  391.      DO_REQUEST;
  392.  }
  393. @@ -865,16 +946,24 @@
  394.      } else {
  395.          ide_handler[HWIF] = NULL;
  396.          disable_irq(ide_irq[HWIF]);
  397. +#if SUPPORT_SERIALIZE
  398. +        if (single_threaded && ide_irq[HWIF] != ide_irq[HWIF^1])
  399. +            disable_irq(ide_irq[HWIF^1]);
  400. +#endif /* SUPPORT_SERIALIZE */
  401.          sti();
  402.          ide_error(ide_cur_dev[HWIF], "timeout", GET_STAT(HWIF));
  403.          do_request(HWIF);
  404.  #if SUPPORT_SHARING_IRQ
  405. -        if (sharing_single_irq)    /* this line is indeed necessary */
  406. +        if (single_threaded)    /* this line is indeed necessary */
  407.              hwif = current_hwif;
  408.  #endif /* SUPPORT_SHARING_IRQ */
  409.          cli();
  410.          start_ide_timer(HWIF);
  411.          enable_irq(ide_irq[HWIF]);
  412. +#if SUPPORT_SERIALIZE
  413. +        if (single_threaded && ide_irq[HWIF] != ide_irq[HWIF^1])
  414. +            enable_irq(ide_irq[HWIF^1]);
  415. +#endif /* SUPPORT_SERIALIZE */
  416.      }
  417.      restore_flags(flags);
  418.  }
  419. @@ -983,7 +1072,7 @@
  420.      if (rq->cmd == WRITE) {
  421.          OUT_BYTE(dev->wpcom,HD_PRECOMP);    /* for ancient drives */
  422.          OUT_BYTE(dev->mult_count ? WIN_MULTWRITE : WIN_WRITE, HD_COMMAND);
  423. -        WAIT_STAT(dev, DATA_READY, BAD_RW_STAT, WAIT_DRQ, "DRQ", error);
  424. +        WAIT_STAT(dev, DATA_READY, BAD_W_STAT, WAIT_DRQ, "DRQ", error);
  425.          if (!dev->unmask)
  426.              cli();
  427.          if (dev->mult_count) {
  428. @@ -991,7 +1080,7 @@
  429.              multwrite(dev);
  430.              ide_handler[DEV_HWIF] = &multwrite_intr;
  431.          } else {
  432. -            OUT_SECTORS(rq->buffer,1);
  433. +            output_ide_data(dev, rq->buffer, SECTOR_WORDS);
  434.              ide_handler[DEV_HWIF] = &write_intr;
  435.          }
  436.          return 0;
  437. @@ -1040,14 +1129,14 @@
  438.  repeat:
  439.      sti();
  440.  #if SUPPORT_SHARING_IRQ
  441. -    current_hwif = hwif;    /* used *only* when sharing_single_irq==1 */
  442. +    current_hwif = hwif;    /* used *only* when single_threaded==1 */
  443.  #endif /* SUPPORT_SHARING_IRQ */
  444.      if ((rq = ide_cur_rq[HWIF]) == NULL) {
  445.          rq = blk_dev[ide_major[HWIF]].current_request;
  446.          if ((rq == NULL) || (rq->dev < 0)) {
  447.  #if SUPPORT_SHARING_IRQ
  448. -            if (sharing_single_irq) {
  449. -                if ((dev = ide_cur_dev[hwif])) /* disable irq */
  450. +            if (single_threaded) {
  451. +                if (sharing_single_irq && (dev = ide_cur_dev[hwif])) /* disable irq */
  452.                      OUT_BYTE(dev->ctl|2,HD_CMD);
  453.                  rq = blk_dev[ide_major[hwif^=1]].current_request;
  454.                  if ((rq != NULL) && (rq->dev >= 0))
  455. @@ -1121,10 +1210,14 @@
  456.  {                        \
  457.      if (ide_handler[hwif] == NULL) {    \
  458.          disable_irq(ide_irq[hwif]);    \
  459. +        if (single_threaded && ide_irq[hwif] != ide_irq[hwif^1]) \
  460. +            disable_irq(ide_irq[hwif^1]); \
  461.          do_request(hwif);        \
  462.          cli();                \
  463.          start_ide_timer(hwif);        \
  464.          enable_irq(ide_irq[hwif]);    \
  465. +        if (single_threaded && ide_irq[hwif] != ide_irq[hwif^1]) \
  466. +            enable_irq(ide_irq[hwif^1]); \
  467.      }                    \
  468.  }
  469.  
  470. @@ -1169,10 +1262,12 @@
  471.  
  472.      if (!OK_STAT(stat=GET_STAT(HWIF), DRIVE_READY, BAD_STAT))
  473.          (void) dump_status(HWIF, "unexpected_intr", stat);
  474. +    outb_p(2,IDE_PORT(HD_CMD,hwif));    /* disable device irq */
  475.  #if SUPPORT_SHARING_IRQ
  476. -    if (sharing_single_irq) {
  477. +    if (single_threaded && ide_irq[hwif] == ide_irq[hwif^1]) {
  478.          if (!OK_STAT(stat=GET_STAT(hwif^1), DRIVE_READY, BAD_STAT))
  479.              (void) dump_status(hwif^1, "unexpected_intr", stat);
  480. +        outb_p(2,IDE_PORT(HD_CMD,hwif^1));    /* disable device irq */
  481.      }
  482.  #endif /* SUPPORT_SHARING_IRQ */
  483.  }
  484. @@ -1197,21 +1292,32 @@
  485.      } else                        \
  486.          unexpected_intr(hwif);            \
  487.      cli();                        \
  488. -    start_ide_timer(hwif);                \
  489.  }
  490.  
  491. +#if SUPPORT_SERIALIZE
  492. +/* entry point for all interrupts when single_threaded==1 */
  493. +static void ide_seq_intr (int irq, struct pt_regs *regs)
  494. +{
  495. +    byte hwif = (irq != ide_irq[0]);
  496. +    IDE_INTR(HWIF);
  497. +    start_ide_timer(current_hwif);
  498. +}
  499. +#endif /* SUPPORT_SERIALIZE */
  500. +
  501.  #if OPTIMIZE_IRQS
  502.  
  503. -/* entry point for all interrupts on ide0 when sharing_single_irq==0 */
  504. +/* entry point for all interrupts on ide0 when single_threaded==0 */
  505.  static void ide0_intr (int irq, struct pt_regs *regs)
  506.  {
  507.      IDE_INTR(0);
  508. +    start_ide_timer(0);
  509.  }
  510.  
  511. -/* entry point for all interrupts on ide1 when sharing_single_irq==0 */
  512. +/* entry point for all interrupts on ide1 when single_threaded==0 */
  513.  static void ide1_intr (int irq, struct pt_regs *regs)
  514.  {
  515.      IDE_INTR(1);
  516. +    start_ide_timer(1);
  517.  }
  518.  
  519.  #else    /* OPTIMIZE_IRQS */
  520. @@ -1219,13 +1325,14 @@
  521.  #define ide0_intr    ide_intr
  522.  #define ide1_intr    ide_intr
  523.  
  524. -/* entry point for all interrupts when sharing_single_irq==0 */
  525. +/* entry point for all interrupts when single_threaded==0 */
  526.  static void ide_intr (int irq, struct pt_regs *regs)
  527.  {
  528.  #if SUPPORT_TWO_INTERFACES
  529.      byte hwif = (irq != ide_irq[0]);
  530.  #endif    /* SUPPORT_TWO_INTERFACES */
  531.      IDE_INTR(HWIF);
  532. +    start_ide_timer(HWIF);
  533.  }
  534.  
  535.  #endif    /* OPTIMIZE_IRQS */
  536. @@ -1235,6 +1342,7 @@
  537.  static void ide_shared_intr (int irq, struct pt_regs * regs)
  538.  {
  539.      IDE_INTR(current_hwif);
  540. +    start_ide_timer(current_hwif);
  541.  }
  542.  #endif /* SUPPORT_SHARING_IRQ */
  543.  
  544. @@ -1454,6 +1562,9 @@
  545.                  case HDIO_GET_UNMASKINTR:
  546.              return write_fs_long(arg, dev->unmask);
  547.  
  548. +                case HDIO_GET_CHIPSET:
  549. +            return write_fs_long(arg, dev->chipset);
  550. +
  551.                  case HDIO_GET_MULTCOUNT:
  552.              return write_fs_long(arg, dev->mult_count);
  553.  
  554. @@ -1468,22 +1579,28 @@
  555.              return 0;
  556.  
  557.          case HDIO_SET_KEEPSETTINGS:
  558. +        case HDIO_SET_UNMASKINTR:
  559.              if (!suser()) return -EACCES;
  560.              if ((arg > 1) || (MINOR(inode->i_rdev) & PARTN_MASK))
  561.                  return -EINVAL;
  562.              save_flags(flags);
  563.              cli();
  564. -            dev->keep_settings = arg;
  565. +            if (cmd == HDIO_SET_KEEPSETTINGS)
  566. +                dev->keep_settings = arg;
  567. +            else
  568. +                dev->unmask = arg;
  569.              restore_flags(flags);
  570.              return 0;
  571.  
  572. -        case HDIO_SET_UNMASKINTR:
  573. +        case HDIO_SET_CHIPSET:
  574.              if (!suser()) return -EACCES;
  575. -            if ((arg > 1) || (MINOR(inode->i_rdev) & PARTN_MASK))
  576. +            if ((arg > 3) || (MINOR(inode->i_rdev) & PARTN_MASK))
  577.                  return -EINVAL;
  578.              save_flags(flags);
  579.              cli();
  580. -            dev->unmask = arg;
  581. +            dev->chipset   = arg;
  582. +            dev->vlb_sync  = (arg & 2) >> 1;
  583. +            dev->vlb_32bit = (arg & 1);
  584.              restore_flags(flags);
  585.              return 0;
  586.  
  587. @@ -1614,10 +1731,20 @@
  588.  
  589.      id = dev->id = (struct hd_driveid *) probe_mem_start; /* kmalloc() */
  590.      probe_mem_start += 512;
  591. -    IN_SECTORS(id,1);    /* read 512 bytes of id info */
  592. +    input_ide_data(dev, id, SECTOR_WORDS);    /* read 512 bytes of id info */
  593.      sti();
  594.  
  595.      /*
  596. +     * EATA SCSI controllers do a hardware ATA emulation:  ignore them
  597. +     */
  598. +    if ((id->model[0] == 'P' && id->model[1] == 'M')
  599. +     || (id->model[0] == 'S' && id->model[1] == 'K')) {
  600. +        printk("%s: EATA SCSI HBA %.10s\n", dev->name, id->model);
  601. +        dev->present = 0;
  602. +        return;
  603. +    }
  604. +
  605. +    /*
  606.       *  WIN_IDENTIFY returns little-endian info,
  607.       *  WIN_PIDENTIFY *usually* returns little-endian info.
  608.       */
  609. @@ -1769,7 +1896,7 @@
  610.          delay_10ms();        /* give drive a breather */
  611.      } while (IN_BYTE(hd_status,DEV_HWIF) & BUSY_STAT);
  612.      delay_10ms();        /* wait for IRQ and DRQ_STAT */
  613. -    if (OK_STAT(GET_STAT(DEV_HWIF),DRQ_STAT,BAD_RW_STAT)) {
  614. +    if (OK_STAT(GET_STAT(DEV_HWIF),DRQ_STAT,BAD_R_STAT)) {
  615.          cli();            /* some systems need this */
  616.          do_identify(dev, cmd);    /* drive returned ID */
  617.          rc = 0;            /* success */
  618. @@ -1957,8 +2084,22 @@
  619.      if (dev->present)
  620.          printk("(redefined) ");
  621.      if (ints[0] == 0) {
  622. +#if SUPPORT_DTC2278
  623. +        if (!strcmp(str,"dtc2278")) {
  624. +            printk("%s\n",str);
  625. +            probe_dtc2278 = 1;    /* try to init DTC-2278 at boot */
  626. +            return;
  627. +        }
  628. +#endif /* SUPPORT_DTC2278 */
  629. +#if SUPPORT_SERIALIZE
  630. +        if (!strcmp(str,"serialize") || !strcmp(str,"cmd")) {
  631. +            printk("%s\n",str);
  632. +            single_threaded = 1;    /* serialize all drive access */
  633. +            return;
  634. +        }
  635. +#endif /* SUPPORT_SERIALIZE */
  636.          if (!strcmp(str,"noprobe")) {
  637. -            printk("noprobe\n");
  638. +            printk("%s\n",str);
  639.              dev->dont_probe = 1;    /* don't probe for this drive */
  640.              return;
  641.          }
  642. @@ -2070,6 +2211,8 @@
  643.          dev->mult_count            = 0; /* set by do_identify() */
  644.          dev->mult_req            = 0; /* set by do_identify() */
  645.          dev->usage            = 0;
  646. +        dev->vlb_32bit            = 0;
  647. +        dev->vlb_sync            = 0;
  648.          dev->id                = NULL;
  649.          dev->ctl            = 0x08;
  650.          dev->wqueue            = NULL;
  651. @@ -2103,6 +2246,13 @@
  652.          }
  653.          handler = &ide_shared_intr;
  654.      }
  655. +#if SUPPORT_SERIALIZE
  656. +    else if (single_threaded) {
  657. +        handler = &ide_seq_intr;
  658. +        if (HWIF != 0)
  659. +            msg = " (single-threaded with ide0)";
  660. +    }
  661. +#endif /* SUPPORT_SERIALIZE */
  662.  #endif /* SUPPORT_SHARING_IRQ */
  663.      save_flags(flags);
  664.      cli();
  665. @@ -2160,6 +2310,54 @@
  666.  #endif CONFIG_BLK_DEV_IDECD
  667.  };
  668.  
  669. +
  670. +#if SUPPORT_DTC2278
  671. +/*
  672. + * From: andy@cercle.cts.com (Dyan Wile)
  673. + *
  674. + * Below is a patch for DTC-2278 - alike software-programmable controllers
  675. + * The code enables the secondary IDE controller and the PIO4 (3?) timings on
  676. + * the primary (EIDE). You may probably have to enable the 32-bit support to
  677. + * get the full speed. You better get the disk interrupts disabled ( hdparm -u0 
  678. + * /dev/hd.. ) for the drives connected to the EIDE interface. (I get my 
  679. + * filesystem  corrupted with -u 1, but under heavy disk load only :-)  
  680. + */
  681. +
  682. +static void sub22 (char b, char c)
  683. +{
  684. +    int i;
  685. +
  686. +    for(i = 0; i < 3; i++) {
  687. +        __inb(0x3f6);
  688. +        outb_p(b,0xb0);
  689. +        __inb(0x3f6);
  690. +        outb_p(c,0xb4);
  691. +        __inb(0x3f6);
  692. +        if(__inb(0xb4) == c) {
  693. +            outb_p(7,0xb0);
  694. +            __inb(0x3f6);
  695. +            return;    /* success */
  696. +        }
  697. +    }
  698. +}
  699. +
  700. +static void try_to_init_dtc2278 (void)
  701. +{
  702. +/* This (presumably) enables PIO mode4 (3?) on the first interface */
  703. +    cli();
  704. +    sub22(1,0xc3);
  705. +    sub22(0,0xa0);
  706. +    sti();
  707. +
  708. +/* This enables the second interface */
  709. +
  710. +    outb_p(4,0xb0);
  711. +    __inb(0x3f6);
  712. +    outb_p(0x20,0xb4);
  713. +    __inb(0x3f6);
  714. +}
  715. +#endif /* SUPPORT_DTC2278 */
  716. +
  717.  /*
  718.   * This is gets invoked once during initialization, to set *everything* up
  719.   */
  720. @@ -2167,6 +2365,11 @@
  721.  {
  722.      byte hwif;
  723.  
  724. +#if SUPPORT_DTC2278
  725. +    if (probe_dtc2278)
  726. +        try_to_init_dtc2278();
  727. +#endif /* SUPPORT_DTC2278 */
  728. +    /* single_threaded = 0; */    /* zero by default, override at boot */
  729.      for (hwif = 0; hwif < 2; hwif++) {
  730.          init_ide_data (hwif);
  731.          if (SUPPORT_TWO_INTERFACES || hwif == HWIF) {
  732. @@ -2191,6 +2394,7 @@
  733.          } else {
  734.  #if SUPPORT_SHARING_IRQ
  735.              sharing_single_irq = 1;
  736. +            single_threaded = 1;
  737.  #else /* SUPPORT_SHARING_IRQ */
  738.              printk("%s: ide irq-sharing%s", ide_name[1], unsupported);
  739.              return mem_start;
  740. @@ -2218,7 +2422,7 @@
  741.                  timer_table[ide_timer[HWIF]].fn
  742.                      = HWIF ? ide1_timer_expiry : ide0_timer_expiry;
  743.  #if SUPPORT_SHARING_IRQ
  744. -                if (sharing_single_irq)
  745. +                if (single_threaded)
  746.                      blk_dev[major].request_fn = &do_shared_request;
  747.                  else
  748.  #endif /* SUPPORT_SHARING_IRQ */
  749. diff -u --recursive --new-file v1.2.8/linux/drivers/char/cyclades.c linux/drivers/char/cyclades.c
  750. --- v1.2.8/linux/drivers/char/cyclades.c    Wed Mar 29 06:52:57 1995
  751. +++ linux/drivers/char/cyclades.c    Tue May 30 14:33:31 1995
  752. @@ -1,5 +1,5 @@
  753.  static char rcsid[] =
  754. -"$Revision: 1.36.1.3 $$Date: 1995/03/23 22:15:35 $";
  755. +"$Revision: 1.36.1.4 $$Date: 1995/03/29 06:14:14 $";
  756.  /*
  757.   *  linux/kernel/cyclades.c
  758.   *
  759. @@ -18,6 +18,9 @@
  760.   *   int  cy_open(struct tty_struct *tty, struct file *filp);
  761.   *
  762.   * $Log: cyclades.c,v $
  763. + * Revision 1.36.1.4  1995/03/29  06:14:14  bentson
  764. + * disambiguate between Cyclom-16Y and Cyclom-32Ye;
  765. + *
  766.   * Revision 1.36.1.3  1995/03/23  22:15:35  bentson
  767.   * add missing break in modem control block in ioctl switch statement
  768.   * (discovered by Michael Edward Chastain <mec@jobe.shell.portal.com>);
  769. @@ -2637,6 +2640,17 @@
  770.  
  771.          base_addr[CyGFRCR] = 0;
  772.          udelay(10L);
  773. +
  774. +        /* The Cyclom-16Y does not decode address bit 9 and therefore
  775. +           cannot distinguish between references to chip 0 and a non-
  776. +           existent chip 4.  If the preceeding clearing of the supposed
  777. +           chip 4 GFRCR register appears at chip 0, there is no chip 4
  778. +           and this must be a Cyclom-16Y, not a Cyclom-32Ye.
  779. +        */
  780. +        if (chip_number == 4
  781. +        && *(true_base_addr + cy_chip_offset[0] + CyGFRCR) == 0){
  782. +        return chip_number;
  783. +        }
  784.  
  785.          base_addr[CyCCR] = CyCHIP_RESET;
  786.          udelay(1000L);
  787. diff -u --recursive --new-file v1.2.8/linux/drivers/net/loopback.c linux/drivers/net/loopback.c
  788. --- v1.2.8/linux/drivers/net/loopback.c    Wed Jan  4 21:16:05 1995
  789. +++ linux/drivers/net/loopback.c    Mon May 29 11:15:01 1995
  790. @@ -71,12 +71,6 @@
  791.  
  792.    dev->tbusy = 0;
  793.  
  794. -  if (!intr_count && (bh_active & bh_mask)) {
  795. -    start_bh_atomic();
  796. -    do_bottom_half();
  797. -    end_bh_atomic();
  798. -  }
  799. -
  800.    return(0);
  801.  }
  802.  
  803. diff -u --recursive --new-file v1.2.8/linux/drivers/scsi/ChangeLog linux/drivers/scsi/ChangeLog
  804. --- v1.2.8/linux/drivers/scsi/ChangeLog    Sat Apr 29 12:42:22 1995
  805. +++ linux/drivers/scsi/ChangeLog    Thu May  4 10:55:24 1995
  806. @@ -2,7 +2,7 @@
  807.  
  808.      * Linux 1.2.5 released.
  809.  
  810. -    * buslogic.c: Update to version 1.15 (From Dave G, I expect).
  811. +    * buslogic.c: Update to version 1.15 (From Leonard N. Zubkoff).
  812.      Fixed interrupt routine to avoid races when handling multiple
  813.      complete commands per interrupt.  Seems to come up with faster
  814.      cards.
  815. diff -u --recursive --new-file v1.2.8/linux/drivers/scsi/buslogic.c linux/drivers/scsi/buslogic.c
  816. --- v1.2.8/linux/drivers/scsi/buslogic.c    Mon May 29 11:16:08 1995
  817. +++ linux/drivers/scsi/buslogic.c    Tue May 30 14:33:32 1995
  818. @@ -1555,7 +1555,7 @@
  819.          bases[setup_idx] = 0;
  820.          return;
  821.      }
  822. -    buslogic_printk("invalid base 0x%X specified.\n", ints[i]);
  823. +    buslogic_printk("invalid base 0x%X specified.\n", ints[1]);
  824.  }
  825.  
  826.  #ifdef MODULE
  827. diff -u --recursive --new-file v1.2.8/linux/drivers/scsi/st.c linux/drivers/scsi/st.c
  828. --- v1.2.8/linux/drivers/scsi/st.c    Fri Apr 14 12:02:43 1995
  829. +++ linux/drivers/scsi/st.c    Tue May 30 14:33:31 1995
  830. @@ -124,22 +124,22 @@
  831.         SCpnt->request_bufflen);
  832.      if (driver_byte(result) & DRIVER_SENSE)
  833.        print_sense("st", SCpnt);
  834. -  } else
  835. +  }
  836.  #endif
  837. -    scode = sense[2] & 0x0f;
  838. -    if (!(driver_byte(result) & DRIVER_SENSE) ||
  839. -    ((sense[0] & 0x70) == 0x70 &&
  840. -     scode != NO_SENSE &&
  841. -     scode != RECOVERED_ERROR &&
  842. -     scode != UNIT_ATTENTION &&
  843. -     scode != BLANK_CHECK &&
  844. -     scode != VOLUME_OVERFLOW)) {  /* Abnormal conditions for tape */
  845. -      printk("st%d: Error %x. ", dev, result);
  846. -      if (driver_byte(result) & DRIVER_SENSE)
  847. -    print_sense("st", SCpnt);
  848. -      else
  849. -    printk("\n");
  850. -    }
  851. +  scode = sense[2] & 0x0f;
  852. +  if (!(driver_byte(result) & DRIVER_SENSE) ||
  853. +      ((sense[0] & 0x70) == 0x70 &&
  854. +       scode != NO_SENSE &&
  855. +       scode != RECOVERED_ERROR &&
  856. +       scode != UNIT_ATTENTION &&
  857. +       scode != BLANK_CHECK &&
  858. +       scode != VOLUME_OVERFLOW)) {  /* Abnormal conditions for tape */
  859. +    printk("st%d: Error %x. ", dev, result);
  860. +    if (driver_byte(result) & DRIVER_SENSE)
  861. +      print_sense("st", SCpnt);
  862. +    else
  863. +      printk("\n");
  864. +  }
  865.  
  866.    if ((sense[0] & 0x70) == 0x70 &&
  867.        scode == RECOVERED_ERROR
  868. diff -u --recursive --new-file v1.2.8/linux/drivers/sound/.blurb linux/drivers/sound/.blurb
  869. --- v1.2.8/linux/drivers/sound/.blurb    Sun Nov 20 21:50:47 1994
  870. +++ linux/drivers/sound/.blurb    Tue May 30 13:20:32 1995
  871. @@ -1,28 +1,3 @@
  872. -NOTE!
  873. -
  874. -    This is an ALPHA TEST VERSION (pre 3.0). The latest
  875. -    released version of this driver is now part of
  876. -    Linux kernel distribution. For other operating systems
  877. -    use the snd-driv-2.5.tar.gz package.
  878. -
  879. -    This particular version contains lots of new features
  880. -    BUT THERE ARE NO APPLICATIONS WHICH USE THEM. So there
  881. -    is no need to install this version as long as you are
  882. -    not developing the driver or applications which use it.
  883. -    All new features are in the /dev/sequencer and /dev/midi
  884. -    parts of the driver.
  885. -
  886. -    
  887. -    This version is little bit incomplete. Some features have
  888. -    not been implemented for each soundcards yet. All features
  889. -    of v2.4 should work OK.
  890. -
  891. -CAUTION!
  892. -    This version of driver works with applications written and
  893. -    compiled for v2.*. The problem is that APPLICATIONS COMPILED
  894. -    WITH soundcard.h OF THIS VERSION WILL NOT WORK WITH OLDER DRIVER.
  895. -    Be careful when distributing applications compiled with this
  896. -    version (just the apps using /dev/sequencer are incompatible).
  897.  
  898.      *********************************************************
  899.      * IF YOU HAVE ANY PROBLEMS WITH THE SOUND DRIVER,    *
  900. @@ -30,5 +5,3 @@
  901.      * NEAREST LINUX FTP SITE AND CONTAINS ANSWER TO YOUR    *
  902.      * PROBLEM.                        *
  903.      *********************************************************
  904. -
  905. -Hannu
  906. diff -u --recursive --new-file v1.2.8/linux/fs/buffer.c linux/fs/buffer.c
  907. --- v1.2.8/linux/fs/buffer.c    Sat Apr 29 12:42:22 1995
  908. +++ linux/fs/buffer.c    Mon May 29 13:50:16 1995
  909. @@ -973,7 +973,7 @@
  910.      }
  911.      if (bhnum)
  912.          ll_rw_block(READ, bhnum, bhr);
  913. -    for (i = 0 ; i < nrbuf ; i++) {
  914. +    for (i = nrbuf ; --i >= 0 ; ) {
  915.          if (bh[i]) {
  916.              wait_on_buffer(bh[i]);
  917.          }
  918. diff -u --recursive --new-file v1.2.8/linux/fs/open.c linux/fs/open.c
  919. --- v1.2.8/linux/fs/open.c    Wed Feb 15 09:31:56 1995
  920. +++ linux/fs/open.c    Tue May 30 14:33:31 1995
  921. @@ -277,6 +277,8 @@
  922.          return -ENOENT;
  923.      if (IS_RDONLY(inode))
  924.          return -EROFS;
  925. +    if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
  926. +        return -EPERM;
  927.      if (mode == (mode_t) -1)
  928.          mode = inode->i_mode;
  929.      newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
  930. @@ -299,6 +301,10 @@
  931.          iput(inode);
  932.          return -EROFS;
  933.      }
  934. +    if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) {
  935. +        iput(inode);
  936. +        return -EPERM;
  937. +    }
  938.      if (mode == (mode_t) -1)
  939.          mode = inode->i_mode;
  940.      newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
  941. @@ -322,6 +328,8 @@
  942.          return -ENOENT;
  943.      if (IS_RDONLY(inode))
  944.          return -EROFS;
  945. +    if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
  946. +        return -EPERM;
  947.      if (user == (uid_t) -1)
  948.          user = inode->i_uid;
  949.      if (group == (gid_t) -1)
  950. @@ -361,6 +369,10 @@
  951.      if (IS_RDONLY(inode)) {
  952.          iput(inode);
  953.          return -EROFS;
  954. +    }
  955. +    if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) {
  956. +        iput(inode);
  957. +        return -EPERM;
  958.      }
  959.      if (user == (uid_t) -1)
  960.          user = inode->i_uid;
  961. diff -u --recursive --new-file v1.2.8/linux/fs/proc/array.c linux/fs/proc/array.c
  962. --- v1.2.8/linux/fs/proc/array.c    Sun Apr  9 11:59:57 1995
  963. +++ linux/fs/proc/array.c    Tue May 30 12:17:18 1995
  964. @@ -1,4 +1,3 @@
  965. -#define THREE_LEVEL
  966.  /*
  967.   *  linux/fs/proc/array.c
  968.   *
  969. diff -u --recursive --new-file v1.2.8/linux/fs/proc/mem.c linux/fs/proc/mem.c
  970. --- v1.2.8/linux/fs/proc/mem.c    Mon Feb 20 21:29:53 1995
  971. +++ linux/fs/proc/mem.c    Tue May 30 12:17:18 1995
  972. @@ -1,4 +1,3 @@
  973. -#define THREE_LEVEL
  974.  /*
  975.   *  linux/fs/proc/mem.c
  976.   *
  977. diff -u --recursive --new-file v1.2.8/linux/include/asm-i386/processor.h linux/include/asm-i386/processor.h
  978. --- v1.2.8/linux/include/asm-i386/processor.h    Fri Feb 24 16:41:01 1995
  979. +++ linux/include/asm-i386/processor.h    Mon May 29 11:13:40 1995
  980. @@ -21,12 +21,6 @@
  981.  extern char wp_works_ok;        /* doesn't work on a 386 */
  982.  extern char hlt_works_ok;    /* problems on some 486Dx4's and old 386's */
  983.  
  984. -#define start_bh_atomic() \
  985. -__asm__ __volatile__("incl _intr_count")
  986. -
  987. -#define end_bh_atomic() \
  988. -__asm__ __volatile__("decl _intr_count")
  989. -
  990.  /*
  991.   * Bus types (default is ISA, but people can check others with these..)
  992.   * MCA_bus hardcoded to 0 for now.
  993. diff -u --recursive --new-file v1.2.8/linux/include/linux/hdreg.h linux/include/linux/hdreg.h
  994. --- v1.2.8/linux/include/linux/hdreg.h    Thu Jan  5 13:47:08 1995
  995. +++ linux/include/linux/hdreg.h    Thu Jun  1 11:23:04 1995
  996. @@ -78,12 +78,14 @@
  997.  #define HDIO_GET_MULTCOUNT    0x304    /* get current IDE blockmode setting */
  998.  #define HDIO_GET_IDENTITY     0x307    /* get IDE identification info */
  999.  #define HDIO_GET_KEEPSETTINGS     0x308    /* get keep-settings-on-reset flag */
  1000. +#define HDIO_GET_CHIPSET    0x309    /* get current interface type setting */
  1001.  #define HDIO_DRIVE_CMD        0x31f    /* execute a special drive command */
  1002.  
  1003.  /* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x32n/0x33n */
  1004.  #define HDIO_SET_MULTCOUNT    0x321    /* set IDE blockmode */
  1005.  #define HDIO_SET_UNMASKINTR    0x322    /* permit other irqs during I/O */
  1006.  #define HDIO_SET_KEEPSETTINGS    0x323    /* keep ioctl settings on reset */
  1007. +#define HDIO_SET_CHIPSET    0x324    /* optimise driver for interface type */
  1008.  
  1009.  /* structure returned by HDIO_GET_IDENTITY, as per ANSI ATA2 rev.2f spec */
  1010.  struct hd_driveid {
  1011. diff -u --recursive --new-file v1.2.8/linux/include/linux/interrupt.h linux/include/linux/interrupt.h
  1012. --- v1.2.8/linux/include/linux/interrupt.h    Thu Jan 26 07:38:17 1995
  1013. +++ linux/include/linux/interrupt.h    Mon May 29 11:13:51 1995
  1014. @@ -45,6 +45,18 @@
  1015.      set_bit(nr, &bh_mask);
  1016.  }
  1017.  
  1018. +extern inline void start_bh_atomic(void)
  1019. +{
  1020. +    intr_count++;
  1021. +}
  1022. +
  1023. +extern inline void end_bh_atomic(void)
  1024. +{
  1025. +    if (intr_count == 1 && (bh_active & bh_mask))
  1026. +        do_bottom_half();
  1027. +    intr_count--;
  1028. +}
  1029. +
  1030.  /*
  1031.   * Autoprobing for irqs:
  1032.   *
  1033. diff -u --recursive --new-file v1.2.8/linux/include/linux/pci.h linux/include/linux/pci.h
  1034. --- v1.2.8/linux/include/linux/pci.h    Sun Apr  9 11:59:57 1995
  1035. +++ linux/include/linux/pci.h    Tue May 30 14:33:31 1995
  1036. @@ -388,7 +388,7 @@
  1037.      {PCI_VENDOR_ID_CONTAQ,        "Contaq"}, \
  1038.      {PCI_VENDOR_ID_NS,        "NS"}, \
  1039.      {PCI_VENDOR_ID_VIA,        "VIA Technologies"}, \
  1040. -    {PCI_VENDOR_ID_SI,        "Silicon Integrated"}, \
  1041. +    {PCI_VENDOR_ID_SI,        "Silicon Integrated Systems"}, \
  1042.      {PCI_VENDOR_ID_LEADTEK,        "Leadtek Research"}, \
  1043.      {PCI_VENDOR_ID_IMS,        "IMS"}, \
  1044.      {PCI_VENDOR_ID_ZEINET,        "ZeiNet"}, \
  1045. diff -u --recursive --new-file v1.2.8/linux/ipc/shm.c linux/ipc/shm.c
  1046. --- v1.2.8/linux/ipc/shm.c    Wed Mar 29 06:53:00 1995
  1047. +++ linux/ipc/shm.c    Tue May 30 12:17:18 1995
  1048. @@ -1,4 +1,3 @@
  1049. -#define THREE_LEVEL
  1050.  /*
  1051.   * linux/ipc/shm.c
  1052.   * Copyright (C) 1992, 1993 Krishna Balasubramanian
  1053. diff -u --recursive --new-file v1.2.8/linux/kernel/module.c linux/kernel/module.c
  1054. --- v1.2.8/linux/kernel/module.c    Tue Jan 31 09:36:21 1995
  1055. +++ linux/kernel/module.c    Fri May 26 08:23:33 1995
  1056. @@ -745,7 +745,7 @@
  1057.          link && (link != &kernel_module);
  1058.          link = link->next) {
  1059.  
  1060. -        if (link->ref->module == mp)
  1061. +        if (link->ref && (link->ref->module == mp))
  1062.              link->ref = newref++;
  1063.      }
  1064.  
  1065. diff -u --recursive --new-file v1.2.8/linux/kernel/resource.c linux/kernel/resource.c
  1066. --- v1.2.8/linux/kernel/resource.c    Fri Jan 13 09:20:31 1995
  1067. +++ linux/kernel/resource.c    Thu Jun  1 08:49:37 1995
  1068. @@ -13,7 +13,7 @@
  1069.  #include <linux/types.h>
  1070.  #include <linux/ioport.h>
  1071.  
  1072. -#define IOTABLE_SIZE 32
  1073. +#define IOTABLE_SIZE 64
  1074.  
  1075.  typedef struct resource_entry_t {
  1076.      u_long from, num;
  1077. diff -u --recursive --new-file v1.2.8/linux/mm/filemap.c linux/mm/filemap.c
  1078. --- v1.2.8/linux/mm/filemap.c    Tue Feb 14 08:39:06 1995
  1079. +++ linux/mm/filemap.c    Tue May 30 12:17:18 1995
  1080. @@ -1,4 +1,3 @@
  1081. -#define THREE_LEVEL
  1082.  /*
  1083.   *    linux/mm/filemmap.c
  1084.   *
  1085. diff -u --recursive --new-file v1.2.8/linux/mm/memory.c linux/mm/memory.c
  1086. --- v1.2.8/linux/mm/memory.c    Sun Apr  9 11:59:57 1995
  1087. +++ linux/mm/memory.c    Tue May 30 12:17:18 1995
  1088. @@ -1,4 +1,3 @@
  1089. -#define THREE_LEVEL
  1090.  /*
  1091.   *  linux/mm/memory.c
  1092.   *
  1093. diff -u --recursive --new-file v1.2.8/linux/mm/mprotect.c linux/mm/mprotect.c
  1094. --- v1.2.8/linux/mm/mprotect.c    Tue Feb 14 08:39:06 1995
  1095. +++ linux/mm/mprotect.c    Tue May 30 12:17:18 1995
  1096. @@ -1,4 +1,3 @@
  1097. -#define THREE_LEVEL
  1098.  /*
  1099.   *    linux/mm/mprotect.c
  1100.   *
  1101. diff -u --recursive --new-file v1.2.8/linux/mm/swap.c linux/mm/swap.c
  1102. --- v1.2.8/linux/mm/swap.c    Fri Apr 28 11:10:56 1995
  1103. +++ linux/mm/swap.c    Tue May 30 12:17:18 1995
  1104. @@ -1,4 +1,3 @@
  1105. -#define THREE_LEVEL
  1106.  /*
  1107.   *  linux/mm/swap.c
  1108.   *
  1109. diff -u --recursive --new-file v1.2.8/linux/mm/vmalloc.c linux/mm/vmalloc.c
  1110. --- v1.2.8/linux/mm/vmalloc.c    Thu Feb  9 18:22:18 1995
  1111. +++ linux/mm/vmalloc.c    Tue May 30 12:17:18 1995
  1112. @@ -1,4 +1,3 @@
  1113. -#define THREE_LEVEL
  1114.  /*
  1115.   *  linux/mm/vmalloc.c
  1116.   *
  1117. diff -u --recursive --new-file v1.2.8/linux/net/inet/af_inet.c linux/net/inet/af_inet.c
  1118. --- v1.2.8/linux/net/inet/af_inet.c    Thu Mar  9 20:37:36 1995
  1119. +++ linux/net/inet/af_inet.c    Fri May 26 08:23:32 1995
  1120. @@ -815,8 +815,8 @@
  1121.      sk->inuse = 1;
  1122.  
  1123.      /* This will destroy it. */
  1124. -    release_sock(sk);
  1125.      sock->data = NULL;
  1126. +    release_sock(sk);
  1127.      sk->socket = NULL;
  1128.      return(0);
  1129.  }
  1130. @@ -939,8 +939,12 @@
  1131.          return 0;    /* Rock and roll */
  1132.      }
  1133.  
  1134. -    if (sock->state == SS_CONNECTING && sk->protocol == IPPROTO_TCP && (flags & O_NONBLOCK))
  1135. -        return -EALREADY;    /* Connecting is currently in progress */
  1136. +    if (sock->state == SS_CONNECTING && sk->protocol == IPPROTO_TCP && (flags & O_NONBLOCK)) {
  1137. +        if (sk->err != 0)
  1138. +            return -sk->err;    /* Connection must have failed */
  1139. +        else
  1140. +            return -EALREADY;    /* Connecting is currently in progress */
  1141. +    }
  1142.        
  1143.      if (sock->state != SS_CONNECTING) 
  1144.      {
  1145. diff -u --recursive --new-file v1.2.8/linux/net/inet/dev.c linux/net/inet/dev.c
  1146. --- v1.2.8/linux/net/inet/dev.c    Thu Mar  9 20:37:37 1995
  1147. +++ linux/net/inet/dev.c    Mon May 29 11:10:05 1995
  1148. @@ -337,7 +337,9 @@
  1149.           *    Make sure we haven't missed an interrupt. 
  1150.           */
  1151.          printk("dev_queue_xmit: worked around a missed interrupt\n");
  1152. +        start_bh_atomic();
  1153.          dev->hard_start_xmit(NULL, dev);
  1154. +        end_bh_atomic();
  1155.          return;
  1156.        }
  1157.  
  1158. @@ -409,12 +411,15 @@
  1159.              }
  1160.          }
  1161.      }
  1162. +    start_bh_atomic();
  1163.      if (dev->hard_start_xmit(skb, dev) == 0) {
  1164. +        end_bh_atomic();
  1165.          /*
  1166.           *    Packet is now solely the responsibility of the driver
  1167.           */
  1168.          return;
  1169.      }
  1170. +    end_bh_atomic();
  1171.  
  1172.      /*
  1173.       *    Transmission failed, put skb back into a list. Once on the list it's safe and
  1174. diff -u --recursive --new-file v1.2.8/linux/net/inet/ip.c linux/net/inet/ip.c
  1175. --- v1.2.8/linux/net/inet/ip.c    Sun Apr  9 11:59:58 1995
  1176. +++ linux/net/inet/ip.c    Tue May 30 14:33:31 1995
  1177. @@ -1489,7 +1489,8 @@
  1178.       *    (4.    We ought to check for IP multicast addresses and undefined types.. does this matter ?)
  1179.       */
  1180.  
  1181. -    if (skb->len<sizeof(struct iphdr) || iph->ihl<5 || iph->version != 4 || ip_fast_csum((unsigned char *)iph, iph->ihl) !=0)
  1182. +    if (skb->len<sizeof(struct iphdr) || iph->ihl<5 || iph->version != 4 ||
  1183. +        skb->len<ntohs(iph->tot_len) || ip_fast_csum((unsigned char *)iph, iph->ihl) !=0)
  1184.      {
  1185.          ip_statistics.IpInHdrErrors++;
  1186.          kfree_skb(skb, FREE_WRITE);
  1187. @@ -2090,8 +2091,6 @@
  1188.              unsigned char ucval;
  1189.  
  1190.              ucval=get_fs_byte((unsigned char *)optval);
  1191. -            if(ucval<1||ucval>255)
  1192. -                                return -EINVAL;
  1193.              sk->ip_mc_ttl=(int)ucval;
  1194.                      return 0;
  1195.          }
  1196. diff -u --recursive --new-file v1.2.8/linux/net/inet/tcp.c linux/net/inet/tcp.c
  1197. --- v1.2.8/linux/net/inet/tcp.c    Mon May 29 11:16:09 1995
  1198. +++ linux/net/inet/tcp.c    Fri May 26 08:23:33 1995
  1199. @@ -934,6 +934,8 @@
  1200.          break;
  1201.  
  1202.      case SEL_OUT:
  1203. +        if (sk->err)
  1204. +            return 1;
  1205.          if (sk->shutdown & SEND_SHUTDOWN) 
  1206.              return 0;
  1207.          if (sk->state == TCP_SYN_SENT || sk->state == TCP_SYN_RECV)
  1208. @@ -948,7 +950,7 @@
  1209.          return 1;
  1210.  
  1211.      case SEL_EX:
  1212. -        if (sk->err || sk->urg_data)
  1213. +        if (sk->urg_data)
  1214.              return 1;
  1215.          break;
  1216.      }
  1217. diff -u --recursive --new-file v1.2.8/linux/net/unix/sock.c linux/net/unix/sock.c
  1218. --- v1.2.8/linux/net/unix/sock.c    Thu Mar  9 20:37:37 1995
  1219. +++ linux/net/unix/sock.c    Tue May 30 12:23:57 1995
  1220. @@ -481,7 +481,7 @@
  1221.      fname[sockaddr_len-UN_PATH_OFFSET] = '\0';
  1222.      old_fs = get_fs();
  1223.      set_fs(get_ds());
  1224. -    i = open_namei(fname, 0, S_IFSOCK, &inode, NULL);
  1225. +    i = open_namei(fname, 2, S_IFSOCK, &inode, NULL);
  1226.      set_fs(old_fs);
  1227.      if (i < 0) 
  1228.      {
  1229. diff -u --recursive --new-file v1.2.8/linux/versions.mk linux/versions.mk
  1230. --- v1.2.8/linux/versions.mk    Mon Jan 23 10:38:28 1995
  1231. +++ linux/versions.mk    Thu Jun  1 11:53:40 1995
  1232. @@ -11,11 +11,14 @@
  1233.  .SUFFIXES: .ver
  1234.  
  1235.  .c.ver:
  1236. -    $(CC) $(CFLAGS) -E -D__GENKSYMS__ $< | genksyms -w $(TOPINCL)/modules
  1237. +    @if [ ! -x /sbin/genksyms ]; then echo "Please read: README.modules"; fi
  1238. +    $(CC) $(CFLAGS) -E -DCONFIG_MODVERSIONS -D__GENKSYMS__ $< | /sbin/genksyms -w $(TOPINCL)/modules
  1239.      @ln -sf $(TOPINCL)/modules/$@ .
  1240.  
  1241.  $(SYMTAB_OBJS):
  1242.      $(CC) $(CFLAGS) -DEXPORT_SYMTAB -c $(@:.o=.c)
  1243. +
  1244. +$(SYMTAB_OBJS:.o=.ver): $(TOPINCL)/autoconf.h
  1245.  
  1246.  $(TOPINCL)/modversions.h: $(SYMTAB_OBJS:.o=.ver)
  1247.      @echo updating $(TOPINCL)/modversions.h
  1248.