Commit Graph

43650 Commits

Author SHA1 Message Date
scottr f2c6836685 Fix a problem uncovered when we started to use the pool allocator to manage
scsipi_xfer structures.

When scsipi_execute_xs() calls the driver's scsi_cmd function, it assumes
that it can still dereference a pointer to the scsipi_xfer struct.  Since
scsipi_done() has already been called, which in turn has called
scsipi_free_xs(), the struct has already been returned the structure to
the pool!  In other words, xs->flags has been compromised, but we are still
testing it.

These changes resolve the problem by doing the following:

- In scsipi_execute_xs(), if the hardware driver's scsi_cmd function
  returns SUCCESSFULLY_QUEUED, set a new flag (SCSI_ASYNCREQ) in xs->flags.
  Since the request will be handled asynchronously, we will need the
  scsipi_xfer struct to be freed in scsipi_done().

  If the hardware driver's scsi_cmd function returns COMPLETE, we now
  simply return any actual errors, or 0 if none occurred.  (Previously,
  we may have returned EJUSTRETURN, of which the sole effect was to
  avoid freeing the scsipi_xfer struct in our caller.)

- In scsipi_done(), only free the scsipi_xfer struct for async requests.
  The contents of the struct will otherwise remain valid until the
  function that initiated the transfer frees it.

With this change, responsibility for freeing the struct now lies in two
places, depending on the type of the request:

- For synchronous requests, the routine calling scsipi_execute_xs()
  must clean up.

- For asynchronous requests, scsipi_done() cleans up (as it always has).

[Note:  this change also corrects a problem with sddump():  scsipi_done()
was attempting to return a static scsipi_xfer struct to the pool!  Since
dumps are performed synchronously, we now handle this correctly.]

This solution was provided by Jason Thorpe, after I got him to look at
some related (but insufficient) attempts of my own.
1998-09-14 05:49:21 +00:00
scottr 10640f1bfc Fix a problem uncovered when we started to use the pool allocator to manage
scsipi_xfer structures.

When scsipi_execute_xs() calls the driver's scsi_cmd function, it assumes
that it can still dereference a pointer to the scsipi_xfer struct.  Since
scsipi_done() has already been called, which in turn has called
scsipi_free_xs(), the struct has already been returned to the pool!  In
other words, xs->flags has been compromised, but we are still testing it.

These changes resolve the problem by doing the following:

- In scsipi_execute_xs(), if the lower-level driver's scsi_cmd function
  returns SUCCESSFULLY_QUEUED and SCSI_NOSLEEP is set in xs->flags, set a
  new flag (SCSI_ASYNCREQ).  This indicates that scsipi_done() should free
  the scsipi_xfer struct.

  If the lower-level driver's scsi_cmd function returns SUCCESSFULLY_QUEUED
  but SCSI_NOSLEEP is not set, we wait (via tsleep()) for the request to
  complete, then fall through to the COMPLETE case.

  If the lower-level driver's scsi_cmd function returns COMPLETE, we now
  simply return any actual errors, or 0 if none occurred.  (Previously,
  we may have returned EJUSTRETURN, of which the sole effect was to
  avoid freeing the scsipi_xfer struct in our caller.  No code seems
  to depend on this behavior, however.)

- In scsipi_done(), only free the scsipi_xfer struct for async requests.
  The contents of the struct will otherwise remain valid until the
  function that initiated the transfer frees it.

With this change, responsibility for freeing the struct now lies in two
places, depending on the type of the request:

- For synchronous requests, the routine calling scsipi_execute_xs()
  must clean up.

- For asynchronous requests, scsipi_done() cleans up (as it always has).

[Note:  this change also corrects a problem with sddump():  scsipi_done()
was attempting to return a static scsipi_xfer struct to the pool!  Since
dumps are performed synchronously, we now handle this correctly.]

