]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
4 years agoaux/acpi, aux/apm: remove nopipe -i flag
cinap_lenrek [Sat, 7 Mar 2020 12:23:34 +0000 (13:23 +0100)]
aux/acpi, aux/apm: remove nopipe -i flag

4 years agohgignore: ignore section 9 manpage indices, ignore init, kernels and bootloader binaries
cinap_lenrek [Sat, 7 Mar 2020 11:28:49 +0000 (12:28 +0100)]
hgignore: ignore section 9 manpage indices, ignore init, kernels and bootloader binaries

4 years agodevproc: fix syscalltrace read for ratrace
cinap_lenrek [Thu, 5 Mar 2020 19:46:01 +0000 (20:46 +0100)]
devproc: fix syscalltrace read for ratrace

4 years agohgfs: fix loadrevinfo() for empty log bug
cinap_lenrek [Sun, 1 Mar 2020 22:23:01 +0000 (23:23 +0100)]
hgfs: fix loadrevinfo() for empty log bug

loadrevinfo() would fail on a empty log portion due
to a bug in the previous commit.

the loop is supposed to skip all bytes until we encounter
a empty line. the loop starts at the beginning of a line
so when we encounter a \n, we have to terminate, otherwise
read bytes until we see \n (end of a line) and then read
another and test the condition again.

4 years agolibsec: move AES XTS function prototypes to AES definition section in the header...
cinap_lenrek [Sun, 1 Mar 2020 15:02:56 +0000 (16:02 +0100)]
libsec: move AES XTS function prototypes to AES definition section in the header file

4 years agolibsec: remove hash pickle functions, document ripemd160, cleanup sechash(2) manpage
cinap_lenrek [Sun, 1 Mar 2020 14:07:44 +0000 (15:07 +0100)]
libsec: remove hash pickle functions, document ripemd160, cleanup sechash(2) manpage

4 years agokernel: simplify exec()
cinap_lenrek [Sat, 29 Feb 2020 20:06:45 +0000 (21:06 +0100)]
kernel: simplify exec()

progarg[0] can be assigned to elem directly as it is a
copy in kernel memory, so the char proelem[64] buffer
is not neccesary.

do the close-on-exit outside of the segment lock. there
is no reason to keep the segment table locked.

4 years agodevproc: make sure writewatchpt() doesnt overflow the watchpoint array
cinap_lenrek [Fri, 28 Feb 2020 15:48:42 +0000 (16:48 +0100)]
devproc: make sure writewatchpt() doesnt overflow the watchpoint array

the user buffer could be changed while we parse it resulting
in a different number of watchpoints than initially calculated.
so add a check to the parse loop so we wont overflow the
watchpoint array.

4 years agokernel: make sure we wont run into the tos when copying exec() arguments
cinap_lenrek [Fri, 28 Feb 2020 15:45:20 +0000 (16:45 +0100)]
kernel: make sure we wont run into the tos when copying exec() arguments

in case the calling process changes its arguments under us, it could
happen that the final argument string lengths become bigger than
initially calculated. this is fine as we still make sure we wont
overflow the stack segment, but we could overrun into the tos
structure at the end of the stack. so change the limit to the
base of the tos, not the end of the stack segment.

4 years agodevproc: cleanup procwrite size checks
cinap_lenrek [Fri, 28 Feb 2020 15:41:09 +0000 (16:41 +0100)]
devproc: cleanup procwrite size checks

writes to /proc/n/notepg and /proc/n/note should be able to write
at ERRMAX-1 bytes, not ERRMAX-2.

simplify write to /proc/n/args by just copying to local buf first
and then doing a kstrdup(). the value of Proc.nargs does not matter
when Proc.setargs is 1.

4 years agofix special case for null pointer constants in cond expressions
Ori Bernstein [Thu, 27 Feb 2020 20:09:10 +0000 (15:09 -0500)]
fix special case for null pointer constants in cond expressions

