Commit Graph

287090 Commits

Author SHA1 Message Date
christos
8ffea519f1 avoid second typedef for boolean_t in kernel code originally defined in
<sys/types.h>
2021-04-15 07:00:50 +00:00
christos
2cb1b4dc1d remove extra typedef for vnode_t done in <sys/vnode.h> 2021-04-15 06:59:57 +00:00
mrg
8842784405 document various gcc warnings that occur frequently enough to
inspire the GCC_NO_* series of variables, and explain some
about what the issues may be for each, hopefully providing some
direction on how to fix new warnings in this space.

christos asked me for this last year, and it's finally complete
enough to commit.  :-)
2021-04-15 05:15:04 +00:00
mrg
f83306c1b9 feedback from rin@: alpha and m68k work well, powerpc not so much
but fixes are known.

thanks!
2021-04-15 05:12:57 +00:00
mrg
5cf114ea09 i've test-built all platforms. everything except arm64, x68k and sun2
builds.  many of them work as well.  most mips are (minimally) tested.
2021-04-15 01:59:51 +00:00
mrg
667f151ae6 convert 'extern phys_ram_seg_t mem_clusters[0];' to the '[]' form
so that when this code accesses mem_clustes[0] and mem_clusters[1]
it does't reach out of bounds.

XXX: should be in a header, but it's ugly to fix and i stopped
     when bus_dma.c wouldn't build.
2021-04-15 01:57:11 +00:00
mrg
90cb3f8f93 vax vs gcc: fsdb.c loses. also build this with -O0. 2021-04-15 01:56:00 +00:00
mrg
e6d9bbbe8f one port complains about string overflow here that i can't see. 2021-04-15 01:55:21 +00:00
mrg
5def991c6d more -fcommon for boot programs. 2021-04-15 01:54:38 +00:00
rin
faefc63d20 intrcnt[] is changed from long to u_int. Use sizeof(var) instead of
sizeof(type) to catch up with this change.

No binary changes as all ports with __HAVE_LEGACY_INTRCNT are ILP32, IIUC.
2021-04-15 00:37:31 +00:00
rin
a68e817e60 dk_start(): retry device-dependent start() routine later, also when it
returns ENOMEM in addition to EAGAIN.

Device-dependent start() routine may allocate buffer directly, or via
bus_dma(9) API (some implementations for bus_dma(9) like alpha allocate
memory internally).

If these attempts fail with ENOMEM, this is not a disk error, therefore
we must retry later, as already done for EAGAIN.
2021-04-15 00:32:50 +00:00
rin
30e0d6e6fe Contrary to comment here, nowadays hardclock() and statclock() should be
called with cpu_intr_p() is turning on, if used from the interrupt context.

Otherwise, entropy_enter() is used instead of entropy_enter_intr(), which
results in KASSERT() failure.

Therefore, bump ci_intrdepth for clock interrupt. Remove stale comment also.
2021-04-15 00:19:52 +00:00
rin
babb50b85b Fix inverted logic!!
vmem_xalloc(9) should be used with VM_NOSLEEP for BUS_DMA_NOWAIT.
2021-04-15 00:11:09 +00:00
rin
488a24ca8d sandpoint has its own module_init_md(). So, do not compile in
that function in powerpc_machdep.c.
2021-04-15 00:04:07 +00:00
rin
b7d76f087c Use uvm_km_alloc(9) with UVM_KMF_NOWAIT flag in pte_enter(), in order not to
sleep in pmap_enter(9) and pmap_kenter_pa(9), which can result in dead lock.

In most cases, pmap_enter(9) is used with PMAP_CANFAIL flag. In this case,
if pte_enter() fails due to uvm_km_alloc(9), we can safely return ENOMEM.
UVM layer will take care of it.

uvm_km_alloc(9) fails for pmap_enter(9) without PMAP_CANFAIL or for
pmap_kenter_pa(9), we have no choice but to panic there.

However, my testbeds for 403 and 405 survive more than a week at least
without hitting this panic.
2021-04-15 00:00:46 +00:00
rin
ca4c7ad410 Style fixes:
- Add "static inline" to pte_enter(), to match with its declaration.
- Remove parentheses from return.
- Use NULL instead of 0 for pointer initialization.

No binary changes.
2021-04-14 23:45:11 +00:00
rillig
507ed84ad7 lint: remove stray semicolon from grammar, make empty rule visible
No functional change.
2021-04-14 22:08:28 +00:00
rillig
63eed110a6 tests/lint: adjust test for C11 to the change in grammar and options 2021-04-14 22:06:38 +00:00
christos
674dc63d44 use an enum instead of constant variables so that they work in CTASSERT. 2021-04-14 21:29:57 +00:00
christos
4d60a3d6f9 there is also an optional type qualifier list in the array size 2021-04-14 21:20:21 +00:00
christos
268a84db7b gnu enables c11 extensions 2021-04-14 21:20:02 +00:00
rillig
9103e93ec9 lint: un-abbreviate code for passing options to cpp, lint1 and lint2
No functional change.
2021-04-14 20:35:31 +00:00
rillig
3874a90eb6 lint: add option to accept C11 features
The list of available letters for the command line options gets shorter
and shorter.  Most of the interesting letters are already used for some
warning categories.  Curiously, -A, -W and -E were all still available.

