Commit Graph

2571 Commits

Author SHA1 Message Date
simonb
28b83fe374 Whitespace: #define<tab> 2021-04-01 04:35:45 +00:00
mrg
110ac605f8 introduce DDB_END_CMD and replace more than 20 copies of the same
list of NULLs and 0.  idea from rillig@.

all touched ports built, several booted.
2021-02-23 07:13:51 +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
thorpej
74ee875269 malloc(9) -> kmem(9) 2020-11-21 22:37:11 +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
mrg
cb37c506c9 make build (and run) with GCC 9. 2020-09-15 05:08:07 +00:00
isaki
08004a7e10 Improve am7930 family drivers to share more code.
audioamd(4) on sparc, vsaudio(4) on vax, and bba(4) are.
- Remove complex and useless callbacks: onopen, onclose, and
  indirect_{read,write}.  This makes audioamd and vsaudio almost the same.
- Remove (already disabled) assembly fast interrupt path from audioamd(4).
  cf. http://mail-index.netbsd.org/source-changes/2009/12/19/msg004585.html
- Use trigger_* method rather than start_* method.  It's more suitable.
vsaudio(4) was tested by naru@, bba(4) was tested by tsutsui@.
2020-09-12 05:19:15 +00:00
isaki
72719b1753 Fix misuse of device_private(). sc_dev is device_t. 2020-08-26 12:59:28 +00:00
maxv
b84521f2f3 Remove references to BRIDGE_IPF, it is now compiled in by default. 2020-08-01 08:20:47 +00:00
maxv
ef06fc5cad hardclock_ticks -> getticks() 2020-07-03 16:23:02 +00:00
maxv
ca08b3e761 Make copystr() a MI C function, part of libkern and shared on all
architectures.

Notes:

 - On alpha and ia64 the function is kept but gets renamed locally to avoid
   symbol collision. This is because on these two arches, I am not sure
   whether the ASM callers do not rely on fixed registers, so I prefer to
   keep the ASM body for now.
 - On Vax, only the symbol is removed, because the body is used from other
   functions.
 - On RISC-V, this change fixes a bug: copystr() was just a wrapper around
   strlcpy(), but strlcpy() makes the operation less safe (strlen on the
   source beyond its size).
 - The kASan, kCSan and kMSan wrappers are removed, because now that
   copystr() is in C, the compiler transformations are applied to it,
   without the need for manual wrappers.

Could test on amd64 only, but should be fine.
2020-06-30 16:20:00 +00:00
chs
69a3e9b705 replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
2020-06-14 01:40:02 +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
rin
482eef7050 For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
2020-05-29 12:30:38 +00:00
ad
0eaaa024ea Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
2020-05-23 23:42:41 +00:00
isaki
23a77a734f Move machine dependent AUDIO_BLK_MS default value to <machine/param.h>.
If the port has __AUDIO_BLK_MS in <machine/param.h>, it will be used.
Otherwise the default value (currently 10 msec) defined in audio.c will
be used.  This mechanism is for very old ports which cannot satisfactorily
handle 10 msec block.  Currently hppa, m68k, sh3, sparc(!64) and vax are.

For port maintainers, if general models in your port cannot satisfactorily
handle 10 msec block, please consider to define your suitable longer period
(40 msec would be a good first choice).
But please don't be eager to make the default value shorter.

