Commit Graph

264764 Commits

Author SHA1 Message Date
skrll 764b8016cd Revert the KASSERT 2019-01-22 15:02:33 +00:00
jmcneill 976227fdc9 Import dts from Linux 4.20.3 2019-01-22 14:57:01 +00:00
kre 4e25d54034 lexical analysis fixes. This fixes the tests just committed in
src/tests/bin/sh/t_here.sh

The "magicq" magic was all wrong - it cannot be simply a parameter
to readtoken1() as its value needs to alter during that routine
(eg: when magicq is set - processing here doc text, or whatever)
and we encountered ${var%pattern} "magicq" needs to be off for
"pattern" - and it wasn't.

To handle this magicq needs to be included in the token stack struct,
and simply init'd from the arg to readtoken1 (which we rename).
Then it can be manipulated as required.

Once we no longer have that problem, some other issues can be cleaned
up as well (some of this unbelievably fragile code was attempting to
cope with this in various ad-hoc - and mostly broken - ways).

Also, remove the magicq parameter from parsebackq() - it was not
used (at all) and should never be, a command substitution, wherever
it appears, always starts a new parsing context.  How that applies
to old style command substitutions is less clear, but until we see
some real examples where we're not doing the right thing (slightly
less likely now than before ... nothing has changed here in the
way command substitutions are parsed, but quoting in general is
slightly better) I don't plan on worrying about it.