The option -A nicely matches the intention of the option, which is to
allow a certain set of language features.  To keep the option available
for further extensions, define -Ac11 as the currently only valid option
of that kind.  This allows straight-forward extension for C17 and future
language standards, as well as independent feature-sets.  The options -W
and -E may someday complement the -A option, using the allow/warn/error
categories.
2021-04-14 20:06:40 +00:00
rillig
c58b6a91cc lint: arrange options in the usage messages
* lowercase the word 'usage'
* group the preprocessor flags on a line of their own
* add missing closing ']' for '-X'
* properly indent the lines
2021-04-14 19:25:48 +00:00
rillig
08565001cc lint: remove redundant condition in update_location 2021-04-14 18:38:06 +00:00
rillig
67509c5839 lint: add support for C11-isms such as int[static 3] 2021-04-14 18:35:40 +00:00
rillig
6aa88d9625 lint: add test for newly added message about static array size 2021-04-14 18:27:11 +00:00
rillig
b40d5c12d2 make: let the compiler decide whether to inline string functions
On x86_64, this reduces the binary size by 2 kB.
2021-04-14 17:39:11 +00:00
rillig
56af7cb8e9 make: turn run-time string concatenation into compile-time
No functional change.
2021-04-14 17:24:48 +00:00
rillig
d6aef06ed9 make: remove unnecessary modifier ':U' for certain fixed expressions
No functional change, since the expression is evaluated using
VARE_WANTRES, not using VARE_UNDEFERR.
2021-04-14 17:20:48 +00:00
rillig
278b3755f7 make: reduce memory allocations in the modifiers ':D' and ':U' 2021-04-14 16:59:34 +00:00
mlelstv
0e3291df0d Add DIOCGDISKINFO compat. 2021-04-14 16:26:23 +00:00
rillig
e7ab8fe199 make: rename members of ModifyWord_LoopArgs
No functional change.
2021-04-14 16:12:26 +00:00
rillig
be9afdd585 make: clean up pattern flags for the modifiers ':S' and ':C'
No special handling is necessary for C90 since none of the struct
members is a const_member.

The prefix 'Var' is not necessary since this type does not apply to a
variable but only to a modifier.

No functional change.
2021-04-14 15:41:08 +00:00
christos
c5e4c84a3f support parsing c99's static class for array size expressions. 2021-04-14 13:34:08 +00:00
christos
bed36db058 lto-common.c needs the stack protector treatment 2021-04-14 12:20:59 +00:00
mrg
384b30b1ad more -fcommon. 2021-04-14 09:29:40 +00:00
mrg
8b5e691ee5 build lfs_node.c with -O3 on ia64 to avoid assembler overflow issues. 2021-04-14 08:31:24 +00:00
mrg
403c2981b5 for GCC, built memset.c with -fno-builtin. this avoids GCC 10 compiling
memset() and emitting calls to memset() where it seems code that looks
like what memset() does, which ends up recursing and blowing the stack.

this makes mips userland with GCC 10 work.
2021-04-14 08:07:49 +00:00
nia
b936cc7999 OpenSSL man pages have moved 2021-04-14 07:56:23 +00:00
nia
de6863b74f intro.3: add a few 2021-04-14 07:52:53 +00:00
dholland
5cb406aa2a Add a ddb disassembler for riscv.
builds, but not really tested yet.
2021-04-14 06:32:20 +00:00
ryo
fdfe41cfc9 Fix the problem "pcictl pci0 list" causes "panic: trap_el1h_error" on rockpro64.
The panic occures in bus_space_barrier() in rk3399_pcie.c:rkpcie_conf_read().
We expected bus_space_peek_4() to trap and recover in the path
trap_el1h_sync() -> data_abort_handler(), but In fact, the read is delayed
until bus_space_barrier(), and we get an SError interrupt (trap_el1h_error)
instead of a Synchronous Exception (trap_el1h_sync).

To catch this correctly, An implicit barrier in bus_space_peek have been added,
and trap the SError interrupt to recover from.
2021-04-14 05:43:09 +00:00
christos
7ddbe09f70 regen 2021-04-14 02:45:58 +00:00
christos
f2d4a2706f use the first element of the array instead 2021-04-14 02:45:40 +00:00
mrg
a16a1d25de dtrace systrace.c issue fixed by christos (thanks!)
mips issue is related to memset.c miscompiling and does not
appear with -ffreestanding (thanks joerg & simonb.)
2021-04-14 01:19:13 +00:00
christos
51ba1c5af8 regen 2021-04-13 23:57:23 +00:00
christos
b643daa87d regen 2021-04-13 22:46:13 +00:00
christos
9f090a2c68 Elide [NUM] in arguments for systrace, use the first address of the array
and cast to intptr_t instead.
2021-04-13 22:45:32 +00:00
mrg
b62893b8db note amd64 dtrace issue is only warning for now.
note that i386 has problems in -current.
2021-04-13 22:24:56 +00:00