Section 6.5.15 of the C99 spec requires that if
one argument of a ?: expression is a null pointer
constant, and the other has a pointer type T*, then
the type of the expression is T*.

We were attempting to follow this rule, however,
we only handled literal expressions when checking
for null pointers.

This change looks through casts, so 'nil' and 'NULL',
and their expansion '(void*)0' are all detected as
null pointer constants.

4 years agowalk arguments to g
Ori Bernstein [Thu, 27 Feb 2020 05:45:00 +0000 (21:45 -0800)]
walk arguments to g

This allows us to 'g' the files
within a directory, as in:

g _MAX /sys/include/ape

Before this change, we'd attempt to
grep the directory structure, which
is not ideal. After, we grep the
files within the directory.

4 years agoinclude section 9 in manpage plumb rules.
Ori Bernstein [Thu, 27 Feb 2020 04:52:20 +0000 (20:52 -0800)]
include section 9 in manpage plumb rules.

We added section 9 to the manual. However,
the plumb rule only recognized sections 1
through 8. Fix it to include section 9.

4 years agoape/cc: stop spamming arguments that are only needed once
BurnZeZ [Sun, 23 Feb 2020 20:33:27 +0000 (20:33 +0000)]
ape/cc: stop spamming arguments that are only needed once

4 years agodevcons: fix permissions for reboot and sysstat
cinap_lenrek [Sun, 23 Feb 2020 19:42:00 +0000 (20:42 +0100)]
devcons: fix permissions for reboot and sysstat

#c/reboot is a write only file
#c/sysstat should not be writable by everyone (write resets counters)

4 years agokernel: avoid selecting the boot process in killbig()
cinap_lenrek [Sun, 23 Feb 2020 17:58:06 +0000 (18:58 +0100)]
kernel: avoid selecting the boot process in killbig()

4 years agokernel: fix multiple devproc bugs and pid reuse issues
cinap_lenrek [Sun, 23 Feb 2020 17:00:21 +0000 (18:00 +0100)]
kernel: fix multiple devproc bugs and pid reuse issues

devproc assumes that when we hold the Proc.debug qlock,
the process will be prevented from exiting. but there is
another race where the process has already exited and
the Proc* slot gets reused. to solve this, on process
creation we also have to acquire the debug qlock while
initializing the fields of the process. this also means
newproc() should only initialize fields *not* protected
by the debug qlock.

always acquire the Proc.debug qlock when changing strings
in the proc structure to avoid doublefree on concurrent
update. for changing the user string, we add a procsetuser()
function that does this for auth.c and devcap.

remove pgrpnote() from pgrp.c and replace by static
postnotepg() in devproc.

avoid the assumption that the Proc* entries returned by
proctab() are continuous.

fixed devproc permission issues:
- make sure only eve can access /proc/trace
- none should only be allowed to read its own /proc/n/text
- move Proc.kp checks into procopen()

pid reuse was not handled correctly, as we where only
checking if a pid had a living process, but there still
could be processes expecting a particular parentpid or
noteid.

this is now addressed with reference counted Pid
structures which are organized in a hash table.
read access to the hash table does not require locks
which will be usefull for dtracy later.

4 years agodevswap: dont assume Proc* structures returned from proctab() are continuous
cinap_lenrek [Sun, 23 Feb 2020 13:08:33 +0000 (14:08 +0100)]
devswap: dont assume Proc* structures returned from proctab() are continuous

4 years agosdiahci, sdodin: avoid calling kproc() while holding ilock()
cinap_lenrek [Sun, 23 Feb 2020 13:05:01 +0000 (14:05 +0100)]
sdiahci, sdodin: avoid calling kproc() while holding ilock()

4 years ago/sys/lib/kbmap: update 0xf860 to Kshift value, fix fake shifts on esc1
Sigrid [Sat, 22 Feb 2020 23:57:05 +0000 (00:57 +0100)]
/sys/lib/kbmap: update 0xf860 to Kshift value, fix fake shifts on esc1