<machine/param.h> was discussed in source-changes-d.  It's better than
ifdef storm, or adding 60+ new header files in every arch/*/include/
directories for this.  Thanks mrg@, ad@, and everyone.
http://mail-index.netbsd.org/source-changes-d/2020/05/01/msg012572.html
2020-05-01 08:21:27 +00:00
joerg
628289e37e Mark the .ident section as mergable string section to avoid redundant
entries.
2020-04-17 14:19:43 +00:00
snj
20b4652c75 fix comment in typo 2020-04-06 01:43:26 +00:00
jdolecek
68e97caa11 mark nsmb major obsolete 2020-04-04 16:06:10 +00:00
ragge
013c463e1d Do not expect a struct buf to be present if doing DMA to kernel space.
Fixes bug reported by sadness on port-vax.
2020-03-22 20:27:47 +00:00
ad
ae4dfbfab6 PR port-vax/55094: vax pmap needs locking adjustments
Make the adjustments noted in the PR and don't call uvm_wait() or do
WAITOK ever - UVM takes care of that.
2020-03-21 18:47:54 +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
skrll
a0a61c51a5 G/C 2020-02-20 08:27:38 +00:00
ad
82002773ec - Move the LW_RUNNING flag back into l_pflag: updating l_flag without lock
in softint_dispatch() is risky.  May help with the "softint screwup"
  panic.

- Correct the memory barriers around zombies switching into oblivion.
2020-02-15 18:12:14 +00:00
thorpej
4541d6828b Remove FDDI support. 2020-01-20 18:38:17 +00:00
ad
2ddceed1d9 Hopefully fix some problems seen with MP support on non-x86, in particular
where curcpu() is defined as curlwp->l_cpu:

- mi_switch(): undo the ~2007ish optimisation to unlock curlwp before
  calling cpu_switchto().  It's not safe to let other actors mess with the
  LWP (in particular l->l_cpu) while it's still context switching.  This
  removes l->l_ctxswtch.

- Move the LP_RUNNING flag into l->l_flag and rename to LW_RUNNING since
  it's now covered by the LWP's lock.

- Ditch lwp_exit_switchaway() and just call mi_switch() instead.  Everything
  is in cache anyway so it wasn't buying much by trying to avoid saving old
  state.  This means cpu_switchto() will never be called with prevlwp ==
  NULL.

- Remove some KERNEL_LOCK handling which hasn't been needed for years.
2020-01-08 17:38:41 +00:00
ad
5c06357c90 Rename uvm_free() -> uvm_availmem(). 2019-12-31 13:07:09 +00:00
msaitoh
74868e2a8b s/recevive/receive/ in comment. 2019-12-27 06:52:43 +00:00
kamil
4d3a90668a Harmonize the namespace of fast TLS base pointer getter functions
Protect __lwp_getprivate_fast() with _RTLD_SOURCE, _LIBC_SOURCE and
__LIBPTHREAD_SOURCE__.

Include in this namespace <sys/tcl.h> and use __BEGIN_DECLS/__END_DECLS
for the sake of consistency.
2019-12-27 00:32:16 +00:00
ad
ddd3a0be1e uvmexp.free -> uvm_free() 2019-12-21 13:00:20 +00:00
ad
57eb66c673 Fix false sharing problems with cpu_info. Identified with tprof(8).
This was a very nice win in my tests on a 48 CPU box.

- Reorganise cpu_data slightly according to usage.
- Put cpu_onproc into struct cpu_info alongside ci_curlwp (now is ci_onproc).
- On x86, put some items in their own cache lines according to usage, like
  the IPI bitmask and ci_want_resched.
2019-12-01 15:34:44 +00:00
riastradh
398a51e047 Nix now-unused definitions of MUTEX_GIVE/MUTEX_RECEIVE. 2019-11-29 22:55:33 +00:00
riastradh
63d8b25a63 Nix mb_* on vax. 2019-11-29 20:06:44 +00:00
riastradh
915952b159 Largely eliminate the MD rwlock.h header file.
This was full of definitions that have been obsolete for over a
decade.  The file still remains for __HAVE_RW_STUBS but that's all.
Used only internally in kern_rwlock.c now, not by <sys/rwlock.h>.
2019-11-29 20:04:52 +00:00
ad
115c1bc097 cpu_need_resched():
- Remove all code that should be MI, leaving the bare minimum under arch/.
- Make the required actions very explicit.
- Pass in LWP pointer for convenience.
- When a trap is required on another CPU, have the IPI set it locally.
- Expunge cpu_did_resched().
2019-11-23 19:40:34 +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
pgoyette
1d577fe379 Move all non-emulation-specific coredump code into the coredump module,
and remove all #ifdef COREDUMP conditional compilation.  Now, the
coredump module is completely separated from the emulation modules, and
they can all be independently loaded and unloaded.

Welcome to 9.99.18 !
2019-11-20 19:37:51 +00:00
chs
d47bcd296c in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
2019-11-10 21:16:21 +00:00
christos
511f85a37d Rewrite the floppy selection logic, and fix an always false condition. 2019-10-28 21:11:23 +00:00
maya
631bfe425c Avoid duplicate PRIxBUSADDR and follow the likely intention, providing PRIxBSH. 2019-09-24 14:26:32 +00:00
skrll
bf158e33f8 Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
2019-09-23 16:17:54 +00:00
kamil
a8778fd7dc Introduce PTRACE_REG_FP() a helper macro to retrieve the frame pointer
The macro is dummy for ia64 (the FP register is unknown and can change
freely) and sparc/sparc64 (not stored in struct reg).
2019-06-18 21:18:11 +00:00
msaitoh
b4eb82f5ca Fix typo in comment(s/similiar/similar/). 2019-06-03 05:59:01 +00:00
msaitoh
fdd9a79fe9 Add il(4). Commented out. 2019-05-24 08:30:26 +00:00
isaki
e622eac459 Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly.  Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism.  The encoding/channels/frequency
  conversions are completely handled in the upper layer.  So the hard-
  ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
  - Obsoletes query_encoding and add query_format instead.
  - Obsoletes set_params and add set_format instead.
  - Remove drain, setfd, mappage.
  - The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c         -> dev/audio/audio.c (rewritten)
- dev/audiovar.h      -> dev/audio/audiovar.h
- dev/audio_dai.h     -> dev/audio/audio_dai.h
- dev/audio_if.h      -> dev/audio/audio_if.h
- dev/audiobell.c     -> dev/audio/audiobell.c
- dev/audiobellvar.h  -> dev/audio/audiobellvar.h
- dev/mulaw.[ch]      -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
2019-05-08 13:40:13 +00:00
kamil
bca8c3ffc4 Switch all users (except ia64) of custom machine/ansi.h to common_ansi.h
Deduplicate the code among ports and poll definitions of types
directly from a compiler.

This fixes miscompilation of certain programs that instruct compilers
to generate code for different types. This bug has been detected with
-fshort-wchar in EFI firmware.

Proposed and discussed on a mailing list (twice).

Itanium uses custom !ELF fallback switch, temporarily leave it as it is.
2019-05-07 03:49:25 +00:00
sevan
702a353ffb Use veriexec.config to reduce duplication 2019-04-26 22:46:03 +00:00
sevan
75d6e670be Enable BUFQ_PRIOCSCAN, CARP, Veriexec by default in GENERIC kernel configs.
On ports without a GENERIC kernel config enable in individul files, e.g evbmips.
Omit on:
atari, dreamcast, emips, epoc32, evbppc/VIRTEX*, ia64, luna68x, mvme68k,
mvmeppc, playstation2, riscv, sun2, sun3, x68k, zaurus due to resource
constraints or port infancy.
2019-04-26 21:40:28 +00:00
isaki
47655f2d42 Add drvctl to kernel which has audio device.
audiocfg(1) requires drvctl(4).
2019-04-13 08:22:58 +00:00
isaki
b8a46fec78 White space -> TAB, fix indent, and add RCS Id.
No functional changes intended.
2019-04-08 14:48:33 +00:00