Commit Graph

283956 Commits

Author SHA1 Message Date
ginsbach
332df7ed8f nl(1): remove superfluous exit
Remove exit(3) call missed when errors were converted to errx(3).
2020-12-22 17:50:55 +00:00
skrll
005355a11c Count bus_dmamap_sync events for coherent ranges and non-coherent ranges 2020-12-22 13:07:32 +00:00
jmcneill
3065a28a94 When lpiconf flushing is required, make sure to flush to PoC and not PoU.
Spotted by nick.
2020-12-22 10:46:51 +00:00
rillig
bd691351f1 make(1): fix comment in test about null bytes in makefiles 2020-12-22 08:57:23 +00:00
rillig
e6d109f2d3 make(1): re-add improved assertion in ParseGetLine 2020-12-22 08:51:30 +00:00
rillig
9582eb4d33 make(1): remove assertion about lines ending with '\n'
It fails the NetBSD build.sh.
2020-12-22 08:31:13 +00:00
rillig
0c15097160 make(1): clean up after test opt-file 2020-12-22 08:23:12 +00:00
rillig
75fb9c6afb make(1): remove needless assignment to line_end in ParseGetLine 2020-12-22 08:10:39 +00:00
rillig
b46e8d7cf5 make(1): fix assertion failure for files without trailing newline
Previously, mmapped files didn't always have the final newline added.
Only those that ended at a page boundary did.

This confused ParseRawLine, which assumed (and since parse.c 1.510 from
moments ago also asserted) that every line ends with a newline, which
allows the code to assume that after a backslash, there is at least one
other character in the buffer, thereby preventing an out-of-bounds read.

This bug had been there at least since parse.c 1.170 from 2010-12-25
04:57:07, maybe even earlier, I didn't check.

Now line_end always points to the trailing newline, which allows
ParseGetLine to overwrite that character to end the string.
2020-12-22 08:05:08 +00:00
rillig
8a4190c0a5 make(1): fix commit number in tests for :gmtime and :localtime 2020-12-22 07:22:39 +00:00
msaitoh
b390736b96 Correctly ACK the fan failure interrupt in ixgbe_legacy_irq(). 2020-12-22 07:16:23 +00:00
rillig
9b03887383 make(1): prevent undefined behavior in loadfile_mmap
Reading a file without a trailing newline had resulted in an
out-of-bounds write, in the common case where the file is loaded via
mmap.
2020-12-22 06:48:33 +00:00
ad
e815cec38a Nothing here came from UCB, it's all NetBSD. 2020-12-22 01:58:58 +00:00
ad
e00452d2f4 Comments. 2020-12-22 01:57:29 +00:00
riastradh
9fd32e5474 usb: Omit bogus assertions about struct usbd_pipe::up_intrxfer.
These assertions were only valid for pipes at UE_IN_DIR, UE_INTERRUPT
endpoints created with usbd_open_pipe_intr, which uses up_intrxfer to
pass the struct usbd_xfer object to usbd_close_pipe to free later.

In contrast, for pipes at UE_OUT_DIR, UE_INTERRUPT endpoints,
up_intrxfer is never initialized, so the assertion cannot be right.
In principle we might even have more than one outstanding interrupt
transfer at a time, rendering the point of the assertion moot anyway.

Found by interrupting a uhidev write to a u2f device.

ok nick
2020-12-22 01:07:23 +00:00
rillig
f2023805b3 make(1): remove excess newline from parse errors (since 2020-11-01)
For the modifiers :gmtime and :localtime, the excess newline had been
added in var.c 1.631 from 2020-10-31 21:40:20.

For the modifiers :range and :ts, the excess newline had been added in
var.c 1.635 from 2020-11-01 14:36:25.
2020-12-21 21:04:18 +00:00
rillig
ecb61f4a92 make(1): align tests for :localtime with those for :gmtime
These tests had been almost the same before, now they are as similar as
possible again.
2020-12-21 20:47:29 +00:00
rillig
23e24e814c make(1): move tests for :gmtime to parse time
It's easier to have both the expressions and the expected values in a
single file.  This also allows for flexible handling of multiple
acceptable outputs, in this case for 32-bit time_t.
2020-12-21 20:35:17 +00:00
sjg
2de15e97b5 Set default for .MAKE.OS once 2020-12-21 18:22:31 +00:00
riastradh
15867ac673 embedded/mkimage: Pad image with zeros to multiple of 4 MB plus 1 MB.
Otherwise, there may not be enough space after the ffs partition for a
gpt, leading to very confusing results.
2020-12-21 16:38:02 +00:00
nia
dc3812a1c6 seemingly did not appear in netbsd 9 2020-12-21 11:30:59 +00:00
skrll
5b1e7d3bd1 Remove variable in function declaration argument 2020-12-21 08:41:38 +00:00
rillig
8277081861 make(1): remove redundant parameters from ParseModifierPart 2020-12-21 02:38:57 +00:00
rillig
0743b63f41 make(1): fix garbled output for failed shell command (since 2020-12-20)
Passing a struct as printf argument for the %s conversion doesn't work.
On NetBSD-8.0-x86_64, the output looks normal, but on SunOS-5.9, the
output is garbled, containing bytes 0xFF and 0xFE.

This bug had been introduced in parse.c 1.507 from 2020-12-20 14:52:16.

Thanks to sjg for finding this bug so quickly.
2020-12-21 02:09:34 +00:00
rillig
fcd6900042 make(1): save a few memory allocations in variable expressions 2020-12-21 00:30:13 +00:00
rillig
e6694a528e make(1): switch memory handling from MFStr to FStr
This makes all intermediate strings constant.  For this simple
search-and-replace refactoring, all intermediate locations where the
"current value of the expression" was stored had to be of the type
MFStr.