4 years agosed: allow whitespace after ! negation (thanks k0ga)
cinap_lenrek [Wed, 19 Feb 2020 18:26:43 +0000 (19:26 +0100)]
sed: allow whitespace after ! negation (thanks k0ga)

4 years agoacme(1): fix scrolling when swiping text at the top or bottom of a frame
spew [Thu, 13 Feb 2020 21:09:25 +0000 (16:09 -0500)]
acme(1): fix scrolling when swiping text at the top or bottom of a frame

4 years agoremove C99_SPRINTF_EXTENSION define.
Ori Bernstein [Tue, 11 Feb 2020 03:26:39 +0000 (19:26 -0800)]
remove C99_SPRINTF_EXTENSION define.

It's been 20 years since c99 came out. By now, if code
hasn't been fixed, it's not going to be. Requiring this
define just confuses porters.

4 years agobcm: change ARGB32 to XRGB32 for framebuffer to avoid slow drawing
Roberto E. Vargas Caballero [Sun, 9 Feb 2020 20:39:17 +0000 (21:39 +0100)]
bcm: change ARGB32 to XRGB32 for framebuffer to avoid slow drawing

4 years agoupas/fs plumb modify messages for self-changed flags
Ori Bernstein [Wed, 5 Feb 2020 22:11:15 +0000 (14:11 -0800)]
upas/fs plumb modify messages for self-changed flags

Currently upas/fs plumbs modify messages only if the flag
changes are made by another imap connection.  If the flag
changes are made within the running upas/fs no modify message
is plumbed.

This changes upas/fs to set the modify flag if we made the
change ourself. It also moves the flag setting before the
imap read, so that we don't clobber flag changes coming
from the imap server with our own flags.

(Thanks Tobias Heinicke)

4 years agoimage(6): fix typo
rgl [Tue, 4 Feb 2020 20:32:33 +0000 (21:32 +0100)]
image(6): fix typo

4 years agokernel: cleanup makefile for $CONF.$O target
cinap_lenrek [Sun, 2 Feb 2020 19:46:58 +0000 (20:46 +0100)]
kernel: cleanup makefile for $CONF.$O target

4 years agomerge
cinap_lenrek [Sun, 2 Feb 2020 19:33:40 +0000 (20:33 +0100)]
merge

4 years agolisten(1): implement one-shot mode flag for listen1 (thanks kivik)
cinap_lenrek [Sun, 2 Feb 2020 19:31:48 +0000 (20:31 +0100)]
listen(1): implement one-shot mode flag for listen1 (thanks kivik)

4 years agofix double free in acme.
Ori Bernstein [Fri, 31 Jan 2020 17:25:39 +0000 (09:25 -0800)]
fix double free in acme.

in acmerrorproc():
sendp(s);
free(s);

in waitthread():
recv(&err)
free(err)

We only want waitthread to free.

4 years agodocument common emulator keys
rgl [Wed, 29 Jan 2020 18:27:07 +0000 (19:27 +0100)]
document common emulator keys

4 years agowalk: add D and T fmt characters (fileserver device/type)
BurnZeZ [Tue, 28 Jan 2020 01:27:41 +0000 (01:27 +0000)]
walk: add D and T fmt characters (fileserver device/type)

4 years agowalk(1): formatting/corrections
BurnZeZ [Tue, 28 Jan 2020 00:53:58 +0000 (00:53 +0000)]
walk(1): formatting/corrections

4 years agowalk: remove superfluous newline
BurnZeZ [Tue, 28 Jan 2020 00:44:44 +0000 (00:44 +0000)]
walk: remove superfluous newline

4 years agokernel: restore old behaviour that kprocs have ther noteid == pid
cinap_lenrek [Mon, 27 Jan 2020 01:17:14 +0000 (02:17 +0100)]
kernel: restore old behaviour that kprocs have ther noteid == pid

