]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
3 years agotm2sec: clear new fields in tm
Ori Bernstein [Mon, 24 Aug 2020 21:47:10 +0000 (14:47 -0700)]
tm2sec: clear new fields in tm

Old users of the time APIs would hand-craft
time structs without first zeroing all the
members. When this got into tmnorm(), we
would try to access the new members, and
things would go off the rails.

This makes tm2sec() clear the new fields
before passing them to the new APIs, so
that the hand-crafted structs remain
valid.

3 years agonusb/lib: use fmtprint for the entire dump to be printed out
Sigrid [Sun, 23 Aug 2020 10:14:32 +0000 (12:14 +0200)]
nusb/lib: use fmtprint for the entire dump to be printed out

3 years agokernel: fix Abind cyclic reference and mounthead leaks (thanks Alex Musolino)
cinap_lenrek [Sun, 23 Aug 2020 03:07:30 +0000 (05:07 +0200)]
kernel: fix Abind cyclic reference and mounthead leaks (thanks Alex Musolino)

The Abind case in namec() needs to cunique() the chan
before attaching the umh mount head pointer onto it.

This is because we cannot give a reference to the mount
head to any of the mh->mount...->to channels, as they
will never go away until the mount head goes away.
This is a cyclic reference.

This could be reproduced with:

@{rfork n; mount -a '#s/boot' /mnt/root; bind /mnt/root /}

Also, fix memory leaks around cunique(), which can
error, leaking the mount head we got from domount().

Move the umh != nil check inside cunique().

3 years agotorrent(1): update url in examples section
Alex Musolino [Fri, 21 Aug 2020 00:36:22 +0000 (10:06 +0930)]
torrent(1): update url in examples section

3 years agoip(3): fix typo in manpage (thanks jstsmthrgk)
Ori Bernstein [Thu, 20 Aug 2020 20:25:37 +0000 (13:25 -0700)]
ip(3): fix typo in manpage (thanks jstsmthrgk)

3 years agolibaml: fix fault when the second operand of comparison cannot be converted
Sigrid [Thu, 20 Aug 2020 06:28:24 +0000 (08:28 +0200)]
libaml: fix fault when the second operand of comparison cannot be converted

3 years agooggdec: give it enough chance to seek from the start, where first seek might be still...
Sigrid [Tue, 18 Aug 2020 14:45:00 +0000 (16:45 +0200)]
oggdec: give it enough chance to seek from the start, where first seek might be still too close to the beginning of the file

3 years agoaudio/oggdec: allow -s 0
Sigrid [Wed, 12 Aug 2020 20:26:06 +0000 (22:26 +0200)]
audio/oggdec: allow -s 0

3 years agoaudio/mp3dec: mad timer duration is all wrong, use samples instead
Sigrid [Wed, 12 Aug 2020 09:42:00 +0000 (11:42 +0200)]
audio/mp3dec: mad timer duration is all wrong, use samples instead

3 years agoaudio/mp3dec: add -s SECONDS option
Sigrid [Wed, 12 Aug 2020 08:43:46 +0000 (10:43 +0200)]
audio/mp3dec: add -s SECONDS option

3 years agoaudio(1): add new -s SECONDS option
Sigrid [Tue, 11 Aug 2020 15:27:11 +0000 (17:27 +0200)]
audio(1): add new -s SECONDS option

3 years agoaudio/oggdec: add -s SECONDS option to seek before decoding
Sigrid [Tue, 11 Aug 2020 15:26:33 +0000 (17:26 +0200)]
audio/oggdec: add -s SECONDS option to seek before decoding

3 years agoaudio/flacdec: add -s SECONDS option to seek before decoding
Sigrid [Tue, 11 Aug 2020 15:25:53 +0000 (17:25 +0200)]
audio/flacdec: add -s SECONDS option to seek before decoding

3 years agotmdate(2): fix typo (thanks mveety)
Ori Bernstein [Tue, 11 Aug 2020 03:33:39 +0000 (20:33 -0700)]
tmdate(2): fix typo (thanks mveety)

sysfata => sysfatal

3 years agostdio.h: correct return type of putc
Ori Bernstein [Tue, 11 Aug 2020 02:36:09 +0000 (19:36 -0700)]
stdio.h: correct return type of putc

