]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
3 years agoico: fix interpretation of 0 widths/heights
Alex Musolino [Tue, 15 Dec 2020 10:14:11 +0000 (20:44 +1030)]
ico: fix interpretation of 0 widths/heights

3 years agocwfs: fix interpretation of startdump argument
Alex Musolino [Sun, 6 Dec 2020 03:24:10 +0000 (13:54 +1030)]
cwfs: fix interpretation of startdump argument

3 years agopc/dma, pc/sdide: use uintptr for physical address instead of ulong
cinap_lenrek [Sat, 5 Dec 2020 16:01:24 +0000 (17:01 +0100)]
pc/dma, pc/sdide: use uintptr for physical address instead of ulong

3 years agopc, pc64: allocate dma bounce buffer right after xinit()
cinap_lenrek [Sat, 5 Dec 2020 15:59:30 +0000 (16:59 +0100)]
pc, pc64: allocate dma bounce buffer right after xinit()

3 years agopc, pc64: exclude memory regions with unusual MTRR cache attributes
cinap_lenrek [Sat, 5 Dec 2020 15:57:12 +0000 (16:57 +0100)]
pc, pc64: exclude memory regions with unusual MTRR cache attributes

Use the MTRR registers to exclude memory ranges that
do not have the expected cache attributes:

RAM -> writeback
UMB -> uncached
UPA -> uncached

3 years agofaces: add -c option to remove faces with button 1 click (thanks sirjofri)
Sigrid [Fri, 4 Dec 2020 08:33:55 +0000 (09:33 +0100)]
faces: add -c option to remove faces with button 1 click (thanks sirjofri)

3 years agomerge
cinap_lenrek [Tue, 1 Dec 2020 23:57:21 +0000 (00:57 +0100)]
merge

3 years agolibdraw: do not force flushimage() on freescreen()
cinap_lenrek [Tue, 1 Dec 2020 23:56:21 +0000 (00:56 +0100)]
libdraw: do not force flushimage() on freescreen()

This causes visual flashes of white in rio. If it is
really needed (it is rare) it should be done by the caller.

3 years agorio: properly restore the windows contents on /dev/mouse close
cinap_lenrek [Tue, 1 Dec 2020 23:53:58 +0000 (00:53 +0100)]
rio: properly restore the windows contents on /dev/mouse close

The previous resize optimization now means that the wfill()
is skipped on resize for libdraw programs.

So do it once /dev/mouse is closed and the window processes
the Refresh message.

3 years ago/lib/keyboard: Anführungszeichen uten (danke sirjofri)
Sigrid [Tue, 1 Dec 2020 08:23:16 +0000 (09:23 +0100)]
/lib/keyboard: Anführungszeichen uten (danke sirjofri)

3 years ago/lib/keyboard: add fingers and more arrows (thanks umbraticus)
Sigrid [Tue, 1 Dec 2020 07:44:18 +0000 (08:44 +0100)]
/lib/keyboard: add fingers and more arrows (thanks umbraticus)

3 years agoproof: don't confuse ""(1) (thanks Stuart Morrow)
Ori Bernstein [Mon, 30 Nov 2020 21:13:49 +0000 (13:13 -0800)]
proof: don't confuse ""(1) (thanks Stuart Morrow)

"" looks for patterns in the form 'prompt;' or 'prompt%',
and gets confused when proof emits 'illegal;'. This change
replaces the ';' with a ':', which both matches other
conventional error outputs and prevents "" from getting
confused.

3 years agotmdate(2): remove lies
Ori Bernstein [Mon, 30 Nov 2020 15:41:49 +0000 (07:41 -0800)]
tmdate(2): remove lies

Initially the code tried to guess the date format. This
turned out to be a bit too magical, so the feature was
removed, but the manpage still documented the nonfeature.

3 years agorio: avoid redrawing window text on resize for programs using libdraw
cinap_lenrek [Sun, 29 Nov 2020 16:51:57 +0000 (17:51 +0100)]
rio: avoid redrawing window text on resize for programs using libdraw

As long as the client as the mouse file open
and maintains reading the winname file of the window
after a resize we will avoid drawing the text frame
on a resize as it will be overdrawn by the client.

This reduces flicker on resize somewhat for slow systems.

3 years agopc, pc64, xen: rewrite interrupt handling code
cinap_lenrek [Sun, 29 Nov 2020 16:43:22 +0000 (17:43 +0100)]
pc, pc64, xen: rewrite interrupt handling code

This implements proper intrdisable() support for all
interrupt controllers.

For enable, (*arch->intrassign)(Vctl*) fills in the
Vctl.enable and Vctl.disable pointers with the
appropriate routines and returns the assigned
vector number.

