Commit Graph

1414 Commits

Author SHA1 Message Date
thorpej 91a4cc8a7c Re-factor the 680x0 Function Code definitions into their own
separate file (as was done on the sun2/sun3 ports ages ago)
and switch everyone to the common header.
2023-12-27 17:35:34 +00:00
thorpej ee2bbf4b98 Stop using magic numbers for the MMU root pointer attributes and the
Translation Control register, and also get rid of "#if PGSHIFT == ..."
where those magic numbers are used.

Instead, define new macros: MMU51_SRP_BITS, MMU51_CRP_BITS, MMU51_TCR_BITS,
and MMU40_TCR_BITS, in terms of the definitions in mmu_{40,51}.h.  These
automagically adapt to 8K and 4K pages based on the machine-specific value
of PGSHIFT.
2023-12-27 03:03:40 +00:00
thorpej 2fe4d0e57e G/C unused ploadw(). 2023-12-26 02:38:26 +00:00
thorpej ea86bfe41b loadustp(): Optimize for the overwhelmingly common case of "not the HP MMU".
Rather than converting the level 1 table address to a page number before
calling loadustp() only to have loadustp() convert it back to an address
for the '851, '030, '040, and '060, instead pass the address and convert
to a page number only in the case of the HP MMU.

This is a wash on HP MMU machines (9000/320 and 9000/350), and saves at
least 4 instructions (2x moveq + 2x lsXl) on every context switch on
everything else.
2023-12-25 21:32:56 +00:00
thorpej e5fbc36ada Remove unnecessary <sys/malloc.h>. 2023-12-20 15:29:04 +00:00
thorpej 23e63c4b5c Remove unnecessary <sys/malloc.h> include. 2023-12-20 00:40:42 +00:00
ad 68fa584377 Arrange to update cached LWP credentials in userret() rather than during
syscall/trap entry, eliminating a test+branch on every syscall/trap.

This wasn't possible in the 3.99.x timeframe when l->l_cred came about
because there wasn't a reliable/timely way to force an ONPROC LWP running on
a remote CPU into the kernel (which is just about the only new thing in
this scheme).
2023-10-05 19:41:03 +00:00
andvar 528e3f93f9 Improve kgdb build for mvme68k:
* include sys/kgdb.h in mvme68k/trap.c for missing definitions.
* cast second kgdb_trap argument to (db_regs_t *).
* build m68k/kgdb_machdep.c in kgdb enable build for kgdb_trap() implementation.

KGDB build still fails, apparently due to missing zs_kgdb.c implementation.
2023-09-30 21:00:43 +00:00
andvar c64267c662 s/resonably/reasonably/. 2023-09-30 20:15:54 +00:00
riastradh e64c5901b7 mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8). 2023-07-11 11:07:54 +00:00
andvar 95f94af301 fix various typos in documentation, comments and sysctl device description.
mainly aion -> ation and inlude -> include.
2023-03-26 19:10:32 +00:00
abs 17aad41300 Add optoion GENERIC.local include to the end of ~all GENERIC configs
This excludes atari, sgimips, evbmips, evbppc, evbsh3, and hpcarm
all of which have somewhat specific kernel config file layouts
2023-02-12 14:50:37 +00:00
tsutsui dac9feab01 mvme68k: Specify proper constraints for bus_space_read region and multi ops.
Sync with next68k.
2023-01-27 20:03:02 +00:00
riastradh 6a4b8d6081 swwdog(4): Add to GENERIC kernels.
Plus a handful of others that I'm familiar with.  Lots of special-
purpose kernels should probably have this too but I'm not going
through all the arm, mips, and ppc evaluation board kernels to see
which ones are relevant.

Omitted from systems I know to be very small:
- sun2/GENERIC
- dreamcast/GENERIC
Feel free to remove it from others that need to be kept smaller.

Compile-tested a few of these just in case:
- alpha/GENERIC
- amd64/GENERIC
- evbmips/OCTEON
- i386/GENERIC
- riscv/GENERIC

PR kern/29702
2022-09-29 10:10:05 +00:00
simonb c7ae7f02a8 UFS/LFS dirhash:
- Enable UFS_DIRHASH if the architecture or kernel model specific config
  file can use 128MB of RAM or more.
- Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel
  and by a number of NetBSD developers for years.