The putc macro is specified as returning an int, but our
type conversion rules turned it into a uint. Put in the
appropriate cast to make the type what we want.

3 years agoaux/ms2, aux/na: fix warnings
Ori Bernstein [Tue, 11 Aug 2020 02:35:05 +0000 (19:35 -0700)]
aux/ms2, aux/na: fix warnings

aux/na was comparing the return of putc with <0, when it should
have been comparing against EOF, which is not specified as -ve.

aux/ms2 was zero-extending the mask for the address when it
should have been sign extended.

3 years agoseconds: use new libc date api
Ori Bernstein [Tue, 11 Aug 2020 02:02:09 +0000 (19:02 -0700)]
seconds: use new libc date api

3 years agodate: use new libc date apis.
Ori Bernstein [Tue, 11 Aug 2020 02:01:45 +0000 (19:01 -0700)]
date: use new libc date apis.

3 years agomerge
Ori Bernstein [Tue, 11 Aug 2020 02:00:59 +0000 (19:00 -0700)]
merge

3 years agovmx: does not do well with certain fb widths, so restrict it
Sigrid [Mon, 10 Aug 2020 14:38:26 +0000 (16:38 +0200)]
vmx: does not do well with certain fb widths, so restrict it

3 years agoupas/fs: port date parsing to libc apis
Ori Bernstein [Mon, 10 Aug 2020 02:46:38 +0000 (19:46 -0700)]
upas/fs: port date parsing to libc apis

There was a lot of code in upas/fs to deal with dates.
Now there isn't.

3 years agoip/httpd: fix 'mk nuke'
Ori Bernstein [Mon, 10 Aug 2020 02:00:06 +0000 (19:00 -0700)]
ip/httpd: fix 'mk nuke'

3 years agolibc: new date apis
Ori Bernstein [Mon, 10 Aug 2020 01:58:44 +0000 (18:58 -0700)]
libc: new date apis

The current date and time APIs on Plan 9 are not good. They're
inflexible, non-threadsafe, and don't expose timezone information.

This commit adds new time APIs that allow parsing arbitrary
dates, work from multiple threads, and can handle timezones
effectively.

3 years agocc: promote integer constants according to c99 spec.
Ori Bernstein [Sat, 8 Aug 2020 18:39:25 +0000 (11:39 -0700)]
cc: promote integer constants according to c99 spec.

C99 integer constants with no type suffix promote differently
depending on the way that they're written: hex and oct consts
promote as int => uint => long => ulong => vlong => uvlong.
Decimal constants are always signed.

We used to promote all values to uint on overflow, and never
went wider. This change fixes that, and adds a warning when
a decimal constant that would have been promoted to uint in
the past gets promoted to int.

3 years agondb/dns: allow multiple txt, nullrr, cert, key and sig records (thanks kvik)
cinap_lenrek [Sat, 8 Aug 2020 16:37:10 +0000 (18:37 +0200)]
ndb/dns: allow multiple txt, nullrr, cert, key and sig records (thanks kvik)

The de-duplication of txt, nullrr, cert, key and sig records
reduced all records to a single one.

Also, dblookup1() missed the txt record case and did not return
a unique list of rr's.

Now we consider these records unique if their value is different.
The new txtequiv() function does that for TXT records, which is
a bit tricky as it needs to take different segmentation into account.

3 years agovmx: set xstart to either nsec or cycles depending on what is available
Sigrid [Fri, 7 Aug 2020 15:08:49 +0000 (17:08 +0200)]
vmx: set xstart to either nsec or cycles depending on what is available

3 years agobullshit: decentralized ActivityPub
Sigrid [Fri, 7 Aug 2020 13:50:55 +0000 (15:50 +0200)]
bullshit: decentralized ActivityPub

3 years agolibttf: fix cmap subtable offset type and rank UCS-4 higher (more codepoints). fixes...
Sigrid [Wed, 5 Aug 2020 12:25:21 +0000 (14:25 +0200)]
libttf: fix cmap subtable offset type and rank UCS-4 higher (more codepoints). fixes runes > 0xffff

