Commit Graph

285364 Commits

Author SHA1 Message Date
jmcneill
c40f7260cb splx: only dispatch hard interrupts if interrupts are enabled 2021-02-15 15:42:58 +00:00
wiz
026eaf4d13 Remove reference to multibyte(3) and trailing commas. 2021-02-15 15:38:43 +00:00
christos
53b5b1c0c5 Remove FreeBSD portions that are not relevant to our implementation (pointed
out by joerg@)
2021-02-15 15:36:53 +00:00
jmcneill
71278a4c79 splx: only dispatch softints if interrupts are enabled 2021-02-15 15:07:47 +00:00
christos
e1d8873a1b new locale pages, sort 2021-02-15 14:38:06 +00:00
christos
da3ff69781 Add missing man pages (from FreeBSD) 2021-02-15 14:35:04 +00:00
isaki
0322faf76e Fix my copy-and-paste bug in rev1.160.
This fixes recording sample dropout.
2021-02-15 13:39:18 +00:00
jmcneill
765c6b80ae pic: reduce the number of daif accesses in pic_do_pending_ints
The caller has already provided daif state. No need to keep updating
daif via pic_set_priority if it's already in the state we need (interrupts
disabled).
2021-02-15 13:03:52 +00:00
martin
50cbb763c2 Fix the build.
Maybe there should be a ICMP6_HDR_ALIGNMENT, but for now there is
only IP6_HDR_ALIGNMENT.
2021-02-15 10:13:45 +00:00
kre
0b2331a3c3 Don't compare int against size_t .. since mbuf lengths should never
be negative, cast it from int to size_t (rather than the other way
around).   Hopefully fix build.
2021-02-15 09:29:56 +00:00
rillig
a82a3ee139 make: improve comments in test for expansions in .for loops 2021-02-15 07:58:19 +00:00
rillig
9478d5a896 make: fix typo in comment 2021-02-15 07:42:35 +00:00
rillig
5dd7b87974 lint: remove redundant comment
That comment was useful when there was no function is_null_pointer.
Back then, the code for testing a null pointer was written in-line,
which made it really hard to see what's going on.  This is no longer the
case.
2021-02-15 07:40:18 +00:00
rillig
db5ee305d0 lint: extract typeok_colon_pointer from typeok_colon
The subtype information is now only accessed if both operands are
actually pointers.

No functional change.
2021-02-15 07:36:40 +00:00
rillig
2944115b18 tests/lint: fix comments in test for message 124 2021-02-15 07:18:20 +00:00
rillig
65e35d76dc tests/libcurses: fix error handling for non-system errors
These errors are unrelated to errno.  The scanf family of functions also
does not set errno.
2021-02-15 07:06:27 +00:00
rillig
0308def1fc make: clean up code and comments around ModifyWord
In ModifyWords, there is no "passed string" anymore since that function
now directly operates on the expression value.

While here, improve the documentation of ModifyWordsCallback and rename
it to ModifyWordProc, focusing on its purpose instead of where it is
used.
2021-02-15 06:46:01 +00:00
knakahara
94b86f7d95 Fix build failure for options GATEWAY. 2021-02-15 03:41:01 +00:00
christos
e6569ddab8 remove _ prefix from args 2021-02-15 00:44:09 +00:00
rillig
449355e949 make: clean up memory management in evaluation of expressions
The condition "st->newValue.str != val" in ApplySingleModifier made the
memory management look more complicated than it really was.  Freeing an
object based on another object's value is harder to understand than
necessary.

To fix this, the "current value" of the expression is now stored in
ApplyModifiersState, and it gets updated in-place by the ApplyModifier
functions.  This reduces the number of parameters for the ApplyModifier
functions.

Accessing the current value of the expression is now more verbose than
before (st->value.str instead of the simple val).  To compensate for
this verbosity, ApplyModifiersIndirect is now much easier to understand
since there is no extra "current value" floating around.

