Commit Graph

291205 Commits

Author SHA1 Message Date
martin 0a474c24d1 Use libhack and the non-widechar hacked version of curses for
the ramdisk image to save some space.
2021-11-01 19:37:32 +00:00
rillig db8c19114d lint: move all declarations above statements
All code that is used by src/tools is supposed to be compatible with C90.

No functional change.
2021-11-01 19:10:07 +00:00
rillig 4d145eb6b1 lint: do not warn about array size mismatch in array[(int)enum]
The cast to 'int' explicitly converts the type away from being an enum.
2021-11-01 18:11:25 +00:00
skrll 8a8c956efd Trailing whitespace 2021-11-01 17:03:53 +00:00
christos 04f561bb0b Remove workaround, @rillig fixed the issue. 2021-11-01 15:56:53 +00:00
skrll fda1991475 Move arm_cache_info from cpufunc.h to cpu.h 2021-11-01 14:45:24 +00:00
hannken f75cd5d61d Test lib/libc/sys/t_timerfd often fails when run on QEMU because
QEMU misses clock interrupts.

Always check values against [ lower, upper ] bounds and use "4 * upper"
when run under QEMU.

Now becomes part of PR kern/43997 "Kernel timer discrepancies".
2021-11-01 14:33:41 +00:00
christos 4feef3ada9 simplify. 2021-11-01 13:30:11 +00:00
christos 637f9844ca work around lint bug 2021-11-01 12:26:18 +00:00
rillig e6933acfcd lint: in the check for array[enum], allow enum constant NUM
When an enum type defines a constant NUM_VALUES, this constant is
usually not part of the enum values available to the application but
rather a handy place for defining the number of other enum values. Don't
warn about this case.

Seen in openpam_impl.h and several other places.
2021-11-01 11:46:50 +00:00
nia 8b8c4023f4 mk: Add support for conditional compilation of parts of the tree with
partial RELRO when MKRELRO=full is set.

Currently the X server needs to be compiled with only partial RELRO
due to the way certain (but not all - it seems wsfb works with full
RELRO) graphics driver modules are loaded.
2021-11-01 10:05:18 +00:00
skrll 4dcd8159ae Fix a last minute rebase/merge botch so that the cpu_hatch commit actually
works.
2021-11-01 08:53:40 +00:00
chs 8b5dbdcc14 fix a typo in compare_futex_key(). 2021-11-01 08:35:17 +00:00
thorpej 02edde8aa3 Version the sigaction(2) libc wrapper. The new version uses the "siginfo"
trampoline exclusively, thus relegating "sigcontext"-style handlers (which
have not been documented for many years now) to the dustbin of the compat
library.
2021-11-01 05:53:45 +00:00
thorpej 2b286a53d4 Don't mention the "struct sigaltstack" name of "stack_t". 2021-11-01 05:29:35 +00:00
thorpej 1c0099b06d regen for "struct sigaltstack" -> "stack_t" 2021-11-01 05:26:27 +00:00
thorpej 0a15a2c8dc Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name.  NFC.
2021-11-01 05:07:15 +00:00
agc 2c1df105e9 Remove the
COPTS.*+=       -Wno-error=.*

lines for building argon2 sources, by fixing the problems at source.

Addresses Rin Okuyama's concerns on tech-userlevel/tech-crypto in

	Message-ID: <f1eab199-3607-bb05-15cc-033e38721ba4@gmail.com>
2021-11-01 03:09:58 +00:00
rillig 5bfb3764f0 tests/indent: test formatting of 'CPU_INFO_FOREACH(cii, ci)' 2021-10-31 23:33:12 +00:00
rillig e1f525de18 lint: fix invalid memory access in array[enum] check
Lint checks whether in an expression 'array[enum]', the array size
matches the value of the maximum enum constant.

The previous tests for this check were missing the case where an enum
name was explicitly cast to an integer type and then used as an array
index. In this situation, the resulting type of the array index is a
plain 'int' without any information about its previous 'enum' history.

An entirely different case is when the 'enum' is implicitly converted to
an integer type, as in the test color_name_too_many. There, for the
final type of the array index, rn->tn_type->t_is_enum is true, which
means that rn->tn_type->t_enum is properly filled.

The bug was a simple typo, I had forgotten a tn_left indirection, which
is necessary to get the type before the implicit conversion.

Found and reported by Christos, triggered by src/lib/libperfuse/ops.c
1.89 line 1226 expression 'VTTOIF(vap->va_type)'.
2021-10-31 23:15:44 +00:00
rillig c1ca348406 indent: clean up
Initialize buffers in reading order, make comments more expressive,
rename add_typename to register_typename, remove unused macro.

No functional change.
2021-10-31 22:38:12 +00:00
thorpej 0d8e07b5c7 Tidy up how __sigaction14_sigtramp.c is added to SRCS. 2021-10-31 22:24:34 +00:00
skrll bd21d0ee0b Fix crash(8) build 2021-10-31 22:06:32 +00:00
rillig 47ec159eb4 indent: for '-pcs', add blank between function and '('
Before indent-2021.09.30.21.48.12, the blank had always been added, even
in '-npcs' mode. Since then, the blank had never been added.

Now, add the blank in '-pcs' mode and omit it in '-npcs' mode.
2021-10-31 21:43:43 +00:00
rillig 38900ecc98 tests/indent: test function declaration with '-pcs' and '-npcs'
The conditions in want_blank_before_lparen are not ordered correctly.
opt.proc_calls_space should override ')('.
2021-10-31 21:31:55 +00:00
rillig e513df21cf tests/indent: test indirect function call with '-pcs' and '-npcs' 2021-10-31 21:06:56 +00:00
rillig 9d5c0b7ac0 indent: remove redundant keyword.is_type
It is still confusing that not all type keywords end up as lsym_type.
Those that occur inside parentheses end up as identifiers instead. To
see whether an identifier is a typename, query ps.curr_is_type and
ps.prev_is_type.