This solution was provided by Jason Thorpe, after I got him to look at
some related (but insufficient) attempts of my own.
1998-09-14 05:49:20 +00:00
ross c7c3a68ca1 Fix MLINKS. Define LDADD and DPADD. 1998-09-14 05:34:41 +00:00
marc 34b14f2e9e remove the sortlist line preferring nasa's nameservers. Sorry jason :-) 1998-09-14 05:05:44 +00:00
ross 51ecc07eb9 NetBSD rcs id keyword. 1998-09-14 04:42:45 +00:00
ross 28e76b2580 Add NetBSD-specific Makefile. 1998-09-14 04:42:21 +00:00
ross e4cac751bf Initial import of bzip2-0.9.0b from Julian Seward. 1998-09-14 04:27:53 +00:00
ross 382f00edd8 Document noasync and nosync.
Clarify the meaning of sync.
Run all the -o keywords through the Cm (keyword emphasis) macro.
1998-09-14 03:48:30 +00:00
ross 43b9fa8f01 New files specific to the NetBSD libbz2. 1998-09-14 03:18:12 +00:00
ross cede6f3c99 More rcs id keywords. 1998-09-14 03:13:53 +00:00
ross ec61451f99 Adding NetBSD rcs id keywords. 1998-09-14 03:08:17 +00:00
ross 6610fc2af7 Initial import of bzip2-0.9.0b from Julian Seward. 1998-09-14 03:01:19 +00:00
thorpej 27f3588d7b oops, missed one. 1998-09-14 02:50:12 +00:00
thorpej cbfc257eda sigset13_t -> int. 1998-09-14 02:48:33 +00:00
ross f9cab68505 NetBSD rcs id keywords.
New Makefile, README.
1998-09-14 02:37:23 +00:00
ross 90b00880b2 Initial import of bzip2-0.9.0b from Julian Seward. 1998-09-14 02:13:36 +00:00
thorpej 3d3a3c610c Back out previous change; it was incorrect. 1998-09-14 00:57:51 +00:00
tv 058853ee30 Use WARNS=1 to get -Wall, and properly disable -Wmain on gcc 2.8 1998-09-14 00:50:22 +00:00
tv 768b3efab5 Switch i386 to egcs 1.1. 1998-09-14 00:29:28 +00:00
eeh 83116b3d6b Libc fixes, mostly to work around the new signal stuff. 1998-09-13 23:54:44 +00:00
perry 5d0722b723 Note that kernel Makefile support for tags is totally broken. 1998-09-13 23:50:39 +00:00
tv a6844453f0 More egcs updates: MD-split objc headers, and add egcs compilers and
static libraries where applicable.
1998-09-13 23:40:35 +00:00
tv 8d78198425 Add libobjc and libg2c runtime shared objects from egcs. 1998-09-13 23:38:33 +00:00
tv 1428a599bf Rethink the origins of LDSTATIC. Instead, use an option NOLINKLIB, which
builds and installs only what is necessary to link and run binaries, when
the library is not externally useable.
- NOPIC: Create and link against a static library.
- PIC: Create, link against, and install a shared object.
- PIC+LDSTATIC: Create and link against a static library; create and
  install a shared object.
1998-09-13 23:25:18 +00:00
tron 7010f82942 Sync with "GENERIC". 1998-09-13 23:15:46 +00:00
tv 6b7ad68b9c Remove directory "/usr/include/g++/gen". 1998-09-13 22:32:17 +00:00
tv a128febf5b MD-split the libstdc++ binaries and includes to reflect the state of
egcs/non-egcs default compiler on each platform.
1998-09-13 22:31:00 +00:00
pk 9949f7d556 regen. 1998-09-13 22:29:06 +00:00
pk c7971c960e Signal compat: sunos sigset_t conversions;
new sunos_sigvec() & sunos_sigpending()
1998-09-13 22:28:16 +00:00
tv a2e65ee4f1 Nuke libg++, leaving only libstdc++ for GCC 2.7-based systems. 1998-09-13 22:23:02 +00:00
tv 9adeb9bb84 Re-sort these files. 1998-09-13 22:14:03 +00:00
hwr 6831c842f3 The post 1.3.2 world is actually ready for this. 1998-09-13 21:39:49 +00:00
pk 459204606f Everyone uses sunos_sendsig(). 1998-09-13 21:05:35 +00:00
hwr 43c45ee409 Enable gre(4) device 1998-09-13 21:02:02 +00:00
tv 138f9d4389 Reorganize comments around .m and .c.lo rules 1998-09-13 20:56:38 +00:00
hwr 1374569d41 Add a tool to set/display the configuration of gre(4) interfaces. 1998-09-13 20:50:55 +00:00
hwr bdf6e1db02 Also build greconfig 1998-09-13 20:48:57 +00:00
hwr 43688c8702 Manpage for gre network interface. 1998-09-13 20:39:35 +00:00
pk ff383dc20d Add compat_13_machdep.c 1998-09-13 20:34:34 +00:00
pk 190e4c429d Move compat_13 sigreturn() into its own file. 1998-09-13 20:33:33 +00:00
tv cd40dfec9f Use tconfig.j to get the proper type definitions. 1998-09-13 20:32:04 +00:00
hwr 366b9c4515 Add a gre tunnel pseudo network device. Gre = generic route encapsulation.
This device shows up like any other network interface and can be used to
tunnel L3 protocols as e.g. IP over IP.
1998-09-13 20:27:47 +00:00
pk 82d2ea3a70 Remove left-over SUNOS_COMPAT line. 1998-09-13 20:24:15 +00:00
pk 06612cb9f8 Since the last signal restructuring the sparc also has an sunos_sendsig(). 1998-09-13 20:20:48 +00:00
pk 9658554e18 Replace previous by something more complete. 1998-09-13 20:17:54 +00:00
pk 9d9f22fa79 Signal handling changes: sunos compat gets its own sendsig(); sunos
sigreturn() == compat_13_sigreturn().
1998-09-13 20:07:54 +00:00
tv c593074e24 Import of egcs 1.1 release (1.1b). 1998-09-13 16:51:44 +00:00
eeh 52cbf86859 Looks like something else changed in signal land. 1998-09-13 16:45:43 +00:00
kleink 38876f6260 Protect local time state and GMT data initialization with a readers/writer lock
and a mutex, respectively.
1998-09-13 16:26:14 +00:00
christos 8dfbc827ea Fix copyright mess:
- remove trailing spaces.
	- make copyrights consistent (put the date before the name).
1998-09-13 16:21:16 +00:00