- Add LFS_DIRHASH if LFS was enabled.
- Be somewhat consistent with FS options order.
2022-08-07 02:52:23 +00:00
andvar ae3a1b96f2 s/functin/function/ in copy pasted comment. 2022-07-26 20:08:54 +00:00
andvar 71981bce9a s/identifing/identifying/ and s/multipler/multiplier/ in comments. 2022-05-30 09:56:02 +00:00
rin ca856fe22e le(4): Fix resource leaks for error paths.
XXX
Compile test only (at least one arch per driver).
2022-05-29 10:45:05 +00:00
andvar 8c15078320 fix various typos in comments. 2022-02-09 22:30:26 +00:00
andvar df3dd44824 fix typos in comments, mainly basicly -> basically. 2022-01-01 21:07:13 +00:00
msaitoh 8a3fe07864 s/from from/from/ in comment. 2021-12-05 04:54:20 +00:00
msaitoh e067b4e4e4 s/initialz/initializ/ in comment. 2021-12-05 03:04:41 +00:00
andvar fb817dab52 fix various typos in comments, mainly copypasta. 2021-10-24 20:00:11 +00:00
tsutsui 5cf9c74cef Call cnpollc(9) before cngetc(9) as the cons(9) man page says.
Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.
2021-10-09 20:00:41 +00:00
tsutsui e96a59e0fb Call cnpollc(9) before cngetc(9) as the cons(9) man page says.
Affects only inside #ifdef DEBUG part on "trap during panic" in trap.c
derived from hp300.
2021-09-25 19:16:31 +00:00
andvar b780d9b67b fix various typos, mainly in comments. 2021-09-16 20:17:46 +00:00
andvar 207defd036 Add missing double p and d for stopped and overriden accordingly.
Fix few more typos along the way, mainly in copy-pasted comments.
2021-09-11 20:28:03 +00:00
andvar ca503f4587 s/definitons/definitions/ 2021-08-09 21:13:05 +00:00
thorpej c7fb772b85 Merge thorpej-cfargs2. 2021-08-07 16:18:40 +00:00
andvar 7991f5a7b8 Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
2021-07-24 21:31:31 +00:00
rin 735b9693ea PR port-mvme68k/56146
Build wrtvid as tools.
2021-05-06 13:23:36 +00:00
thorpej 2685996b0e Merge thorpej-cfargs branch:
Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
2021-04-24 23:36:23 +00:00
mrg 5def991c6d more -fcommon for boot programs. 2021-04-15 01:54:38 +00:00
rin 6c56221482 For ports with __HAVE_LEGACY_INTRCNT, turn intrcnt[] and derived
variables into u_int, to match with kern/subr_evcnt.c.
2021-04-02 12:11:41 +00:00
simonb fa2e10609e Define __HAVE_LEGACY_INTRCNT to indicate this port uses legacy intrcnt
interrupt accounting.
2021-04-01 04:42:59 +00:00
simonb 4136f0bb13 Adjust the number of entries in the intrcnt array to match the number
of names in the intrnames list.
2021-03-31 09:48:14 +00:00
tsutsui 5bb95625d8 Remove #undefs against INTERRUPT_SAVEREG and INTERRUPT_RESTOREREG.
They have been defined in <m68k/asm.h> for years.
2021-01-25 13:08:04 +00:00
christos 97492ef8ca Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.
2021-01-23 19:38:07 +00:00
nia f3ec8521a0 add a commented out compat_ossaudio wherever there's compat_linux
requested by mrg
2021-01-21 06:51:54 +00:00
thorpej 098dc0bddb malloc(9) -> kmem(9) 2020-11-21 17:59:13 +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
maxv b84521f2f3 Remove references to BRIDGE_IPF, it is now compiled in by default. 2020-08-01 08:20:47 +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
msaitoh fa85244576 s/impliment/implement/ in comment. 2020-04-02 15:30:25 +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 fc9073f9fe Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).
Background:
- All m68k ports have fixed PAGE_SIZE value in their kernels,
  but each port uses different PAGE_SIZE value (4096 or 8192)
  due to historical reasons.
- Currently module(7) binaries are built per each port so
  all m68k kernel sources don't support run-time variable PAGE_SIZE.
- MI <uvm/uvm_param.h> assumes that the port supports a variable
  PAGE_SIZE on module(7) builds if both MAX_PAGE_SIZE and MIN_PAGE_SIZE
  are defined and they have different values.
- On the other hand, jemalloc(3) checks MAX_PAGE_SHIFT in
  src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
  for internal optimization.
- m68k ports share userland binaries (especially pkgsrc binaries)
  among all ports, so we need to define MAX_PAGE_SHIFT as 13 to
  support m68k ports where PAGE_SIZE==8192.
  (though this would affect only if static binaries built on
   4k page hosts are executed on 8k page hosts)

To solve these inconsistency on PAGE_SIZE definitions,
we should have an independent PAGE_SIZE related definitions
for userland, but it requires major reorganization.
For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and
PAGE_SHIFT values in <m68k/vmparam.h> only in !defined(_KERNEL) case.

Discussed on source-changes-d@ and tech-kern@ with christos@ and thorpej@:
 https://mail-index.netbsd.org/source-changes-d/2020/01/thread1.html#012035
 https://mail-index.netbsd.org/tech-kern/2020/01/thread1.html#025954

Should be pulled up to netbsd-9.
2020-02-01 19:41:48 +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