]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
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

3 years agondb/dns: mark ns record authoritative when in our area for delegation
cinap_lenrek [Sat, 17 Oct 2020 19:28:25 +0000 (21:28 +0200)]
ndb/dns: mark ns record authoritative when in our area for delegation

I have the problem that i need to delegate a subdomain
to another name server that is confused about its own zone
(and its own name) returning unusable ns records.

With this, one can make up a nameserver entry in ndb that
is authoritative and owned by us for that nameserver,
and then put it in the soa=delegated ns entry.

This promotes the ns record in the soa=delegated to
Authoritative, which avoids overriding the ns rr's from
the confused server for the delegated zone.

3 years agogames/nes: workaround for truncated chr
Sigrid [Thu, 15 Oct 2020 08:30:40 +0000 (10:30 +0200)]
games/nes: workaround for truncated chr

3 years agoip/torrent: try harder allocating ports
cinap_lenrek [Mon, 12 Oct 2020 00:03:52 +0000 (02:03 +0200)]
ip/torrent: try harder allocating ports

we used to only allocate ports from 6881 to 6890,
which limits the maximum of parallel torrents to 9.

this change make it go up to 9000, which gives us
at best 2120 ports, which is overkill but ports might
be randomly occupied by other connections.

3 years agoupas/fs: fix truncation of plumb date
cinap_lenrek [Sun, 11 Oct 2020 12:59:49 +0000 (14:59 +0200)]
upas/fs: fix truncation of plumb date

the new date format introduced by the previous commit;
using numeric timezone offsets; needs one character more,
so increase the date format buffer to 31 characters.

3 years agokernel: get rid of unused ucallocb
cinap_lenrek [Fri, 9 Oct 2020 20:05:32 +0000 (22:05 +0200)]
kernel: get rid of unused ucallocb

the whole idea of a ucallocb() is bad, as even access to the
metadata header would be in uncached memory. also, it tuns out
that it was never used by anyone.

3 years agovmx: add Kmod4
Sigrid [Fri, 9 Oct 2020 14:47:34 +0000 (16:47 +0200)]
vmx: add Kmod4

3 years agoetheriwl: add Wireless 8260 card
Ori Bernstein [Mon, 5 Oct 2020 21:10:12 +0000 (14:10 -0700)]
etheriwl: add Wireless 8260 card

After the latest tweaks to the order of operations,
the card works.

3 years agomerge
cinap_lenrek [Mon, 5 Oct 2020 20:43:25 +0000 (22:43 +0200)]
merge

3 years agoetheriwl: remove stations *after* disabling binding quotas, drain all queues in rxoff...
cinap_lenrek [Mon, 5 Oct 2020 20:42:13 +0000 (22:42 +0200)]
etheriwl: remove stations *after* disabling binding quotas, drain all queues in rxoff7000()

3 years agorio: move the code for 'send' into a function
kvik [Sun, 4 Oct 2020 20:45:22 +0000 (22:45 +0200)]
rio: move the code for 'send' into a function

Makes the code a bit nicer and allows reusing wsend() in patches.

3 years agoetheriwl: add for Intel Wireless-AC 9260
cinap_lenrek [Sun, 4 Oct 2020 19:10:53 +0000 (21:10 +0200)]
etheriwl: add for Intel Wireless-AC 9260

the 9000 series uses a new receive descriptor format
wich appears to reqire 4k aligned buffers. the old
format "halfworks" and just makes the firmware not
respond to any commands after the enable paging command.

the smartfifo command appears to causes problems.
but apparently not issuing it at all seems to work
fine on both the 8265 and 9260. so removing the code
for now.

issuing the bindingquota command before associated
makes association impossible. but enabling afterwards
works fine. (tested in 8265 and 9260).

the prph access functions now mask the address with
0xfffff. it is unclear why linux and openbsd drivers
specify addresses beyond that in ther register constants.

the timeevent change is interesting. the timeevent
needs to be restarted when it has stoped to make sure
probing/association packets are sent during the evnet.

3 years agobootrc: allow kbmap to be set via plan9.ini (thanks Aaron Bieber)
kvik [Thu, 1 Oct 2020 15:47:52 +0000 (17:47 +0200)]
bootrc: allow kbmap to be set via plan9.ini (thanks Aaron Bieber)

3 years agoacme: revert stray changes
Ori Bernstein [Tue, 29 Sep 2020 14:28:47 +0000 (07:28 -0700)]
acme: revert stray changes

forgot I had local changes when testing, re-revert scrolling.