Once the Vctl struct has been linked to its vector
chain, Vctl.enable(Vctl*, shared) gets called with a
flag if the vector has been already enabled (shared).

This order is important here as enabling the interrupt
on the controller before we have linked the chain can
cause spurious interrupts, expecially on mp system
where the interrupt can target a different cpu than
the caller of intrenable().

The intrdisable() case is the other way around.
We first disable the interrupt on the controller
and after that unlink the Vctl from the chain.
On a multiprocessor, the xfree() of the Vctl struct
is delayed to avoid freeing it while it is still
in use by another cpu.

The xen port now also uses pc/irq.c which has been
made generic enougth to handle xen's irq scheme.
Also, archgeneric is now a separate file to avoid
pulling in dependencies from the 8259 interrupt
controller code.

3 years agogames/mix: fix decoding of shift instructions
Alex Musolino [Sat, 28 Nov 2020 12:33:44 +0000 (23:03 +1030)]
games/mix: fix decoding of shift instructions

3 years agogames/mix: fix SLAX and SRAX instructions (thanks nicolagi)
Alex Musolino [Sat, 28 Nov 2020 12:32:28 +0000 (23:02 +1030)]
games/mix: fix SLAX and SRAX instructions (thanks nicolagi)

MIX shift instructions shift by bytes not bits.

3 years agofplot: add hyperbolic functions
Sigrid [Fri, 27 Nov 2020 09:51:16 +0000 (10:51 +0100)]
fplot: add hyperbolic functions

3 years agofplot(1): use abs()
Sigrid [Fri, 27 Nov 2020 09:35:57 +0000 (10:35 +0100)]
fplot(1): use abs()

3 years agofplot: add abs
Sigrid [Fri, 27 Nov 2020 09:34:16 +0000 (10:34 +0100)]
fplot: add abs

3 years agomerge
Alex Musolino [Fri, 27 Nov 2020 00:58:25 +0000 (11:28 +1030)]
merge

3 years agogames/mix: fix implementation of MOVE instruction (thanks nicolagi)
Alex Musolino [Fri, 27 Nov 2020 00:49:49 +0000 (11:19 +1030)]
games/mix: fix implementation of MOVE instruction (thanks nicolagi)

Plan 9 memcpy(2) uses the same implementation as memmove(2) to handle
overlapping ranges.  Hovewer, the MIX MOVE instruction, as described
in TAOCP, specifically does not do this.  It copies words one at a
time starting from the lowest address.

This change also expands the address validation to check that all
addresses within the source and destination ranges are valid before
proceeding.

3 years agokbmap/neo2: add support for neo2 kbmak (thanks jstsmthrgk)
Ori Bernstein [Thu, 26 Nov 2020 19:18:41 +0000 (11:18 -0800)]
kbmap/neo2: add support for neo2 kbmak (thanks jstsmthrgk)

3 years agoupas: fix mk nuke
Alex Musolino [Wed, 25 Nov 2020 09:24:52 +0000 (19:54 +1030)]
upas: fix mk nuke

3 years agog: fix typo in last commit
Ori Bernstein [Mon, 23 Nov 2020 01:42:25 +0000 (17:42 -0800)]
g: fix typo in last commit