4 years agokernel: fix mistake from previous commit (noteid not being inherited by default)
cinap_lenrek [Mon, 27 Jan 2020 00:51:35 +0000 (01:51 +0100)]
kernel: fix mistake from previous commit (noteid not being inherited by default)

4 years agokernel: implement portable userinit() and simplify process creation
cinap_lenrek [Sun, 26 Jan 2020 18:01:36 +0000 (19:01 +0100)]
kernel: implement portable userinit() and simplify process creation

replace machine specific userinit() by a portable
implemntation that uses kproc() to create the first
process. the initcode text is mapped using kmap(),
so there is no need for machine specific tmpmap()
functions.

initcode stack preparation should be done in init0()
where the stack is mapped and can be accessed directly.

replacing the machine specific userinit() allows some
big simplifications as sysrfork() and kproc() are now
the only callers of newproc() and we can avoid initializing
fields that we know are being initialized by these
callers.

rename autogenerated init.h and reboot.h headers.
the initcode[] and rebootcode[] blobs are now in *.i
files and hex generation was moved to portmkfile. the
machine specific mkfile only needs to specify how to
build rebootcode.out and initcode.out.

4 years agoppc: remove old duplicate of devtls.c
cinap_lenrek [Sat, 25 Jan 2020 17:37:28 +0000 (18:37 +0100)]
ppc: remove old duplicate of devtls.c

4 years agoadd v8e
aiju [Wed, 22 Jan 2020 13:09:09 +0000 (13:09 +0000)]
add v8e

4 years agopage(1): fix troff manual example
Alex Musolino [Mon, 20 Jan 2020 04:29:04 +0000 (14:59 +1030)]
page(1): fix troff manual example

4 years agomerge
cinap_lenrek [Sun, 19 Jan 2020 18:21:10 +0000 (19:21 +0100)]
merge

4 years agoApply http://www.9paste.net/qrstuv/patch/acme-movetodelmesg/
Roberto E. Vargas Caballero [Sun, 19 Jan 2020 18:18:12 +0000 (19:18 +0100)]
Apply http://www.9paste.net/qrstuv/patch/acme-movetodelmesg/

4 years agomerge
cinap_lenrek [Sun, 19 Jan 2020 17:45:04 +0000 (18:45 +0100)]
merge

4 years agoacme: fix off by one in colclose(), make dellist() code consistent
cinap_lenrek [Sun, 19 Jan 2020 17:43:51 +0000 (18:43 +0100)]
acme: fix off by one in colclose(), make dellist() code consistent

4 years agoacme: Restore call to movetodel() in colclose
Roberto E. Vargas Caballero [Sun, 19 Jan 2020 17:36:50 +0000 (18:36 +0100)]
acme: Restore call to movetodel() in colclose

4 years agocycv: support for registers
aiju [Mon, 13 Jan 2020 23:22:35 +0000 (23:22 +0000)]
cycv: support for registers

4 years agocyclone v kernel: fpga support, fix CONFADDR
aiju [Sun, 12 Jan 2020 03:40:42 +0000 (03:40 +0000)]
cyclone v kernel: fpga support, fix CONFADDR

4 years agovnc/devdraw: fix topnwindows() panic when images are not windows (thanks aiju)
cinap_lenrek [Sat, 11 Jan 2020 23:19:39 +0000 (00:19 +0100)]
vnc/devdraw: fix topnwindows() panic when images are not windows (thanks aiju)

see changeset 319be6cfe7ef

4 years agodevdraw: fix topnwindows() panic when images are not windows (thanks aiju)
cinap_lenrek [Sat, 11 Jan 2020 23:07:27 +0000 (00:07 +0100)]
devdraw: fix topnwindows() panic when images are not windows (thanks aiju)

Crashes drawterm and native:

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

void
main(int argc, char **argv)
{
  initdraw(nil, nil, nil);

  Image *a[] = {screen, display->black};

  topnwindows(a, nelem(a));
  flushimage(display, 1);
}

