Commit Graph

286908 Commits

Author SHA1 Message Date
palle
27ed5ac363 Improve cpu_idle() by allowing a platform specific implementaion (same logic as the sparc implementation) - currently only used by sun4v 2021-04-03 17:01:24 +00:00
thorpej
18787f8eb1 Slight tweak to last: Our IPL gets raised to IPL_SCHED by simply *trying*
to acquire the pmap activation lock, regardless of whether or not that was
successful.  So, in addition to remember if we acquired it, also remember
if we tried, and drop back to IPL_VM if so.
2021-04-03 15:29:02 +00:00
rillig
6b6212fb65 make: revert accidental change from the previous commit
The definition of MAKE_GNUC_PREREQ was not supposed to be changed.  This
change only slipped accidentally, the test for __STDC_VERSION__ was only
supposed to be for UNCONST.
2021-04-03 15:22:23 +00:00
thorpej
ab671aa0ea Fix an IPI deadlock scenario that resulted in a TLB shootdown timeout
panic reported by John Klos on port-alpha:

- pmap_tlb_shootnow(): If we acquire a pmap's activation lock, we will
  have raised the IPL on the current CPU to IPL_SCHED until we drop
  the tlb_lock (due to how nested spin mutexes work).  As such, when
  we release the activation lock, forcibly lower our IPL back to IPL_VM
  so that we can receive and process IPIs while waiting for other CPUs
  to process the shootdowns.
- mutex_vector_enter(): Invoke SPINLOCK_SPIN_HOOK while spinning to acquire
  a spin mutex.  This is a nop on most platforms, but it's important on
  the Alpha.  Without this, IPIs (and thus TLB shootdowns) cannot be
  processed if trying to acquire an IPL_SCHED spin mutex such as those
  used by the scheduler.

...and while we're poking around in here:

- Rework the Alpha SPINLOCK_SPIN_HOOK to only check curcpu()->ci_ipis
  if the current CPU's IPL is >= IPL_CLOCK (thus ensuring that preemption
  is disabled and thus guaranteeing that curcpu() is stable).  (Alpha does
  not yet support kernel preemption, but this is now one less thing that
  would need to be fixed.)
2021-04-03 14:56:13 +00:00
rillig
a71bce0149 make: backport to C90
In the past few months I had accidentally used C99 features in the make
code.  According to tools/README, tools that are used in the build
system should restrict themselves to C90.

This allows make to build with GCC's options "-pedantic
-Wno-system-headers -Dinline= -Wno-error=cast-qual".

I didn't notice anyone actively complaining though, I just wanted to see
how much work this backporting would be.  The identifier __func__ is
still used, as in other tools.

No functional change.
2021-04-03 14:39:02 +00:00
rillig
1e65de9557 make: rename function parameters to match boolean constants
No functional change.
2021-04-03 14:31:44 +00:00
simonb
ba42c78d37 Add a -L option to follow all symbolic links. Useful if you have symlinks
in a makefs directory tree but want to refer to the actual file.
2021-04-03 14:10:56 +00:00
simonb
353a61bfae Deal with the case when a device gets recreated (eg when mtree is called by
MAKEDEV) and the stat buffer contains information about the original device
before checking/setting the owner/group/mode of the new device file.
2021-04-03 13:37:18 +00:00
simonb
af1c0e7ba9 Centralise the setitimer() timer type validation in dosetitimer() as is
done with dogetitimer().
2021-04-03 12:57:21 +00:00
simonb
2beb587e3e Print the "preposterous TOD clock time" message only if the RTC is
before very late 2020 (1/1/2021 minus a few leap days) instead of
late 1994.  Someone(TM) should remember to adjust this in somewhat
less than 26 years.
2021-04-03 12:06:53 +00:00
rillig
588b377eb0 make: use standard %H in strftime instead of %k
The conversion specifier %k is neither in C99 nor in C90.

