Commit Graph

2594 Commits

Author SHA1 Message Date
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger
35fb64746b bcmp -> memcmp 2009-03-18 15:14:29 +00:00
cegger
df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
joerg
f5b0fec0e0 Remove SHMMAXPGS from all kernel configs. Dynamically compute the
initial limit as 1/4 of the physical memory. Ensure the limit is at
least 1024 pages, the old default on most platforms.
2009-03-06 20:31:46 +00:00
hauke
2f03f5338a Add Nubus IDs for the Atto SiliconExpress IV, an isp1000 based
fast/wide SCSI adapter.
2009-03-04 19:55:16 +00:00
apb
0cc72e51ac Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
2009-02-13 22:41:00 +00:00
jym
92ae85d18e Changes to MEMORY_RBFLAGS option:
- renamed to MEMORY_DISK_RBFLAGS to better fit the rest of the
MEMORY_DISK options(4)
- change default value to RB_AUTOBOOT instead of RB_SINGLE, and adapt
the config(5) files accordingly
- document this option inside options(4)

See also http://mail-index.netbsd.org/tech-kern/2008/12/25/msg003924.html

Reviewed by abs@ in private mail.
2009-02-06 18:50:26 +00:00
martin
f055e18205 Centralize fpu exception to siginfo code encoding for all m68k archs,
fixes a failure in the lib/libc/ieeefp/except regression test.
2009-01-27 20:30:12 +00:00
mrg
c6a4afa995 add COMPAT_50 to all the configs with COMPAT_40. 2009-01-24 05:06:05 +00:00
he
d4b1297c8f Re-adapt to the changed return types for major() and minor(). 2009-01-21 16:24:33 +00:00
tsutsui
00ae5151a8 Move extern decls for Sysseg, Sysptmap, Sysptsize, mem_size, virtual_avail,
virtual_end, and protection_codes[] to common <m68k/pmap_motorola.h>,
and also make protection_codes[] unsigned.

XXX: avail_start and avail_end should also be moved, but it causes
XXX: -Wshadow warnings in uvm/uvm_page.c:uvm_page_physload() and
XXX: I don't have a good idea of alternative names for now.
2009-01-17 07:17:35 +00:00
tsutsui
616515e8fc Split device_t/softc, missed on MI dp8390nic changes 10 months ago.
Also use aprint_*(), and remove unnecessary casts against void * variables.

Tested by John Klos on port-mac68k, and should be pulled up to netbsd-5.
2009-01-16 23:43:46 +00:00
yamt
70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
oster
af47f33d5b Deal with new dev_t build lossage. Fix from lukem. 2009-01-11 21:55:45 +00:00
martin
6f6ed4ddab Decode the fpu status bits into siginfo code values when signaling fpu
traps. This makes us pass all of our ieee regression tests.
2009-01-11 21:09:13 +00:00
martin
f24aab6b37 Use PRIu64 format to printf major() and minor() values. 2009-01-11 21:04:59 +00:00
tsutsui
74ed958e0f Fix inverted logic on FPU type check in fpfault(). From OpenBSD. 2009-01-11 06:02:18 +00:00
tsutsui
7c5092b818 Remove unnecessary "last kernel PT page" mapping.
The lkptpa was required for hp300 (where PA != VA)
to prepare a page PA == VA to turn on the MMU,
and it is not needed for mac68k which has PA == VA
mappings even in kernel text/data/bss.  Tested on LC630.
2009-01-10 11:28:47 +00:00
tsutsui
970121f868 Use the global kernel_pmap_ptr pointer in each MD pmap_bootstrap.c
(where MMU is not enabled yet) and make kernel_pmap_store static again.
Also consistently use uintptr_t on address conversion in RELOC() macro.

Tested on hp300 (PA != VA) and news68k (PA == VA).
2008-12-28 05:15:59 +00:00
cegger
dcf705893e use M_ZERO on malloc() and remove subsequent bzero(). 2008-12-19 18:49:37 +00:00
cegger
9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
martin
719a906ef5 As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.
2008-11-30 18:21:31 +00:00
hauke
37bef7c624 Remove various COMPAT_ options for unsupported releases and optional
features; remove parallel printer driver.
Bring back pppoe support.
2008-11-27 15:44:04 +00:00
ad
6ba528b5bc Remove softdep, pass 1. We are focused on improving journalling.
Proposed on tech-kern@.
2008-11-24 11:41:07 +00:00
ad
0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
dyoung
94d985722a It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled.  So I have made two changes:

