Commit Graph

281431 Commits

Author SHA1 Message Date
christos
a9f74273b0 Add -A (noac) option to turn off the attribute cache. (Maciej W. Rozycki) 2020-10-03 18:06:37 +00:00
thorpej
806d42fb8f Add a comment describing the rpb::rpb_vptb field. 2020-10-03 17:33:23 +00:00
thorpej
ef2f8a9cde Provide an alternate delay function that uses the Qemu get-time hypercall. 2020-10-03 17:32:49 +00:00
thorpej
d0123f4cd6 Qemu loads the kernel directly, and so there's no bootloader to provide
a "bootinfo" structure for us.  Qemu does, however, place a Linux kernel
parameter block at kernel_text[] - 0x6000 that contains Linux-style kernel
command line arguments.  So, add a prom_qemu_getenv() that allows us to
look for specific things passed along to the kernel from there, and use
them as follows:

- Support specifying the root device in the forms "root=/dev/wd0a",
  "root=wd0a", or "rootdev=wd0".
- Support SRM-like -flags ... in the form of "flags=AD".  In the case of
  Qemu, we also assume that no flags=... is the same as "flags=A", i.e.
  perform an auto-boot.

Also allow an alternate delay() function to be specified, if the platform
wishes to provide one.
2020-10-03 17:31:46 +00:00
rillig
6f58a78513 make(1): add test demonstrating the Towers of Hanoi puzzle
It's not the primary task of make to handle procedure calls with
parameters, combined with lexical scoping, therefore the code does not
look as straight-forward or clean as in other programming languages.  It
feels more like squeezing a programming problem from the imperative
world into the world of declarative dependencies.

A more idiomatic way of implementing this puzzle should be as a
dependency graph since that's both the natural structure of the puzzle
and the primary domain of make.  Something like having a main target
"hanoi-5" that depends on intermediate targets of the form
"move-1.2.3.4.5-_._._._._-_._._._._", each representing a single
configuration of the stacks.  These targets could be generated
dynamically.  A benefit of this implementation would be that the puzzle
could be resumed from an arbitrary configuration, just just from the
initial configuration.
2020-10-03 17:30:54 +00:00
rillig
27ec5f2921 make(1): demonstrate naive output filtering with csh in parallel mode 2020-10-03 15:38:13 +00:00
rillig
eaf8289576 make(1): fix shell definition for csh
The bug has been there since at least 1993-03-21.  This is strong
evidence that nobody has ever used the csh in parallel mode.
2020-10-03 15:28:37 +00:00
rillig
cc4e65a520 make(1): demonstrate wrong output when using csh in parallel mode 2020-10-03 15:23:42 +00:00
rillig
53e5ff806e make(1): refine test for printing commands using csh 2020-10-03 15:21:12 +00:00
rillig
7455b57006 make(1): inline Str_FindSubstring in JobOutput 2020-10-03 15:00:57 +00:00
rillig
2a17966ff7 make(1): inline Str_FindSubstring in ModifyWord_Subst 2020-10-03 14:41:20 +00:00
rillig
227e2c03bb make(1): add tests for the various supported shells 2020-10-03 14:39:36 +00:00
christos
1f8ba1a635 Filter out the VUSECOUNT_GATE bit 2020-10-03 14:01:16 +00:00
jmcneill
ac87b8e9ad MMIO configuration space is in guest byte order. AArch64 BE is special,
as the guest starts in LE and we switch to BE after the kernel starts.
For this case, we need to byte swap all config space accesses.
2020-10-03 13:51:34 +00:00
rillig
2804d33708 make(1): replace backslash-newline with ordinary string literals
The character sequence backslash-newline is not mentioned in ISO C99.
2020-10-03 13:22:39 +00:00
rillig
36aaeb8197 make(1): allow to disable debug logging options
This is only intended for the unit tests, to selectively enable and
disable debug logging as needed.  Previously the tests for debug logging
required complicated postprocessing that was not obvious when looking at
the test .mk file alone, but was specified externally in
unit-tests/Makefile.

This is the simplest possible implementation.  Another variant would
have been to selectively disable individual debug logging options, but
that would have made the code more complicated.

The -dL option is not affected by -d0 since that is not really a debug
option, even if it is implemented as one.
2020-10-03 13:06:56 +00:00
rillig
9685dd8d18 make(1): extract ApplyModifier_Literal into separate function 2020-10-03 12:51:49 +00:00
rillig
0ff3a91bfe make(1): extract ApplyModifier_Unique into separate function 2020-10-03 12:46:52 +00:00
rillig
4ee8fe9ef2 make(1): in lint mode, reject modifiers without delimiter
The expression ${VAR:LPL} must now be written as ${VAR:L:P:L}.  The
manual page has never documented that some modifiers don't need to be
delimited by ':' and others need to.  That would have been unnecessarily
confusing anyway.
2020-10-03 12:30:17 +00:00
rillig
3b9fe6b026 make(1): add test for variable modifiers without delimiter 2020-10-03 12:26:11 +00:00
rillig
55160f6aaa make(1): ignore -env and -literal in assignments to .MAKE.EXPORTED
Previously, assigning the string "-env" to the variable .MAKE.EXPORTED
had the same effect as the .export-env directive.  This was only due to
a sloppy implementation, not by design.

For the string "-literal" and the directive .export-literal, the
situation was even worse since the actually executed code was a wild
mixture between .export and .export-literal that in the end exported the
expanded form of the variable.  Therefore there was no practical use
case of this implementation flaw.
2020-10-03 10:42:08 +00:00
rillig
94556345df make(1): do not export variable names starting with '-'
By convention, names of environment variables consist of uppercase
letters and underscores.  Most of them start with an uppercase letter.
In a few cases, the names also contain lowercase letters, such as in
http_proxy.

