Commit Graph

284046 Commits

Author SHA1 Message Date
jmcneill
e7c133d3b6 Add G3 and DevSleep definitions. This changes the mask used by
SControl_IPM_NONE from 0x3 to 0x7.
2020-12-27 15:15:45 +00:00
jmcneill
d9dac464c6 AHCI 1.3.1 section 5.5.3 "Processing Completed Commands" says that we
should clear PxIS before IS.IPS.
2020-12-27 15:13:07 +00:00
rillig
565eefa2e5 make(1): remove outdated comment about string comparisons
Back in 1993, the variables in a context were stored in a linked list.
Searching such a list indeed required literally thousands of calls to
strcmp.  In make.h 1.22 from 1999-09-15, the linked list was replaced
with a hash table, requiring much fewer string comparisons.  Since then,
the rationale doesn't apply anymore.
2020-12-27 14:41:25 +00:00
rillig
8eecc3ec3e make(1): remove unnecessary VPR_ERR_SILENT 2020-12-27 14:02:12 +00:00
rillig
cd38937700 make(1): do not inspect output variables in ParseVarnameShort 2020-12-27 13:15:43 +00:00
rillig
39c946421d make(1): move error handling code out of UndefinedShortVarValue 2020-12-27 13:12:34 +00:00
jdolecek
c51d5c7f2e reduce indentation for the main processing loop in kqueue_scan(), this also
makes the code more similar to FreeBSD; NFCI

part of PR kern/50094
2020-12-27 12:45:33 +00:00
rillig
bb4b461edd make(1): exit 2 on technical errors
This allows the -q option to distinguish errors from out-of-date
targets.  Granted, it's an edge case but it should be solved
consistently anyway.

The majority of cases in which make exits with exit status 1, even in -q
mode, is when there are parse errors.  These have been kept as-is for
now as they affect many of the unit tests.

The technical errors, on the other hand, occur so rarely that it's hard
to write reliable tests for them that fail consistently on all platforms
supported by make.
2020-12-27 11:47:04 +00:00
rillig
7c7dae763b make(1): split Var_Subst into easily understandable functions
Extracting the character-level details makes the essence of Var_Subst
visible in the code, which is to iterate over the given text, handling a
few types of tokens.
2020-12-27 11:03:00 +00:00
rillig
fab83987ed make(1): clean up VarParseResult constants
The many constants were invented because at that time I didn't quite
understand the actual outcomes of Var_Parse that need to be
distinguished.  There are only a few:

(1) Errors, whether they are parse errors, or evaluation errors or
    undefined variables.  The old constants VPR_PARSE_MSG and
    VPR_UNDEF_MSG are merged into VPR_ERR.

(2) Undefined expressions in a situation in which they are allowed.
    Previously the documentation for VPR_UNDEF_SILENT talked about
    undefined expressions in situations where they were not allowed.
    That case is fully covered by VPR_ERR instead.

(3) Errors that are silently ignored.  These are probably bugs.

(4) Everything went fine, the expression has a defined value.
2020-12-27 10:53:23 +00:00
rillig
e0ea9a9396 make(1): remove unnecessary VPR_UNKNOWN for error handling
There is no sensible way for a caller of Var_Parse to deal with an error
state of "maybe successful, maybe not", therefore remove the constant
for it.
2020-12-27 10:09:53 +00:00
rillig
6c648b37ce make(1): add error handling for .for loop items
Right now, Var_Subst always returns VPR_OK, even if there had been parse
errors or evaluation errors.  If that is no longer true, the errors will
be reported properly.
2020-12-27 10:04:32 +00:00
rillig
9be4bfa647 make(1): add test for missing error handling in .for loop 2020-12-27 09:58:35 +00:00
rillig
eb9a329939 make(1): re-export variables from the actual make process
Since make uses vfork if available, re-exporting the variables happens
in the address space of the main process anyway, so there is no point in
mentioning anything about "our client process" anywhere.
2020-12-27 05:16:26 +00:00
rillig
0134a24c0d make(1): add test for expansion errors in jobs mode
Since compat mode and jobs mode are implemented separately and vary in
lots of small details, each of them needs to be tested on its own.
2020-12-27 05:11:40 +00:00
rillig
ea8c5a40a4 make(1): align names of VarExportMode with the directives 2020-12-27 05:06:17 +00:00
skrll
5db5105ca4 G/C 2020-12-26 22:28:35 +00:00
jym
a99a2d70c7 Add WayTech USB to Serial device to quirks routines, in order to prevent
uhid(4) from attaching and leave it to ugen(4) so libusb can query it.

