Commit Graph

51 Commits

Author SHA1 Message Date
nyan
ecfd2441ca MFC: Don't call bus_deactivate_resource() explicitly before calling
bus_release_resource().
2007-05-12 06:10:11 +00:00
jhb
bd48914a94 MFC: Change the life cycle of bpf interface objects to close attach/detach
races with bpf(4).  This includes shims to preserve the ABI for any old
modules.  For more details see the commit log for 1.166 of sys/net/bpf.c.
2007-01-19 23:01:34 +00:00
jhb
025e3d0a95 MFC: Split struct ithd into struct intr_thread and intr_event and
associated changes.  More details below:

  Remove public declarations of variables that were forgotten when they were
  made static.

  Revision  Changes    Path
  1.31      +0 -1      src/sys/sys/interrupt.h

  Make sure the interrupt is masked before processing it, or bad things
  can happen.

  Revision  Changes    Path
  1.10      +3 -3      src/sys/arm/arm/intr.c

  Reorganize the interrupt handling code a bit to make a few things cleaner
  and increase flexibility to allow various different approaches to be tried
  in the future.
  - Split struct ithd up into two pieces.  struct intr_event holds the list
    of interrupt handlers associated with interrupt sources.
    struct intr_thread contains the data relative to an interrupt thread.
    Currently we still provide a 1:1 relationship of events to threads
    with the exception that events only have an associated thread if there
    is at least one threaded interrupt handler attached to the event.  This
    means that on x86 we no longer have 4 bazillion interrupt threads with
    no handlers.  It also means that interrupt events with only INTR_FAST
    handlers no longer have an associated thread either.
  - Renamed struct intrhand to struct intr_handler to follow the struct
    intr_foo naming convention.  This did require renaming the powerpc
    MD struct intr_handler to struct ppc_intr_handler.
  - INTR_FAST no longer implies INTR_EXCL on all architectures except for
    powerpc.  This means that multiple INTR_FAST handlers can attach to the
    same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach
    to the same interrupt.  Sharing INTR_FAST handlers may not always be
    desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun
    either.  Drivers can always still use INTR_EXCL to ask for an interrupt
    exclusively.  The way this sharing works is that when an interrupt
    comes in, all the INTR_FAST handlers are executed first, and if any
    threaded handlers exist, the interrupt thread is scheduled afterwards.
    This type of layout also makes it possible to investigate using interrupt
    filters ala OS X where the filter determines whether or not its companion
    threaded handler should run.
  - Aside from the INTR_FAST changes above, the impact on MD interrupt code
    is mostly just 's/ithread/intr_event/'.
  - A new MI ddb command 'show intrs' walks the list of interrupt events
    dumping their state.  It also has a '/v' verbose switch which dumps
    info about all of the handlers attached to each event.
  - We currently don't destroy an interrupt thread when the last threaded
    handler is removed because it would suck for things like ppbus(8)'s
    braindead behavior.  The code is present, though, it is just under
    #if 0 for now.
  - Move the code to actually execute the threaded handlers for an interrrupt
    event into a separate function so that ithread_loop() becomes more
    readable.  Previously this code was all in the middle of ithread_loop()
    and indented halfway across the screen.
  - Made struct intr_thread private to kern_intr.c and replaced td_ithd
    with a thread private flag TDP_ITHREAD.
  - In statclock, check curthread against idlethread directly rather than
    curthread's proc against idlethread's proc. (Not really related to intr
    changes)

  Tested on:      alpha, amd64, i386, sparc64
  Tested on:      arm, ia64 (older version of patch by cognet and marcel)

  Revision  Changes    Path
  1.88      +43 -29    src/sys/alpha/alpha/interrupt.c
  1.38      +5 -5      src/sys/alpha/isa/isa.c
  1.16      +58 -52    src/sys/amd64/amd64/intr_machdep.c
  1.6       +1 -1      src/sys/amd64/include/intr_machdep.h
  1.16      +2 -2      src/sys/amd64/isa/atpic.c
  1.11      +28 -22    src/sys/arm/arm/intr.c
  1.462     +2 -2      src/sys/dev/sio/sio.c
  1.6       +1 -1      src/sys/dev/uart/uart_kbd_sun.c
  1.24      +2 -2      src/sys/dev/uart/uart_tty.c
  1.15      +58 -52    src/sys/i386/i386/intr_machdep.c
  1.8       +1 -1      src/sys/i386/include/intr_machdep.h
  1.21      +2 -2      src/sys/i386/isa/atpic.c
  1.52      +32 -25    src/sys/ia64/ia64/interrupt.c
  1.180     +3 -2      src/sys/kern/kern_clock.c
  1.127     +437 -270  src/sys/kern/kern_intr.c
  1.206     +0 -1      src/sys/kern/subr_witness.c
  1.6       +3 -3      src/sys/powerpc/include/intr_machdep.h
  1.7       +35 -32    src/sys/powerpc/powerpc/intr_machdep.c
  1.14      +1 -1      src/sys/sparc64/include/intr_machdep.h
  1.24      +43 -36    src/sys/sparc64/sparc64/intr_machdep.c
  1.32      +36 -36    src/sys/sys/interrupt.h
  1.440     +1 -3      src/sys/sys/proc.h

  Catch up with interrupt-thread changes.

  Revision  Changes    Path
  1.32      +1 -1      src/sys/dev/zs/zs.c

  Catch up with new interrupt handling code.

  Revision  Changes    Path
  1.16      +3 -3      src/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c

  Catch up with new interrupt handling code.

  Revision  Changes    Path
  1.162     +2 -2      src/sys/dev/cy/cy.c
  1.101     +2 -2      src/sys/dev/rc/rc.c

  Catch up with new interrupt handling code.

  Revision  Changes    Path
  1.50      +2 -2      src/sys/dev/cx/if_cx.c
  1.41      +1 -1      src/sys/dev/sab/sab.c
  1.238     +2 -2      src/sys/pc98/cbus/sio.c

  Add a swi_remove() function to teardown software interrupt handlers.  For
  now it just calls intr_event_remove_handler(), but at some point it might
  also be responsible for tearing down interrupt events created via swi_add.

  Revision  Changes    Path
  1.128     +17 -0     src/sys/kern/kern_intr.c
  1.33      +1 -0      src/sys/sys/interrupt.h

  - Use swi_remove() to teardown swi handlers rather than
    intr_event_remove_handler().
  - Remove tty: prefix from a couple of swi handler names.

  Revision  Changes    Path
  1.51      +1 -1      src/sys/dev/cx/if_cx.c
  1.102     +2 -2      src/sys/dev/rc/rc.c
  1.42      +1 -1      src/sys/dev/sab/sab.c
  1.25      +1 -1      src/sys/dev/uart/uart_tty.c
  1.33      +1 -1      src/sys/dev/zs/zs.c
  1.17      +2 -2      src/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c

  Remove a stray return statement in the interrupt dispatch function
  that caused a premature exit after calling a fast interrupt handler
  and bypassing a much needed critical_exit() and the scheduling of
  the interrupt thread for non-fast handlers. In short: unbreak :-)

  Revision  Changes    Path
  1.53      +0 -1      src/sys/ia64/ia64/interrupt.c

  If we get a stray interrupt, return after logging it.  In the extremely
  rare case of a stray interrupt to an unregistered source (such as a stray
  interrupt from the 8259As when using APIC), this could result in a page
  fault when it tried to walk the list of interrupt handlers to execute
  INTR_FAST handlers.  This bug was introduced with the intr_event changes,
  so it's not present in 5.x or 6.x.

  Submitted by:   Mark Tinguely tinguely at casselton dot net

  Revision  Changes    Path
  1.17      +1 -0      src/sys/amd64/amd64/intr_machdep.c
  1.16      +1 -0      src/sys/i386/i386/intr_machdep.c