Variable names starting with a hyphen are confusing and might be
mistaken as command line options.  Therefore don't export these.

This also affects a few edge cases that don't occur in practice, such as
setting .MAKE.EXPORTED=-env or .MAKE.EXPORTED=-literal.  These had not
worked as expected anyway.
2020-10-03 10:31:05 +00:00
rillig
f1c1af7fec make(1): clean up confusing code in Var_Export
The generated code stays exactly the same.
2020-10-03 10:13:39 +00:00
rillig
f4ce722011 make(1): format code in arch.c 2020-10-03 10:04:34 +00:00
martin
75325bbdbe Add missing __BEGIN_DECLS/__END_DECLS to force function declarations into
the "C" namespace.
2020-10-03 09:56:00 +00:00
rillig
55fdd4871b make(1): explain the purpose of the test make-exported 2020-10-03 09:48:40 +00:00
rillig
5729ade48e make(1): add test for .export-literal 2020-10-03 09:37:04 +00:00
rillig
2090dc1c6a make(1): add test for the -dF option 2020-10-03 09:10:26 +00:00
rillig
cd39b7362f make(1): add test for the -df debug option 2020-10-03 08:29:32 +00:00
rillig
5d9145e94f make(1): add test for the -dj debug option 2020-10-03 08:16:53 +00:00
rillig
cec214a3c6 make(1): add test for the -dl command line option 2020-10-03 07:52:30 +00:00
rillig
81d3fdb276 make(1): fix indentation of code for printing enum values 2020-10-03 06:36:01 +00:00
skrll
5d0471c57b G/C 2020-10-03 05:56:26 +00:00
rillig
a2ba7e7ed3 make(1): use hash table for looking up open directories by name
As long as there are less than 20 open directories, it's perfectly fine
to use a doubly-linked list for name lookup.  A singly linked list or
even an array list would have been better, but anyway.

When the number of directories rises above 1000, which happens with
dirdeps.mk, linear list lookup becomes too expensive, especially since
each list entry is compared using a strcmp call, in a callback function
that is not inlined.

Using a hash table is much more efficient than linear lookup.  While
here, abstract all operations regarding the openDirectories list into a
new data type that provides a simple and straight-forward API.  This
strongly typed API is especially important since the current
implementation of the list and hash table is weakly typed, using void *
for the actual data, and StringList and CachedDirList refer to the
exactly same type, they just have different names to help the human
readers but don't provide any type safety.
2020-10-02 22:20:25 +00:00
rillig
6527b1ca65 make(1): add test for repeating the :L variable modifier 2020-10-02 20:48:37 +00:00
rillig
1c85acad23 make(1): add tests for parsing and exporting variables
Once again, there are a few surprises deeply hidden inside the edge
cases.
2020-10-02 20:34:59 +00:00
rillig
e2e28fa7a8 make(1): add test for the special .PATH target and variable 2020-10-02 18:46:54 +00:00
rillig
311d5aead3 make(1): in ApplyModifier_To, update pp in each branch
Before, the parsing position was updated once at the beginning, which
didn't make sense.  Updating it in each branch allows to decide for its
appropriate value in each branch individually.
2020-10-02 17:42:33 +00:00
christos
883939c9f3 undo previous for 'r' and 'e' modifiers; they should no go further than
the last '/'.
2020-10-02 17:33:13 +00:00
jmcneill
e9022974c1 Build arm64.img for aarch64eb with a LE FFS, and include GENERIC64 in
release builds.
2020-10-02 17:27:12 +00:00
rin
5daf99f3f4 Revert rev 1.5:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/fdt/dw_apb_uart.c#rev1.5

The device is capable to recognize break signal actually.
Reset cnmagic from +++++ to default.

Pointed out by jakllsch. Thanks!
2020-10-02 14:59:56 +00:00
kamil
4d7b5ca9b5 Do not assume that _lwp_getprivate() returns unbiased private pointer
Cherry-pick and adapt:

From 2a9ce60de98e53198047daaeeec3cf09ece4e693 Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski <n54@gmx.com>
Date: Fri, 2 Oct 2020 16:13:09 +0200
Subject: [PATCH] [compiler-rt] [netbsd] Improve the portability of
 ThreadSelfTlsTcb

Use __lwp_gettcb_fast() and __lwp_getprivate_fast(), as _lwp_getprivate()
can be a biased pointer and invalid for use in this function on all CPUs.
2020-10-02 14:36:54 +00:00
nia
aa47858fae xterm: Enable SIXEL graphics support.
could also enable REGIS, it will require -lm and i suppose isn't
a default upstream yet(?)

test with "-ti vt340".
2020-10-02 13:08:07 +00:00
rillig
1173b48fe5 make(1): clean up documentation of Main_ParseArgLine
The previous documentation contained lots of irrelevant implementation
details.
2020-10-01 23:52:51 +00:00
rillig
2e1094d852 make(1): add missing const for Parse_AddIncludeDir 2020-10-01 23:44:36 +00:00
rillig
63a1802d8a make(1): clean up option handling
The test for argvalue == NULL for the individual options was unnecessary
since that is already done in the common part.
2020-10-01 23:42:22 +00:00
rillig
0912219df3 make(1): format code in MainParseArgs 2020-10-01 23:28:01 +00:00
rillig
88855abb8c make(1): extract handling of the -m option into separate function 2020-10-01 23:20:48 +00:00
rillig
29ec43aa5e make(1): extract option handling for -j/-J into separate functions 2020-10-01 23:14:07 +00:00
rillig
c66c049945 make(1): extract MainParseArgChdir into separate function
This removes the struct stat from MainParseArg.
2020-10-01 23:06:56 +00:00