These timestamps are only used in the debug output.
2021-04-03 12:01:00 +00:00
simonb
bef679e4ab CTASSERT that NSIG <= 128. There are many hard-coded assumptions that
there are <= 4 x 32bit signal mask bits.
2021-04-03 11:19:11 +00:00
rillig
244fd9f4c4 make: use C99 bool type instead of defining its own
No functional change.
2021-04-03 11:08:40 +00:00
simonb
8fab31f439 For MIPS N32, register_t needs to be uint64_t as "long" isn't
big enough.
2021-04-03 07:38:11 +00:00
simonb
31ca042232 Revert parsedate(3) XXX as per discussion with kre@. 2021-04-03 04:33:08 +00:00
isaki
398f413a6e Rework about the rest note in speaker(4).
- Obsolete the sc_rest callback.  The rest note operation can be done by
  the common spkr layer.  This also fixes PR kern/56060.
  This work-in-progress patch was left in my local tree for years. :(
- Improve calculations of tone and rest length.
2021-04-03 04:10:30 +00:00
isaki
74bd6922f5 Improve SPKRDEBUG code.
- Replace wrong aprint_debug_dev() with device_printf().
  By this, it no longer need to print dev_t.
- Improve some messages.
2021-04-03 03:21:53 +00:00
rillig
a5de3b3d6e lint: reword message about constant argument to '!'
In the other messages, operators are typically written in their literal
form as well.  Using single quotes disambiguates them from normal
punctuation.
2021-04-02 22:41:53 +00:00
rillig
c0d1467e66 tests/lint: add test for constant argument to '!' 2021-04-02 22:38:42 +00:00
rillig
473375a8eb lint: reduce memory usage
No functional change.
2021-04-02 22:05:43 +00:00
rillig
1cb2fa84ac tests/lint: prevent typo from tree.c 1.264 from happening again 2021-04-02 17:25:04 +00:00
rillig
ff88ea5538 lint: fix typo from previous commit in merge_qualifiers 2021-04-02 17:10:52 +00:00
rillig
59a0181251 lint: clean up merge_qualifiers
No functional change.
2021-04-02 17:01:39 +00:00
macallan
e99657a23f clarify comment in previous
( this is a hack, should go away when the root cause is fixed etc. )
no functional change
2021-04-02 16:59:59 +00:00
rillig
15fe6af379 lint: rename local variable in build_colon
The name 'rtp' was confusing since it did not correspond to 'rn'.  The
'r' meant 'result', not 'right-hand side'.

No functional change.
2021-04-02 16:38:08 +00:00
rillig
5f2c416cbb lint: replace a new modtab with op_name
This reduces the types of variables that are passed around.

No functional change.
2021-04-02 16:17:19 +00:00
rillig
423d380130 lint: rename getopname to op_name
There are several functions called 'get' that allocate memory.  Remove
this possible confusion.

No functional change.
2021-04-02 15:06:35 +00:00
rillig
60a8adda7c lint: reorder struct members to be in comprehension order
No functional change.
2021-04-02 14:50:47 +00:00
rin
36b164a2d7 Fix style to appease changes2html. 2021-04-02 14:41:07 +00:00
rillig
ee16289de5 lint: rename members of brace_level
The terms 'member' and 'subscript' are distinctive enough.

No functional change.
2021-04-02 14:32:27 +00:00
rillig
7910543396 lint: remove unused brace_level.bl_array_of_unknown_size
Since init.c 1.177 from 2021-03-29, the type of the object to be
initialized is no longer modified in the middle of the initialization,
as required by C99 6.7.8p22.  Therefore it is no longer necessary to
keep this redundant information around.

No functional change.
2021-04-02 14:19:33 +00:00
rillig
59dc6d2516 tests/lint: add test for enum type mismatch 2021-04-02 13:16:38 +00:00
rillig
4a7db9da8e lint: add parentheses after sizeof, as required by share/misc/style
No functional change.
2021-04-02 12:16:50 +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
rillig
a9672b5f66 lint: rename functions for duplicating types
No functional change.
2021-04-02 11:53:25 +00:00
simonb
f39221eba7 Make extern declaration of intrcnt a u_int instead of a long. Matches
some declartions in some ports.  Fixes build on news68k (and probably
newsmips).
2021-04-02 10:39:22 +00:00
rillig
719899e56c lint: rename members of struct memory_block
No functional change.
2021-04-02 10:30:35 +00:00
rillig
53a994099e lint: name memory allocation functions consistently
No functional change.
2021-04-02 10:13:03 +00:00
martin
c3782d2faa named/filter-aaaa.so is unrelated to DYNAMICROOT 2021-04-02 10:06:26 +00:00
rillig
1e98380776 lint: rename getnode to expr_zalloc_tnode
The new name highlights that the returned memory is only valid in the
scope of the current expression.  This was misleading before since the
other related functions all have a 't' (probably for 'temporary') in
their names.

Also encode in the function name that the returned memory is zeroed out
as that could not be inferred from the old name.

No functional change.
2021-04-02 09:52:36 +00:00
rillig
1348dd5e14 lint: extract filename ID counter into separate function
No functional change.
2021-04-02 09:45:55 +00:00
rillig
2f8ba8fe5c lint: rename mbl to memory_block
No functional change.
2021-04-02 09:39:25 +00:00
skrll
55d3abf644 Call usbnet_attach before usbnet_{lock_core,busy}
kern/56090: panic in udav_attach
2021-04-02 09:27:44 +00:00
martin
68d6e418c1 Add gpt wedge support 2021-04-02 09:27:32 +00:00
rillig
b2b4a8cbfd lint: make debug logging compatible with C90
The previous code used the GCC-style varargs macros, which did not even
conform to C99.

No functional change.
2021-04-02 08:38:44 +00:00
nia
2843dad115 rndctl: make -l's "Flags" field reflect current reality
don't print "legacy options" RND_FLAG_ESTIMATE_TIME and
"RND_FLAG_ESTIMATE_VALUE"

only print "estimate" if we have actually counted any bits from
something, since it's no longer really possible to "enable estimation".

ideally, there should also be a "samples" field so it's clear
collected bits are not being counted.
2021-04-02 07:17:56 +00:00
rin
791f2c453f Document DHT kernel for evbppc. 2021-04-02 07:09:11 +00:00
rin
385a602eeb - Hook DHT kernel
- Add bin and ub to KERNEL_SUFFIXES
- Group and sort kernels
2021-04-02 07:08:36 +00:00
nia
a712f2f75f rndctl.8: reflect current reality 2021-04-02 07:04:05 +00:00
rin
3332664a59 evbppc: Add support for DHT Walnut 405GP evaluation board.
(Digital Home Technologies PCB 01070201 Rev. 1.1)

Official web page seems gone, but analyses by Linux people are at:

- https://elinux.org/DHT-Walnut
- http://web.archive.org/web/20070225171826/http://supernova.stanford.edu/dingdong/

The board features:

- 266MHz PowerPC 405GP processor
- one PC133 SDRAM slot
- two 32-bit 5V PCI slot
- on-chip ethernet controller with DP83843 PHY
- on-chip serial port / GPIO controller
- on-board PDC20265 IDE controller

Hardware limitations:

- no MAC address assigned
- no RTC present

Known problem:

- atabus(4) channels cannot be attached to pdcide(4) for cold boot

dmesg:

- https://dmesgd.nycbug.org/index.cgi?do=view&id=5997

Have fun!
2021-04-02 07:00:33 +00:00