Approved by:	re (scottl)
2006-03-10 19:37:35 +00:00
rwatson
e13b2df854 Merge linux_ioctl.c:1.128 svr4_sockio.c:1.17 altq_cbq.c:1.3 if_oltr.c:1.38
if_pflog.c:1.14 if_pfsync.c:1.21 if_an.c:1.70 if_ar.c:1.72 if_arl.c:1.11
amrr.c:1.10 onoe.c:1.10 if_ath.c:1.101 awi.c:1.41 if_bfe.c:1.27
if_bge.c:1.93 if_cm_isa.c:1.7 smc90cx6.c:1.16 if_cnw.c:1.20 if_cp.c:1.25
if_cs.c:1.42 if_ct.c:1.26 if_cx.c:1.46 if_ed.c:1.256 if_em.c:1.68
if_en_pci.c:1.37 midway.c:1.66 if_ep.c:1.143 if_ex.c:1.58 if_fatm.c:1.20
if_fe.c:1.93 if_fwe.c:1.38 if_fwip.c:1.8 if_fxp.c:1.244 if_gem.c:1.33
if_hatm.c:1.25 if_hatm_intr.c:1.20 if_hatm_ioctl.c:1.13 if_hatm_rx.c:1.10
if_hatm_tx.c:1.14 if_hme.c:1.39 if_ie.c:1.104 if_ndis.c:1.101
if_ic.c:1.24 if_ipw.c:1.10 if_iwi.c:1.10 if_ixgb.c:1.13 if_lge.c:1.41
if_lnc.c:1.113 if_my.c:1.31 if_nge.c:1.77 if_nve.c:1.10 if_owi.c:1.12
if_patm.c:1.9 if_patm_intr.c:1.6 if_patm_ioctl.c:1.10 if_patm_tx.c:1.10
pdq_ifsubr.c:1.28 if_plip.c:1.38 if_ral.c:1.12 if_ral_pci.c:1.2
if_ray.c:1.81 if_rayvar.h:1.22 if_re.c:1.49 if_sbni.c:1.21 if_sbsh.c:1.14
if_sn.c:1.48 dp83932.c:1.21 if_snc_pccard.c:1.9 if_sr.c:1.70 if_tx.c:1.91
if_txp.c:1.33 if_aue.c:1.92 if_axe.c:1.32 if_cdce.c:1.8 if_cue.c:1.59
if_kue.c:1.66 if_rue.c:1.23 if_udav.c:1.16 if_ural.c:1.12 if_vge.c:1.16
if_vx.c:1.58 if_wi.c:1.185 if_wi_pci.c:1.26 if_wl.c:1.68 if_xe.c:1.60
if_xe_pccard.c:1.30 if_el.c:1.68 i4b_ipr.c:1.35 i4b_isppp.c:1.31
kern_poll.c:1.20 bridge.c:1.94 bridgestp.c:1.4 if_arcsubr.c:1.27
if_atm.h:1.24 if_atmsubr.c:1.40 if_bridge.c:1.16 if_ef.c:1.35
if_ethersubr.c:1.196 if_faith.c:1.37 if_fddisubr.c:1.100 if_fwsubr.c:1.14
if_gif.c:1.54 if_gre.c:1.34 if_iso88025subr.c:1.70 if_loop.c:1.107
if_ppp.c:1.106 if_spppsubr.c:1.121 if_tap.c:1.57 if_tun.c:1.154
if_vlan.c:1.80 ppp_tty.c:1.67 ieee80211_ioctl.c:1.32 atm_if.c:1.31
ng_eiface.c:1.33 ng_ether.c:1.50 ng_fec.c:1.19 ng_iface.c:1.44
ng_sppp.c:1.9 ip_carp.c:1.30 ip_fastfwd.c:1.30 in6.c:1.53 nd6_nbr.c:1.31
natm.c:1.40 if_dc.c:1.162 if_de.c:1.168 if_pcn.c:1.72 if_rl.c:1.154
if_sf.c:1.84 if_sis.c:1.135 if_sk.c:1.108 if_ste.c:1.86 if_ti.c:1.109
if_tl.c:1.101 if_vr.c:1.106 if_wb.c:1.81 if_xl.c:1.194 from HEAD to
RELENG_6:

  Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
  IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
  ifnet.if_drv_flags.  Device drivers are now responsible for
  synchronizing access to these flags, as they are in if_drv_flags.  This
  helps prevent races between the network stack and device driver in
  maintaining the interface flags field.

  Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
  some less so.

  Reviewed by:    pjd, bz