Using FStr instead of MFStr allows to save a few memory allocations,
which will be done in the follow-up commits.
2020-12-21 00:20:58 +00:00
rillig
be2b5e4446 make(1): clean up memory management for expanding variable expressions
Previously, memory management had been split among several variables.
The general idea was very simple though.  The current value of the
expression needs to be kept in memory, and each modifier either keeps
that value or replaces it with its own newly allocated result, or
var_Error or varUndefined.

Using MFStr, it does not matter anymore that var_Error and varUndefined
are statically allocated since these are assigned using MFStr_InitRefer.

The complexity of the implementation is now closer to the actual
complexity.  Most probably the code can be simplified even more.
2020-12-21 00:11:29 +00:00
rillig
23688beebb make(1): add tests for :tW and :tw modifiers 2020-12-20 23:29:50 +00:00
rillig
b8f5741af7 make(1): use FStr for ApplyModifiersState.newVal
Memory management is still complicated in this area.  To clean this up,
the previous value of the expression needs to be converted to an MFStr
first, and later to an FStr.
2020-12-20 23:27:37 +00:00
rillig
26a72fc416 make(1): add tests for variable modifiers on trailing slashes 2020-12-20 22:57:40 +00:00
rillig
94f06ed7ea make(1): fix undefined behavior in meta_oodate
Do not increment a null pointer.

Do not assign to a variable twice in the same statement.  To be fair,
this may be safe because of the sequence point when the function is
called, but anyway, it looks too close to undefined behavior.
2020-12-20 22:36:40 +00:00
rillig
06ccd6ce96 make(1): reduce scope of cp in meta_oodate
That function is way too long (550 lines) and has too creative variable
names such as fname, fname1, fname2, fname3.
2020-12-20 22:12:36 +00:00
rillig
4b4d56707b make(1): fix declared variable type in printCMDs
No functional changes since StringListNode and GNodeListNode are both
typedefs of a simple generic ListNode.
2020-12-20 22:02:54 +00:00
uwe
c34ee3711d run_rc_command - don't prefix the rcvar variable name with the dollar sign.
The output without the dollar sign is less confusing as it's actual
valid shell syntax:

  $ /etc/rc.d/foo rcvar
  # food
  food=YES

Brought up on tech-userlevel@ by Rocky Hotas with some LGTMs from
other people and no objections.

We still refer to '$food' in warnings/errors though.
2020-12-20 21:30:28 +00:00
rillig
5196cc55b0 make(1): omit linear search for command in Compat_RunCommand 2020-12-20 21:07:32 +00:00
rillig
7a800efcdb make(1): remove redundant assignment in ApplyModifier_SysV 2020-12-20 19:51:37 +00:00
rillig
00ba7da94c make(1): error out on unknown variable modifiers at parse time
Before, make printed an "error message" that did not include the word
error and thus was not easily identified as such.  This "error message"
also did not influence the exit status in the default mode but only in
-dL mode.  The error message also didn't include any line number
information and was thus rude.
2020-12-20 19:47:34 +00:00
rillig
d52e9b267b make(1): include line numbers in output of test varmod-edge.mk
Suppressing the line numbers does not provide much benefit, given that
the test file doesn't change often.
2020-12-20 19:37:23 +00:00
jdolecek
7919cd9239 disable (U)DMA for ATAPI on aceride(4), the chip doesn't support it
PR port-sparc64/55540
2020-12-20 19:30:03 +00:00
rillig
374368e991 make(1): move tests for indirect modifiers around
The next commit will error out on unknown modifiers and influence the
exit status.  The test modmisc.mk contains both parse time tests and run
time tests.  To prevent the latter from being run, the parse error is
moved to varmod-indirect.mk, which only contains parse time tests.
2020-12-20 19:29:06 +00:00
rillig
b1b3d2f62b make(1): remove wrong error message for indirect modifier in lint mode 2020-12-20 19:10:53 +00:00
rillig
4938cf88d2 make(1): document that indirect modifiers fall back to SysV modifiers 2020-12-20 19:02:28 +00:00
rillig
9c42de2852 make(1): remove redundant const declarations for parameters 2020-12-20 18:23:24 +00:00
rillig
ffd320932f make(1): extract ApplySingleModifier from ApplyModifiers 2020-12-20 18:13:50 +00:00
rillig
e2fd21af29 make(1): turn ApplyModifiersState.val into a local variable
This reduces the scope and makes it more obvious at which places this
variable can be changed and how the memory management is done.
2020-12-20 17:22:10 +00:00
skrll
31d27c3628 Support __HAVE_PMAP_PV_TRACK in sys/uvm/pmap based pmaps (aka common pmap) 2020-12-20 16:38:25 +00:00
skrll
cdb6e12087 Remove bogus KASSERT - can't assert a spin mutex is !mutex_owned. 2020-12-20 15:59:28 +00:00
skrll
103a7264ea Remove VM_MD_TO_PAGE that was accidentally committed in 1.106. It's going
to be readded with the code that uses it
2020-12-20 15:50:44 +00:00
rillig
0e4ce27167 make(1): use FStr for memory management in Var_SetWithFlags 2020-12-20 15:31:29 +00:00
rillig
fa8bd88f04 make(1): extract SetVar from Var_SetWithFlags
SetVar contains the part that is not concerned about memory management
and expansion of the variable name.
2020-12-20 15:26:40 +00:00