3 years agovncv: implement rfb 3.8 protocol (thanks Iruatã)
Ori Bernstein [Sun, 27 Sep 2020 16:43:43 +0000 (09:43 -0700)]
vncv: implement rfb 3.8 protocol (thanks Iruatã)

Gnome and bhyve's VNC servers implement the RFB 3.8
protocol, so we need to support it in the client in
order to connect.

3 years agoaux/vga: eepc igfx support (thanks p.kosyh)
Ori Bernstein [Sun, 27 Sep 2020 03:47:17 +0000 (20:47 -0700)]
aux/vga: eepc igfx support (thanks p.kosyh)

This patch to makes 1024x600x32 work. Without it
only 800x600 is supported.

To load this mode, run:

aux/vga -m eeepc -l 1024x600x32

3 years agoupas: convert to tmdate, change timezone format
Ori Bernstein [Sat, 26 Sep 2020 18:20:42 +0000 (11:20 -0700)]
upas: convert to tmdate, change timezone format

Complete the conversion of upas to remove ctime,
use the new date library, and print time zones
in +hhmm format, instead of NNN format.

This may affect code that expects specific names
for timezones. Fix that code.

3 years agotmdate(1): fix missing arg, fix formatting (thanks joe9)
Ori Bernstein [Sat, 26 Sep 2020 04:22:47 +0000 (21:22 -0700)]
tmdate(1): fix missing arg, fix formatting (thanks joe9)

3 years agomerge
Ori Bernstein [Fri, 25 Sep 2020 23:51:08 +0000 (16:51 -0700)]
merge

3 years agotmdate(2): fix mistakes in prototype (thanks moody)
Ori Bernstein [Fri, 25 Sep 2020 23:32:32 +0000 (16:32 -0700)]
tmdate(2): fix mistakes in prototype (thanks moody)

3 years agoaux/acpi: connect EC region handler, fixes battery status on eeepc 1000px (thanks...
Sigrid [Fri, 25 Sep 2020 08:28:25 +0000 (10:28 +0200)]
aux/acpi: connect EC region handler, fixes battery status on eeepc 1000px (thanks Peter Kosyh)

3 years agosyscall: fix build problem caused by stale tab.h
kvik [Wed, 23 Sep 2020 15:17:52 +0000 (17:17 +0200)]
syscall: fix build problem caused by stale tab.h

Recently the script which generates tab.h and the code including it got
incompatibly changed.  People reported problems involving syntax errors
when trying to rebuild the system following a sysupdate.

The problem was with the script being embedded within a mkfile rule,
meaning that mk didn't notice it changing and therefore didn't rebuild
the target file.  For people who were rebuilding the system this meant
that the old tab.h got included, causing syntax errors.

This patch moves the codegen script into a file and tells mk about this
new dependency, so that tab.h will get rebuilt for everyone.  I also
took an opportunity to rewrite the script, hopefuly making it easier to
follow.

3 years agoftpd: handle "allo" command by treating it as a no-op
Alex Musolino [Wed, 23 Sep 2020 03:14:05 +0000 (12:44 +0930)]
ftpd: handle "allo" command by treating it as a no-op

RFC959 says:

"The ALLO command should be treated as a NOOP (no
operation) by those servers which do not require
that the maximum size of the file be declared
beforehand..."

3 years agolibc: ignore '?' in date format strings
Ori Bernstein [Wed, 23 Sep 2020 02:24:01 +0000 (19:24 -0700)]
libc: ignore '?' in date format strings

Ignoring '?' when formatting date strings allows
the format strings to be reused for parsing. This
is convenient, since we don't need to duplicate
the format strings.

3 years agolibc: make yday 0-based, as docs suggest
Ori Bernstein [Wed, 23 Sep 2020 02:21:51 +0000 (19:21 -0700)]
libc: make yday 0-based, as docs suggest

Tm.yday is docuemnted as being 0-based, and our new api
should respect that. Fix the code so that this is true.

3 years agoacme: import changes from plan9port (thanks jxy)
Ori Bernstein [Tue, 22 Sep 2020 18:42:15 +0000 (11:42 -0700)]
acme: import changes from plan9port (thanks jxy)

Import the following improvements and bugfixes from plan9port:

4650064a acme: scale window bodies on resize, not including tag space
d28913a9 acme: save/restore multiline tags in Dump/Load
d2df5d6c acme: fix crash in X |cat with multiple windows
3d6e5cb5 acme: preserve window position and selection during Get

3 years agoape/limits.h: fix typo in (U)LLONG_MAX
Ori Bernstein [Mon, 21 Sep 2020 18:43:31 +0000 (11:43 -0700)]
ape/limits.h: fix typo in (U)LLONG_MAX

