Commit Graph

287663 Commits

Author SHA1 Message Date
rillig
2bdae3c73f lint: undefine macros for defining keywords after use
No functional change.
2021-05-03 08:03:45 +00:00
rillig
fd5ea9b204 if_wm: do not return a void value from a void function
This is a GCC extension.
2021-05-03 07:43:31 +00:00
rillig
d6845656c5 lint: remove redundancy when defining classic keywords
No functional change.
2021-05-03 07:30:19 +00:00
rillig
f34b241711 lint: reduce redundancy when defining GCC attributes
This macro would have prevented the unintended inconsistency in the
attribute 'pcs' (for ARM).

No functional change.  The generated code is the same, except for the
line numbers in lint_assert.
2021-05-03 07:25:08 +00:00
rillig
58cf05d8c5 lint: allow variables to be named 'pcs' 2021-05-03 07:08:54 +00:00
rillig
5615754a21 tests/lint: demonstrate bug in the lexer for GCC attributes 2021-05-03 06:24:18 +00:00
rillig
944c465b9d lint: fix parsing of __typeof__ after statement in ({ ... })
Since C99, declarations and statements can be freely mixed, and GCC
supported this even before 1999.
2021-05-03 05:24:44 +00:00
rillig
413a9598ba tests/lint: remove outdated comment
The test d_gcc_extension is already activated in line 121.
2021-05-03 03:50:43 +00:00
rillig
fd32325145 lint: fix compiler warning about signedness mismatch
No functional change.
2021-05-03 03:46:55 +00:00
rillig
9491476953 lint: allow large integer types for bit-fields in GCC mode
These types are explicitly allowed by GCC.

I'm not sure which of the flags -g and -p should be stronger.  That is,
if both -g and -p are given, should 'unsigned char' be allowed as a
bit-field type since -g would allow it, or should it be warned about
since -p warns about it?  For now, continue to warn about these.
2021-05-02 22:07:49 +00:00
rillig
46bc06fdbe lint: extract check_bit_field_type from declare_bit_field
No functional change.
2021-05-02 21:48:53 +00:00
rillig
b0f8c816d4 tests/lint: fix test for GCC bit-field types
The whole purpose of this test is to try the message about invalid
bit-field types in GCC mode.  Therefore, use the default lint1-flags
that include -g.
2021-05-02 21:47:28 +00:00
nia
9bf7704373 audio: Only score hardware formats by channel count at count<=2
Scoring by channel count makes sense when you are using hardware that
supports mono and stereo formats. However, if your hardware also supports
surround formats, defaulting to those might be confusing. So, don't
prefer them.

Problem reported and fix tested by tcmart14 with a 2015 model Macbook Pro.
2021-05-02 21:37:32 +00:00
rillig
c29d5e341f tests/lint: add test for bit-field types in GCC mode 2021-05-02 21:22:09 +00:00
rillig
8e6f3338ac lint: on request, keep the preprocessor output
Previously, the simplest way of getting the preprocessed translation
unit was to run lint with the additional flag -V, which outputs the
command line of the C preprocessor, among other things.  That command
line does not include the proper quoting though, so it cannot be used
verbatim as a shell command if the command line contains spaces such as
in -Du64="unsigned long long".

In the common situation where lint is run via a Makefile, the option -V
had to be added in the Makefile itself since there is no make variable
for additional user-settable lint flags.  This is not straight-forward
enough.

Adding another command line option for this purpose would reduce the
remaining namespace for options.  Most of the 52 letters are already
used up.

To make this situation as simple as possible, preserve the output of the
C preprocessor depending on an environment variable.
2021-05-02 21:05:42 +00:00
rillig
f090e42deb lint: sort GCC attributes alphabetically in the grammar
No functional change.
2021-05-02 20:53:13 +00:00
rillig
ed02aca188 tests/lint: demonstrate missing support for __packed __aligned 2021-05-02 20:44:46 +00:00
rillig
f0bd455f32 sys/conf/lint.mk: fix order of command line options
The option -o must come before the first filename.

Now it is possible to lint kern_exec.c at least.  The next failure is in
netbsd32_machdep.c:

	netbsd32_machdep.c(395): error: illegal bit-field size: 255 [36]

That line in netbsd32_process_read_fpregs reads:

	__CTASSERT(sizeof(*regs) == sizeof(struct save87));

This is probably a bug in lint.  The struct save87 contains 3 uint16_t,
followed by a union containing a uint64_t, followed by a packed struct
with size 10.  The combination of packed and padding is suspicious.
2021-05-02 20:11:43 +00:00
rillig
0286d007d2 sys/conf/lint.mk: allow GCC extensions in the kernel
The syntax errors due to the __asm statements are now gone.  The file
kern_exec.c only produces a few warnings now.  But after running that
file through lint1, the main lint complains about wrong usage.  This is
due to this call:

	${LINT} ... -i $< -o $@

The main lint has never supported -o after the first filename, so it
complains.  It would have been helpful if lint had given any hint as to
which option was invalid.  Anyway, the next step is to reorder the
arguments.  As it is now, the code can never have worked.
2021-05-02 19:51:57 +00:00
rillig
09e420f981 sys/conf/lint.mk: a small step for linting the kernel
Due to the missing path, the following commands had failed:

	$ cd src/sys/arch/amd64/compile/GENERIC
	$ nbmake-amd64-lint kern_exec.ln
	nbmake: don't know how to make kern/kern_exec.c. Stop