3 years agokernel: don't strip binaries in bootfs.paq
cinap_lenrek [Tue, 4 Aug 2020 14:31:24 +0000 (16:31 +0200)]
kernel: don't strip binaries in bootfs.paq

3 years agoqball: remove unused #include <stdio.h>
cinap_lenrek [Tue, 4 Aug 2020 14:27:27 +0000 (16:27 +0200)]
qball: remove unused #include <stdio.h>

3 years agodevmnt: print chanpath for unexpected reply tag
cinap_lenrek [Tue, 4 Aug 2020 14:23:22 +0000 (16:23 +0200)]
devmnt: print chanpath for unexpected reply tag

3 years agorc: avoid stat calls for directory globbing
cinap_lenrek [Tue, 4 Aug 2020 14:21:37 +0000 (16:21 +0200)]
rc: avoid stat calls for directory globbing

On Plan9, we can count on Readdir() onlydirs argument
to work, which allows us to avoid stating every single
file to see if it is a directory.

3 years agolibttf: check directory() result
Sigrid [Tue, 4 Aug 2020 09:42:43 +0000 (11:42 +0200)]
libttf: check directory() result

3 years ago7c: now really fix OASxxx operations
cinap_lenrek [Mon, 3 Aug 2020 22:50:33 +0000 (00:50 +0200)]
7c: now really fix OASxxx operations

the previous patch broke 64-bit ops as the type for the
operation is determined from the first argument to
gopcode() (nod1.type), not the type the result (nod.type).

so we need to include the conversion of nod1 type to
the type of nod.

3 years agomerge
cinap_lenrek [Mon, 3 Aug 2020 21:17:32 +0000 (23:17 +0200)]
merge

3 years agoreverting 7c change, breaks some 64-bit shifts...
cinap_lenrek [Mon, 3 Aug 2020 21:16:41 +0000 (23:16 +0200)]
reverting 7c change, breaks some 64-bit shifts...

3 years agomerge
cinap_lenrek [Mon, 3 Aug 2020 19:52:22 +0000 (21:52 +0200)]
merge

3 years agoacme: reverting scroll change, causes continuous scrolling with scrollwheel
cinap_lenrek [Mon, 3 Aug 2020 19:51:25 +0000 (21:51 +0200)]
acme: reverting scroll change, causes continuous scrolling with scrollwheel

3 years ago7c: fix wrong type on OASxxx operations
cinap_lenrek [Sun, 2 Aug 2020 17:48:25 +0000 (19:48 +0200)]
7c: fix wrong type on OASxxx operations

the bug can be reproduced with the following test case:

#include <u.h>
#include <libc.h>

void
main()
{
int size = 1;
size*=1.5;
exits(0);
}

this produces the following assembly:

TEXT main+0(SB),0,$16
MOVW $1,R1
FCVTZSDW $1.50000000000000000e+00,R2 <- tries to convert rhs to int??
MULW R2,R1,R2 <- multiplication done in int? bug!
MOV $0,R0
BL ,exits+0(SB)
RETURN ,
END ,

the confusion comes from the *= operation using the wrong type
for the multiplication. in this case we should use the float
type of the rhs, do the operation, and then convert the result
back to int type of the lhs.

this change ports the same logic from 5c's getasop().

3 years agorc-httpd: fix invalid test(1) invocation in dir-index
Alex Musolino [Sun, 2 Aug 2020 09:00:01 +0000 (18:30 +0930)]
rc-httpd: fix invalid test(1) invocation in dir-index