It is used by some UPS peripherals for their management, especially the
ones from Infosec and Megatec.

Tested with Infosec E3 UPS through ups-nut-usb and `blazer_usb' driver
using the following configuration (ups.conf):

        [infosec]
                driver = blazer_usb
                port = auto
                vendorid = 0665
                productid = 5161

Make sure the associated /dev/ugenXXX is accessible to `nut' user if you
use ups-nut.
2020-12-26 22:15:37 +00:00
jym
a02c14d579 Regen. 2020-12-26 22:11:20 +00:00
jym
08c7f434ce Add WayTech Development USB to Serial product.
It is used by some UPS devices, notably Infosec and Megatec.

The vendor ID (0x0665) is known differently from various mainstream OSes;
but it is officially registered by USB-IF as `WayTech Development, Inc.'. So
be it.
2020-12-26 22:09:18 +00:00
jmcneill
174e6401e8 ahci_intr: use ffs in the port bitmask instead of looping over all 32 bits 2020-12-26 15:40:29 +00:00
gson
2e0ec785ec Disable the lib/libossaudio/t_ossaudio:oss_dsp_trigger_read test case
on sparc until PR port-sparc/55876 gets fixed.
2020-12-26 15:28:52 +00:00
nia
e5ad6630f8 Check the return value of device_lookup_private against NULL.
Reported-by: syzbot+06561ba90b6e618ce6d0@syzkaller.appspotmail.com
2020-12-26 14:50:50 +00:00
jmcneill
d90a6f1029 AHCI 1.3.1 specification says that it is good practice for system software
to 'zero-out' the memory allocated and referenced by PxCLB and PxFB.
2020-12-26 10:56:25 +00:00
nia
72eb3e2596 Avoid NULL pointer dereference, noticed by KUBSAN.
"Looks fine" roy@
2020-12-26 10:43:39 +00:00
tsutsui
ccc5c3a158 Ignore WSDISPLAYIO_PUTCMAP in WSDISPLAYIO_MODE_EMUL, i.e. text mode.
The hardware palette settings are handled by the STI ROM in STI_TEXTMODE
and changing cmap could cause mangled text colors at least on CRX on 425t.
Updating CMAP in EMUL mode isn't expected anyway.

Fixes "red or invisible text" after exiting mlterm-wscons on A1659 CRX.
2020-12-26 08:58:03 +00:00
msaitoh
e841c41c22 Copy & paste some missing part (flow director, ECC and temp sensor) from
ixgbe_msix_admin() to ixgbe_legacy_irq(). Now it's ready to make a new
function to share the common part. It'll be done in near future.
2020-12-26 06:27:38 +00:00
msaitoh
4e19a24239 Don't return in the middle of ixgbe_msix_admin() when an flow director reinit
failed. NetBSD currently doesn't support flow director, so this is not a real
bug.
2020-12-26 06:17:55 +00:00
msaitoh
83aea15efa Disable some interrupt in ixgbe_{legacy_irq,msix_admin}() to prevent log spam. 2020-12-26 06:10:17 +00:00
msaitoh
89171011d3 Disable/enable the OTHER interrupts correctly.
The OTHER interrupt was not blocked correctly when MSI-X is used.
    ixgbe.c rev. 1.260 added new mutex to avoid the race but it didn't
    disable the interrupt itself.

     Calling ixgbe_enable_intr() enables all interrupts, so it's not good to
    call it when some interrupt sources should not be enabled (e.g.:
    calling ixgbe_enable_intr() in ixgbe_handle_admin() enables queue
    interrupt).

     IXGBE_REQUEST_TASK_NEED_ACKINTR doesn't work as expected because
    ixgbe_handle_admin() can't know which task is enqueued from the
    interrupt context and can't re-enable a specific EIMS bit.

     Solve the above three problems by the following two changes:

      - MSI-X: Disable the OTHER interrupts in the biginning of
        ixgbe_msix_admin().

      - Set mask bits correctly at the end of ixgbe_legacy_irq() and
        ixgbe_msix_admin() using with eim_orig, eims_enable and eims_disable.

      - Remove IXGBE_REQUEST_TASK_NEED_ACKINTR and add
        IXGBE_REQUEST_TASK_{MOD,MSF}_WOI.
2020-12-26 06:07:16 +00:00
msaitoh
34817fabc0 Check EICR's queue bit instead of IFF_RUNNING. This change fixes a bug that
it might incorrectly enable interrupt when IFF_RUNNING is not set. It also
changes that the TX/RX is not processed if a queue interrupt isn't occurred.
2020-12-26 06:02:42 +00:00
msaitoh
b000a59fe1 Don't use "more" flag for simplify in ixgbe_legacy_irq().
No functional change intended.
2020-12-26 06:01:22 +00:00
sjg
a3aef1439d Use .MAKE.DEPENDFILE as makefiles set it 2020-12-26 03:54:48 +00:00
jmcneill
bcac45412d Always issue isb after cpacr_el1 writes since it is a context-changing
operation.
2020-12-26 00:55:26 +00:00
tsutsui
806e09ad47 Fix a longstanding bug in hilkbd (and dnkbd) console attachment.
cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.
Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.
Should be pulleld up to netbsd-8 and netbsd-9.
2020-12-26 00:16:16 +00:00
tsutsui
a0efd42a57 Use C99 designated initializers for struct consdev. 2020-12-25 21:12:15 +00:00
tsutsui
35d011b3d1 Handle WSSCREEN_REVERSE properly. Based on OpenBSD's sti(4).
Also remove WSSCREEN_UNDERLINE from capabilities that is not handled
by sti(4) ROM routines.

Tested on HP9000/425t with CRX.
2020-12-25 20:41:24 +00:00
martin
5dd83105b3 Adjust to "pool" usage in our standard ntp.conf, pointed out
by Connor McLaughlan.
2020-12-25 13:42:02 +00:00
skrll
feae5f4f22 Use designated initializers for struct ata_bustype 2020-12-25 12:33:03 +00:00
nia
479d6bd7ae Avoid potentially accessing an array with an index out of range.
Reported-by: syzbot+8832f540234b996bc5a9@syzkaller.appspotmail.com
Reported-by: syzbot+0b785dd10d987350ecb3@syzkaller.appspotmail.com
2020-12-25 10:00:40 +00:00
mlelstv
1bc006b1c2 When reading from a block device, queue parallel block requests to
fill a buffer with breadn.
2020-12-25 09:28:56 +00:00
maya
70f2b24ae4 Update to 2021, hopefully less errors made in this year. 2020-12-25 09:02:41 +00:00
skrll
768fb9809e Trailing whitespace 2020-12-25 08:57:38 +00:00
skrll
c5d8f61215 Use designated initializers for struct ata_bustype 2020-12-25 08:55:40 +00:00
dholland
5a724c86b4 List calendar's known calendars explicitly, and only install those.
Prevents build failures caused by installing editor backups and other
such silliness.
2020-12-25 07:00:52 +00:00
msaitoh
bc0a983a5e Simplify setting of EIAC register. No functional change intended. 2020-12-24 22:36:43 +00:00
msaitoh
b756d0271c Fix a bug that INTx is disabled if the INTx line is shared with other device.
ixgbe.c rev. 1.264 was not correct.

     Restore EIMS before return. To read ECIR, clearing EIMC is required for
    an errata, so
        0) save the original EIMS value
        1) clear EIMS
	2) read EICR
	3) restore with the saved value.
2020-12-24 18:32:53 +00:00
msaitoh
701a48b283 The EICR register are cleared in the beginning of the ixgbe_legacy_irq(),
so it's not required to clear each bit later in the function.
2020-12-24 15:51:33 +00:00
msaitoh
1528ff5e8a The EICR register's all OTHER interrupt bits are cleared in the beginning of
the ixgbe_msix_admin(), so it's not required to clear each bit later in the
function.
2020-12-24 15:51:04 +00:00
jmcneill
260f8c16f9 trailing whitespace 2020-12-24 14:44:49 +00:00