No functional change.
2021-10-31 20:59:26 +00:00
rillig 4945e1c360 indent: replace kw_tag with lsym_tag
This leaves only one special type of token, which is lsym_ident, which
in some cases represents a type name and in other cases an identifier,
constant or string literal.

No functional change.
2021-10-31 20:40:42 +00:00
rillig fe749f9d12 indent: replace simple cases of keyword_kind with lexer_symbol
The remaining keyword kinds 'tag' and 'type' require a bit more thought,
so do them in a separate step.

No functional change.
2021-10-31 19:57:44 +00:00
rillig 651538a0a8 indent: rename lsym_type to better reflect reality
Type names that occur in parentheses are parsed as lsym_ident having the
subtype kw_type instead.

No functional change.
2021-10-31 19:20:52 +00:00
rillig d97233bf48 indent: remove support for pre-1978 variable initialization 2021-10-31 19:13:41 +00:00
rillig 6c663131dc tests/indent: test support for ancient initialization without '=' 2021-10-31 19:08:39 +00:00
christos 987f284e0a Put the NOAOUT in one place 2021-10-31 18:06:42 +00:00
christos b83f5063e9 USE CPPFLAGS instead of CFLAGS for -D ! 2021-10-31 17:50:35 +00:00
skrll 81569494bf Fix non-DIAGNOSTIC builds (hopefully). No idea why this didn't fail to
build for me without DIAGNOSTIC.
2021-10-31 17:24:11 +00:00
rillig d0e8b4fc64 indent: in debug log, print token subtype in same line
The keyword 'void' is parsed as lsym_type in some cases and lsym_ident
in others. Its corresponding keyword is always kw_type though. Put the
subtype into the same line as the other token information.
2021-10-31 17:22:47 +00:00
christos 1096792191 Avoid null pointer exception hpcmips/mipsel src/lib/libperfuse/ops.c 2021-10-31 16:42:16 +00:00
skrll f28144ebb6 Only perform pic_unblock_percpu if all of the following are true
- mp_online, i.e. APs are running.
- is_mpsafe, i.e. the interrupt handler is MP safe
- is_percpu, i.e. the interrupt actually requires it!

The last one (is_percpu) is true for GIC PPI+SGI only.
2021-10-31 16:29:18 +00:00
skrll 42bcbe7322 Revert the 2015 change I made that allowed sleeping in the idle lwp
if it wasn't running yet, e.g. in cpu_hatch
---
 sys/kern/kern_lock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 40557427de86..c0c9d8adaf9e 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -89,8 +89,7 @@ assert_sleepable(void)
 	} while (pctr != lwp_pctr());

 	reason = NULL;
-	if (idle && !cold &&
-	    kcpuset_isset(kcpuset_running, cpu_index(curcpu()))) {
+	if (idle && !cold) {
 		reason = "idle";
 	}
 	if (cpu_intr_p()) {
--
2.25.1
2021-10-31 16:26:26 +00:00
skrll da9193a3cb Assert we can sleep in pic_add 2021-10-31 16:24:47 +00:00
skrll e677f16f14 Rework Arm (32bit and 64bit) AP startup so that cpu_hatch doesn't sleep.
The AP initialisation code in cpu_init_secondary_processor will read and
initialise the required system registers and state for the BP to attach
and report.

Rework the interrupt handler code for this new sequence. Thankfully,
this removes a bunch of code for bcm2836mp.

The VFP detection handler on <= armv7 relies on the global undefined
handler being in place until the BP attaches vfp. That is, after the
APs have been spun up.

gicv3_its.c has a serialisation issue which is protected against in
the gicv3_its_cpu_init, which is called from cpu_hatch, with a spin
lock. The serialisation issue needs addressing more completely.

Tested on RPI3, Apple M1, QEMU, and lx2k

Fixes PR port-arm/56264:
   diagnostic assertion "l->l_stat == LSONPROC" failed on RPI3
2021-10-31 16:23:47 +00:00
jmcneill dbc391605c Reload tpidr_el1 into x3 and re-test newipl vs cpl on restart. 2021-10-31 15:32:14 +00:00
jmcneill 704afd10dd Disable GIC_SPLFUNCS (still crashy) 2021-10-31 12:34:48 +00:00
gson e417ffbfac Skip the test when there is insufficient disk space. Fixes PR misc/56324. 2021-10-31 11:36:26 +00:00
rillig 28d9c678b2 tests/indent: document that 'void' is not always parsed as a type 2021-10-31 10:56:19 +00:00
nia dc6d60f228 timed(8): avoid hand-rolling arc4random_uniform 2021-10-31 10:47:18 +00:00
rillig ba378f4a1a indent: add separate lexer symbol for offsetof
No functional change.
2021-10-31 10:09:43 +00:00
rillig 678fe6af01 indent: add separate lexer symbol for sizeof
The plan is to get rid of the type keyword_kind, which largely overlaps
with lexer_symbol.

No functional change.
2021-10-31 10:00:37 +00:00
rillig bf42b1a40c indent: clean up definition of keywords
Rename kw_struct_or_union_or_enum to the shorter kw_tag.

Merge kw_jump with kw_inline_or_restrict since they are handled in the
same way.

No functional change.
2021-10-31 09:52:37 +00:00
rillig 6642459ee9 indent: condense lexi_alnum
No functional change.
2021-10-31 09:41:48 +00:00