Commit Graph

2003 Commits

Author SHA1 Message Date
ad
92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
tsutsui
c5f4f0e1da Fix errors which were hidden in #ifdef COMPAT_09:
- fix a typo in rev 1.43 (ep_setup_stack -> es_setup_stack)
- fix an arg missed on ktrace-lwp merge in rev 1.47

XXX Is it really worth to have COMPAT_09 code on mips?
XXX No mips port in 0.9 and quite few a.out MIPS binaries..
2008-11-19 13:55:00 +00:00
ad
a471d58a44 Remove compat ifdef. 2008-11-15 11:15:22 +00:00
dyoung
90a821d0b5 To fix compilation, consistently use 'cmd' instead of 'command'
for the ioctl command code.  Thanks he@.
2008-11-13 19:44:02 +00:00
ad
5b57d1bcce LKM -> MODULAR 2008-11-13 10:51:23 +00:00
dyoung
de87fe677d *** Summary ***
When a link-layer address changes (e.g., ifconfig ex0 link
02🇩🇪ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address.  (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior.  Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability.  KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR.  In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr.  That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR.  In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR.  For example, pull ..._init() out of any switch
statement that looks like this:

        switch (...->sa_family) {
        case ...:
                ..._init();
                ...
                break;
        ...
        default:
                ..._init();
                ...
                break;
        }

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

        switch (x & (IFF_UP|IFF_RUNNING)) {
        case 0:
                ...
                break;
        case IFF_RUNNING:
                ...
                break;
        case IFF_UP:
                ...
                break;
        case IFF_UP|IFF_RUNNING:
                ...
                break;
        }

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure.  Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls.  In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source.  In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively.  Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset.  Delete unnecessary casts to void *.  Use
sockaddr_in_init() and sockaddr_in6_init().  Compare pointers with
NULL instead of "testing truth".  Replace some instances of (type
*)0 with NULL.  Change some K&R prototypes to ANSI C, and join
lines.
2008-11-07 00:20:01 +00:00
tsutsui
7605567fa0 Wrap #include "opt_sa.h" with #if defined(_KERNEL_OPT)/#endif
since this file is also used for compat_irix.
2008-10-25 10:41:05 +00:00
dyoung
2be1ba83a2 Use aprint_error_dev() instead of printf(). 2008-10-24 22:16:26 +00:00
ad
d1b01a3709 Provide a small inline wrapper for sysent::sy_call() and use it to store
the active syscall description in struct lwp. To be used at some future
point to prevent unloading of modules that provide syscalls, while the
syscalls are in use.
2008-10-21 12:16:58 +00:00
uebayasi
b4f453049e Oops; redo previous. 2008-10-17 00:46:07 +00:00
uebayasi
8922bc6f78 p_smutex was merged into p_lock some time ago. 2008-10-17 00:29:21 +00:00
wrstuden
fc7511b00e Merge wrstuden-revivesa into HEAD. 2008-10-15 06:51:17 +00:00
tsutsui
1a0c6c8f90 Remove advertising clause for UCB in various genassym.cf files,
which were derived from genassym.c in 4.4BSD-Lite2 (or 386BSD).
Closes PR misc/39573.  Approved by martin@.
2008-09-20 18:29:04 +00:00
matt
91d4704c12 Update <machine/ieeefp.h> to use the C99 FE_* definitions instead of the
NetBSD defined ones.  Redefine the NetBSD ones in terms of the C99 ones.
Step 1 to having <fenv.h>
2008-08-05 16:47:41 +00:00
tsutsui
70612e5c54 Remove __weak_alias() for mips3_delay(). It's in mips3_clock.c. 2008-08-03 09:14:28 +00:00
tsutsui
2d4879d193 Add CPU_MIPS_DOUBLE_COUNT to R10K family CPUs and
also remove (unused?) MIPS_NOT_SUPP flag from them.

Problem on R10k O2 is reported by martin@ on port-sgimips.
2008-08-03 00:09:20 +00:00
joerg
52c17c8946 - device/softc split for ath(4) 2008-07-09 19:47:23 +00:00
gmcgarry
8cb6efd4df Add stdargs support for pcc. 2008-06-21 00:56:39 +00:00
cegger
54a1f88f19 fix typo. should compile again. 2008-06-16 08:36:51 +00:00
cegger
27309530b4 use device_lookup_private to get softc 2008-06-13 12:08:01 +00:00
cegger
175e9cfe68 use __array_count 2008-06-13 11:57:08 +00:00
cegger
3d8fe45fc9 use device_lookup_private to get softc 2008-06-11 23:54:45 +00:00
ad
06c343ac94 vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both. 2008-06-04 12:41:40 +00:00
ad
fd089e08cf Remove ref to uvm.page_idle_zero 2008-06-04 11:30:25 +00:00
dyoung
71f2cf5b71 Make this compile again: don't use USBDEVNAME().
While I'm here, use device_t, device_private(), aprint_error_dev().
2008-05-27 21:24:15 +00:00
tsutsui
40f5425d58 Remove all initialization of obsolete ci_divisor_recip in
mips struct cpu_info and related macroes.
The member was prepared for a hack in MD microtime(9) implementation
but it has been superseded by MI timecounter(9).
2008-05-26 15:59:29 +00:00
tsutsui
31d6cdf996 Add simple help messages for MD machine commands on ddb(4).
PR port-mips/38306
2008-05-23 17:01:32 +00:00
martin
5d1469bd77 Backout previous: the license sweep touched these files in error, so
restore the old license.
2008-05-10 15:31:03 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos
1a72a1c693 fix signature 2008-04-25 17:39:20 +00:00
ad
284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
drochner
16304febf2 minor fixes for device/softc split, approved by dogcow
(not tested on real hardware yet)
2008-04-03 15:12:43 +00:00
dogcow
50ea53d902 ...and fix my fix to do the proper device_t split. 2008-03-31 03:19:20 +00:00
dogcow
0e06ed5d6e fix device_t split fallout. 2008-03-31 02:42:42 +00:00
cube
7aa6248cdf Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
2008-03-18 20:46:35 +00:00
cube
607ead0ef4 Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend).  Use proper types and ansify where appropriate.
2008-03-14 15:09:09 +00:00
dyoung
7bbfa300c6 Do not use sc_invalid, it is no more. 2008-03-12 18:08:43 +00:00
dyoung
d347ff7717 Prepare for PMF self-suspension: in the if_stop() methods, clear
IFF_UP and IFF_RUNNING before running the 'disable' step, instead
of after.  Soon I will handle the 'disable' step by calling into
PMF, which may call if_stop(, 0).  Ordinarily, that is harmless.
This change lets the if_stop() routines exit early when they find
on entry that IFF_RUNNING is not set.
2008-03-11 23:58:06 +00:00
dyoung
25cf32ee3d Use device_t and accessors. 2008-03-11 23:19:03 +00:00
dyoung
f612df5fb6 Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:38:28 +00:00
xtraeme
f402cadf9a Remove CTL_MACHDEP_NAMES, it's not used anywhere.
Ok by martin@.
2008-02-27 18:26:15 +00:00
simonb
fa9544ebbf Add entries for MIPS's 24K, 24KE, 34K and 74K cores.
From Alexander Voropay in mail to port-mips@.
2008-02-19 12:15:46 +00:00
simonb
4ffc28b34a Add PrID's for MIPS's 24K, 24KE, 34K and 74K cores.
From Alexander Voropay in mail to port-mips@.
2008-02-19 11:26:40 +00:00
tsutsui
556a6829d8 Backout previous. vr_idle.S no longer depends on assym.h. 2008-02-18 15:21:04 +00:00
joerg
34c8721568 Another assym.h dependency for hpcmips 2008-02-18 13:23:34 +00:00
ad
372461e58e Add aliases for atomic_cas_foo_ni(). 2008-02-10 13:32:14 +00:00
dyoung
2ccede0a9c Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs.  This will ease extending the kernel and sharing of code
between drivers.

First steps:  Make the signature of ifioctl_common() match struct
ifinet->if_ioctl.  Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.
2008-02-07 01:21:52 +00:00
dsl
c2a8c787c3 Remove the 'args' parameter to 'trace_exit()' it is no longer used.
Instead of passing the (un)real system call code and syscall table pointer,
just pass the number of arguments - which is what ktrace really wants.
Ride forthcoming 4.99.53
2008-02-06 22:12:39 +00:00
tsutsui
3bf45f63f8 Avoid using division ops in delay(9). 2008-01-31 17:37:45 +00:00
tsutsui
ff0e8a32fd Make these TX39xx stuff compile without "-mips2" option.
TX39xx has a sync instruction, but it doesn't support all mips2 instructions.
2008-01-26 14:40:08 +00:00