Commit Graph

288696 Commits

Author SHA1 Message Date
tsutsui ce046ada8b Use more shrinked binaries from distrib/utils/x_foo versions. 2021-07-10 03:19:12 +00:00
rillig 154b71395a lint: remove 6 conflicts from the grammar, in type_direct_decl
No functional change.
2021-07-09 20:51:27 +00:00
rillig a9a95a6338 lint: remove 6 of the remaining 162 conflicts from the grammar
No functional change.
2021-07-09 20:36:34 +00:00
rillig 09444204eb tests/lint: add test for unrealistic edge cases in declarations
The example code for triggering these grammar rules looks completely
contrived.  Even if lint had not implemented these cases, hopefully
nobody would have ever noticed.
2021-07-09 20:20:03 +00:00
kre d0dfc7df83 Make opts.cmd const char * rather than char * -- nothing ever modifies
the string it points to, it is never passed to a function not taking a
const char * arg, and this allows "" (or other literal strings if ever
needed) to be assigned to it - which should fix the build.
2021-07-09 20:00:26 +00:00
tsutsui 45c2ddaf52 Use more shrinked binaries from distrib/utils/x_foo versions. 2021-07-09 19:11:06 +00:00
tsutsui 78a0766dec Create rd3 device nodes, for HPDisk. 2021-07-09 19:01:29 +00:00
rillig ecdf1eb326 tests/lint: ensure that GCC __attribute__ can be parsed 2021-07-09 18:55:28 +00:00
tsutsui 5586b2b2c8 Specify -fno-unwind-tables to shrink binaries.
Before:
   text    data     bss     dec     hex filename
  77902    4328  137120  219350   358d6 uboot
After:
   text    data     bss     dec     hex filename
  64186    4328  137120  205634   32342 uboot
2021-07-09 17:44:28 +00:00
tsutsui 520cf7bbbd Mention about hp300 rd(4) improvements for HPDisk. 2021-07-09 17:07:29 +00:00
tsutsui cc528b47db Add support of multiple rd(4) disks on all punits for HPDisk.
Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.
2021-07-09 17:05:33 +00:00
christos ad9a00f7f3 fixes from RVP 2021-07-09 15:26:59 +00:00
christos ace315b97a Don't adjust the buffers when write returns 0. This happens with fmemopen
and other synthetic write functions. This fixes the unit-tests for fmemopen,
but adjusting should be the right behavior for all cases?
2021-07-09 09:24:16 +00:00
rillig 6818082fe2 lint: indent grammar actions properly
No functional change.
2021-07-09 06:37:11 +00:00
yamaguchi b0d413b9c0 added tests for IFF_PROMISC of vlan(4) 2021-07-09 05:54:11 +00:00
thorpej cd7ac92010 If we're netbooting on a system with, for example, an ISA DE204 Ethernet
interface, we don't have sufficient information to find the device using
the bus/slot scheme that we do with a PCI network interface.  However, in
these cases, some versions of the SRM console supply the MAC address of
the interface in the booted_dev environment variable, like so:

	BOOTP 1 1 0 0 0 5 0 08-00-2B-xx-xx-xx 1

So, if we weren't able to find the booted device by the usual means,
check for this and, if we find a MAC address, try to find the network
interface by the MAC address.
2021-07-09 01:29:20 +00:00
rillig 6dc7601c10 tests/lint: test error recovery of the parser 2021-07-08 20:11:15 +00:00
rillig 4114c20a2b lint: fix assignment to midrule in grammar (since today)
When compiling the grammar with Bison, it complains:

	error: $$ for the midrule at $2 of 'struct' has no declared type

Yacc does not complain, instead it assumes that a midrule has the same
type as the rule itself.

The assignment '$$ = $1' in the midrule action does not influence the $$
of the whole rule, it only assigns to $2.  The assignment to $$ was done
via the default action, therefore everything worked as expected.  Any
missing assignment in this rule would have been caught quickly by the
strict assertion in mktag.

No functional change.
2021-07-08 19:08:03 +00:00
rillig edf4510155 lint: fix wrong check for enum constants in switch (since today) 2021-07-08 18:53:57 +00:00
rillig a94824d394 lint: demonstrate bug in handling enum declarations (since today)
Since cgram.y 1.270 from today (a "cleanup" commit), the enum constants
were only registered in the symbol table, but they were not added to the
enum type (en_first_enumerator).  That information is used for
validating switch statements on enum types.

The actual bug is an off-by-one error in the grammar, in the grammar
rule 'enum_declaration'.  Yacc does not notice this obvious error.
Bison does, but it is not involved in building lint.

In the grammar rule 'enum_declaration', the intended $3 contains the
first enumeration constant of the type, while $2, which yacc interprets
as a symbol, contains a null pointer, at least on x86_64.