Approved by:	re (scottl)
2005-08-25 05:01:24 +00:00
rik
a62ddd3522 Use m_length (m, NULL) instead of m->m_pkthdr.len.
Problems reported by: strijar at urai dot ru
Approved by:	re (scottl)
2005-07-09 16:14:05 +00:00
rik
6f7b42e659 Lost cx_mpsafenet check.
Pointy hat:	me
Approved by:	re (scottl)
2005-07-09 14:31:48 +00:00
rik
8413a0582f Lost t_oproc() callback assignment.
Pointyhats:	phk (who lost it), me (who didn't notice that)
Approved by:	re (scottl)
2005-07-09 14:27:35 +00:00
rik
5e351d0161 Lost CX_UNLOCK().
Pointy hat:	me
Approved by:	re (scottl)
2005-07-09 14:23:42 +00:00
rik
452b8fd2ee Protect from partially initialized channels.
Approved by:	re (scottl)
2005-07-09 14:03:02 +00:00
rik
5910b0e970 Space & alignment nits.
Approved by:	re (scottl)
2005-07-09 13:44:36 +00:00
brooks
567ba9b00a Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
 - Struct arpcom is no longer referenced in normal interface code.
   Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
   To enforce this ac_enaddr has been renamed to _ac_enaddr.
 - The second argument to ether_ifattach is now always the mac address
   from driver private storage rather than sometimes being ac_enaddr.

Reviewed by:	sobomax, sam
2005-06-10 16:49:24 +00:00
joerg
c85a3e95f7 netchild's mega-patch to isolate compiler dependencies into a central
place.

This moves the dependency on GCC's and other compiler's features into
the central sys/cdefs.h file, while the individual source files can
then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to
refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42.

By now, GCC and ICC (the Intel compiler) have been actively tested on
IA32 platforms by netchild.  Extension to other compilers is supposed
to be possible, of course.

Submitted by:	netchild
Reviewed by:	various developers on arch@, some time ago
2005-03-02 21:33:29 +00:00
imp
4b319958e7 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
rik
4940a86594 Make code MPSAFE.
You could turn this off by debug.mpsafenet=0 for full network
stack or via debug.{cp|cx|ctau}.mpsafenet for cp(4), cx(4) and
ctau(4) accordingly.

MFC after:	10 days
2004-12-13 22:07:23 +00:00
rik
b73c74d91c Partially backout 1.34. These ioctls and function cx_modem_status () are
used by sync part of driver, so put them back.
2004-12-09 23:43:03 +00:00
rik
0dc1d96706 Don not call pp_down()/pp_up() form XX_tlf()/XX_tls() in non PPP mode
to privent running of PPP's state machine in non PPP mode.

MFC: after 3 days.
2004-12-03 16:57:15 +00:00
phk
47c2584ada Use generic tty code instead of local copy. 2004-10-13 09:27:18 +00:00
phk
e35c2bf38e First half of tty code rework: unifdef -D__FreeBSD_Version=600000
The changes in the next commit would make the code totally unreadable
if the #ifdef'ing were maintained.

It might make a lot of sense to split if_cx.c in a netgraph related
and in a tty related file but I will not attempt that without hardware.
2004-10-13 07:02:56 +00:00
phk
d240df25ed Remove bogus cdevsw frobbing code which tries to prevent double
loading of modules.

MODULE_VERSION() should be used for this I belive.
2004-09-23 12:21:11 +00:00
rik
f3b648e6a6 Make code ready to switch debug.mpsafenet to 1 since I've not able to
commit MPSAFE code for now it is just IFF_NEEDSGIANT.
2004-08-27 22:14:26 +00:00
rik
7cdae66efa Fix resource check while autodetection. 2004-08-13 12:35:52 +00:00
rik
d5629fc00d White space cleanup. 2004-08-13 12:14:39 +00:00
julian
8c938ed70a Slight cosmetic changes.
Also introduce a macro to be called by persistent nodes to signal their
persistence during shutdown to hide this mechanism from the node author.

Make node flags have a consistent style in naming.

Document the change.
2004-07-20 17:15:38 +00:00
phk
f00200d8a4 Preparation commit for the tty cleanups that will follow in the near
future:

rename ttyopen() -> tty_open() and ttyclose() -> tty_close().

We need the ttyopen() and ttyclose() for the new generic cdevsw
functions for tty devices in order to have consistent naming.
2004-07-15 20:47:41 +00:00
phk
3683e698d2 Introduce ttygone() which indicates that the hardware is detached.
Move dtrwait logic to the generic TTY level.
2004-07-11 15:18:39 +00:00
jhb
050c6affec - Shorten the names for the TTY related swi interrupt handlers as the
'tty:' prefix is largely redundant.
- Fix the priority of the low-priority TTY SWIs that are hung off of the
  softclock thread.

Submitted by:	bde (2)
2004-06-28 16:17:11 +00:00
julian
dfb6d51195 Convert Netgraph to use mbuf tags to pass its meta information around.
Thanks to Sam for importing tags in a way that allowed this to be done.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
Also allow the sr and ar drivers to create netgraph versions of their modules.
Document the change to the ksocket node.
2004-06-25 19:22:05 +00:00
rik
7c1f24f113 Use bus_dma* instead of contigmalloc()+vtophys() for RELENG_5. 2004-06-23 18:13:10 +00:00
rik
7de2955c80 Make code more clean: backout support for 3.x branch. 2004-06-23 11:23:54 +00:00
phk
40dd98a3bd Second half of the dev_t cleanup.
The big lines are:
	NODEV -> NULL
	NOUDEV -> NODEV
	udev_t -> dev_t
	udev2dev() -> findcdev()

Various minor adjustments including handling of userland access to kernel
space struct cdev etc.
2004-06-17 17:16:53 +00:00
phk
dfd1f7fd50 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
rik
1052c2e128 Free tty at detach().
Tested by:	`pstat -t`
Requested by:	phk
2004-06-10 13:50:28 +00:00
rik
c298d11504 Check if we control device. Else we will go to panic cause we don't have
properly initialized dev_t structure at open.
2004-06-09 17:58:51 +00:00
rik
75d585e46d 1. struct tty => struct tty *tty.
Requested by:	phk
2004-06-08 10:38:20 +00:00
phk
bfb13da831 Make linesw[] an array of pointers to linedesc instead of an array of
linedisc.
2004-06-07 20:45:45 +00:00
phk
17b52df3d7 Centralize the line discipline optimization determination in a function
called ttyldoptim().

Use this function from all the relevant drivers.

I belive no drivers finger linesw[] directly anymore, paving the way for
locking and refcounting.
2004-06-04 21:55:55 +00:00
phk
06049d3eaf Manual edits to change linesw[]-frobbing to ttyld_*() calls. 2004-06-04 20:04:52 +00:00
phk
9bb2c2f2d2 Make the remaining serial drivers call ttyioctl() rather than calling
the linedisc directly.
2004-06-04 08:02:37 +00:00
phk
9d102d7d5a Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
rik
1bc72344a4 Switch to using C99 sparse initialisers for the type methods array.
Requested by:	harti

MFC after:	1 week
2004-05-29 13:17:28 +00:00
rik
f13a054c86 Use better way of closing fr support before current sppp doesn't have it. 2004-05-07 11:45:25 +00:00
rik
1e881321c1 Sync with RELENG_4. 2004-05-07 11:11:13 +00:00
rik
70641422ab Delete unused cx_slow_ih.
Pointed by:	jhb
2004-05-07 11:06:25 +00:00
trhodes
dfcfecd6e4 These are changes to allow to use the Intel C/C++ compiler (lang/icc)
to build the kernel. It doesn't affect the operation if gcc.

Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as
icc v8 may define __GNUC__ some parts may look strange but are
necessary.

Additional changes:
 - in_cksum.[ch]:
   * use a generic C version instead of the assembly version in the !gcc
     case (ASM code breaks with the optimizations icc does)
     -> no bad checksums with an icc compiled kernel
     Help from:		andre, grehan, das
     Stolen from: 	alpha version via ppc version
     The entire checksum code should IMHO be replaced with the DragonFly
     version (because it isn't guaranteed future revisions of gcc will
     include similar optimizations) as in:
        ---snip---
          Revision  Changes    Path
          1.12      +1 -0      src/sys/conf/files.i386
          1.4       +142 -558  src/sys/i386/i386/in_cksum.c
          1.5       +33 -69    src/sys/i386/include/in_cksum.h
          1.5       +2 -0      src/sys/netinet/igmp.c
          1.6       +0 -1      src/sys/netinet/in.h
          1.6       +2 -0      src/sys/netinet/ip_icmp.c

          1.4       +3 -4      src/contrib/ipfilter/ip_compat.h
          1.3       +1 -2      src/sbin/natd/icmp.c
          1.4       +0 -1      src/sbin/natd/natd.c
          1.48      +1 -0      src/sys/conf/files
          1.2       +0 -1      src/sys/conf/files.amd64
          1.13      +0 -1      src/sys/conf/files.i386
          1.5       +0 -1      src/sys/conf/files.pc98
          1.7       +1 -1      src/sys/contrib/ipfilter/netinet/fil.c
          1.10      +2 -3      src/sys/contrib/ipfilter/netinet/ip_compat.h
          1.10      +1 -1      src/sys/contrib/ipfilter/netinet/ip_fil.c
          1.7       +1 -1      src/sys/dev/netif/txp/if_txp.c
          1.7       +1 -1      src/sys/net/ip_mroute/ip_mroute.c
          1.7       +1 -2      src/sys/net/ipfw/ip_fw2.c
          1.6       +1 -2      src/sys/netinet/igmp.c
          1.4       +158 -116  src/sys/netinet/in_cksum.c
          1.6       +1 -1      src/sys/netinet/ip_gre.c
          1.7       +1 -2      src/sys/netinet/ip_icmp.c
          1.10      +1 -1      src/sys/netinet/ip_input.c
          1.10      +1 -2      src/sys/netinet/ip_output.c
          1.13      +1 -2      src/sys/netinet/tcp_input.c
          1.9       +1 -2      src/sys/netinet/tcp_output.c
          1.10      +1 -1      src/sys/netinet/tcp_subr.c
          1.10      +1 -1      src/sys/netinet/tcp_syncache.c
          1.9       +1 -2      src/sys/netinet/udp_usrreq.c

          1.5       +1 -2      src/sys/netinet6/ipsec.c
          1.5       +1 -2      src/sys/netproto/ipsec/ipsec.c
          1.5       +1 -1      src/sys/netproto/ipsec/ipsec_input.c
          1.4       +1 -2      src/sys/netproto/ipsec/ipsec_output.c

          and finally remove
            sys/i386/i386        in_cksum.c
            sys/i386/include     in_cksum.h
        ---snip---
 - endian.h:
   * DTRT in C++ mode
 - quad.h:
   * we don't use gcc v1 anymore, remove support for it
   Suggested by:	bde (long ago)
 - assym.h:
   * avoid zero-length arrays (remove dependency on a gcc specific
     feature)
     This change changes the contents of the object file, but as it's
     only used to generate some values for a header, and the generator
     knows how to handle this, there's no impact in the gcc case.
   Explained by:	bde
   Submitted by:	Marius Strobl <marius@alchemy.franken.de>
 - aicasm.c:
   * minor change to teach it about the way icc spells "-nostdinc"
   Not approved by:	gibbs (no reply to my mail)
 - bump __FreeBSD_version (lang/icc needs to know about the changes)

Incarnations of this patch survive gcc compiles since a loooong time,
I use it on my desktop. An icc compiled kernel works since Nov. 2003
(exceptions: snd_* if used as modules), it survives a build of the
entire ports collection with icc.

Parts of this commit contains suggestions or submissions from
Marius Strobl <marius@alchemy.franken.de>.

Reviewed by:	-arch
Submitted by:	netchild
2004-03-12 21:45:33 +00:00
rik
e6b8b40794 1. Fix compilation and panic while system boot problem after makedev was
changed to unde2dev.

Approved by: imp (mentor)
2004-03-02 16:44:07 +00:00
phk
39fb4aef3d Device megapatch 5/6:
Remove the unused second argument from udev2dev().

Convert all remaining users of makedev() to use udev2dev().  The
semantic difference is that udev2dev() will only locate a pre-existing
dev_t, it will not line makedev() create a new one.

Apart from the tiny well controlled windown in D_PSEUDO drivers,
there should no longer be any "anonymous" dev_t's in the system
now, only dev_t's created with make_dev() and make_dev_alias()
2004-02-21 21:32:15 +00:00
phk
ad925439e0 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
phk
fcf7e634fb Device megapatch 3/6:
Add missing D_TTY flags to various drivers.

Complete asserts that dev_t's passed to ttyread(), ttywrite(),
ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty
pointer.

Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default
cdevsw methods for D_TTY drivers and remove the explicit initializations
in various drivers cdevsw structures.
2004-02-21 20:41:11 +00:00
rik
c7adc4f135 Fixing copyright and adding vendor cvs id.
Approved by:	imp (mentor)
2004-02-14 21:08:11 +00:00
rik
9184072cec Fixing memory deallocation 2004-02-14 20:56:09 +00:00