Commit Graph

293706 Commits

Author SHA1 Message Date
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
rillig c604dc9b17 make: clean up stylistically
No binary change.
2021-12-28 01:20:24 +00:00
rillig f329a60c1a make: constify cached_realpath
No binary change.
2021-12-28 01:11:36 +00:00
rillig 5467d03499 tests/make: clean up after test 'opt-debug-file' 2021-12-28 01:04:03 +00:00
rillig 1ed2b64416 tests/make: document inconsistencies between '!=' and '::!='
Found while trying to make the error messages from Cmd_Exec more
detailed.
2021-12-28 00:56:16 +00:00
simonb 16ba9b01e7 In biosdisk_findpartition() check if part_name isn't NULL before
assigning *part_name.

Thanks to manu@ for the pointer.
2021-12-28 00:37:16 +00:00
simonb 314f8da246 Fix a tyop. 2021-12-28 00:34:30 +00:00
rillig 0ce8241610 make: clean up Cmd_Exec
Renaming savederr to saved_errno makes the comment redundant.

Group the conditions for setting errfmt, retaining their relative order.

No functional change.
2021-12-27 23:44:06 +00:00
rillig ca80611ac0 make: reduce indentation of Cmd_Exec
No functional change.
2021-12-27 23:19:41 +00:00
rillig 48bc374a2e make: free the names of the makefiles in cleanup mode
Since parse.c 1.576 from 2021-12-13 the filenames from opts.makefiles no
longer end up in the GNodes, they are copied by Str_Intern.
2021-12-27 23:11:55 +00:00
rillig 0b37d6eba5 make: merge local variables holding the path to the object directory
This is a similar pattern as in the other situations where a string is
fed through Var_Subst.  In this case though, the unexpanded string may
need to be freed, therefore the FStr_Done that is not needed in the
other places.

No functional change.
2021-12-27 23:06:19 +00:00
andvar c54cdfdc0c fix few typos in comments. 2021-12-27 23:04:19 +00:00
rillig e4149aebc4 make: prevent out-of-bounds read for debug log file name
Even though the name of the debug log file currently only occurs in
strings of the form '-dFname' or '-dF+name', the code for replacing '%d'
with the PID accesses the passed string out of bounds.  That's not a
problem in practice but looks suspicious anyway.
2021-12-27 22:57:26 +00:00
riastradh 4a85b256a6 cgd(4): Fix criterion for detach when wedgies are held.
The somewhat confusingly named DK_BUSY(dksc, pmask) answers the
following question:

        Suppose I hold either the character or the block device (but
        not both) of all of the partitions in pmask.  Is anyone else
        using the disk, rendering it unsafe to detach?

This is useful for ioctls like CGDIOCCLR and VNDIOCCLR, which must be
issued on open file descriptors for the disk, so the question cannot
simply be answered by testing whether dk_openmask != 0.

Instead, DK_BUSY breaks the question into the following criteria:

        1. Are there any _other_ partitions than those in pmask open
           at all?  If so, it must be someone else, since I only hold
           partitions in pmask -- hence the disk is busy.

        2. Are any of the partitions in pmask open _both_ as a block
           device _and_ as a character device?  If so, it must be
           someone else, since I only hold _either_ the character
           _or_ the block device open but not both -- hence the disk
           is busy.

When config_detach_all runs at shutdown time, it tries to detach
cgd(4), which has DVF_DETACH_SHUTDOWN; this is important so we submit
queued writes to the underlying disk and wait for them to complete
with dk_drain.

If cgd(4) has any dk wedges with file systems mounted still
configured on it, it isn't ready to detach yet.  But asking
DK_BUSY(dksc, 1 << RAW_PART) returns false, because the dk wedges
only hold RAW_PART open as a block device -- so if nobody has
RAW_PART open as a character device, or any other partitions open,
cgd_detach blithely goes on its way to forcibly detach the wedges.

Instead, ask DK_BUSY(dksc, 0), because the caller -- cgd_detach
issued by config_detach_all -- does not, in fact, hold any partitions
open, so it doesn't need to work around them like ioctl(CGDIOCCLR)
does.  Fixes hang in zfs on dk on cgd during shutdown (and probably
also zfs on cgd without any intervening dk but I haven't tested).

(This change might have the side effect that `drvctl -d cgdN' doesn't
work, but I don't care.)

XXX pullup-9
XXX pullup-8 (...-7, -6, -5...)
2021-12-27 22:57:19 +00:00
rillig 069962538c make: remove usage message if the debug file cannot be opened
Since a non-writable file is not a syntax error, there is no point in
showing the usage in this situation.  Showing the usage may have been a
copy-and-paste mistake from a few lines below, when this option was
added back in main.c 1.133 from 2006-10-15.
2021-12-27 22:22:48 +00:00
rillig 0ad1c33dcd tests/make: cover a debug log file that cannot be opened 2021-12-27 22:04:20 +00:00
rillig 9756129355 make: narrow down the return type of ReadMakefile
No functional change.
2021-12-27 21:27:25 +00:00
rillig 80048f6c39 make: rename local variables to be simpler
No binary change.
2021-12-27 21:21:17 +00:00
rillig b1c34aa60f make: clean up 'explode'
Breaking out of the first 'for' loop was unnecessarily complicated.  The
call to strlen was not necessary since f already pointed at the end of
the string.

No functional change.
2021-12-27 20:59:59 +00:00
rillig 443ab0ca6f tests/make: test MAKEFLAGS in POSIX mode
This test covers the function 'explode' in main.c, the case in which the
flags are actually expanded.
2021-12-27 20:17:35 +00:00
rillig b77845afac make: replace __func__ with actual strings
Make is supposed to be C90-compatible, and __func__ is from C99.

No functional change.
2021-12-27 19:06:07 +00:00
rillig 4e16c2d814 make: clean up comments 2021-12-27 18:54:19 +00:00
rillig 2d7f7c37dc make: remove unnecessary words from command line options
Several years ago, the command line options were individual global
variables.  The global variable could therefore not be named 'silent'
since that would have conflicted with local variables of the same name.
After moving the global variable to the namespace 'struct CmdOpts',
there is no conflict anymore.

There doesn't seem to be any risk of naming collisions for the names
'touch' and 'query'.

No functional change.
2021-12-27 18:26:22 +00:00
rillig 2a65bef432 make: rename eunlink to unlink_file
The name eunlink suggested a relation with the similarly named functions
emalloc or esnprintf, but that was misleading.  Instead, unlink_file
works like unlink, except that it refuses to remove an empty directory.

No functional change.
2021-12-27 17:18:57 +00:00