There is still room for improvement.  In ApplyModifiers, passing an FStr
in and returning another (or possibly the same) makes it difficult to
understand memory management.  Adding a separate Expr type that outlives
the ApplyModifiersState will make this easier, in a follow-up commit.
2021-02-14 22:48:17 +00:00
rillig
6118cc0289 make: reduce redundant code around ModifyWords
The result of ModifyWords had been passed to Expr_SetValueOwn in all
cases.  The last argument to ModifyWords had always been st->sep.
2021-02-14 21:54:42 +00:00
rillig
370ad03170 make: clean up FStr and MFStr memory in cleanup mode 2021-02-14 21:32:58 +00:00
christos
9183889817 - centralize header align and pullup into a single inline function
- use a single macro to align pointers and expose the alignment, instead
  of hard-coding 3 in 1/2 the macros.
- fix an issue in the ipv6 lt2p where it was aligning for ipv4 and pulling
  for ipv6.
2021-02-14 20:58:34 +00:00
palle
aa7e1ebfd6 sun4v: update TODO with status of verified systems(T2000, T5 and qemu) 2021-02-14 20:30:31 +00:00
rillig
f9dcbbe347 make: print error about failed shell command before overwriting variable
Memory management of the value of variable expressions is currently more
complicated than necessary.  It is the responsibility of ApplyModifiers,
even though conceptually the value belongs to an expression, so it
should rather be in Expr.  Right now, this is an alias for
ApplyModifiersState, but that will change soon.

When that is done, there will no longer be a "current value" and a "new
value", only a single "value" of an expression.  At that point, before
Expr_SetValueOwn will overwrite the old value with the output of the
shell command, the error message needs to refer to the latter.
2021-02-14 20:22:30 +00:00
rillig
fe211a10c7 make: add test for the variable modifier ':sh' 2021-02-14 20:16:17 +00:00
roy
2a093b6406 if_arp: Just KASSERT that arphrd is aligned
While here improve readability of checking ARP IEEE1394 matches interface.
2021-02-14 19:47:16 +00:00
roy
951b7674b2 if_ether: revert prior alignment checks
Apparently not needed as our drivers ensure this.
2021-02-14 19:35:37 +00:00
roy
880dbbbc52 if_gre: Remove alignment checks in favour copying to stack
Makes the code a lot simpler, idea from dyoung@
2021-02-14 19:33:29 +00:00
rillig
bc023be5d8 make: clean up ValidShortVarname
The switch statement was hard to read, especially the "break" that
needed a comment since it was effectively a "continue".
2021-02-14 18:59:36 +00:00
rillig
d0e45fa73b make: clean up ParseVarnameShort
Single-character short variable expressions such as $V neither have a
starting character nor an ending character.  The only interesting
character forms the complete variable name.

No functional change.
2021-02-14 18:55:51 +00:00
pgoyette
0d15fa02aa Add KERNEL_DIR to /etc/release
"Sure, why not" from xtos!
2021-02-14 18:45:44 +00:00
rillig
52e5117b68 make: rename VarExprStatus to ExprStatus
It is only used in var.c so there is no need to use a prefix.
2021-02-14 18:21:31 +00:00
rillig
73654455e2 make: add test for indirect ':U' modifier
Unlike ':ts' and ':tW', the effects of ':U' are visible even after the
modifiers from the nested expression have been applied.  These subtle
details, like many others, are not documented in the manual page.
2021-02-14 17:47:33 +00:00
rillig
b37a044ff1 make: revert part of previous commit
That code was not ready yet.
2021-02-14 17:27:25 +00:00
rillig
62b202434d make: update line numbers in expected test output
The documentation from the previous commit added a few lines.
2021-02-14 17:24:47 +00:00
rillig
a6cd09f3da make: document since when indirect modifiers are supported 2021-02-14 17:22:37 +00:00
rillig
7d5825c040 make: add more tests for edge cases in evaluating variable expressions
As a preparation for refactoring the code around variable expressions,
there need to be a few tests for indirect variable modifiers since these
were not covered before.