1 Do not call pmf_system_shutdown() from doshutdownhooks().  Instead,
change every call to doshutdownhooks() to a call to doshutdownhooks()
followed by a call to pmf_system_shutdown().  No functional change
is intended by this change.

2 Make i386 re-enable interrupts briefly while it calls
pmf_system_shutdown().  I leave it to others either to fix the
other ports, or to factor out some MI shutdown code, as joerg@
suggests, and fix that.  Note that a functional change *is* intended
by this change.

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
2008-11-11 06:46:40 +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
apb
f46c1de7cb Use ${TOOL_SED} instead if plain sed in Makefiles. 2008-10-25 22:27:34 +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
tsutsui
9636fc5edc Remove ancient workaround hacks for gcc 2.7.2. 2008-09-14 15:03:17 +00:00
christos
9d61fcf10f replace \xa0 with space from Andy Shevchenko 2008-09-10 19:20:06 +00:00
tls
fca9d633b9 Add accept filters to GENERIC kernels where they exist. 2008-08-10 15:31:20 +00:00
hauke
9588641dc1 No WAPBL (ffs journaling) for memory-strapped machines. 2008-08-08 13:59:24 +00:00
simonb
0751ba4bff Add "options WAPBL" to standard GENERIC/INSTALL type configs. 2008-07-31 07:40:59 +00:00
hauke
3411d8045b Having read Frank Kardel's web page again, I think the XXX comment
wrt. the splhigh() guard can go.
2008-07-22 14:43:45 +00:00
tsutsui
770f58015d Revert part of previous changes:
> make makeiplcookie() return PSL bits via ipl2psl_table[]
> rather than IPL_FOO indexes
because ipl2psl_table[] could be updated during autoconf(9)
and we can't use it as cookie before cpu_configure(9).
2008-07-17 16:13:33 +00:00
ad
b94f79f0e8 Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@. 2008-07-02 17:28:54 +00:00
tsutsui
5bbd2ba098 Unify splraiseipl(9) implementation among m68k ports as per
suggestion from isaki@ on port-m68k.

For mac68k:
- rename mac68k_ipls[] to common ipl2psl_table[]
- make makeiplcookie() return PSL bits via ipl2psl_table[]
  rather than IPL_FOO indexes
2008-06-19 13:56:22 +00:00
tsutsui
a4f3c7efda Don't pass fdUnit to lookup softc of iwm. It's a parent of fd, not fd itself. 2008-06-15 10:46:14 +00:00
tsutsui
9087265ab9 Make this compile (fix an unused variable). 2008-06-15 10:29:18 +00:00
cegger
1d9f25d95a use device_lookup_private to get softc 2008-06-13 11:36:11 +00:00
cegger
c3b5ec7f50 use device_lookup_private to get softc and uncascade if blocks 2008-06-13 10:01:32 +00:00
cegger
3d8fe45fc9 use device_lookup_private to get softc 2008-06-11 23:54:45 +00:00
hauke
81cf7934a2 esp_quick_dma_go() gets called from the MI ncr53c9x_intr() handler,
which protects itself against multiple invocation with a
simple_lock. Follow the example of ncr53c9x_poll() for servicing an
interrupt that came while we run in splhigh(), and 'manually' unlock
the MI handler for calling ncr53c9x_intr().

Fixes PR mac68k/38758.
2008-06-02 12:01:11 +00:00
tsutsui
6b0322861b Add options COMPAT_40 to files which have options COMPAT_30. 2008-05-30 20:10:01 +00:00
hauke
9dd4931827 Add LOCKDEBUG option, commented out, so that people know it's there. 2008-05-28 10:20:02 +00:00
hauke
409e8d93e6 Switch files I authored to two-clause BSD license. 2008-05-26 17:58:37 +00:00
hauke
215d0dd444 Fix NetBSD version tag. 2008-05-23 10:46:10 +00:00