4 years agopc64: adapt vgaradeon driver to 64-bit (thanks Robert Ransom)
cinap_lenrek [Sat, 11 Jan 2020 22:31:54 +0000 (23:31 +0100)]
pc64: adapt vgaradeon driver to 64-bit (thanks Robert Ransom)

Not yet tested.

4 years agokernel: remove relics of CPU 'load balancing' policy in scheduler (thanks Robert...
cinap_lenrek [Sat, 11 Jan 2020 20:26:42 +0000 (21:26 +0100)]
kernel: remove relics of CPU 'load balancing' policy in scheduler (thanks Robert Ransom)

This code was deleted from Plan 9 before the 9front repo began.
Proc.movetime was used by it, but has never been referenced in 9front.

4 years agobootrc: fix comment typo (thanks Robert Ransom)
cinap_lenrek [Sat, 11 Jan 2020 20:25:05 +0000 (21:25 +0100)]
bootrc: fix comment typo (thanks Robert Ransom)

4 years agoip/cifsd: implement SMB_SET_FILE_UNIX_BASIC for wstat
cinap_lenrek [Sat, 11 Jan 2020 13:50:52 +0000 (14:50 +0100)]
ip/cifsd: implement SMB_SET_FILE_UNIX_BASIC for wstat

4 years agolibFLAC: 1.3.1 -> 1.3.3
Sigrid [Sat, 11 Jan 2020 12:25:02 +0000 (13:25 +0100)]
libFLAC: 1.3.1 -> 1.3.3

4 years agodont spin on MDIO
aiju [Fri, 10 Jan 2020 20:43:24 +0000 (20:43 +0000)]
dont spin on MDIO

4 years agomerge
aiju [Fri, 10 Jan 2020 18:49:39 +0000 (18:49 +0000)]
merge

4 years agoadd cycv ethernet driver
aiju [Fri, 10 Jan 2020 18:49:33 +0000 (18:49 +0000)]
add cycv ethernet driver

4 years agoshow line numbers in dtracy type errors
Ori Bernstein [Thu, 9 Jan 2020 19:59:44 +0000 (11:59 -0800)]
show line numbers in dtracy type errors

4 years agoadd cycv kernel
aiju [Wed, 8 Jan 2020 02:35:01 +0000 (02:35 +0000)]
add cycv kernel

4 years agodumb bug
aiju [Wed, 8 Jan 2020 02:27:09 +0000 (02:27 +0000)]
dumb bug

4 years agoadd aux/aout2uimage
aiju [Wed, 8 Jan 2020 02:22:20 +0000 (02:22 +0000)]
add aux/aout2uimage

4 years agorc-httpd: append carriage return to content-length header
Alex Musolino [Tue, 7 Jan 2020 06:58:59 +0000 (17:28 +1030)]
rc-httpd: append carriage return to content-length header

4 years agodevip: fix packet loss when interface is wlocked
cinap_lenrek [Sun, 5 Jan 2020 17:20:47 +0000 (18:20 +0100)]
devip: fix packet loss when interface is wlocked

to prevent deadlock on media unbind (which is called with
the interface wlock()'ed), the medias reader processes
that unbind was waiting for used to discard packets when
the interface could not be rlocked.

this has the unfortunate side effect that when we change
addresses on a interface that packets are getting lost.
this is problematic for the processing of ipv6 router
advertisements when multiple RA's are getting received
in quick succession.

this change removes that packet dropping behaviour and
instead changes the unbind process to avoid the deadlock
by wunlock()ing the interface temporarily while waiting
for the reader processes to finish. the interface media
is also changed to the mullmedium before unlocking (see
the comment).

4 years ago/sys/man/9: more pages added
rgl [Sat, 4 Jan 2020 17:02:54 +0000 (18:02 +0100)]
/sys/man/9: more pages added

in addition to the pages, there's also changes to the mkfile
to generate the index for the new section.

4 years agoip/ipconfig: keep on sending router solicitation after initial RA
cinap_lenrek [Sat, 4 Jan 2020 10:49:50 +0000 (11:49 +0100)]
ip/ipconfig: keep on sending router solicitation after initial RA

avm fritzbox uses very long RA period so it effectively only
responds after a router solicitation. when there are multiple
fritzbox routers on the lan, then while configuring one prefix
of the first RA, the ip stack can drop the second router
advertisement and we would never get the second route.

packets can always get lost. so we just keep on sending router
solicitations (up to 3 times) to make sure we got all the RA's.

4 years agorio, kbdfs: increase read buffer for high latency kbdfs support
23hiro [Mon, 23 Dec 2019 00:31:30 +0000 (01:31 +0100)]
rio, kbdfs: increase read buffer for high latency kbdfs support

4 years ago9p(2): fix sentence for wstat function (thanks jsmoody)
cinap_lenrek [Sat, 21 Dec 2019 14:31:10 +0000 (15:31 +0100)]
9p(2): fix sentence for wstat function (thanks jsmoody)

4 years agosleep(9): recover comment with the right reference
rgl [Fri, 20 Dec 2019 22:15:07 +0000 (23:15 +0100)]
sleep(9): recover comment with the right reference

4 years agokproc(9) and sleep(9) corrections
rgl [Fri, 20 Dec 2019 17:01:43 +0000 (18:01 +0100)]
kproc(9) and sleep(9) corrections

4 years agothread(2): fix description of when/why procexec(l) functions return
Alex Musolino [Thu, 19 Dec 2019 06:42:15 +0000 (17:12 +1030)]
thread(2): fix description of when/why procexec(l) functions return

4 years agopc, pc64: fix cputemp decimal handling in amd10temprd (thanks Robert Ransom)
Alex Musolino [Thu, 19 Dec 2019 04:49:02 +0000 (15:19 +1030)]
pc, pc64: fix cputemp decimal handling in amd10temprd (thanks Robert Ransom)

4 years agoflate(2): fix typos (thanks rgl)
Alex Musolino [Tue, 17 Dec 2019 22:31:38 +0000 (09:01 +1030)]
flate(2): fix typos (thanks rgl)

4 years agoip(3): document special null-address hack for accepting all incoming connections
cinap_lenrek [Sun, 15 Dec 2019 12:59:08 +0000 (13:59 +0100)]
ip(3): document special null-address hack for accepting all incoming connections

4 years agodate: make ISO 8601 time output compatible to RFC3339
cinap_lenrek [Sat, 14 Dec 2019 16:09:14 +0000 (17:09 +0100)]
date: make ISO 8601 time output compatible to RFC3339

RFC3339 is a stricter subset of ISO 8601, in particular
the timezone offset needs to be specified as +HH:MM while
in ISO 8601 the colon is optional.

4 years agonormalize error messages in yacc, stop writing to closed fd.
Ori Bernstein [Thu, 12 Dec 2019 07:26:15 +0000 (23:26 -0800)]
normalize error messages in yacc, stop writing to closed fd.

4 years agomerge
cinap_lenrek [Wed, 11 Dec 2019 22:53:10 +0000 (23:53 +0100)]
merge

4 years agodevcons: fix write length of writebintime() (thanks BurnZeZ)
cinap_lenrek [Wed, 11 Dec 2019 22:52:05 +0000 (23:52 +0100)]
devcons: fix write length of writebintime() (thanks BurnZeZ)

4 years agoremove unused code.
Ori Bernstein [Wed, 11 Dec 2019 07:13:25 +0000 (23:13 -0800)]
remove unused code.

4 years agoonly ensurecache() on doplumb().
Ori Bernstein [Wed, 11 Dec 2019 07:01:06 +0000 (23:01 -0800)]
only ensurecache() on doplumb().

4 years agomerge
Ori Bernstein [Wed, 11 Dec 2019 02:21:05 +0000 (18:21 -0800)]
merge

4 years agocrop(1): remove duplicate -b option in synopsis
Alex Musolino [Tue, 10 Dec 2019 04:43:44 +0000 (15:13 +1030)]
crop(1): remove duplicate -b option in synopsis

4 years agoupas/fs plumb flag changes.
Ori Bernstein [Mon, 9 Dec 2019 20:46:27 +0000 (12:46 -0800)]
upas/fs plumb flag changes.

This patch makes 3 changes:

- It makes upas/fs send plumb messages when a message
  changes in the background (eg, someone on another imap
  connection opens a message and sets the read flag)
- It makes faces not complain when it gets one of these
  new modify messages.
- It makes acme/Mail update the flags in the display
  when it gets one of these messages.

4 years agoriostart: when system uses serial console, provide a system shell on it
cinap_lenrek [Mon, 9 Dec 2019 17:08:02 +0000 (18:08 +0100)]
riostart: when system uses serial console, provide a system shell on it

on systems with serial console and graphics such as the raspberry pi,
it is nice to get a system shell on the serial console even when no
monitor is connected.

4 years agoconsole(8): add console command and manpage
cinap_lenrek [Mon, 9 Dec 2019 16:44:28 +0000 (17:44 +0100)]
console(8): add console command and manpage

the console command runs a command or the system shell under
a new instance of kbdfs, optionally providing a serial console
when $console environment variable is set.

4 years agomerge
cinap_lenrek [Mon, 9 Dec 2019 01:03:10 +0000 (02:03 +0100)]
merge

4 years agohgfs: fix loadrevinfo() breakage on long lines using libbio (thanks deuterion)
cinap_lenrek [Mon, 9 Dec 2019 01:01:12 +0000 (02:01 +0100)]
hgfs: fix loadrevinfo() breakage on long lines using libbio (thanks deuterion)

4 years agohack around timezone issues.
Ori Bernstein [Sun, 8 Dec 2019 19:58:52 +0000 (11:58 -0800)]
hack around timezone issues.

4 years agomerge
Ori Bernstein [Sun, 8 Dec 2019 19:58:19 +0000 (11:58 -0800)]
merge

4 years agofix filetype detecton by suffix so that multiple dots dont confuse it. (thanks kvik)
Ori Bernstein [Sun, 8 Dec 2019 19:54:59 +0000 (11:54 -0800)]
fix filetype detecton by suffix so that multiple dots dont confuse it. (thanks kvik)

4 years agopc: replace duplicated and broken mmu flush code in vunmap()
cinap_lenrek [Sat, 7 Dec 2019 01:19:14 +0000 (02:19 +0100)]
pc: replace duplicated and broken mmu flush code in vunmap()

comparing m with MACHP() is wrong as m is a constant on 386.

add procflushothers(), which flushes all processes except up
using common procflushmmu() routine.

4 years agokernel: avoid useless mmu flushes, implement better wait condition for procflushmmu()
cinap_lenrek [Sat, 7 Dec 2019 01:13:51 +0000 (02:13 +0100)]
kernel: avoid useless mmu flushes, implement better wait condition for procflushmmu()

procflushmmu() returns once all *OTHER* processors that had
matching processes running on them flushed ther tlb/mmu state.
the caller of procflush...() takes care of flushing "up" by
calling flushmmu() later.

if the current process matched, then that means m->flushmmu
would be set, and hzclock() would call flushmmu() again.

to avoid this, we now check up->newtlb in addition to m->flushmmu
in hzclock() before calling flushmmu().

we also maintain information on which process on what processor
to wait for locally, which helps making progress when multiple
procflushmmu()'s are running concurrently.

in addition, this makes the wait condition for procflushmmu()
more sophisticated, by validating if the processor still runs
the selected process and only if it matchatches, considers
the MACHP(nm)->flushmmu flag.

4 years agofix some acme memory leaks
Ori Bernstein [Fri, 6 Dec 2019 20:08:00 +0000 (12:08 -0800)]
fix some acme memory leaks

(imported from plan9port 7ca1c90109e17dced4b38fbaadea9d2cf39871b7,
some tag restoration lines not relevant.)

4 years agohoc: don't nest calls to follow() when lexing ++/+= and --/-= (#287)
Ori Bernstein [Fri, 6 Dec 2019 19:53:44 +0000 (11:53 -0800)]
hoc: don't nest calls to follow() when lexing ++/+= and --/-= (#287)

The code had a nested use of the follow() function that could cause +=+
and -=- to register as ++ and --.  The first follow() to execute could
consume a character and match and then the second follow() could consume
another character and match.  For example i-=-10 would result in a syntax
error and i-=- would decrement i.

(imported from plan9port commit f1dd3f065a97f57bf59db2e3284868e181734159)

4 years agowords: transgender
Sigrid [Fri, 6 Dec 2019 14:20:35 +0000 (15:20 +0100)]
words: transgender

4 years agodelete obsolete comments (replies are flagged elsewhere)
Ori Bernstein [Thu, 5 Dec 2019 08:16:15 +0000 (00:16 -0800)]
delete obsolete comments (replies are flagged elsewhere)

4 years agomerge
cinap_lenrek [Wed, 4 Dec 2019 21:04:12 +0000 (22:04 +0100)]
merge

4 years agobcm: use extended small pages so XN bit can work
cinap_lenrek [Wed, 4 Dec 2019 21:02:51 +0000 (22:02 +0100)]
bcm: use extended small pages so XN bit can work

the change to support no-execute bits broke the original
raspberry pi1, as it uses backwards compatible page table
format.

to use the XN bit, subpage AP bits have to be disabled
using the XP bit in CP15 Control Register c1 Bit 23.

4 years ago9/boot/net.rc: suppress error from grep if ethernet ifstats file is not found
cinap_lenrek [Wed, 4 Dec 2019 20:56:13 +0000 (21:56 +0100)]
9/boot/net.rc: suppress error from grep if ethernet ifstats file is not found

this can happen with nusb/ether, which does not implement ifstats file.

4 years agoacme: Apply each -/+ only once (#156)
Ori Bernstein [Wed, 4 Dec 2019 20:55:03 +0000 (12:55 -0800)]
acme: Apply each -/+ only once (#156)

When plumbing an address like `3-`, Acme selects line 1,
and similarly `3+` selects line 5.
The same problem can be observed for character addresses (`#123+`)
but _not_ for ones like `+`, `.+` or `/foo/+`:
The problem only occurs when a number is followed by a direction (`-`/`+`).

Following along with the example `3-` through `address` (in addr.c):
We read `3` into `c` and match the `case` on line 239.
The `while` loop on line 242ff reads additional digits into `c`
and puts the first non-digit back by decrementing the index `q`.
Then we find the range for line 3 on line 251 and continue.

On the next iteration, we set `prevc` to the last `c`,
but since that part read ahead _into `c`_,
`c` is currently the _next_ character we will read, `-`,
and now `prevc` is too.

Then in the case block (line 210) the condition on line 211 holds
and Acme believes that it has read two `-` in sequence
and modifies the range to account for the “first” `-`.
The “second” `-` gets applied after the loop is done, on line 292.

So the general problem is:
While reading numbers, Acme reads the next character after the number into `c`.
It decrements the counter to ensure it will read it again on the next iteration,
but it still uses it to update `prevc`.

This change solves the problem by reading digits into `nc` instead.
This variable is used to similar effect in the block for directions (line 212)
and fills the role of “local `c` that we can safely use to read ahead” nicely.

(imported from plan9front a82a8b6368274d77d42f526e379b74e79c137e26)

4 years agoacme: avoid division by zero when resizing col (#189)
Ori Bernstein [Wed, 4 Dec 2019 20:37:07 +0000 (12:37 -0800)]
acme: avoid division by zero when resizing col (#189)

To reproduce, create a column with at least two windows and resize
acme to have almost zero height.

(imported from plan9port commit 76b9347a5fa3a0970527c6ee1b97ef1c714f636b)