Indirect modifiers may include ':ts' and ':tW', which change the
interpretation of the variable expression in small details.  The scope
of these changes is limited to the indirect modifier, any evaluations
outside this indirect modifier are unaffected.

The changes to the .exp file are mostly line number changes, plus a
demonstration of a newly found bug, where an expression is evaluated
successfully despite producing a parse error.
2021-02-14 16:12:46 +00:00
jakllsch
ca39d05145 if_bnx.c: fix misleading indentation
suggested by rillig@
2021-02-14 14:05:03 +00:00
rillig
2606f6962c make: add functions for assigning the value of an expression
The plan is to have only the "current value" of the expression as a
member, not the "new value".  To do this consistently and get the memory
management right, there must be a single place (or two) where the value
of the expression is updated.

No functional change.
2021-02-14 13:53:28 +00:00
rillig
733483f46f make: rename ApplyModifiersState_Define to Expr_Define
The type name ApplyModifiersState was only intended as a working draft,
its name is too long and its scope a little too narrow.

Applying the modifiers is the main part of evaluating a variable
expression, and the scope of that type will be extended to parsing the
name of the expression as well.  This will hopefully reduce the number
of parameters, which is currently at 14.

No functional change.
2021-02-14 13:46:01 +00:00
rillig
fe28e4c2f6 make: fix TMPDIR in unit-tests
Combining the assignment operator ':=' with the variable modifier ':U'
on the same variable does not work as intended.  At the point where the
':U' is evaluated, the variable is guaranteed to be defined because the
code in VarAssign_EvalSubst says so.
2021-02-14 13:24:45 +00:00
rillig
635f837c66 make: condense the code for parsing :S and :C modifiers
No functional change.
2021-02-14 12:35:27 +00:00
rillig
35c51735d0 make: rearrange some comments to make them easier to spot 2021-02-14 12:24:53 +00:00
rillig
3b4441442a make: document purpose of stepping back in the parser
In ApplyModifier_Assign there was no need to compute the delimiter from
st->startc since that has already be done at that point.
2021-02-14 12:16:13 +00:00
rillig
c8f6aa36d9 make: add test for ::= modifier enclosed in parentheses 2021-02-14 12:14:37 +00:00
rillig
f6084dc243 tests/libcurses: document the history about tab bugs in addch/addstr
Verified by installing all versions of libcurses from 2012 to 2021 and
running a simple test program on them:

	#include <stdio.h>
	#include <curses.h>

	int
	main(int argc, char **argv)
	{
		int xstr, ystr, xch, ych;

		initscr();

		addstr("\t");
		xstr = getcurx(stdscr);
		addstr("\n");
		ystr = getcury(stdscr);

		addch('\t');
		xch = getcurx(stdscr);
		addch('\n');
		ych = getcury(stdscr);

		endwin();

		fprintf(stderr, "%s\t%d,%d\t%d,%d\n",
		    argv[1], ystr, xstr, ych, xch);
	}

Some selected outputs:

	...
	2016.11.24.14.49.08	1,0	2,8
	2016.11.28.18.25.26     1,8	2,8
	...
	2019.05.12.02.29.00	1,8	2,8
	2019.05.20.22.17.41	1,8	2,16
	...
	2021.02.13.10.37.00	1,8	2,16
	2021.02.13.14.30.37	1,8	2,8
2021-02-14 11:21:37 +00:00
isaki
44db56f660 Add missing curlwp_bindx() corresponding to curlwp_bind().
Pointed out by riastradh@.
2021-02-14 03:41:13 +00:00
joerg
0cf30132cd Adjust test cases to hit the fudge case after the changes in nbperf
itself.
2021-02-14 01:27:33 +00:00
rillig
1131246067 tests/libcurses: note that addbytes is not part of the API
https://mail-index.netbsd.org/source-changes-d/2021/02/13/msg013199.html
2021-02-13 22:19:47 +00:00