summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-17libndb: order subnets by prefix length for ndbipinfo() lookupscinap_lenrek
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.
2020-07-16ape: simplify mkfile (thanks amavect)Ori Bernstein
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
2020-07-16mergecinap_lenrek
2020-07-16pc64: disable interrupts in mmuwalk() for checkmmu()cinap_lenrek
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.
2020-07-14g: add '.hs' and 'mkfile' to the walk. (thanks joe9)Ori Bernstein
This expands the set of files that we grep through by default to include mkfiles and haskell.
2020-07-13cpp: fix mutually recursive macrosOri Bernstein
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.
2020-07-12kernel: make segments non-executable when icache is not maintainedcinap_lenrek
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.
2020-07-12aux/cpuid: flush instruction cache of after patching trampolinecinap_lenrek
2020-07-12hjfs: update mtime and qid.vers for directory on renamecinap_lenrek
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.
2020-07-12cwfs: update mtime and qid.vers for directory on renamecinap_lenrek
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.
2020-07-11stdio, ape/stdio: fix order of operations in putcOri Bernstein
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.
2020-07-05imap4d: fix missing return in %δ format of Dfmt()cinap_lenrek
2020-07-05imap4d: get rid of unixdate/unixfrom handlingcinap_lenrek
all this logic is already done by upas/fs, the unixdate and from fields in the info file will always be correct.
2020-07-05imap4d: fix mkfile to have the correct default targetcinap_lenrek
2020-07-05upas/fs: wait until the index becomes unlockedcinap_lenrek
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.
2020-07-05upas/fs: fix wrong nparts field index (changed in previous commit)cinap_lenrek
2020-07-05nedmail: don't try to shoot down subcommand on interruptcinap_lenrek
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.
2020-07-05upas/fs: put date822 into the index, fix from and replyto handlingcinap_lenrek
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.
2020-07-05upas/fs: fix memory leak in ref822()cinap_lenrek
2020-07-03imap4d: respect errors from read(), remove debug printsOri Bernstein
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.
2020-07-03kbdfs/mklatin: allow >16 bit runes in /lib/keyboardAlex Musolino
2020-07-03bcm64: increase maximum segment size to 8GBcinap_lenrek
make it possible for one process to use all of physical memory.
2020-07-02bcm64: handle 8GB of physical memory for raspberry pi4cinap_lenrek
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
2020-07-02bcm64: fix usb xhci controller on pi4 8GB variant (thanks richard miller)cinap_lenrek
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.
2020-06-29mergecinap_lenrek
2020-06-29upas/fs: move unixheader handling to parseheaders()cinap_lenrek
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.
2020-06-28graphics(2): fix typokvik
2020-06-28kernel: segflush() needs to flush tlb of other processescinap_lenrek
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.
2020-06-27aux/trampoline: Implement inactivity timeout (-t option)cinap_lenrek
Using aux/trampoline to relay udp traffic needs a inactivity timeout to be practical as there is no explicit connection termination.
2020-06-259p(2): fix typokvik
2020-06-24upas/fs: remove now unused Mtrunc mimeflags constantcinap_lenrek
2020-06-24upas/fs: use memchr() instead of strchr() in hdrlen()cinap_lenrek
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.
2020-06-24mergecinap_lenrek
2020-06-24ip/tinc: run script sub-shell in its own environmentcinap_lenrek
2020-06-23acme/win: add trailing space to window tagAlex Musolino
2020-06-22upas/marshal: make attachment failure fatalAlex Musolino
2020-06-21usbxhci: implement isochronous in transfers (for webcam, audio recording)cinap_lenrek
2020-06-21devusb: keep isochronous ep->hz consistent with maxpkt, ntds and pollivalcinap_lenrek
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.
2020-06-21abaco: add fonts.h to HFILES in mkfile (thanks eekee)Alex Musolino
2020-06-19ip/torrent: fix size check in 64-bit "v" unpack (thanks pr)cinap_lenrek
2020-06-18cifsd(8): fix typo (thanks senthil)Alex Musolino
2020-06-16add a compose sequence to type ⑨Sigrid
2020-06-15libc: revert date change again. this is getting ridicuoulus.cinap_lenrek
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
2020-06-14libc, seconds: new time and date apis (try 2)Ori Bernstein
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.
2020-06-14libc: reverting previous change until ori can fix itcinap_lenrek
2020-06-13libc, seconds: new time and date apis.Ori Bernstein
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.
2020-06-12mergecinap_lenrek
2020-06-12ramfs: make Elocked[] more consistent (thanks fazlul)cinap_lenrek
Go expects the error to be one of the three errors returned in Bell Labs Plan 9. As listed in https://github.com/golang/go/blob/f7ba82d68f90e20aa9e6aa973cb6f12321abec71/src/cmd/go/internal/lockedfile/lockedfile_plan9.go#L16: // Opening an exclusive-use file returns an error. // The expected error strings are: // // - "open/create -- file is locked" (cwfs, kfs) // - "exclusive lock" (fossil) // - "exclusive use file already open" (ramfs) var lockedErrStrings = [...]string{ "file is locked", "exclusive lock", "exclusive use file already open", }
2020-06-11acme: implement position-dependent scroll-wheel scrollingkvik
This brings acme scrolling behaviour in line with that of 9front's rio and sam, where the amount scrolled varies with a vertical position of the pointer within the window, similar to how the scrollbar works. At some point it would be good to implement a line-at-a-time scrolling when the Shift key is pressed, as seen in rio. For this to happen the acme keyboard input needs to be rewritten in terms of /dev/kbd instead of relying on keyboard(2) -- that is, the /dev/cons interface.
2020-06-09libplumb: add missing mkfileOri Bernstein