There are a couple of other minor cleanups, which make no actual
difference (like adding () around the use of the parameter in the
RETURN macro ... which is generally better, but makes no difference
here as the param is always a simple constant.

All the current ATF tests pass.
2019-01-22 14:32:17 +00:00
kre 8d9df45b43 Add sub tests to the quoting test case, to demonstrate a parsing
bug (and its fix (depending upon whether the test is run against
an unfixed, or fixed, shell).

An obvious indication of the failure is the following (one of the
new sub-tests)

p=A
cat <<EOF
${p+\%$p\%}
${p+%$p%}
EOF

which should output

\%A\%
%A%


as a here doc is treated as a double quoted string, except
that the " character is just a character.  In such a string,
the \ is only an escape character when the following character
is special, otherwise it represents a literal \ (which is the
case here).

An unfixed shell will omit the backslashes in the output.

It gets even more wrong if the % chars are replaced by "
(double quote) chars, which should make no difference, other
than the corresponding change, in the output.   But doesn't
(it doesn't even produce output broken in a similar way).

This one is a harder case to be specific about however,
as while the fixed (and expected in the test) output is what
is technically correct, only a few shells actually produce
it, most generate something different (but not all the same.)
2019-01-22 14:31:53 +00:00
kre a672c6e148 NFCI - DEBUG mode only change.
Add tracing of lexical analyser operations.   This is deliberately
kept out of the normal "all on" set as it makes a *lot* of noise
when enabled (especially in verbose mode) - but when needed, it
helps (evidence for which is coming soon).

As usual, no doc, you need the sources (and of course, a specially
built sh to even be able to enable it.)
2019-01-22 13:48:28 +00:00
tron 94fb8a5b02 Fix build with "USE_SSP" set to "yes" 2019-01-22 12:45:25 +00:00
skrll e7915bf9da Fix indentation whitespace 2019-01-22 07:51:25 +00:00
skrll 26ee7ba1a4 KNF 2019-01-22 06:46:21 +00:00
skrll c83dd31736 Add a KASSERT 2019-01-22 06:42:33 +00:00
skrll 137adc2b0b Update a comment 2019-01-22 06:40:49 +00:00
skrll 4e90287f77 #ifdef DIAGNOSTIC / panic -> KASSERTMSG 2019-01-22 06:39:24 +00:00
skrll 87dfb49004 Update a comment 2019-01-22 06:38:53 +00:00
skrll a1ed3ec09d Fix two comments 2019-01-22 06:38:28 +00:00
skrll 31c3919a08 Whitespace 2019-01-22 06:37:54 +00:00
mrg 00e064adab o don't display special files in the directory index. they aren't
served, but links to them are generated.
2019-01-22 05:32:57 +00:00
kamil 82a5a0ea60 Mark traceme_vfork_crash_bus as no longer failing
Fixed in src/sys/kern/core_elf32.c r. 1.58

Closes PR lib/53343
2019-01-22 03:47:45 +00:00
kamil 90b401b1e0 Fix code generation for programs with a faulty process map
In case of any errors of scanning the segments reset
their content to a default value with zeros. This is
achieved with shortening the p_filesz parameter.

This allows to emit core(5) files for a process
regardless of its state of mappings, such as mapping
pages after EOF in a file.

Fixes PR lib/53343
2019-01-22 03:44:44 +00:00
msaitoh a5cdd4b441 Change MII PHY read/write API from:
int (*mii_readreg_t)(device_t, int, int);
	void (*mii_writereg_t)(device_t, int, int, int);
to:

	int (*mii_readreg_t)(device_t, int, int, uint16_t *);
	int (*mii_writereg_t)(device_t, int, int, uint16_t);

Now we can test if a read/write operation failed or not by the return value.

 In 802.3 spec says that the PHY shall not respond to read/write transaction
to the unimplemented register(22.2.4.3). Detecting timeout can be used to
check whether a register is implemented or not (if the register conforms to
the spec). ukphy(4) can be used this for MII_MMDACR and MII_MMDAADR.

 Note that I noticed that the following code do infinite loop in the
read/wirte function. If it accesses unimplemented PHY register, it will hang.
It should be fixed:

	arm/at91/at91emac.c
	arm/ep93xx/epe.c
	arm/omap/omapl1x_emac.c
	mips/ralink/ralink_eth.c
	arch/powerpc/booke/dev/pq3etsec.c(read)
	dev/cadence/if_cemac.c <- hkenken
	dev/ic/lan9118.c


Tested with the following device:

	axe+ukphy
	axe+rgephy
	axen+rgephy	(tested by Andrius V)
	wm+atphy
	wm+ukphy
	wm+igphy
	wm+ihphy
	wm+makphy
	sk+makphy
	sk+brgphy
	sk+gentbi
	msk+makphy
	sip+icsphy
	sip+ukphy
	re+rgephy
	bge+brgphy
	bnx+brgphy
	gsip+gphyter
	rtk+rlphy
	fxp+inphy	(tested by Andrius V)
	tlp+acphy
	ex+exphy
	epic+qsphy
	vge+ciphy	(tested by Andrius V)
	vr+ukphy	(tested by Andrius V)
	vte+ukphy	(tested by Andrius V)

Not tested (MAC):
	arm:at91emac
	arm:cemac
	arm:epe
	arm:geminigmac
	arm:enet
	arm:cpsw
	arm:emac(omac)
	arm:emac(sunxi)
	arm:npe
	evbppc:temac
	macppc:bm
	macppc:gm
	mips:aumac
	mips:ae
	mips:cnmac
	mips:reth
	mips:sbmac
	playstation2:smap
	powerpc:tsec
	powerpc:emac(ibm4xx)
	sgimips:mec
	sparc:be
	sf
	ne(ax88190, dl10019)
	awge
	ep
	gem
	hme
	smsh
	mtd
	sm
	age
	alc
	ale
	bce
	cas
	et
	jme
	lii
	nfe
	pcn
	ste
	stge
	tl
	xi
	aue
	mue
	smsc
	udav
	url

Not tested (PHY):
	amhphy
	bmtphy
	dmphy
	etphy
	glxtphy
	ikphy
	iophy
	lxtphy
	nsphyter
	pnaphy
	rdcphy
	sqphy
	tlphy
	tqphy
	urlphy
2019-01-22 03:42:24 +00:00
kamil 8059cc86d2 Fix MKCATPAGES=yes build
Register vboxvideo.0 for i386 and amd64 sets.
2019-01-22 03:11:32 +00:00
htodd 9beb80a581 EOIS, additional EOL, NRND added. 2019-01-22 01:32:30 +00:00
alnsn 3eaf14fed6 Cast register_t to uintptr_t before casting to void *.
Not sure what's going on here but evbmips64-el build fails
without this cast.
2019-01-22 01:25:53 +00:00
alnsn 11498dee00 Sync the first argument type with mco_icache_sync_range. 2019-01-22 00:36:02 +00:00
blymn 3e0ce67bf9 Fix script to use getopts instead of a hand rolled argument parser,
add option to set curses debug output file and other general fixes.
Thanks to kre@netbsd.org for comments and help with this.
2019-01-21 21:21:13 +00:00
christos 0a4f449bbb Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.
2019-01-21 21:11:54 +00:00
dholland ed814a1c48 Fix wrong scoping of {U,}LLONG_MAX. Final case, I think.
PR 53298 from Roberto E. Vargas Caballero.
2019-01-21 20:29:27 +00:00
dholland 480020cd90 Fix wrong scoping of {U,}LLONG_MAX. More cases, not just amd64.
PR 53298 from Roberto E. Vargas Caballero.
2019-01-21 20:28:17 +00:00
martin 0053548254 msg_prompt_win: if the default string fits, show it separately even
in fixed size windows. Previously it would only show up when auto-sizing
prompts figured it would fit (probably an oversight).
2019-01-21 20:28:08 +00:00
dholland 0bd4d1d80a Fix wrong scoping of {U,}LLONG_MAX.
PR 53298 from Roberto E. Vargas Caballero.
2019-01-21 20:22:48 +00:00
sevan f555b79219 Add Alfred North Whitehead quote. 2019-01-21 16:58:47 +00:00
jmcneill 918e5fb8e9 No need to specify root and console bootargs on amlogic 2019-01-21 16:28:39 +00:00
jmcneill 1b14cfdabc Auto-detect root device on Meson8b 2019-01-21 16:27:48 +00:00
kre f2dc4639fa DEBUG mode shell cleanups (NFC for any normal shell).
Add an error DEBUG trace in exraise() (when the shell has detected
some error or signal, and is aborting what it is doing)

Fix an arith error in DEBUG bit assignments (harmless as we haven't
reached the limit of flags yet), and add some missing (recently added)
debug flags so they are turned on when the user (ie: me) asks for
"everything".
2019-01-21 14:29:12 +00:00
kre 9cef82b269 Fix an amazing crazy botch (of mine) when expanding prompt strings
(PS1 etc) which, if the shell were already exiting, and a prompt
were to be expanded (which only really happens if -x is enabled,
and an exit trap is set, so the commands in the trap need PS4
expanded and written, last thing, before the shell exits) the shell
would instead simply exit when it finished expanding PS4 (before
even writing it, or the xtrace output).

There were more conditions required to set up the environment for
this to actually occur (it seems to only happen when the exit trap
is set in a function, called in a command substitution) but that's
unimportant, the code was nonsense.

Problem noticed by Martijn Dekker.

XXX pullup -8
2019-01-21 14:24:44 +00:00
kre 6b3f958390 When we are about to execute something, and the traps are invalid
(which means this is the very first execution in a new subshell)
clear the traps completely, unless the command is "trap".   We were
allowing any special builtin, which was probably harmless, but not
intended.

Also (though not required) permit "command trap" and "eval trap"
and combinations thereof, because they might be useful, and there is
no particular reason why not.   This is all a part of making t=$(trap)
work as POSIX requires, but almost nothing beyond that.  The "trap"
command must be alone (modulo eval and command) in the subshell for
the exception to apply, no t=$(trap; echo) or anything like that.

Martijn Dekker asked for "command trap" to work (no idea why though,
it converts "trap" from being a special builtin, to a normal one,
which means an error won't cause the shell to exit ... if there's
an error, the "trap" command won't do anything useful, and as we
permit no more commands (for this special treatment) the shell is
going to exit anyway, this difference is not really significant.
2019-01-21 14:18:59 +00:00
kre f499a5853f Add an explanation of the error (warning)
RANDOM initialisation failed
when the shell might print after RANDOM has been reseeded
(which includes at sh startup) the next time RANDOM is accessed.
It indicates that /dev/urandom was not available or did not
provide data - in that case, sh uses a (weak) seed made out of
the pid and time (but otherwise nothing else changes).
2019-01-21 14:09:24 +00:00
kre dd761e12dc Fix an off by one buffer length problem. Fortunately, it was off by
one in the "safe" way (it was ensuring the buffer always ended in 2 \0
characters ... one is enough.)   This could affect the expansions of
LINENO RANDOM and SECONDS, though only if they have at least 8 digits
(and then, only sometimes).   RANDOM thus is safe, as it never produces
a number with more than 5 digits, you'd need a script with 10000000
lines before there might be an issue with LINENO (and even autoconf
generated scripts don't generally get that bit) and a shell would need
to be running for almost 4 months for SECONDS to climb that high.

Nevertheless: XXX pullup -8.
2019-01-21 13:27:29 +00:00
kre 15320a4ac2 Add subtests to verify that both "sleep 0.2" and "sleep 0,2" work
when the locale is ru_RU.UTF-8 (which has ',' as its decimal radix char).
Inspired by a problem with rc.subr experiened by ru_RU.UTF-8 reported on
netbsd-users.  These are in the "fraction" test case.

While here, add some more (sub-)tests of invalid input, to make sure they
fail (in the "nonnumeric" test case), and for fun, a couple of subtests
testing hex input fractional delays (in the "hex" test case).
2019-01-21 13:19:18 +00:00
skrll d29b3aba0c Use ci_{package,core,smt}_id instead of ci_data.cpu_{package,core,smt}_id
NFC
2019-01-21 08:04:26 +00:00
skrll 539eb04e48 Make more KVA available 2019-01-21 07:49:45 +00:00
skrll 6c83fe9640 Remove redundant pmap_devmap_register(netwalker_devmap) call 2019-01-21 07:47:30 +00:00
skrll e0b64ed158 G/C 2019-01-21 07:46:40 +00:00
skrll 340a5db42f Wrong long lined comment 2019-01-21 07:46:20 +00:00
skrll ff9e533ffb Sort 2019-01-21 07:29:36 +00:00
skrll 314240bfb3 G/C 2019-01-21 07:26:14 +00:00
macallan 2b6d546e2a apply patches from PR 49639
compile tested only for lack of hardware
2019-01-21 06:23:17 +00:00
msaitoh 1f87c10270 Regen. 2019-01-21 04:15:50 +00:00
msaitoh 9c8521166f Marvell 0x4365 is 88E8070. 2019-01-21 04:15:22 +00:00
pgoyette f24c721fc4 Note that kernels with NET_MPSAFE won't work with non-NET_MPSAFE modules.
XXX The initial merge of the [pgoyette-compat] branch will NOT address
XXX this issue.
2019-01-21 02:28:25 +00:00
alnsn ee8812412f Update sljit version. 2019-01-21 01:02:50 +00:00
alnsn 8cef4130c5 Add sljit rump glue for aarch64.
XXX arm_icache_sync_range() and mips_icache_sync_range() call

	(void)rumpcomp_sync_icache((void *)va, (uint64_t)sz);

but linking fails if I do the same on aarch64 (I suspect it also
fails on 32bit arm and mips).

As a workaround, I call __builtin___clear_cache().
2019-01-21 00:30:14 +00:00