After fixing the path, "make kern_exec.ln" fails with:

	sys/kern/kern_exec.c(65): error: syntax error '"' [249]

The affected line contains:

	__KERNEL_RCSID(0, "...");

The macro __KERNEL_RCSID expands to __asm("some strings").  Since
KERNLINTFLAGS is missing the -g, lint does not recognize __asm as
keyword and tries to parse it as an identifier instead, expecting a
variable or function declaration.
2021-05-02 19:29:30 +00:00
jdolecek
e010d49ce8 implement fo_restart hook for kqueue descriptors, so that close(2)
on the descriptor won't block indefinitely if other thread is currently
blocked on the same kqueue in kevent(2)

done similarily to pipes and sockets, i.e. using flag on the potentially
shared kqueue structure hooked off file_t - this is somewhat suboptimal
if the application dup(2)ped the descriptor, but this should be rare
enough to not really matter

usually this causes the kevent(2) to end up returning EBADF since
on the syscall restart the descriptor is not there anymore; if
dup(2)ped the kevent(2) call can continue successfully if the closed
kqueue descriptor was other than the one used for the kevent(2)
call

PR kern/46248 by Julian Fagir
2021-05-02 19:13:43 +00:00
jmcneill
06e5adc04e Add RISC-V 64-bit support. 2021-05-02 15:22:27 +00:00
rillig
2caa24ffff countmail: remove outdated comments
Using the shell builtin 'read' command was necessarily slow because it
is specified to read a single byte at a time.
2021-05-02 13:10:36 +00:00
rillig
1182a44c59 games: remove trailing whitespace in *.c and *.h 2021-05-02 12:50:43 +00:00
rillig
0527d6d12b fish: remove trailing whitespace 2021-05-02 12:25:55 +00:00
rillig
4dbccc6d68 fish: use arc4random_uniform for drawing random numbers
Thanks nia@ for the hint.
2021-05-02 12:24:59 +00:00
martin
3e0848b4f6 Add test for POSIX_SPAWN_RESETIDS flag 2021-05-02 11:18:11 +00:00
martin
2bec2479f8 Fix copy&pasto in handling of POSIX_SPAWN_RESETIDS in posix_spawn(3) 2021-05-02 10:23:55 +00:00
wiz
f5858a27ff gcc-11.1.0 is out. 2021-05-02 08:18:38 +00:00
rillig
ac598ab1cf fish: remove modulo bias from random number generation
It probably doesn't matter in practice, but omitting this piece of code
always looks like an oversight.
2021-05-01 21:10:57 +00:00
rillig
6a70979a86 cgram: rename local functions
The word 'cleanup' should have been named clean_up all along, but 'done'
is even shorter.

No functional change.
2021-05-01 20:29:23 +00:00
rillig
c6b805dbac caesar: WARNS=6, strict bool mode
The rotation is validated to be nonnegative, therefore use unsigned int
for it.
2021-05-01 20:21:25 +00:00
rillig
ae67c40d79 ktruss: fix typo in comment 2021-05-01 18:07:52 +00:00
jakllsch
905e5ea3f4 fix syntax of latest CHANGES entry 2021-05-01 16:14:35 +00:00
thorpej
a13eceb08c Remove unnecessary interface attributes from "smu". 2021-05-01 15:12:25 +00:00
hannken
9decf88a36 Make sure fdesc_lookup() never returns VNON vnodes.
Should fix PR kern/56130 (fdescfs create nodes with wrong major number)
2021-05-01 15:08:14 +00:00
skrll
513f5635f2 Revert previous 2021-05-01 14:00:57 +00:00
thorpej
3c9602bc22 Make sure preemption is disabled around PMAP_USERRET(); it uses
per-cpu information.

XXX mi_userret() also internally disables preemption.  Should restructure
these to remove redundancies.
2021-05-01 13:23:07 +00:00
rillig
277632d833 tests/lint: add test for __attribute__((nonnull())) 2021-05-01 07:56:20 +00:00
skrll
e0a182239c Fixup some pmap / VM related #defines and code 2021-05-01 07:41:24 +00:00
nia
719c9c8c6e intro.7: add missing entries 2021-05-01 07:41:14 +00:00
rillig
b7fe254f77 lint: support all documented variants of __attribute__((nonnull)) 2021-05-01 07:25:07 +00:00
skrll
6a4a1d7bd5 Fixup kernel linking and provide a linker script with standard sections
and symbols
2021-05-01 07:13:21 +00:00
skrll
b2baafe27f Enable interrupts at the end of cpu_configure 2021-05-01 07:11:12 +00:00
skrll
36a97d5bd4 Quick hack to make this link 2021-05-01 07:10:34 +00:00
skrll
85f6ed222f Provide riscvreg_satp_{read,write} 2021-05-01 07:09:55 +00:00
skrll
81bebf3704 Indent the FCSR_FRM value #defines 2021-05-01 07:09:04 +00:00
skrll
fa49a3b558 Bump MSGBUFSIZE (if not defined)
Provide COHERENCY_UNIT and CACHE_LINE_SIZE

Also provide MAXCPUS
2021-05-01 07:06:54 +00:00
skrll
52a00092ff Provide __CONCAT, __STRING and ___CONCAT 2021-05-01 07:05:07 +00:00
skrll
597f3633c4 Expose pmap_tlb_update_addr to the PMAP_HWPAGEWALKER platforms 2021-05-01 06:56:41 +00:00