Commit Graph

293729 Commits

Author SHA1 Message Date
christos ee157e9d66 build the rest of the tools. 2021-12-29 18:13:43 +00:00
skrll 1e4e60ba8d Remove duplicate KASSERT 2021-12-29 12:53:38 +00:00
rillig d5e7b1f687 make: in irrelevant function calls in conditions, return false
When a condition contains an irrelevant function call, it doesn't matter
whether the function call evaluates to true or to false, it will be
discarded anyway by either CondParser_And or CondParser_Or.

Returning false instead of true makes the code simpler, plus it is more
common to return false for irrelevant results.

No functional change.
2021-12-29 08:23:40 +00:00
rillig dfb79a6573 make: use simpler return type for ParseWord in conditions
No functional change.
2021-12-29 08:15:45 +00:00
rillig 56ec8664b8 make: replace table for function lookup in conditions with simple code
The code for looking up the function from the table forced the compiler
to use a specific memory layout.  Replacing the table with explicit code
provides the compiler more opportunities to optimize the code.  Another
side effect is that there are fewer pointer operations.

Previously, is_token checked that the character after the word does not
continue the word, this is now done separately since for the function
lookup, this check was unnecessary.  The newly added skip_string
provides a higher abstraction level, it is no longer necessary to pass
the string length as a separate, redundant parameter.

No functional change.
2021-12-29 07:40:52 +00:00
rillig c41220df56 make: clean up condition parser
No functional change.
2021-12-29 05:16:44 +00:00
rillig 661e0bd3a7 make: merge duplicate types CondEvalResult and CondResult
No binary change.
2021-12-29 05:05:21 +00:00
rillig 6035ea7532 make: merge duplicate enum constants for CondEvalResult and CondResult
No binary change.
2021-12-29 05:01:35 +00:00
rillig 3a10c88e96 make: remove redundant parameter for evaluating conditions
No functional change.
2021-12-29 04:50:56 +00:00
rillig bcf936b8fd make: merge types CondResult and CondEvalResult
No functional change.
2021-12-29 04:41:38 +00:00
rillig 5be4420992 lint: do not output "Lint pass2:"
A colon at the end of a line requires at least 1 follow-up line, but
xlint cannot know whether lint2 will find anything to complain about.
Having a colon followed by nothing creates unnecessary confusion.
2021-12-28 22:59:56 +00:00
rillig 7e26407346 tests/lint: extend documentation for omitted braces in initializer 2021-12-28 22:54:08 +00:00
rillig 15f2f5fb32 tests/make: test function names without following '(' 2021-12-28 22:13:56 +00:00
rillig 5b6709cb7c make: fix double-free in CLEANUP mode (since 2021.12.27.23.11.55)
When make is run without the '-f' option, it searches for the files
'makefile' and 'Makefile' in the current directory.  The function
ReadFirstDefaultMakefile allocated memory for these filenames, added the
filenames to opts.makefiles and then freed the memory.  From that
moment, opts.makefiles contained dangling pointers.

The function main_CleanUp cleans the list, but only if make is compiled
with -DCLEANUP.  Since main.c 1.557 from 2021.12.27.23.11.55, the
strings in opts.makefiles are freed as well, before that, only the list
nodes were freed.  Freeing the strings led to the double-free.

Fix this bug by using a separate list for these short-lived strings.  At
the point where ReadFirstDefaultMakefile is called, opts.makefiles is
not used anymore, therefore there are no side effects.

To reproduce, run 'make test-coverage', which compiles with -DCLEANUP.
The test opt-chdir failed with a segmentation fault in main_Cleanup.
This test may be the only one that doesn't use the option '-f'.
2021-12-28 21:56:13 +00:00
rillig 6b8cc654d4 make: rename and constify SkipExtraTargets
No binary change.
2021-12-28 19:43:42 +00:00
rillig 6523598688 make: clean up function names in parse.c, remove redundant comments
No functional change.
2021-12-28 19:41:01 +00:00
christos 6e96237455 Open with non-blocking I/O and then reset the flags to avoid blocking for
FIFOs. This is a lot easier to do than adding another stat(2) to avoid open(2).
2021-12-28 19:22:58 +00:00
rillig 0332878aff make: extract the non-parsing part from ParseDependencyTargets
No functional change.
2021-12-28 19:13:40 +00:00
rillig 8eade2c2c0 make: clean up ParseDependency
No functional change.
2021-12-28 19:01:36 +00:00
rillig 0e9020d18e make: remove redundant variable in ParseDependencyTargets
The idea of that variable was to work on constant strings as far as
possible.  For now it just blew up the code unnecessarily.