Fix missing 'L' in the size suffix, so we were overflowing the
maximum size.

3 years agodiff: support unified diff via -u
Ori Bernstein [Mon, 21 Sep 2020 16:40:42 +0000 (09:40 -0700)]
diff: support unified diff via -u

The format produced by `diff -u` is inferior to that
produced by `diff -c`, but it's what ape/patch and
unix patch expect, so it's useful to generate it.

This patch adds `diff -u`.

3 years agosyscall: utility overhaul
kvik [Sun, 20 Sep 2020 12:49:12 +0000 (14:49 +0200)]
syscall: utility overhaul

Following is a list of functional changes:

* The -o flag outputs the entire buffer to the length returned
  by the syscall, or, in case of fd2path(2) and errstr(2), to '\0'.
* The -x flag is removed; the above makes it possible to pipe
  into xd(1) to get the same result.
* The -s flag uses dirfmt(2) to format the stat message, instead
  of trying to imitate ls(1).
* Stderr reports are normalized and made easier to parse.

The code also suffered a number of stylistic changes.

3 years agoupas/fs: fix handing of multi-line header fields (thanks theinicke)
Ori Bernstein [Thu, 17 Sep 2020 23:11:10 +0000 (16:11 -0700)]
upas/fs: fix handing of multi-line header fields (thanks theinicke)

Right now, upasfs exposes header lines as is, without stripping
out new lines. It also documents that it provides one header per
line in the info file.

As a result, when we get a mail with headers that span lines,
our tools get confused.

These split lines are not semantically meaningful. From RFC5322:

  2.2.3.  Long Header Fields

   Each header field is logically a single line of characters comprising
   the field name, the colon, and the field body.  For convenience
   however, and to deal with the 998/78 character limitations per line,
   the field body portion of a header field can be split into a
   multiple-line representation; this is called "folding".  The general
   rule is that wherever this specification allows for folding white
   space (not simply WSP characters), a CRLF may be inserted before any
   WSP.

As a result, to simplify processing, we should just strip out the
line separators when exposing the headers from upasfs.

3 years agoptrap: fix /env/status always being set on main process exit
BurnZeZ [Wed, 16 Sep 2020 20:45:49 +0000 (20:45 +0000)]
ptrap: fix /env/status always being set on main process exit

3 years agosyscall: don't append '\n' to the output
kvik [Wed, 16 Sep 2020 11:18:43 +0000 (13:18 +0200)]
syscall: don't append '\n' to the output

3 years agowindow: fix error exit with the -m flag
kvik [Wed, 16 Sep 2020 11:12:13 +0000 (13:12 +0200)]
window: fix error exit with the -m flag

When called with the -m flag window would always exit with
some error, usually status='no match', because of an if-match
being the last status-setting command in the script.

3 years agowin: fix window recreation command
kvik [Wed, 16 Sep 2020 10:41:24 +0000 (12:41 +0200)]
win: fix window recreation command

3 years ago/lib/rob, /lib/rsc, /lib/theo: So it sounds like everyone is in favor of the entire...
stanley lieber [Tue, 15 Sep 2020 03:10:16 +0000 (23:10 -0400)]
/lib/rob, /lib/rsc, /lib/theo: So it sounds like everyone is in favor of the entire generics proposal and all the semantics, and all we have left to hammer out is the bracket characters? Do I have that right?

3 years agomerge
cinap_lenrek [Sun, 13 Sep 2020 18:34:30 +0000 (20:34 +0200)]
merge

3 years agokernel: massive pci code rewrite
cinap_lenrek [Sun, 13 Sep 2020 18:33:17 +0000 (20:33 +0200)]
kernel: massive pci code rewrite

The new pci code is moved to port/pci.[hc] and shared by
all ports.

Each port has its own PCI controller implementation,
providing the pcicfgrw*() functions for low level pci
config space access. The locking for pcicfgrw*() is now
done by the caller (only port/pci.c).

Device drivers now need to include "../port/pci.h" in
addition to "io.h".

The new code now checks bridge windows and membars,
while enumerating the bus, giving the pc driver a chance
to re-assign them. This is needed because some UEFI
implementations fail to assign the bars for some devices,
so we need to do it outselfs. (See pcireservemem()).

While working on this, it was discovered that the pci
code assimed the smallest I/O bar size is 16 (pcibarsize()),
which is wrong. I/O bars can be as small as 4 bytes.
Bit 1 in an I/O bar is also reserved and should be masked off,
making the port mask: port = bar & ~3;

