Commit Graph

615 Commits

Author SHA1 Message Date
thorpej fd5889cbee malloc(9) -> kmem(9) 2020-11-21 00:27:52 +00:00
rin db7d386e10 Kernel without -fno-omit-frame-pointer works fine now, both for GCC8 and 9.
Not sure which commit ``fixed'' the problem although...
2020-10-05 10:42:53 +00:00
roy 98f3a8d458 vether: Add to kernel configurations
It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
2020-09-27 13:48:49 +00:00
rin 3e961dc468 Fix tracedump() for sun3 and sun2 by adding __noinline attribute.
It unwinds stack frame by using address of its first argument, which
does not, of course, work if inline-expanded.
2020-09-10 02:03:44 +00:00
mrg 71e6058904 don't warn about array bounds for dodgy diagnostic code.
fixes gcc9 builds.
2020-09-08 00:51:29 +00:00
rin 1b18db475e Clean up _LKM --> _MODULE leftovers.
Note that _KERNEL is always defined for modules.
2020-08-10 10:59:33 +00:00
rin 2d72fb0c8c Reduce kernel size by
- Adding -fno-asynchronous-unwind-tables and -fno-unwind-tables to COPTS
- Specify NO_KERNEL_RCSIDS to strip RCSIDS
Also adding -fno-omit-frame-pointer to COPTS for backtrace in DDB.
2020-08-10 06:29:49 +00:00
rin 293b2f4b88 Compile sun2 kernel with -fno-omit-frame-pointer for GCC8 as a work
around for reproducible kernel freezes just after ``Starting postfix.'',
where I cannot even enter DDB nor obtain crash dump.

I still haven't figured out why. Possibly something wrong with -Os
optimization level for GCC/m68k, cf.,
http://mail-index.netbsd.org/port-sun3/2020/07/19/msg000166.html
2020-08-10 06:28:42 +00:00
maxv b84521f2f3 Remove references to BRIDGE_IPF, it is now compiled in by default. 2020-08-01 08:20:47 +00:00
nia 58d8753b2e Fix various typos of "system" in comments. Mainly copypasto errors.
from vezhlys on freenode.
2020-07-11 13:07:01 +00:00
ad 4b8a875ae2 uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched.  It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.
2020-06-11 19:20:42 +00:00
jdolecek 68e97caa11 mark nsmb major obsolete 2020-04-04 16:06:10 +00:00
thorpej e731d726d4 Replace manipulating IFF_OACTIVE with an internal "txbusy" field. 2020-03-19 14:01:48 +00:00
ad be9c6147a4 pmap_remove_all(): Return a boolean value to indicate the behaviour. If
true, all mappings have been removed, the pmap is totally cleared out, and
UVM can then avoid doing the work to call pmap_remove() for each map entry.
If false, either nothing has been done, or some helpful arch-specific voodoo
has taken place.
2020-03-14 14:05:42 +00:00
rin 4f7c8158b1 Fix build without kbd at zstty, simplify. 2020-03-13 01:48:16 +00:00
rin 68a9949de7 Fix comments on root devices. 2020-03-08 06:32:41 +00:00
rin 5f7530ccf6 Retire md(4) in favor of tmpfs provided by module,
though both are not useful for 8MB RAM system...
2020-03-08 06:25:10 +00:00
rin 501603fb78 sun2 kernel is restricted to ~2MB due to bootloader.
It seems that working kernel should be more smaller.

Strip off most kernel options, and provide by kernel modules.
Also add GENERIC kernel for NFS root instead of FFS.
2020-03-08 06:23:18 +00:00
rin 1819fa0f99 Support module(7). 2020-03-08 06:06:46 +00:00
rin f5e0fa4535 Sort headers. 2020-03-08 06:05:05 +00:00
skrll a0a61c51a5 G/C 2020-02-20 08:27:38 +00:00
skrll 94257d06d8 G/C LS{SLEEP,RUN,ONPROC}
LWP status manipulation was moved out of assembly long ago.
2020-02-17 09:09:48 +00:00
tsutsui 721e2dfed8 Use "__nothing" macro defined in <sys/cdefs.h> for empty pmap_update().
Suggested by pgoyette@ in PR/54869.
2020-02-01 06:17:11 +00:00
thorpej d4bc9d1186 Adopt <net/if_stats.h>. 2020-01-29 05:30:14 +00:00
ad 5c06357c90 Rename uvm_free() -> uvm_availmem(). 2019-12-31 13:07:09 +00:00
ad ddd3a0be1e uvmexp.free -> uvm_free() 2019-12-21 13:00:20 +00:00
ad 8d31b01840 mi_userret(): take care of calling preempt(), set spc_curpriority directly,
and remove MD code that does the same.
2019-11-21 19:23:58 +00:00
msaitoh 91e19acff6 Fix typo in comment. Found by Wataru Ashihara. 2019-08-06 05:37:30 +00:00
msaitoh b4eb82f5ca Fix typo in comment(s/similiar/similar/). 2019-06-03 05:59:01 +00:00
msaitoh b9958efe6c Even if we don't use MII(4), use the common path of SIOC[GS]IFMEDIA in
sys/net/if_ethersubr.c if we can.
 - Add ec_ifmedia into struct ethercom.
 - ec_mii in struct ethercom is kept and used as it is. It might be used in
   future. Note that some Ethernet drivers which _DOESN'T_ use mii(4) use
   ec_mii for keeping the if_media. Those should be changed in future.