No binary change.
2021-12-28 17:58:41 +00:00
riastradh 11ba2468a1 zfs: Expose hostid to zfs, as in gethostid/sethostid(3).
If set to nonzero, the hostid is recorded in the metadata of a zpool,
and checked by `zpool import' when the pool has not been explicitly
exported.  After reboot, zpool import will not need `-f' to reimport
the pool.

Setting the hostid must be done explicitly through sysctl (or the
sethostid(3) library call) on all ports except acorn32, amiga,
mvme68k, newsmips, sparc, sparc64, sun2, and sun3.  So for most users
this change will have no immediate effect.  But you can obviate the
need for `zpool import -f' by adding `kern.hostid=123456789' to
/etc/sysctl.conf and importing the pool one last time with `-f'.
2021-12-28 17:51:23 +00:00
rillig 77e13755e6 make: remove redundant parameter from ParseDependencyTargets
No functional change.
2021-12-28 17:45:56 +00:00
rillig 52b614be9e make: remove redundant parameters in dependency parsing functions
Before 2020, there had been a huge function for parsing a dependency
line, with lots of local variables that were reused for different
purposes.  When that function was split up into smaller functions, that
was done mechanically, without eliminating redundant variables.

No functional change.
2021-12-28 17:39:04 +00:00
rillig d7dc9abe90 make: remove redundant comments from ParseDependencyTargets
The large comment is already explained in the archive module.
2021-12-28 17:30:11 +00:00
christos 183d9d37ef for openldap.mk 2021-12-28 17:06:05 +00:00
christos d536862b7d Add slapd WIP. 2021-12-28 17:05:43 +00:00
christos bebb2620db remove tools support, not needed, but add the ugcendat Makefile 2021-12-28 17:05:23 +00:00
christos 53b02e147d Commit a Makefile with tools support 2021-12-28 17:04:18 +00:00
rillig 91b79ddb5a make: reduce scope of the list of wildcard target names
The list is only used when a single target name is parsed, in case the
name contains wildcards.  There is no need to keep it any longer or
reuse it.

Clean up outdated and redundant comments.

No functional change.
2021-12-28 16:59:09 +00:00
rillig 338ef15d8a make: make ParseIsEscape simpler
No functional change.
2021-12-28 16:35:43 +00:00
rillig ca9b601382 make: rename functions for handling dependency lines
The prefix 'Parse' was ambiguous since it was both the module name and a
verb.  Rename those functions that don't actually parse anything.

No functional change.
2021-12-28 16:17:54 +00:00
rillig 04775b4d02 make: make debug logging for .ORDER more human-friendly
The interesting part of the .ORDER constraint is what is made before
what, so reveal this information in the debug log.

The debug output from the test looks a bit strange since it forces
'three' to be made before 'one', but that's because the test exercises
the edge case of introducing a circular dependency.
2021-12-28 16:11:00 +00:00
christos 962d2193b3 kern.hashstat takes too long and it is meaningless here. 2021-12-28 16:06:57 +00:00
rillig e15ce18588 make: make debug logging a bit more human-friendly
The previous log format "ParseReadLine (%d): '%s'" focused on the
implementation, it was not immediately obvious to a casual reader that
the number in parentheses was the line number.  Additionally, having
both a colon and quotes in a log message is uncommon.  The quotes have
been added in parse.c 1.127 from 2007-01-01.

The new log format "Parsing line %d: %s" is meant to be easier readable
by humans.  The quotes are not needed since ParseReadLine always strips
trailing whitespace, leaving no room for ambiguities.  The other log
messages follow common punctuation rules, which makes the beginning of
the line equally unambiguous.  Before var.c 1.911 from 2021-04-05,
variable assignments were logged with the format "%s:%s = %s", without a
space after the colon.
2021-12-28 15:48:59 +00:00
rillig 4d796ef180 make: clean up variable names for parsing dependency lines
Rename 'spec' to 'special', for consistency with the previous commits.

Rename 'tOp' to 'targetAttr' since it is not an dependency operator like
':', it's an attribute like '.SILENT'.

No binary change, except for the line number of the assertion in line
1618.
2021-12-28 15:03:10 +00:00
christos 0ccef54a9a PR/56584: Andreas Gustafsson: Skip FIFO's when -D 2021-12-28 14:59:02 +00:00
rillig 48f5ae208e make: do not treat .USEBEFORE as candidate for the main target
A .USE target is not a candidate, so .USEBEFORE shouldn't either.

Since make.h 1.36 from 2001-07-03.  In that commit, OP_USEBEFORE should
have been added to OP_NOTARGET.
2021-12-28 14:22:51 +00:00
rillig 62a0c54367 make: extract OP_NOTARGET into separate function
No binary change, except for line numbers in assertions.
2021-12-28 14:06:42 +00:00
jmcneill 6225e78e6c acpi: sdhc: Ignore clkbase register if clock-frequency property is present 2021-12-28 13:41:12 +00:00
riastradh 90917aa11e kern: Show relevant variables for uidinfo counts in kasserts. 2021-12-28 13:28:24 +00:00
riastradh 29f68bc1c1 wd(4): Fix bugs in softbadsect handling.
- Don't copyout kernel virtual addresses (of SLIST entries) that
  userland won't use anyway.
  => The structure still has space for this pointer; it's just always
     null when userland gets it now.

- Don't copyout under a lock.

- Stop and return error if copyout fails (unless we've already copied
  some out).

- Don't kmem_free under a lock.

XXX Unclear whether anyone actually uses WD_SOFTBADSECT or why --
it's always been disabled by default.  Maybe we should just remove
it?
2021-12-28 13:27:32 +00:00
riastradh 6419117616 sys: Use preempt_point and preempt_needed, not open-coded versions. 2021-12-28 13:22:43 +00:00
riastradh b24dc162a1 mii(9): Fix callout race between mii_phy_down and mii_phy_detach. 2021-12-28 12:00:48 +00:00
rillig aa6b5708e5 tests/make: use tabs instead of spaces for indentation 2021-12-28 10:47:00 +00:00
msaitoh 3aac9260bd %hhx -> %x 2021-12-28 09:19:02 +00:00
msaitoh bd9af1d16f Decode link control2's Compliance Preset/De-emphasis more. Fix typo. 2021-12-28 09:16:05 +00:00
msaitoh 09ce039b20 Reduce the access of the ESSR register.
- makphyattach() have a code to detect the Fiber/Copper auto selection
   feature. Save the info to sc_flags to reduce the access
   to the ESSR register. One of the reason is that the register is not
   implemented on QEMU. Another reason is that it's not required to
   access the register if the device is in the copper only mode.
2021-12-28 06:36:29 +00:00
msaitoh 2612a28064 QEMU e1000's PHY code doesn't implement register 16. Do workaround.
- Marvell 88E1[01]11 (and many other Marvell PHYs) have the Fiber/Copper
   auto selection feature. Our makphy(4) implement it but QEMU doesn't.
   If it fails, a garbage data is used in the attach function and unexpected
   media may be used. Fix this behavior by checking the return value of
   PHY_READ(MAKPHY_ESSR). If the access failed, the media is regarded
   as copper only. It's just a cosmetic change. It's not affected to the
   packet processing.
2021-12-28 06:35:37 +00:00
msaitoh 3401d1f8f2 QEMU e1000's PHY code doesn't implement page 0 register 15. Do workaround.
- The BMSR register bit 8 (BMSR_EXTSTAT) denote the existence of page 0
   register 15. qemu's e1000 sets BMSR_EXTSTAT but the access to register 15
   fails. It doesn't conforms to the IEEE standard. Our makphy automatically
   check the existence of 1000BASE-T or 1000BASE-SX by accessing the register
   15. If the access failed, neither 1000BASE-T nor 1000BASE-SX is set to
   the ability(mii_extcapabilities). Set EXTSR_1000TFDX and EXTSR_1000THDX
   if the access failed in the attach function. It's just a cosmetic change.
   It's not affected to the packet processing.
2021-12-28 06:34:40 +00:00
rillig e6db57e4b1 make: remove redundant local variable
The variable name 'end' suggested pointing to the end of the string, but
instead it pointed to the last possible starting position of the word to
be searched.  Remove this possible misunderstanding.

No functional change.
2021-12-28 01:27:37 +00:00