3 years agogames/4s: increase thread size (thanks majiru)
Ori Bernstein [Sun, 13 Sep 2020 18:21:21 +0000 (11:21 -0700)]
games/4s: increase thread size (thanks majiru)

It seems like on amd64, we're overflowing the stack.
Let's not do that.

3 years agofaces: remove log support
Ori Bernstein [Sun, 13 Sep 2020 00:40:41 +0000 (17:40 -0700)]
faces: remove log support

Use a damn plumber, you animals!

3 years agotmdate(1): document tz field
Ori Bernstein [Sun, 13 Sep 2020 00:36:14 +0000 (17:36 -0700)]
tmdate(1): document tz field

3 years agoctime(2), tmdate(2): document ctime/tmparse incompatibility
Ori Bernstein [Thu, 10 Sep 2020 23:26:42 +0000 (16:26 -0700)]
ctime(2), tmdate(2): document ctime/tmparse incompatibility

Tmparse and ctime don't mix. The timezone name may be
too long for the number of characters ctime mandates.
Document this footgun.

3 years agotmdate(2): one more typo
Ori Bernstein [Tue, 8 Sep 2020 02:32:50 +0000 (19:32 -0700)]
tmdate(2): one more typo

no more top arse. only bottom arse.

3 years agotmdate(2): fix examples, stale references (thanks deuteron)
Ori Bernstein [Tue, 8 Sep 2020 02:28:30 +0000 (19:28 -0700)]
tmdate(2): fix examples, stale references (thanks deuteron)

There were a number of ideas that were tried out as the tmdate
api evolved. As a result, there were some references in the
manpage to things that are no more.

Fix them.

3 years agotmdate(2): fix name of tm struct
Ori Bernstein [Tue, 8 Sep 2020 01:49:00 +0000 (18:49 -0700)]
tmdate(2): fix name of tm struct

There was a leftover from when this library was separate
with different types.

3 years agoetheriwl: add support for Intel Wireless AC 8265
cinap_lenrek [Sun, 6 Sep 2020 14:53:39 +0000 (16:53 +0200)]
etheriwl: add support for Intel Wireless AC 8265

3 years agowifi: add packet timestamping support
cinap_lenrek [Sun, 6 Sep 2020 14:51:02 +0000 (16:51 +0200)]
wifi: add packet timestamping support

3 years agowalk(1): improve wording, formatting
Ori Bernstein [Fri, 4 Sep 2020 03:07:44 +0000 (20:07 -0700)]
walk(1): improve wording, formatting

Clean up the wording of the walk(1) manpage,
improve the formatting of the format characters.

3 years agotmparse: put in local timezone hack
Ori Bernstein [Wed, 2 Sep 2020 02:32:45 +0000 (19:32 -0700)]
tmparse: put in local timezone hack

Ctime is defined as printing a 3-character timezone
name. The timezone name is ambiguous. For example,
EST refers to both Australian and American eastern
time. On top of that, we don't want to make the
tzabbrev table exhaustive. So, we put in this hack:

Before we consult the well known table of timezones,
we check if the local time matches the timezone name.

On top of that, tm2sec

If you want unambiguous timezone parsing, use numeric
timezone offsets (Z, ZZ formats).

3 years agoseconds: tolerate trailing whitespace in dates
Ori Bernstein [Wed, 2 Sep 2020 02:03:17 +0000 (19:03 -0700)]
seconds: tolerate trailing whitespace in dates

This allows handling dates with leading and trailing whitespace,
including newlines.

3 years agoupas: appendfolder() don't be picky about the timezone of ctime()
cinap_lenrek [Tue, 1 Sep 2020 21:08:58 +0000 (23:08 +0200)]
upas: appendfolder() don't be picky about the timezone of ctime()

This is temporary fix, we should try to emulate the previous
behaviour where we accept at least our local timezone, and
otherwise ignore the offset.

3 years agoupas: appendfolder(): skip the address from unix header before date
cinap_lenrek [Tue, 1 Sep 2020 21:01:45 +0000 (23:01 +0200)]
upas: appendfolder(): skip the address from unix header before date

3 years agoupas/fs: extract proper date from unix header
cinap_lenrek [Tue, 1 Sep 2020 19:39:45 +0000 (21:39 +0200)]
upas/fs: extract proper date from unix header

do not try to parse the m->unixfrom field, it only contains
the unix mail address.

instead, have parseunix() save a pointer into the unixheader
after the unix mail address for the unixdate, and later use
it to derive the mails timestamp.

3 years agoupas/fs: remove unused function date822tounix
Alex Musolino [Tue, 1 Sep 2020 12:55:06 +0000 (22:25 +0930)]
upas/fs: remove unused function date822tounix