2019-05-29 10:07:28 +00:00
msaitoh b7b3f0d6ee KNF. No functional change. 2019-05-29 06:21:56 +00:00
msaitoh d4b636ef14 Whitespace fix. No functional change. 2019-05-29 05:06:39 +00:00
sevan 702a353ffb Use veriexec.config to reduce duplication 2019-04-26 22:46:03 +00:00
msaitoh 14d9bb3260 No functional change:
- Use __arraycount().
- u_int_{8,16,32}_t -> uint_{8,16,32}_t
- KNF.
- Tabify.
- Remove extra space.
2019-04-25 10:08:45 +00:00
thorpej 91bfaeb675 Overhaul the API used to fetch and store individual memory cells in
userspace.  The old fetch(9) and store(9) APIs (fubyte(), fuword(),
subyte(), suword(), etc.) are retired and replaced with new ufetch(9)
and ustore(9) APIs that can return proper error codes, etc. and are
implemented consistently across all platforms.  The interrupt-safe
variants are no longer supported (and several of the existing attempts
at fuswintr(), etc. were buggy and not actually interrupt-safe).

Also augmement the ucas(9) API, making it consistently available on
all plaforms, supporting uniprocessor and multiprocessor systems, even
those that do not have CAS or LL/SC primitives.

Welcome to NetBSD 8.99.37.
2019-04-06 03:06:23 +00:00
christos 764686a72d Gut more stuff so we fit. Last working RAMDISK kernel was 6.1.5.
Nobody runs this stuff anymore, so consider that netbsd 9 might be
the last sun2 release.
2019-04-03 16:30:28 +00:00
msaitoh 091e15265d Remove very old IFF_NOTRAILERS flag. 2019-02-05 06:17:00 +00:00
dholland 810a783361 Systematize handling of removed drivers.
- Every driver that was removed and whose number hasn't already been
   reused is now listed with a commented-out "obsolete" line.
 - The format of these has been systematized. Future format changes can
   probably be safely done with a script.
 - This does not include a few cases of assignments that only lasted a
   couple days, or stuff from before major reorgs. Some of these may
   be included nonetheless, because there was a lot of ground to cover
   and therefore not a lot of time to dig into history in detail.

Note that the obsolete listings do not mean the major numbers can
never be reused; that's up to portmasters and/or core. It does mean
that they won't be reused by accident, however, which in some cases
(depending on the driver, how widely used it was, its family of device
nodes, their default permissions, etc.) can be quite dangerous.

Note that some of the things now explicitly listed as obsolete are
really ancient history. My scan went back as far as when the majors
files were added. (But not before that.)
2019-01-28 02:28:56 +00:00
maxv 43c9320743 Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
2018-12-19 13:57:44 +00:00
rin e9ac1fc994 - Determine KERN_AS automatically depending on whether OPT_MODULAR is
set or not, in the same way as libcompat.

- Specify OPT_MODULAR in the port Makefile instead of KERN_AS.

Now, KERN_AS=library is used for kernels without module(7) for all ports.

OK christos
2018-09-22 12:24:01 +00:00
rin 44423b808b No need to specify COMPAT_AS anymore.
Now, it is automatically determined from OPT_MODULAR.
2018-09-22 12:05:52 +00:00
riastradh d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
maxv f71d13bdf7 Unreference IPF/PF from all the config files, and enable NPF instead when
wanted. This also fixes some inconsistencies I saw in several files (eg
IPF options while IPF was not compiled, IPF+PF enabled by default, etc).
2018-08-01 20:04:09 +00:00
maxv 62c8988166 Remove the kernel PMC code. Sent yesterday on tech-kern@.
This change:

 * Removes "options PERFCTRS", the associated includes, and the associated
   ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
   good.

 * Removes the PMC code of ARM XSCALE.

 * Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

 * Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
   definitions are put in sysarch.h.

 * Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
   and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
   netbsd32 and rump.

 * Removes the pmc_evid_t and pmc_ctr_t types.

 * Removes all the associated man pages. The sets are marked as obsolete.
2018-07-12 10:46:40 +00:00
msaitoh 3cd62456f9 Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

 This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
2018-06-26 06:47:57 +00:00
msaitoh 4b508fb16e It's not required to include net/bpfdesc.h. Remove it. 2018-06-22 04:17:40 +00:00
mrg 018c94e858 disable a few more things and return another 1% of memory. 2018-06-01 01:19:06 +00:00
christos 42d14e79e6 make as not having pmap statistics available 2018-05-08 19:35:17 +00:00
maya d3a0c8241a Remove more unused functions with COMPAT_AS=library 2018-03-07 15:20:50 +00:00
mrg ec8d43fcc0 sun2/sun3:
- build libkern as an archive for non modular builds.  from maya@
sun3:
- cut down GENERIC a bunch to bring below 2MB.
- reduce UBC_NWINS, MAXEXEC, and PAGER_MAP_DEFAULT_SIZE to recover
  enough lost VA to actually run basic tests.
2018-03-03 03:19:18 +00:00