3 years agoupas/*: fix mkfile issues (thanks amavect)
Ori Bernstein [Sun, 22 Nov 2020 19:36:23 +0000 (11:36 -0800)]
upas/*: fix mkfile issues (thanks amavect)

Fixes 3 issues in our upas mkfiles:
- mk/mkfile and send/mkfile were rebuilding
  only the rfc822.tab.$O, even though the
  header also needed to be rebuilt.
- CLEANFILES had a pattern that  would not
  get expanded.
- Third, ../upas/mkfile was being included
  in the wrong place and making the wrong
  rule default.

3 years agopc, pc64: move common irq handling code out of trap.c
cinap_lenrek [Sun, 22 Nov 2020 16:44:21 +0000 (17:44 +0100)]
pc, pc64: move common irq handling code out of trap.c

Move the common irq handling code out of trap.c
into pc/irq.c so that it can be shared between 386
and amd64 ports.

3 years agog: filter directory arguments
Ori Bernstein [Sun, 22 Nov 2020 05:23:46 +0000 (21:23 -0800)]
g: filter directory arguments

When searching directories recursively, it's still
desirable to filter the contents by the file pattern,
so that 'g foo /sys/src' doesn't end up searching for
foo within .$O files.

Files passed explicitly are still searched, so for the
old behavior, just use walk:

g foo `{walk -f $dir}

3 years ago9boot(8): update manual to reflect efi loader search order changes
mischief [Sat, 21 Nov 2020 22:55:33 +0000 (14:55 -0800)]
9boot(8): update manual to reflect efi loader search order changes

the efi loader now looks for plan9.ini and the kernel in the ESP
first, before looking elsewhere.

3 years agoefi: prefer plan9.ini from ESP we loaded from
mischief [Sat, 21 Nov 2020 22:18:52 +0000 (14:18 -0800)]
efi: prefer plan9.ini from ESP we loaded from

currently the EFI loader's behavior is to search all disks in a
firmware-defined order.  we search the list returned by the firmware
in reverse order in the hopes of searching the first 9FAT instead of
the ESP, but this results in unintuitive behavior when there are
multiple FAT partitions (possibly in multiple disks), such as loading
a plan9.ini and kernel from a different disk than the one you executed
the EFI loader from.

to resolve this, we change the EFI loader to instead prefer read
plan9.ini and the kernel from the same disk as the EFI loader was read
from, and then fall back to the old behavior, since the old behavior
is relied on by current installations.

3 years agodc: fix crashes with : operator (thanks istvan bak)
Ori Bernstein [Sun, 22 Nov 2020 01:56:34 +0000 (17:56 -0800)]
dc: fix crashes with : operator (thanks istvan bak)

dc crashes because a Blk* sometimes ends getting double freed.
To make it crash, any of these lines will do:
(each line is a separate input to dc):

1 sa 2 :a le d sa v :a
1 sa 2 :a le d sa :a
1 sa 2 :a le d sa c

Fix by assigning p to sptr->val before EMTPY causes a jump.

Additionally, dcgetwd() can return 0. all other uses check for
0 ptr; Also fix a buffer overflow.

3 years agoupas: make 'all' the default target
Ori Bernstein [Sun, 22 Nov 2020 00:13:20 +0000 (16:13 -0800)]
upas: make 'all' the default target

When consolidating the duplicated targets, the
one that actually got built ended up arbitrary.
Put in a 'default' target that runs 'mk all'.

3 years agopc, pc64: fix grub multiboot
cinap_lenrek [Sat, 21 Nov 2020 22:15:19 +0000 (23:15 +0100)]
pc, pc64: fix grub multiboot

It appears that our IDT overlaps with the data structures
passed from grub in multiboot load.

So defer setup of the interrupt table after the multiboot
parameters have been processed.

3 years agomerge
cinap_lenrek [Sat, 21 Nov 2020 21:04:15 +0000 (22:04 +0100)]
merge

3 years agoether8169: fix interrupt panic before init, defer initialization until attach
cinap_lenrek [Sat, 21 Nov 2020 21:03:13 +0000 (22:03 +0100)]
ether8169: fix interrupt panic before init, defer initialization until attach

The driver used to register the interrupt handler just
after reset, tho the Ctlr struct, including the buffer
descriptor arrays where only allocated on attach.

This moves most of the reset/init out of pnp
function and into attach. This also means we can
error out and even retry on the next attach.

The logic of the reseter kproc has been changed:
now it is only started once the first initialization
completely succeeded. This avoids the strange qlock
passing.

Implement a shutdown function so the device gets
halted for /dev/reboot.

Assume 64 bit physical addresses for dma.

Check that pci bar0 is actually I/O.

3 years agopc, pc64: implement disabling of msi interrupts
cinap_lenrek [Sat, 21 Nov 2020 20:48:25 +0000 (21:48 +0100)]
pc, pc64: implement disabling of msi interrupts

3 years agonusb/kb, nusb/joy: dont try to set protocol on nonboot devices
mischief [Sat, 21 Nov 2020 20:31:54 +0000 (12:31 -0800)]
nusb/kb, nusb/joy: dont try to set protocol on nonboot devices

the hid 1.11 specification says that for hid devices which arent in
the boot subclass (subclass 1), it is only optional to support the set
protocol command.  for my devices, trying to set protocol results in a
stall error and unusable devices.

fixes my Tex Shinobi keyboard and Playstation 4 controller.

3 years agopc, pc64: new MTRR code supporting AMD TOM2 MSR and fixed mtrr ranges
cinap_lenrek [Sat, 21 Nov 2020 15:26:46 +0000 (16:26 +0100)]
pc, pc64: new MTRR code supporting AMD TOM2 MSR and fixed mtrr ranges

The new MTRR code handles overlapping ranges
and supports AMD specific TOM2 MSR.

The format in /dev/archctl now only shows
the effective cache ranges only, without
exposing the low level registers.

3 years agopc, pc64: disable all pci devices for /dev/reboot
cinap_lenrek [Sat, 21 Nov 2020 15:17:20 +0000 (16:17 +0100)]
pc, pc64: disable all pci devices for /dev/reboot

Make sure all pci busmaster activity is disabled,
including MSI/MSI-X interrupts, before switching
control to the new kernel.

3 years agopc, pc64: disable all pci devices in pcicfginit()
cinap_lenrek [Sat, 21 Nov 2020 15:10:56 +0000 (16:10 +0100)]
pc, pc64: disable all pci devices in pcicfginit()

Make sure all pci busmaster activity is disabled,
including MSI/MSI-X interrupts. Drivers will later
reenable once taking control of a device.

3 years agokernel: add portable pcimsienable()/pcimsidisable(), disable MSI/MSI-X on pcidisable...
cinap_lenrek [Sat, 21 Nov 2020 15:02:21 +0000 (16:02 +0100)]
kernel: add portable pcimsienable()/pcimsidisable(), disable MSI/MSI-X on pcidisable()/pcireset()

This avoids some duplication in the pci support code and
allows pcireset() to diable MSI and MSI-X interrupts
when disabling or reseting a device.

3 years agoetherm10g: remove duplicated pci capability enum
cinap_lenrek [Fri, 20 Nov 2020 23:45:44 +0000 (00:45 +0100)]
etherm10g: remove duplicated pci capability enum

3 years agokernel: remove unused pcinextcap() function
cinap_lenrek [Fri, 20 Nov 2020 23:41:57 +0000 (00:41 +0100)]
kernel: remove unused pcinextcap() function

3 years agopc/l.s: remove unsued m0gdtptr/m0idtptr structs
cinap_lenrek [Fri, 20 Nov 2020 23:06:55 +0000 (00:06 +0100)]
pc/l.s: remove unsued m0gdtptr/m0idtptr structs

3 years agoawk: fix truncated input after fflush
Anthony Martin [Fri, 20 Nov 2020 07:05:26 +0000 (23:05 -0800)]
awk: fix truncated input after fflush

Before the "native" awk work, a call to the fflush function resulted
in one or more calls to the APE fflush(2).

Calling fflush on a stream open for reading has different behavior
based on the environment: within APE, it's a no-op¹; on OpenBSD, it's
an error²; in musl, it depends on whether or not the underlying file
descriptor is seekable³; etc. I'm sure glibc is subtly different.

Now that awk uses libbio, things are different: calling Bflush(2) on a
file open for reading simply discards any data in the buffer. This
explains why we're seeing truncated input. When awk attempts to read
in the next record, there's nothing in the buffer and no more data to
read so it gets EOF and exits normally. Note that this behavior is not
documented in bio(2). It was added in the second edition but I haven't
figured out why or what depends on it.

The simple fix is to have awk only call Bflush on files that were
opened for writing. You could argue that this is the only correct
behavior according to the awk(1) manual and it is, in fact, how GNU
awk behaves⁴.

1. /sys/src/ape/lib/ap/stdio/fflush.c
2. https://cvsweb.openbsd.org/src/lib/libc/stdio/fflush.c?rev=1.9
3. https://git.musl-libc.org/cgit/musl/tree/src/stdio/fflush.c
4. https://git.savannah.gnu.org/cgit/gawk.git/tree/io.c#n1492

3 years agotmdate(2): failed to (p)arse
Sigrid [Wed, 18 Nov 2020 19:14:26 +0000 (20:14 +0100)]
tmdate(2): failed to (p)arse

3 years agoctime(2): add tmdate(2) to "see also"
Sigrid [Wed, 18 Nov 2020 19:11:55 +0000 (20:11 +0100)]
ctime(2): add tmdate(2) to "see also"

3 years agoupas/*: cleanup mkfiles (thanks amavect)
Ori Bernstein [Wed, 18 Nov 2020 02:37:38 +0000 (18:37 -0800)]
upas/*: cleanup mkfiles (thanks amavect)

Changeset 50ad211fb12f broke the libcommon rule in
mkupas. Deleting the 'mk clean' in the recipe fixes
this.

Cleanup includes deleting UPDATE vars from all mkfiles,
reorganization of vars in TARG,LIB,OFILE,HFILE order,
and deletion of extra vars used for UPDATE.

3 years agopc, pc64: load idt early in trapinit0()
cinap_lenrek [Tue, 17 Nov 2020 22:30:09 +0000 (23:30 +0100)]
pc, pc64: load idt early in trapinit0()

loading the interrupt vector table early allows
us to handle traps during bootup before mmuinit()
which gives better diagnostics for debugging.

we also can handle general protection fault on
rdmsr() and wrmsr() which helps during
cpuidentify() and archinit() when probing for
cpu features.

3 years agopc/l.s: load virtual gdt pointer after mmu switch
cinap_lenrek [Tue, 17 Nov 2020 22:18:08 +0000 (23:18 +0100)]
pc/l.s: load virtual gdt pointer after mmu switch

before removing the double map at 0, load our
initial gdt pointer with its new KZERO based
virtual address.

this is prerequisite for handling traps early during
bootup before mmuinit() loads the final gdt.

3 years agonusb/cam: don't videoclose() when open failed
cinap_lenrek [Mon, 16 Nov 2020 18:56:13 +0000 (19:56 +0100)]
nusb/cam: don't videoclose() when open failed

The fsdestroyfid() is called regardless if the open succeeded
or failed. This causes erroneous videoclose() when opening
the frame or video file while the camera is active.

3 years agodiff: fix change marker for -c mode
kvik [Mon, 16 Nov 2020 18:19:37 +0000 (19:19 +0100)]
diff: fix change marker for -c mode

3 years agoptrap: fail if invoked with no arguments
kvik [Mon, 16 Nov 2020 10:45:05 +0000 (11:45 +0100)]
ptrap: fail if invoked with no arguments

3 years agoaux/cpuid: fix final newline on printbits()
cinap_lenrek [Sun, 15 Nov 2020 21:47:45 +0000 (22:47 +0100)]
aux/cpuid: fix final newline on printbits()

3 years agoetheriwl: bring back recovery on flushq timeout
cinap_lenrek [Sun, 15 Nov 2020 13:54:09 +0000 (14:54 +0100)]
etheriwl: bring back recovery on flushq timeout

3 years agoaudiohda: do not enable interrupts before intrenable()
cinap_lenrek [Sun, 15 Nov 2020 13:34:17 +0000 (14:34 +0100)]
audiohda: do not enable interrupts before intrenable()

When using /dev/reboot, the MSI vecor might have already
been setup causing interrupts to fire on the designated
cpu while we send the commands to the card.

3 years agoaudiohda: reset irbsts bits in hdainterrupt() (thanks LordCreepity)
cinap_lenrek [Tue, 10 Nov 2020 23:55:53 +0000 (00:55 +0100)]
audiohda: reset irbsts bits in hdainterrupt() (thanks LordCreepity)

reseting irbsts bits in hdacmd() only works
while interrupts are disabled during hdareset().
once interrupts are enabled we need to reset the
irbsts bits in the interrupt handler or else the
interrupt never clears and locks up the system.

3 years agoimap4d: imap4date should ignore time and timezone (RFC3501, 6.4.4)
Ori Bernstein [Sun, 8 Nov 2020 22:21:14 +0000 (14:21 -0800)]
imap4d: imap4date should ignore time and timezone (RFC3501, 6.4.4)

3 years agopop3(1): write options consistently
Ori Bernstein [Sun, 8 Nov 2020 17:34:39 +0000 (09:34 -0800)]
pop3(1): write options consistently

The pop3 options were prefixed with a '-'; the
imap4d options were not. Proofreading, foolks.

3 years agoupas/marshal: add -S saveto to save outgoing mail, fix -F
Ori Bernstein [Sat, 7 Nov 2020 02:15:15 +0000 (18:15 -0800)]
upas/marshal: add -S saveto to save outgoing mail, fix -F

Upas/marshal -F was broken with the '-8' command, and silly
without it: It used aliases passed on the command line, so
the destination address was ignored with -8 was passed.

In addition, it would create a new mailbox for any aliases
being sent to, instead of putting them all in one location.

The new -S option is similar to -F, but specifies where the
message should go.

3 years agomerge
cinap_lenrek [Wed, 4 Nov 2020 22:09:47 +0000 (23:09 +0100)]
merge

3 years agopc/pc64: fix faulty mtrr slot reuse (thanks Fulton)
cinap_lenrek [Wed, 4 Nov 2020 22:08:52 +0000 (23:08 +0100)]
pc/pc64: fix faulty mtrr slot reuse (thanks Fulton)

The change 3306:c5cf77167bfe made the code reuse MTRR slots
of the default memory type.

But this did not take overlapping ranges into account!

If two or more variable-range MTRRs overlap, the following rules apply:

a. If the memory types are identical, then that memory type is used.
b. If at least one of the memory types is UC, then UC memory type is used.
c. If at least of of the memory types is WT. and the only other memory type
is WB, then th WT memory type is used.
d. If the combination of memory types is not listed above,
then the memory type used in undefined.

It so happend that on a Dell Latitude E7450 that the BIOS defines
the default type as UC. and the first slot defines a 16GB range
of type WB. Then the rest of the ranges mark the PCI space back
as UC, but overlapping the first WB range! This works because
of rule (B) above.

When trying to make the framebuffer write-combining, we would
falsely reuse one of the UC sub-ranges and making the UC memory
into WB as a side effect.

Thanks to Fulton for his patience and providing debug logs and
doing experiments for us to narrow the problem down.

3 years agomerge
cinap_lenrek [Tue, 3 Nov 2020 19:47:14 +0000 (20:47 +0100)]
merge

3 years agopc, pc64: allocate i/o port space for unassigned pci bars, move ioalloc() to port...
cinap_lenrek [Tue, 3 Nov 2020 19:46:09 +0000 (20:46 +0100)]
pc, pc64: allocate i/o port space for unassigned pci bars, move ioalloc() to port/iomap.c

With some newer UEFI firmware, not all pci bars get
programmed and we have to assign them ourselfs.

This was already done for memory bars. This change
adds the same for i/o port space, by providing a
ioreservewin() function which can be used to allocate
port space within the parent pci-pci bridge window.

Also, the pci code now allocates the pci config
space i/o ports 0xCF8/0xCFC so userspace needs to
use devpnp to access pci config space now. (see
latest realemu change).

Also, this moves the ioalloc()/iofree() code out
of devarch into port/iomap.c as it can be shared
with the ppc mtx kernel.

3 years agoupas/common: delete library on 'mk clean'
Ori Bernstein [Mon, 2 Nov 2020 21:12:34 +0000 (13:12 -0800)]
upas/common: delete library on 'mk clean'

libcommon.a$O doesn't end with a .a, so mk
doesn't know how to look inside it in order
to check if the files are up to date.

This means that when 'mk clean' is run,
libcommon.a$O looks up to date:

% mk clean
...
% mk
mk: 'default' is up to date

Deleting the library works around this problem.

3 years agomtx: fix pci access routines (see changeset 8012:78891f472fbf)
cinap_lenrek [Mon, 2 Nov 2020 19:53:20 +0000 (20:53 +0100)]
mtx: fix pci access routines (see changeset 8012:78891f472fbf)

3 years agoprofile: don't create $wsys if it doesn't exist
Ori Bernstein [Mon, 2 Nov 2020 16:29:05 +0000 (08:29 -0800)]
profile: don't create $wsys if it doesn't exist

When $wsys doesn't exist (eg, drawterm -G, or
rcpu from a text console), the profile would
create an empty $wsys variable, and sessions
started in this environment would fail with a
null list in concatenation.

This change tests if /mnt/term/env/wsys exists
before assigning it.

3 years agoaudio/wavdec: add -s option
Sigrid [Mon, 2 Nov 2020 10:46:50 +0000 (11:46 +0100)]
audio/wavdec: add -s option

3 years agoaux/realemu: use #$/pci/B.D.Fraw to access pci config space
cinap_lenrek [Mon, 2 Nov 2020 00:14:30 +0000 (01:14 +0100)]
aux/realemu: use #$/pci/B.D.Fraw to access pci config space

This prevents VESA bios from accessing the pci
CONFIG_ADDRESS/CONFIG_DATA registers (0xCF8/0xCFC)
directly to access pci config space.

This makes sure the access to pci config space is
properly serialized by the kernel.

3 years agovmx: mask out bits 0:2 and 24:30 of pci CONFIG_ADDRESS on read
cinap_lenrek [Mon, 2 Nov 2020 00:01:48 +0000 (01:01 +0100)]
vmx: mask out bits 0:2 and 24:30 of pci CONFIG_ADDRESS on read

These bits are reserved, and by the specification,
must return zero on read.

This is also used by plan 9 for detecting config mode #1.

3 years agorc: show line numbers on error
Ori Bernstein [Sun, 1 Nov 2020 19:56:26 +0000 (11:56 -0800)]
rc: show line numbers on error

This change provides a location for errors
like 'null list in concatenation'.

3 years agolibbio: add aux pointer to bio
Ori Bernstein [Sun, 1 Nov 2020 19:42:54 +0000 (11:42 -0800)]
libbio: add aux pointer to bio

This allows us to attach additional context
to the biobuf so can read from some sort of
data structure without a global variable.

3 years agolibc: recurse on smaller half of array
Ori Bernstein [Sun, 1 Nov 2020 19:23:39 +0000 (11:23 -0800)]
libc: recurse on smaller half of array

Our qsort has an optimization to recurse on one
half of the array, and do a tail call on the other
half. Unfortunately, the condition deciding which
half of the array to recurse on was wrong, so we
were recursing on the larger half of the array and
iterating on the smaller half.

This meant that if we picked the partition poorly,
we were pessimizing our stack usage instead of
optimizing it.

This change reduces our stack usage from O(n)
to O(log(n)) for poorly chosen pivots.

3 years agojpg: treat EOF as EOI marker
Alex Musolino [Sat, 31 Oct 2020 05:14:49 +0000 (15:44 +1030)]
jpg: treat EOF as EOI marker

Some jpegs, rightly or wrongly, do not contain an EOI marker.  This
causes jpg(1) to bail out even after correctly parsing the entire
image.

3 years agovt: improve behavior of chording
Ori Bernstein [Fri, 30 Oct 2020 20:23:16 +0000 (13:23 -0700)]
vt: improve behavior of chording

vt chording behaves slightly differently from other
applications: a chord must be fully released before
the next chord can be applied. This makes any change
in chord apply the action.

3 years agoip/cifsd: fix missing int return type for vpack() (thanks pr)
cinap_lenrek [Thu, 29 Oct 2020 17:26:35 +0000 (18:26 +0100)]
ip/cifsd: fix missing int return type for vpack() (thanks pr)

3 years agoaux/cpuid: decode leaf 7; extend leaf 13 decoding
Sigrid [Thu, 29 Oct 2020 10:27:26 +0000 (11:27 +0100)]
aux/cpuid: decode leaf 7; extend leaf 13 decoding

3 years agoaudiohda: make it work with qemu (thanks mischief)
cinap_lenrek [Tue, 27 Oct 2020 14:16:03 +0000 (15:16 +0100)]
audiohda: make it work with qemu (thanks mischief)

the driver was not using irb interrupts
and was just polling the irb write pointer
to wait for command completion.

this is not supported by qemu.

qemu requires the use of irb interrupt handshake
and it refuses to accept the next command until we
acknowledge the irb interrupt.

3 years agoip/tinc: fix reportedge()
cinap_lenrek [Sun, 25 Oct 2020 21:27:30 +0000 (22:27 +0100)]
ip/tinc: fix reportedge()

supplying a non-ip address in ADD_EDGE crashes the unix tincd.

the reason was that we where misreporting ADD_EDGE messages;
ignoring the information from our peers; and always supplying
the Address string from our configuration instead of the
connections ip address.

now we just report the edge information as is.

3 years agomp(2): correct documentation of error handling (thanks LordCreepity)
Ori Bernstein [Sun, 25 Oct 2020 00:24:59 +0000 (17:24 -0700)]
mp(2): correct documentation of error handling (thanks LordCreepity)

The documentation for mp(2) claimed we'd return nil on error, when
we actually sysfatal. This corrects the documentation to match our
actual behavior.

3 years agokbmap: add latvian keymap (thanks freddy)
cinap_lenrek [Sat, 24 Oct 2020 22:49:29 +0000 (00:49 +0200)]
kbmap: add latvian keymap (thanks freddy)

3 years agokbmap: add croatian kbmap (thanks skerbergs)
cinap_lenrek [Sat, 24 Oct 2020 22:46:56 +0000 (00:46 +0200)]
kbmap: add croatian kbmap (thanks skerbergs)

3 years agonewuser(8): fix reference to incorrect file server console command
Alex Musolino [Fri, 23 Oct 2020 07:21:03 +0000 (17:51 +1030)]
newuser(8): fix reference to incorrect file server console command

3 years agovmx/vga: fix allocimage leaks
Sigrid [Thu, 22 Oct 2020 22:16:47 +0000 (00:16 +0200)]
vmx/vga: fix allocimage leaks

3 years agoupas/fs/mbox.c: fix cosmetic typo
khm [Thu, 22 Oct 2020 20:46:00 +0000 (13:46 -0700)]
upas/fs/mbox.c:  fix cosmetic typo

3 years agolibaml: add (nop) "signal" op
Sigrid [Wed, 21 Oct 2020 10:06:25 +0000 (12:06 +0200)]
libaml: add (nop) "signal" op

3 years agovncv: pick an auth type that we support
Ori Bernstein [Mon, 19 Oct 2020 02:30:14 +0000 (19:30 -0700)]
vncv: pick an auth type that we support

We used to pick the highest auth type regardless of whether
we supported it. Now we filter down to types that we support.

3 years agosdiahci: accept AHCI controllers from ASMedia vendor id (thanks mischief)
cinap_lenrek [Sun, 18 Oct 2020 23:20:29 +0000 (01:20 +0200)]
sdiahci: accept AHCI controllers from ASMedia vendor id (thanks mischief)

3 years agopc, pc64: remove mystery "type" bits in pcicfgrw*raw() (fixes qemu, thanks mischief)
cinap_lenrek [Sun, 18 Oct 2020 21:39:07 +0000 (23:39 +0200)]
pc, pc64: remove mystery "type" bits in pcicfgrw*raw() (fixes qemu, thanks mischief)

the access functions for pci config space in config mode #1
used to set bit 0 in the register offset if the access was
to a device on any bus different from 0.

it is completely unclear why this was done and i can't find
any documentation on this.

but for sure, this breaks all pci config spacess access to
pci devices behind a bridge on qemu. with -trace pci* it
was discovered that all config space register offsets on
devies behind pci brige where off by one.

on real hardware, setting bit 0 in the offset doesnt appear
to be an issue.

thanks mischief for reporting and providing a qemu demo
configuration to reproduce the problem.

3 years agosdnvme: use PCIWADDR() instead of PADDR()
cinap_lenrek [Sun, 18 Oct 2020 15:02:42 +0000 (17:02 +0200)]
sdnvme: use PCIWADDR() instead of PADDR()

3 years agoetherbcm: handle 64-bit host addresses, use PCIWADDR() instead of PADDR()
cinap_lenrek [Sun, 18 Oct 2020 15:01:50 +0000 (17:01 +0200)]
etherbcm: handle 64-bit host addresses, use PCIWADDR() instead of PADDR()

3 years agoaudiohda: use PCIWADDR() instead of PADDR(), handle 64-bit dma addresses
cinap_lenrek [Sun, 18 Oct 2020 15:00:04 +0000 (17:00 +0200)]
audiohda: use PCIWADDR() instead of PADDR(), handle 64-bit dma addresses

3 years agoetheriwl: delay before crystal calibration
Ori Bernstein [Sun, 18 Oct 2020 14:50:07 +0000 (10:50 -0400)]
etheriwl: delay before crystal calibration

On my 6235 card, if we calibrate the crystal
immediately after disabling wimax, the the
firmware gets unhappy. A short nap before
sending the command prevents the command from
timing out.

3 years agonusb/serial: add ids for FT230X (thanks mischief)
Ori Bernstein [Sun, 18 Oct 2020 02:27:21 +0000 (19:27 -0700)]
nusb/serial: add ids for FT230X (thanks mischief)

3 years agomerge
Ori Bernstein [Sun, 18 Oct 2020 02:04:17 +0000 (19:04 -0700)]
merge

3 years agoupas: fix appendfolder timestamps (thanks umbraticus)
Ori Bernstein [Sun, 18 Oct 2020 01:59:36 +0000 (18:59 -0700)]
upas: fix appendfolder timestamps (thanks umbraticus)

When moving messages between folders, mbappend,
deliver, and nedmail were trying to parse the
timestamp ouut of the message. They were doing
it incorrectly, trying to include the user name
as part of the date format.

Change to pass just the date to the date parser.

3 years agoetheriwl: don't break controller on command flush timeout
cinap_lenrek [Sun, 18 Oct 2020 01:05:35 +0000 (03:05 +0200)]
etheriwl: don't break controller on command flush timeout

ori and echoline are reporting regression on some 6000 cards;
which sometimes time out on crystal calibration command;
which is expected by the driver. but the new code used
to force a device reset on any command timeout.

reverting to old behaviour until for now until we have
a chance investigating.

3 years agosdnvme: handle machines with more cpu's than submit queues (thanks mischief)
cinap_lenrek [Sun, 18 Oct 2020 00:51:32 +0000 (02:51 +0200)]
sdnvme: handle machines with more cpu's than submit queues (thanks mischief)

We used to assume a 1:1 pairing of processors to submit queues.
With recent machines, we now got more cpu cores than what some
nvme drives support so we need to distribute the queues across
these cpu's which requires locking on command submission.

There is a feature get/set command to probe the number of submit
and completion queues, but we decided to just handling
submission queue create command error gracefully as it is simpler
and has less chance of regression with existing setups.

Thanks to mischief for investigating and writing the code.

3 years agomerge
cinap_lenrek [Sat, 17 Oct 2020 19:30:10 +0000 (21:30 +0200)]
merge

3 years agondb/dnsdebug: add -c flag to debug caching dns server behaviour
cinap_lenrek [Sat, 17 Oct 2020 19:28:56 +0000 (21:28 +0200)]
ndb/dnsdebug: add -c flag to debug caching dns server behaviour