The existing tests did not cover this scenario, so the bug went
unnoticed.
2021-07-08 18:50:57 +00:00
gson 0033969404 When running an individual test case under isolation, make the test
case count on the tp-start line of the output match the number of test
cases actually executed (one) so that the atf-run output is valid
input to atf-report.
2021-07-08 18:10:52 +00:00
rillig fdd3710481 tests/lint: add test coverage for some parse errors 2021-07-08 18:02:22 +00:00
christos c90ee0ee4a Include the 0 return from write. Although the real write system call does
not return 0, the synthetic writes from funopen/fmemopen could. This avoids
infinite loops in >= test19 in fmemopen, but the tests still fail, perhaps
because they assume the previous behavior, where flush does not adjust the
stdio pointers on error.
2021-07-08 15:44:44 +00:00
christos 209a58fb36 fix printf format strings 2021-07-08 15:21:40 +00:00
christos a981b8de86 need to set BINDIR 2021-07-08 12:30:20 +00:00
christos e517cc9890 Add new interrupted stdio tests 2021-07-08 09:16:24 +00:00
christos 99be3a9d16 Add interrupted I/O tests (from RVP) 2021-07-08 09:07:46 +00:00
christos f280538df1 Obey EINTR and return immediately adjusting for unwritten. From RVP 2021-07-08 09:06:51 +00:00
rillig 19f514055a tests/lint: add tests for C90 mode and malformed declarations
In the grammar, 148 lines are still uncovered by the tests.  The
untested parts are mostly obscure declarations and a few parse errors.
2021-07-08 05:18:49 +00:00
rillig 3a16f78e73 lint: add grammar rule type_attribute_list_opt
Since type attributes (and GCC attributes as well) often modify the
preceding identifier, without referring to $$, the easiest way to
integrate them into the grammar is to define a separate grammar rule
that can be placed wherever these attributes are allowed.  This avoids
duplicate actions like in direct_param_decl.

No functional change.
2021-07-08 04:09:10 +00:00
rillig 79667b1e11 lint: clean up grammar
enum_decl_lbrace was only used once and was small enough to be inlined.

Renamed expr_statement and added block_item_list_opt to match the
wording from C99.

Added references to C99.

No functional change.
2021-07-08 03:55:54 +00:00
rillig c42555c28a lint: clean up grammar for member declarations
No functional change.
2021-07-08 03:35:07 +00:00
rillig 7580978075 lint: move optional grammar rules above their corresponding rules
No functional change.
2021-07-08 03:22:47 +00:00
rillig 509717aced lint: move grammar rules for generic_selection around
They were misplaced between the statements, as they belong to the
expressions, as indicated by the C99 section number.

No functional change.
2021-07-08 03:19:17 +00:00
rillig 85a42ed97b lint: remove irrelevant type information from __attribute__ tokens
The grammar once declared that an __attribute__ contained type
information, but that was not used anyway.

No functional change.
2021-07-08 03:14:56 +00:00
rillig aa99fa9f49 lint: remove double negation in comment
No functional change.
2021-07-08 03:10:39 +00:00
rillig 7cd2fbf849 lint: constify keyword in lexer
No functional change.
2021-07-08 02:59:22 +00:00
martin 5c18a11ba1 Allow to set sanitizer flags for the rump build from the
build.sh command line, like: -V RUMP_SANITIZE=address
2021-07-07 11:51:45 +00:00
christos d66b04778c PR/56270: Matthias Scheler: dump fails on ffsv1: Zero c_extsize since ffsv1
does not support extended attributes.
2021-07-07 11:06:37 +00:00
msaitoh ac174f2716 Add new sysctl "rx_copy_len".
ixgbe_rxeof() has an optimization "RX_COPY" to reduce costs of
bus_dmamap_load_mbuf() and bus_dmamap_unload() by copying a mbuf cluster's
memory to a newly allocated mbuf's MH_databuf[] and recycle the original map.
The optimization is used when a length of a packet is smaller than a specific
value. The value is calculated based on MHLEN. The size of MHLEN is
architecture specific. It's 256 or 512. Make the threshold controllable by
adding a new sysctl.
2021-07-07 08:58:19 +00:00
msaitoh fb62057e86 Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
ixgbe_setup_receive_ring() fully allocates rx buffers. When a
descriptor ring is full, rxr->next_to_refresh should point to
rxr_next_to_check -1. Before this change, rxr->next_to_refresh
is set to 0 and ixgbe_refresh_mbufs() wastefully loops in
ixgbe_refresh_mbufs() because it means the ring is empty.
2021-07-07 08:32:51 +00:00
thorpej ee112ce142 Provide a BWX version of alpha_copystr() and patch it into place if
the system supports the BWX extension.  The inner loop of the BWX
version is 42% shorter than the non-BWX version (7 vs 12 insns).
2021-07-07 03:30:35 +00:00
thorpej ceb097d8a2 After attaching CPUs, call alpha_patch() in case there are any function
patches we wish to do based on discovered architecture features.
2021-07-07 03:24:26 +00:00
thorpej e126333bd4 Re-arrange alpha_copystr() so that the the error/unlikely cases are forward
branches (which will be predicted as not-taken), and that the likely cases
are fall-through, with the exception of the loop branch (which is a backward
branch, and thus will be predicted as taken).
2021-07-07 02:44:04 +00:00
rillig 7949930972 lint: document further shift/reduce conflicts
These cannot be resolved as easily as those from the previous commit.
Anyway, the relevant code from the grammar is not yet covered by the
tests, this needs to be done first.
2021-07-06 21:41:36 +00:00
rillig 2c0bfe917a lint: document the cause for 24 of the 162 grammar conflicts 2021-07-06 20:56:38 +00:00
rillig 651d9e1434 lint: resolve conflict in grammar for __real__ and __imag__
There is no need for extra rules for '__real__(term)' since that is
already handled by the simpler '__real__ term', just a few lines further
up in the grammar.  Likewise for __imag__.

The GCC manual does not mention anything about parentheses either.
2021-07-06 20:29:08 +00:00
rillig 8636180887 lint: __real__ and __imag__ are GNU extensions
https://gcc.gnu.org/onlinedocs/gcc/Complex.html
2021-07-06 20:17:15 +00:00
rillig cbf601a4c6 lint: do not allow _Alignas (from C11) or __packed after a label 2021-07-06 19:08:28 +00:00
rillig 2282c27e30 tests/lint: add test for empty __attribute__(()) 2021-07-06 18:43:27 +00:00