Commit Graph

285588 Commits

Author SHA1 Message Date
rillig
199346cc31 lint: change spelling of initialisation to initialization
That's the wording from the ISO C99 standard.
2021-02-22 15:09:50 +00:00
rillig
368c75e0d5 lint: improve debug message and comment 2021-02-22 15:01:03 +00:00
jmcneill
9f542e2491 Adjust description of compact list view output. 2021-02-22 11:38:13 +00:00
jmcneill
25801e14c4 In compact view, show the CPUs as a range (0-n) instead of a list
(0, 1, 2, ...) when the interrupt is assigned to all CPUs in the system.
2021-02-22 11:33:34 +00:00
palle
77d7a13c52 sun4v: update current status of sun4v 2021-02-22 10:30:57 +00:00
palle
ffe39134af sun4v: handle spill normal user traps properly when current trap level is 1 - registers are spilled to the PA of the stack to avoid further mmu-related traps, since sun4v only has 2 trap levels 2021-02-22 09:56:42 +00:00
ryo
e6178ccf0e PR/56002: aarch64 has a true 64bit CPU cycle counter, we will use it.
This fix solves PR/56002 on aarch64, but this problems can occur on
all other architectures where cpu_counter() is 32bit.
2021-02-22 09:29:38 +00:00
ryo
d2f78e9130 It is more appropriate to use clk_get_rate() rather than sc->sc_freq_target * 1000000.
ci_data.cpu_cc_freq should be set to a higher precision value.

In addition, when cpufreq_dt_init(), or while throttling, sc->sc_freq_target should not
be referenced by cpufreq_dt_change_cb() because it does not have the correct value.
2021-02-22 06:21:35 +00:00
rin
11047dadd4 Elucidate why synchronous transfer is disabled for AV Macs.
Sync negotiation times out when drive advertises that capability:

----
sd1 at scsibus0 target 1 lun 0: <codesrc, SCSI2SD, 6.0> disk fixed
sd1: 16384 MB, 2088 cyl, 255 head, 63 sec, 512 bytes/sect x 33554432 sectors
sd1: sync (160.00ns offset 15), 8-bit (6.250MB/s) transfers
...
sd1(esp0:0:1:0): esp0: timed out [ecb 0x9f7fc4 (flags 0x1, dleft 8, stat 0)], <state 5, nexus 0x9f7fc4, phase(l 1, c 1, p 1), resid 8, msg(q 0,o 80) DMA active>
sd1(esp0:0:1:0): sync negotiation disabled
sd1(esp0:0:1:0): esp0: timed out [ecb 0x9f7fc4 (flags 0x41, dleft 8, stat 0)], <state 5, nexus 0x9f7fc4, phase(l 1, c 1, p 1), resid 8, msg(q 20,o 80) DMA active> AGAIN
sd1: async, 8-bit transfers
----

This is observed for real SCSI drives as well as SCSI2SD (rev 6.0).

Note that this is not a fallout from DMA patch for AV Macs; timeout
takes place even if ``avdma'' code is forcibly disabled.

No binary changes.
2021-02-22 05:23:36 +00:00
rin
c72e2f75d5 - Add missing \n's to printf(9).
- Whitespace fixes.
2021-02-22 04:24:41 +00:00
jmcneill
276aa796cb KNF 2021-02-22 02:18:33 +00:00
christos
51673057e9 Locking protocol changed again, adjust. 2021-02-22 01:31:51 +00:00
jmcneill
d7832b60a2 When waking from cpu_idle(), only call dosoftints if ci_intr_depth == 0 2021-02-21 23:37:09 +00:00
mrg
886e97cda5 add ddb commands to inspect usb xfer and xferlist structures. 2021-02-21 23:06:39 +00:00
mrg
605a7c24da replace printf "ERROR<n>" with device_printf() and useful messages. 2021-02-21 23:06:13 +00:00
rillig
9510ff87da cgram: allow navigation with KEY_PPAGE and KEY_NPAGE 2021-02-21 22:21:56 +00:00
rillig
352df404f7 indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.