3 years agoderoff: fix out-of-bounds access if runes above 0X80 are inside EQ clauses (thanks...
Ori Bernstein [Sat, 1 Aug 2020 17:54:03 +0000 (10:54 -0700)]
deroff: fix out-of-bounds access if runes above 0X80 are inside EQ clauses (thanks mmnmnnmnmm, via plan9port)

Characters greater than 0X80 will cause a read beyond the bounds of the
array chars[]. For particular unicode characters this can cause deroff
to segfault.

A minimal example:
$ deroff
.EQ
u∈
Segmentation fault

Throughout deroff, charclass() is used instead of directly indexing
chars[] so I presume this was just missed.

3 years agohtmlroff: fix out of bounds access (thanks Rei-sen, via plan9port)
Ori Bernstein [Sat, 1 Aug 2020 17:49:29 +0000 (10:49 -0700)]
htmlroff: fix out of bounds access (thanks Rei-sen, via plan9port)

_readx() uses rune count as its argument and not size, so we should
pass nelem() instead of sizeof().

3 years agomk9660(8): fix reference to proto file format
kvik [Sat, 1 Aug 2020 14:17:29 +0000 (16:17 +0200)]
mk9660(8): fix reference to proto file format

3 years agopre-lib9p servers: fix incorrect Tversion handling
kvik [Sat, 1 Aug 2020 13:27:28 +0000 (15:27 +0200)]
pre-lib9p servers: fix incorrect Tversion handling

version(5) says:

If the server does not understand the client's version
string, it should respond with an Rversion message (not
Rerror) with the version string the 7 characters
``unknown''.

Pre-lib9p file servers -- all except cwfs(4) -- do return Rerror.

lib9p(2) follows the above spec, although ignoring the next part
concerning comparison after period-stripping.  It assumes an
Fcall.version starting with "9P" is correctly formed and returns
the only supported version of the protocol, which seems alright.

This patch brings pre-lib9p servers in accordance with the spec.

3 years agovmx(1): use _tos->cyclefreq (thanks cinap)
Sigrid [Sat, 1 Aug 2020 13:23:51 +0000 (15:23 +0200)]
vmx(1): use _tos->cyclefreq (thanks cinap)

3 years agodc: increase exponent limit (thanks unboe, lyndon)
Ori Bernstein [Fri, 31 Jul 2020 15:52:17 +0000 (08:52 -0700)]
dc: increase exponent limit (thanks unboe, lyndon)

dc has an arbitrary limit on the size of the exponent. Lets
replace it with a different arbitrary limit.

3 years agovmx(1): add missing file
Sigrid [Fri, 31 Jul 2020 13:51:32 +0000 (15:51 +0200)]
vmx(1): add missing file

3 years agovmx(1): use cycles() instead of nsec() when possible
Sigrid [Fri, 31 Jul 2020 13:48:54 +0000 (15:48 +0200)]
vmx(1): use cycles() instead of nsec() when possible

this provides better timing and reduced number of syscalls (~2.7M old
vs ~35K new in a test)

3 years agovmx: use _actual_ system kbmap
Sigrid [Fri, 31 Jul 2020 09:24:02 +0000 (11:24 +0200)]
vmx: use _actual_ system kbmap

3 years agoaux/acpi: forgot to commit -p option
Sigrid [Thu, 30 Jul 2020 13:59:04 +0000 (15:59 +0200)]
aux/acpi: forgot to commit -p option

3 years agoaux/acpi: write a man page, fix usage, call threadexits
Sigrid [Thu, 30 Jul 2020 09:25:14 +0000 (11:25 +0200)]
aux/acpi: write a man page, fix usage, call threadexits

3 years agosshfs: update usage text to match man page
Alex Musolino [Wed, 29 Jul 2020 04:26:03 +0000 (13:56 +0930)]
sshfs: update usage text to match man page

3 years agoupasfs: make imap debug logging less noisy
Ori Bernstein [Mon, 27 Jul 2020 02:12:48 +0000 (19:12 -0700)]
upasfs: make imap debug logging less noisy

The current logging prints a debug line for every
message in an inbox, which is unusably verbose.
This removes the prints for unchanged messages,
and adds a print for flag changes.

3 years agoreplica: fix mkfile script installation (thanks Amavect)
Ori Bernstein [Tue, 21 Jul 2020 01:58:52 +0000 (18:58 -0700)]
replica: fix mkfile script installation (thanks Amavect)

The $SCRIPTS were added to $TARG, which complicates the all rule, as
each script's object file must be suppressed.
Fix by removing $SCRIPTS from $TARG, removing the script object file
suppression rule, and overriding the install rule.

The script bin install rule assumes that only one script install is
called at a time. Valid calls like 'mk -a /$objtype/replica/changes
/$objtype/replica/pull' will fail.
Fix by adding a for loop.

Remove the unused $UPDATE variable.

3 years agostdio: fix warnings, make code more standard
Ori Bernstein [Sun, 19 Jul 2020 21:14:14 +0000 (14:14 -0700)]
stdio: fix warnings, make code more standard

Masking with _IO_CHMASK after the assignment causes a warning.
We're better off masking before, but casting the assignment to
prevent sign extension.

3 years agolibndb: order subnets by prefix length for ndbipinfo() lookups
cinap_lenrek [Fri, 17 Jul 2020 14:53:20 +0000 (16:53 +0200)]
libndb: order subnets by prefix length for ndbipinfo() lookups

to reproduce:

ipnet=foo0 ip=192.168.0.0 ipmask=/16
ipnet=foo1 ip=192.168.0.0 ipmask=/24
ip=192.168.0.1 sys=foo2

% ndb/ipquery sys foo2 ipnet ipmask
ipnet=foo0 ipmask=/16

we would expect to get ipnet=foo1 here as it is more
specific subnet.

the solution is to order the subnets by prefix length
in subnet() before calling filter(), so that we process
the longest prefixes first.

3 years agoape: simplify mkfile (thanks amavect)
Ori Bernstein [Thu, 16 Jul 2020 22:22:42 +0000 (15:22 -0700)]
ape: simplify mkfile (thanks amavect)

ape cp, mv, and cc build with ?c, not pcc
ape cp and mv just ignore one or two extra flags,
instead of providing posix compatibility
it's better to fail then do nothing

remove cp.c and mv.c
move cc.c to /sys/src/ape/9src so it doesn't
need its own mkfile rule

3 years agomerge
cinap_lenrek [Thu, 16 Jul 2020 01:12:31 +0000 (03:12 +0200)]
merge

3 years agopc64: disable interrupts in mmuwalk() for checkmmu()
cinap_lenrek [Thu, 16 Jul 2020 01:11:27 +0000 (03:11 +0200)]
pc64: disable interrupts in mmuwalk() for checkmmu()

we have to disable interrupts during mmuwalk() of user pages
as we can get preempted during mmu walk and the original
m->pml4 might become one of a different process.

3 years agog: add '.hs' and 'mkfile' to the walk. (thanks joe9)
Ori Bernstein [Wed, 15 Jul 2020 03:46:00 +0000 (20:46 -0700)]
g: add '.hs' and 'mkfile' to the walk. (thanks joe9)

This expands the set of files that we grep through by default to
include mkfiles and haskell.

3 years agocpp: fix mutually recursive macros
Ori Bernstein [Tue, 14 Jul 2020 01:50:14 +0000 (18:50 -0700)]
cpp: fix mutually recursive macros

Handle cases where parameterless macros expand to each other:

#define FOO BAR
#define BAR FOO
FOO

There were cases where the macros didn't make it into the hidesets,
and we would recurse infinitely. This fixes that.

3 years agokernel: make segments non-executable when icache is not maintained
cinap_lenrek [Sun, 12 Jul 2020 19:42:26 +0000 (21:42 +0200)]
kernel: make segments non-executable when icache is not maintained

This change makes it mandatory for programs to call segflush() on
code that is not in the text segment if they want to execute it.

As a side effect, this means that everything but the text segment
will be non-executable by default, even without the SG_NOEXEC
attribute. Segments with the SG_NOEXEC attribute never become
executable, even when segflush() is called on them.

3 years agoaux/cpuid: flush instruction cache of after patching trampoline
cinap_lenrek [Sun, 12 Jul 2020 17:37:38 +0000 (19:37 +0200)]
aux/cpuid: flush instruction cache of after patching trampoline

3 years agohjfs: update mtime and qid.vers for directory on rename
cinap_lenrek [Sun, 12 Jul 2020 16:54:22 +0000 (18:54 +0200)]
hjfs: update mtime and qid.vers for directory on rename

when wstating a file, its directory should be updated to
reflect this change.

here is what the manpage states:

> The mtime field reflects the time of the last change of content
> (except when later changed by wstat). For a directory it is the
> time of the most recent remove, create, or wstat of a file in the
> directory.

3 years agocwfs: update mtime and qid.vers for directory on rename
cinap_lenrek [Sun, 12 Jul 2020 16:52:28 +0000 (18:52 +0200)]
cwfs: update mtime and qid.vers for directory on rename

when wstating a file, its directory should be updated to
reflect this change.

here is what the manpage states:

> The mtime field reflects the time of the last change of content
> (except when later changed by wstat). For a directory it is the
> time of the most recent remove, create, or wstat of a file in the
> directory.

3 years agostdio, ape/stdio: fix order of operations in putc
Ori Bernstein [Sat, 11 Jul 2020 20:28:58 +0000 (13:28 -0700)]
stdio, ape/stdio: fix order of operations in putc

When calling putc, we need to return either EOF
or the character returned. To distinguish the
two, we need to avoid sign extending 0xff. The
code attempted to do this, but the order of
operations was wrong, so we ended up masking,
setting a character, and then sign extending
the character.

This fixes things so we mask after assignment.

3 years agoimap4d: fix missing return in %δ format of Dfmt()
cinap_lenrek [Sun, 5 Jul 2020 20:15:02 +0000 (22:15 +0200)]
imap4d: fix missing return in %δ format of Dfmt()

3 years agoimap4d: get rid of unixdate/unixfrom handling
cinap_lenrek [Sun, 5 Jul 2020 19:18:26 +0000 (21:18 +0200)]
imap4d: get rid of unixdate/unixfrom handling

all this logic is already done by upas/fs, the unixdate and from
fields in the info file will always be correct.

3 years agoimap4d: fix mkfile to have the correct default target
cinap_lenrek [Sun, 5 Jul 2020 19:16:41 +0000 (21:16 +0200)]
imap4d: fix mkfile to have the correct default target

3 years agoupas/fs: wait until the index becomes unlocked
cinap_lenrek [Sun, 5 Jul 2020 19:15:55 +0000 (21:15 +0200)]
upas/fs: wait until the index becomes unlocked

For big mailboxes with imap4d, ignoring the index and trying to scan
the mailbox concurrently is not very productive. Just wait for the
other upas/fs to write the whole index.

The issue is that imap might time out and make another connection
spawning even more upas/fs instances that all then try to rebuild
the index concurrently.

3 years agoupas/fs: fix wrong nparts field index (changed in previous commit)
cinap_lenrek [Sun, 5 Jul 2020 17:51:59 +0000 (19:51 +0200)]
upas/fs: fix wrong nparts field index (changed in previous commit)

3 years agonedmail: don't try to shoot down subcommand on interrupt
cinap_lenrek [Sun, 5 Jul 2020 16:17:20 +0000 (18:17 +0200)]
nedmail: don't try to shoot down subcommand on interrupt

this breaks interrupt key handling in rio. theres also no
point in trying todo so as rio sends the note to the whole
process group so the subcommand should have got the note
already.

just wait for the subprocess to terminate.

3 years agoupas/fs: put date822 into the index, fix from and replyto handling
cinap_lenrek [Sun, 5 Jul 2020 15:44:32 +0000 (17:44 +0200)]
upas/fs: put date822 into the index, fix from and replyto handling

the date, from and replyto fields where unstable, in that the value
read depended on the state of the cache.

fixing the from and replyto fields is easy, we just handle the
substitution in parsebody().

the date field however requires us to put the date822 into the index
so it can be recovered without requiering to reparse the header
(and body, as we might have a message/rfc822 message with promoted
fields).

with these changes, the fields will be consistent and independnet
of the cache state.

a small optimization also has been added:

after parsing the body, attachments and substitution of from/replyto,
the boundary and unixfrom strings are not needed anymore and can
be freed early.

3 years agoupas/fs: fix memory leak in ref822()
cinap_lenrek [Sun, 5 Jul 2020 15:05:49 +0000 (17:05 +0200)]
upas/fs: fix memory leak in ref822()

4 years agoimap4d: respect errors from read(), remove debug prints
Ori Bernstein [Fri, 3 Jul 2020 18:29:45 +0000 (11:29 -0700)]
imap4d: respect errors from read(), remove debug prints

When read() failed, we were casting the -1 return to
unsigned, which would cause us to index out of bounds.
found using dovecot imap test suite. While we're here,
let's remove the stray debug prints.

4 years agokbdfs/mklatin: allow >16 bit runes in /lib/keyboard
Alex Musolino [Fri, 3 Jul 2020 12:44:49 +0000 (22:14 +0930)]
kbdfs/mklatin: allow >16 bit runes in /lib/keyboard

4 years agobcm64: increase maximum segment size to 8GB
cinap_lenrek [Thu, 2 Jul 2020 23:17:38 +0000 (01:17 +0200)]
bcm64: increase maximum segment size to 8GB

make it possible for one process to use all
of physical memory.

4 years agobcm64: handle 8GB of physical memory for raspberry pi4
cinap_lenrek [Thu, 2 Jul 2020 19:12:40 +0000 (21:12 +0200)]
bcm64: handle 8GB of physical memory for raspberry pi4

widen and move the KMAP window to a new address so we can
handle the 8GB of physical memory of the new raspberry pi4.

the new memory map on pi4 uses the following 4 banks:

0x000000000 0x03e600000
0x040000000 0x0fc000000 <- soc.dramsize (only < 4GB)
0x100000000 0x180000000
0x180000000 0x200000000

4 years agobcm64: fix usb xhci controller on pi4 8GB variant (thanks richard miller)
cinap_lenrek [Thu, 2 Jul 2020 19:04:01 +0000 (21:04 +0200)]
bcm64: fix usb xhci controller on pi4 8GB variant (thanks richard miller)

On the 8GB variant of the raspberry pi 4,
the eeprom chip for the xhci controller is missing and
instead loaded from sdram (by the gpu firmware).

for this, the gpu firmware needs to be notified of
the xhci controllers pci bus address (after reset)
that was assigned by our pci enumeration code.

4 years agomerge
cinap_lenrek [Sun, 28 Jun 2020 22:24:45 +0000 (00:24 +0200)]
merge

4 years agoupas/fs: move unixheader handling to parseheaders()
cinap_lenrek [Sun, 28 Jun 2020 22:23:37 +0000 (00:23 +0200)]
upas/fs: move unixheader handling to parseheaders()

parsing the unixheader in mdir fetch routine is the wrong place,
as no invalid character handling has been performed yet. also
the string is not neccesarily null terminated.

avoid duplication with plan9 mbox parsing and just do it in
parseheaders(), which already handles faking the unix headers
for pop3 and imap.

4 years agographics(2): fix typo
kvik [Sun, 28 Jun 2020 21:45:18 +0000 (23:45 +0200)]
graphics(2): fix typo

4 years agokernel: segflush() needs to flush tlb of other processes
cinap_lenrek [Sun, 28 Jun 2020 14:26:59 +0000 (16:26 +0200)]
kernel: segflush() needs to flush tlb of other processes

instruction cache maintenance is done on tlb miss;
when a page gets fauled in; with putmmu() checking
the page->txtflush cpu bitmap.

syssegflush() used to only call flushmmu() after
segflush() for the calling process, but when a segment
is shared with other processes, we have to flush the
other processes tlb as well.

this adds the missing procflushseg() call into segflush().

note that procflushseg() leaves the calling process alone,
so the flushmmu() call in syssegflush() is still required.

segmentioproc() does not need to call flushmmu() after
segflush() as it is never going to jump to the modified
page, hence the stale icache does not matter.

4 years agoaux/trampoline: Implement inactivity timeout (-t option)
cinap_lenrek [Sat, 27 Jun 2020 14:40:53 +0000 (16:40 +0200)]
aux/trampoline: Implement inactivity timeout (-t option)

Using aux/trampoline to relay udp traffic needs a inactivity
timeout to be practical as there is no explicit connection
termination.

4 years ago9p(2): fix typo
kvik [Thu, 25 Jun 2020 21:23:23 +0000 (23:23 +0200)]
9p(2): fix typo

4 years agoupas/fs: remove now unused Mtrunc mimeflags constant
cinap_lenrek [Wed, 24 Jun 2020 17:21:47 +0000 (19:21 +0200)]
upas/fs: remove now unused Mtrunc mimeflags constant

4 years agoupas/fs: use memchr() instead of strchr() in hdrlen()
cinap_lenrek [Wed, 24 Jun 2020 17:18:37 +0000 (19:18 +0200)]
upas/fs: use memchr() instead of strchr() in hdrlen()

make sure we look for the end of the header within the
pointer range, and not accidentally read beyond hend.

also, messages are not null terminated, so this could
even go beyond the email data buffer.

get rid of mimeflag which was only used for some assert
checks.

take header length into account when comparing header
against ignored header strings.

4 years agomerge
cinap_lenrek [Wed, 24 Jun 2020 16:47:03 +0000 (18:47 +0200)]
merge

4 years agoip/tinc: run script sub-shell in its own environment
cinap_lenrek [Wed, 24 Jun 2020 16:45:58 +0000 (18:45 +0200)]
ip/tinc: run script sub-shell in its own environment

4 years agoacme/win: add trailing space to window tag
Alex Musolino [Tue, 23 Jun 2020 09:11:00 +0000 (18:41 +0930)]
acme/win: add trailing space to window tag

4 years agoupas/marshal: make attachment failure fatal
Alex Musolino [Mon, 22 Jun 2020 07:04:31 +0000 (16:34 +0930)]
upas/marshal: make attachment failure fatal

4 years agousbxhci: implement isochronous in transfers (for webcam, audio recording)
cinap_lenrek [Sun, 21 Jun 2020 19:42:13 +0000 (21:42 +0200)]
usbxhci: implement isochronous in transfers (for webcam, audio recording)

4 years agodevusb: keep isochronous ep->hz consistent with maxpkt, ntds and pollival
cinap_lenrek [Sun, 21 Jun 2020 19:36:50 +0000 (21:36 +0200)]
devusb: keep isochronous ep->hz consistent with maxpkt, ntds and pollival

The sample frequency is an artificial parameter used for
isochronous out transfers to better match the target
frequency (usually, a sound card).

when hz is set, devusb adjusts the endpoint's maxpkt to get
the requested frequency and a multiple of the samplesize per
packet.

however, when hz is not set, then we should calculate the
frequency from maxpkt, ntds and pollival, so all parameters
will be consistent with each other.

4 years agoabaco: add fonts.h to HFILES in mkfile (thanks eekee)
Alex Musolino [Sun, 21 Jun 2020 10:04:54 +0000 (19:34 +0930)]
abaco: add fonts.h to HFILES in mkfile (thanks eekee)

4 years agoip/torrent: fix size check in 64-bit "v" unpack (thanks pr)
cinap_lenrek [Fri, 19 Jun 2020 18:19:57 +0000 (20:19 +0200)]
ip/torrent: fix size check in 64-bit "v" unpack (thanks pr)

4 years agocifsd(8): fix typo (thanks senthil)
Alex Musolino [Thu, 18 Jun 2020 02:41:06 +0000 (12:11 +0930)]
cifsd(8): fix typo (thanks senthil)

4 years agoadd a compose sequence to type ⑨
Sigrid [Tue, 16 Jun 2020 15:29:00 +0000 (17:29 +0200)]
add a compose sequence to type ⑨

4 years agolibc: revert date change again. this is getting ridicuoulus.
cinap_lenrek [Sun, 14 Jun 2020 22:12:57 +0000 (00:12 +0200)]
libc: revert date change again. this is getting ridicuoulus.

this breaks the sample from the seconds manpage, and overall
produces funky results. this needs alot more testing.

term% seconds '23 may 2011'
seconds: tmparse: invalid date 23 may 2011 near 'may 2011'

term% seconds '2019-01-01 00:00:00'
-118370073600

4 years agolibc, seconds: new time and date apis (try 2)
Ori Bernstein [Sun, 14 Jun 2020 16:33:32 +0000 (09:33 -0700)]
libc, seconds: new time and date apis (try 2)

Redo date handling in libc almost entirely. This allows
handling dates and times from outside your timezones,
fixes timezone loading in multithreaded applications,
and allows parsing and formatting using custom format
strings.

As a test of the APIs, we replace the formatting code in
seconds(1), shrinking it massively.

The last commit missed a few removals, and made it
unnecessarily hard to do an update.

4 years agolibc: reverting previous change until ori can fix it
cinap_lenrek [Sun, 14 Jun 2020 02:47:22 +0000 (04:47 +0200)]
libc: reverting previous change until ori can fix it