The indent test suite requires each test file to have both a NetBSD and
a FreeBSD RCS ID.  If the FreeBSD RCS ID is missing, the test will
silently pass since in that case, an empty file is compared with an
empty file.  See the /start/,/end/ operator in t_indent.sh.
2021-02-21 21:26:26 +00:00
rillig
1646b19068 cgram: rewrite completely, fixing bugs and style
Fixed bugs:

Do not consider the puzzle solved if all letters in the visible area are
substituted correctly.  To be properly solved, the whole puzzle must be
solved, even those parts that are currently off-screen.

Never place the cursor at the very right edge of the screen since that
does not work well with some terminals.  The maximum valid x coordinate
is COLS - 1.

Add horizontal scrolling.  Make all coordinate handling symmetric in
regard to the horizontal and vertical axes.  Previously, lines longer
than 80 characters could not be seen on the screen.

Improvements:

Remove the arbitrary limit of 128 characters per line.  Even if
fortune(6) may never generate such long lines, the code is easy enough
to adapt to other sources.

Properly clean up the allocated memory.  Previously, only the string
arrays were freed but not the strings themselves.

Stylistic:

Add RCS ID.

Fix ctype functions in lint's strict bool mode.

Avoid excessive calls to strlen whenever the cursor moves.  Given that
the whole screen is redrawn every time a key is pressed, this is an
unnecessary optimization, but the code smelled nevertheless.
2021-02-21 20:33:42 +00:00
jdolecek
d477b21b26 in xen_shm_map(), make sure to unmap any successfully mapped pages
before returning failure if there is partial failure

fix detection of partial failure - GNTTABOP_map_grant_ref can actually return
zero for partial failure, so we need to always check all the entries
to detect it

previously, DIAGNOSTIC kernel triggered panic() for partial failure,
and non-DIAGNOSTIC kernel did not detect it at all, leading to Dom0 page
fault later; since the mapping failure can be triggered by malicious
DomU via bad grant reference, it's important to expect the calls
to fail, and handle it gracefully without crashing Dom0

part of fixes for XSA-362
2021-02-21 20:11:59 +00:00
jdolecek
c144ae48ec reset xio_xv before calling xbdback_io_error() so it won't try to unmap
the non-initialized handles when xen_shm_map() fails

remove the ratechecked error printf for shm error - xbdback_io_error() prints
the error too

part of fixes for XSA-362
2021-02-21 20:02:25 +00:00
rillig
12c09445ec cgram: WARNS=6, use int for all coordinates
Eliminate some frequently occurring subexpressions during substitution.

No functional change, assuming that fortune(6) always spits out less
than 2 gigacharacters of text.
2021-02-21 17:16:00 +00:00
jmcneill
899244206a Inline pic_set_priority and use cpu_dosoftints_ci when available. 2021-02-21 17:07:45 +00:00
jmcneill
388a3964cd Add cpu_dosoftints_ci(). Like cpu_dosoftints(), but takes a cpu_info ptr
so we can avoid the extra tpidr_el1 access if cpu_info is already known.
2021-02-21 17:07:06 +00:00
rillig
f21d40b5e2 cgram: consistently use char for characters
Having to convert back and forth between char, unsigned char and int is
confusing.  Just stay with char, until the support for wide characters
is added.

No functional change.
2021-02-21 16:50:57 +00:00
rillig
c414f53223 cgram: fix undefined behavior when pressing function keys
The key codes for function keys are outside of the "range representable
by an unsigned char".  This resulted in parts of the screen being
cleaned.
2021-02-21 16:37:26 +00:00
rillig
0249cb139b isascii.3: fix typo 2021-02-21 16:33:22 +00:00
jmcneill
4d6fdc916e Align descriptors to 64 bytes instead of CACHE_LINE_SIZE (128) as all known
Allwinner SoCs with this part use 64-byte cache lines.
2021-02-21 16:07:43 +00:00
rillig
905a01e770 cgram: adjust style to survive lint's strict bool mode
The biggest change is the return type of substitute().  Before, 0 meant
success, now false means failure.

No functional change.
2021-02-21 16:05:44 +00:00
jmcneill
24ba1db8db Apply PMR optimizations from gicv3 2021-02-21 15:45:30 +00:00
rillig
43892d8404 cgram: sort includes 2021-02-21 15:42:21 +00:00
rillig
b15c3153c9 cgram: indent
With manual corrections afterwards:

- indent removes empty lines between statement and declaration.  This
  had been a syntax error in C90, since C99 this is common style and
  should be accepted by indent.

- indent didn't format the first line of main for whatever reason, did
  that manually.

- indent removed the empty line above the '/////' separators.  It should
  have left these empty lines as-is.
2021-02-21 15:41:04 +00:00
rillig
154c4e09c1 lint: extract check_non_constant_initializer from init_using_expr
No functional change.
2021-02-21 15:02:16 +00:00
jmcneill
5ea515b272 Keep current hardware priority value in struct cpu_info and use it instead
of reading icc_pmr_el1 in gicv3_set_priority.
2021-02-21 15:00:04 +00:00
rillig
80fb46b343 lint: extract check_bit_field_init from init_using_expr
No functional change.
2021-02-21 14:57:25 +00:00
rillig
0826316a44 lint: add test for bit-field initialisation in traditional C 2021-02-21 14:49:23 +00:00
rillig
4bbce6e96b lint: add debug logging for initializing an array of unknown size
It is possible that the type name 'array[unknown_size]' may spill into
the user-visible diagnostics.  The current test suite does not cover
such a case.  Anyway, saying 'array[unknown_size]' is still better than
saying 'array[0]', which would be misleading.
2021-02-21 14:19:27 +00:00
rillig
881e9b200c lint: rename and condense initstack_check_too_many
No functional change.
2021-02-21 14:02:36 +00:00
rillig
bd3424cb84 lint: remove redundant debug logging
In initstack_pop_nobrace, if anything happens to the initstack, it will
be logged by initstack_pop_item.

In init_using_expr, the address of the node is irrelevant, the node's
contents has already been logged above.
2021-02-21 13:52:21 +00:00
rillig
0aae6846c3 cgram: fix Home key for cursor navigation
Reported by liweitianux via GitHub.
2021-02-21 13:35:37 +00:00
rillig
db03d9f153 lint: clean up comments in mem1.c
The comment for tgetblk had been misplaced.
2021-02-21 13:27:22 +00:00
rillig
329f58d857 lint: document i_brace, add comments, rename initstack_string
No functional change outside debug mode.
2021-02-21 13:13:14 +00:00
rillig
43a6794406 lint: add test for initializing a character array using a string
The previous attempt took another code path than expected.  The
initialization of static_duration actually calls initstack_string.
2021-02-21 13:10:57 +00:00
rillig
6a0956331d lint: add more tests for C99 initialization 2021-02-21 12:49:05 +00:00
martin
7676dfd5b6 Add a bunch of USB loader devices for Freescale SoC that should not
attach as HID devices.
2021-02-21 12:36:38 +00:00
rillig
788308fa94 lint: always initialize return values of constant_addr
Before, the caller was responsible for initializing the return values
from the function.  This was an unexpected burden.

Ensure that in each branch that returns true, both return values are
properly set.

Strangely, the only caller of that function, init_using_expr, uses
neither of the return values.  It just tests whether the expression is
constant or not.

No functional change.
2021-02-21 11:23:33 +00:00
rillig
4c4ccffbb5 lint: add type information to message about enum mismatch 2021-02-21 10:28:32 +00:00
rillig
c6411a2f09 lint: add test for enum mismatch in initialization
This warning is currently not user-friendly because it omits any type
information, but that information is crucial.
2021-02-21 10:12:29 +00:00
rillig
8fb84076f2 lint: clean up debug logging in initstack_pop_item
The debug logging contained much redundant information and was
misleading in a few places.  For example, "pop" did not actually pop an
item, plus there are several things that could be popped, so that didn't
help either.

Sprinkle some comments in places where the code needs to become clearer.

No functional change outside debug mode.  The condition
'istk->i_remaining >= 0' was redundant due to the assertion directly
above it.
2021-02-21 10:03:35 +00:00
rillig
9e32617b0c lint: rename istk to initstack_element
The longer name is more expressive and more correct.  The previous name
called each stack element a stack itself, which was unnecessarily
confusing.

No functional change.
2021-02-21 09:24:32 +00:00
rillig
1214ba323a lint: add another test case for initializing an object 2021-02-21 09:19:53 +00:00