]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
4 years agobcm64: reorganize virtual memory map for rapberry pi4
cinap_lenrek [Thu, 25 Jul 2019 07:10:07 +0000 (09:10 +0200)]
bcm64: reorganize virtual memory map for rapberry pi4

4 years agobcm64: update io.h for pci express and raspberry pi 4
cinap_lenrek [Thu, 25 Jul 2019 07:08:35 +0000 (09:08 +0200)]
bcm64: update io.h for pci express and raspberry pi 4

4 years agobcm64: add pci express driver for raspberry pi 4
cinap_lenrek [Thu, 25 Jul 2019 07:04:50 +0000 (09:04 +0200)]
bcm64: add pci express driver for raspberry pi 4

4 years agobcm64: add gic interrupt controller driver for raspberry pi 4
cinap_lenrek [Thu, 25 Jul 2019 07:02:47 +0000 (09:02 +0200)]
bcm64: add gic interrupt controller driver for raspberry pi 4

4 years agobcm64: add gisb arbiter driver to catch bus timeouts
cinap_lenrek [Thu, 25 Jul 2019 07:01:44 +0000 (09:01 +0200)]
bcm64: add gisb arbiter driver to catch bus timeouts

4 years agobcm, bcm64: make irq.$O optional and add intrdisable(), use intrenable()
cinap_lenrek [Thu, 25 Jul 2019 06:58:58 +0000 (08:58 +0200)]
bcm, bcm64: make irq.$O optional and add intrdisable(), use intrenable()

the raspberry pi 4 has a new interrupt controller and
pci support, so get rid of intrenable() macro and
properly make intrenable function with tbdf argument.

4 years agobcm64: strip debug symbols to make sure .img file is multiple of 4 bytes
cinap_lenrek [Thu, 25 Jul 2019 06:52:46 +0000 (08:52 +0200)]
bcm64: strip debug symbols to make sure .img file is multiple of 4 bytes

the raspberry pi4 firmware refuses to enable the GIC interrup controller
for arm64 when the .img file is not a multiple of 4 bytes. yes, this
is insane and nowhere documented.

4 years agobcm, bcm64: add dmaflush() function and make virtio size and virtual address configur...
cinap_lenrek [Thu, 25 Jul 2019 06:41:37 +0000 (08:41 +0200)]
bcm, bcm64: add dmaflush() function and make virtio size and virtual address configurable in Soc.virtio and Soc.iosize

4 years agobcm, bcm64: add support for device tree parameter passing
cinap_lenrek [Thu, 25 Jul 2019 06:19:12 +0000 (08:19 +0200)]
bcm, bcm64: add support for device tree parameter passing

the new raspberry pi 4 firmware for arm64 seems to have
broken atag support. so we now parse the device tree
structure to get the bootargs and memory configuration.

4 years agousbxhci: implement portable dma flush operations and move to port/
cinap_lenrek [Wed, 17 Jul 2019 08:30:06 +0000 (10:30 +0200)]
usbxhci: implement portable dma flush operations and move to port/

4 years agousbehci: introduce dmaflush() function to handle portable cache invalidation for...
cinap_lenrek [Wed, 17 Jul 2019 08:24:50 +0000 (10:24 +0200)]
usbehci: introduce dmaflush() function to handle portable cache invalidation for device drivers

4 years agomerge
cinap_lenrek [Thu, 11 Jul 2019 05:49:52 +0000 (07:49 +0200)]
merge

4 years agokernel: move common ethermii to port/
cinap_lenrek [Thu, 11 Jul 2019 05:47:39 +0000 (07:47 +0200)]
kernel: move common ethermii to port/

4 years agodevuart: make sure uart is enabled in uartkick()
cinap_lenrek [Thu, 11 Jul 2019 05:45:34 +0000 (07:45 +0200)]
devuart: make sure uart is enabled in uartkick()

4 years agowalk(1): add history section
Alex Musolino [Tue, 2 Jul 2019 14:04:31 +0000 (23:34 +0930)]
walk(1): add history section

4 years agotinc(8): add history section
Alex Musolino [Tue, 2 Jul 2019 12:54:10 +0000 (22:24 +0930)]
tinc(8): add history section

4 years agousbxhci: fix mysterious ENABLESLOT failures (update to XHCI spec revision 1.2 (2019))
cinap_lenrek [Tue, 2 Jul 2019 03:34:13 +0000 (05:34 +0200)]
usbxhci: fix mysterious ENABLESLOT failures (update to XHCI spec revision 1.2 (2019))

Ori Bernstein had Sunrise Point-H USB 3.0 xHCI Controller that would mysteriously
crash on the 5th ENABLESLOT command. This was reproducable by even just allocating
slots in a loop right after init.

It turns out, the 1.2 spec extended the Max Scratchpad Buffers in HCSPARAMS2 so our
driver would not allocate enougth scratchpad buffers and controller firmware would
crash once it went beyond our allocated scratchpad buffer array.

This change also fixes:

- ignore bits 16:31 in PAGESIZE register
- preserve bits 10:31 in the CONFIG register
- handle ADDESSDEV command failure (so it can be retried)

5 years agopc64: preallocate mmupool page tables
cinap_lenrek [Fri, 28 Jun 2019 16:12:13 +0000 (18:12 +0200)]
pc64: preallocate mmupool page tables

preallocate 2% of user pages for page tables and MMU structures
and keep them mapped in the VMAP range. this leaves more space
in the KZERO window and avoids running out of kernel memory on
machines with large amounts of memory.

5 years agoape: reimplement rename() - fixing compiler warnings and handling more error cases
cinap_lenrek [Mon, 24 Jun 2019 18:09:04 +0000 (20:09 +0200)]
ape: reimplement rename() - fixing compiler warnings and handling more error cases

handle empty filename, dot and dotdot. handle mismatching from/to directory/file
type. cleanup destination file on error. error when attempting to copy non-empty
directories.

little test program:

#include <unistd.h>
#include <stdio.h>

int
main(int argc, char *argv[])
{
if(argc != 3){
fprintf(stderr, "usage: %s old new\n", argv[0]);
return 1;
}
if(rename(argv[1], argv[2])){
perror("rename");
return 1;
}
return 0;
}

5 years ago8c, 6c: LEA x, R; MOV (R), R -> MOV x, R
cinap_lenrek [Mon, 24 Jun 2019 17:38:46 +0000 (19:38 +0200)]
8c, 6c: LEA x, R; MOV (R), R -> MOV x, R

5 years ago8c, 6c: avoid allocating index registers when we don't have to
cinap_lenrek [Mon, 24 Jun 2019 17:36:01 +0000 (19:36 +0200)]
8c, 6c: avoid allocating index registers when we don't have to

when a operation receives a chain of OINDEX nodes as its operands,
each indexing step used to allocate a new index register. this
is wastefull an can result in running out of fixed registers on 386
for code such as: x = a[a[a[a[i]]]].

instead we attempt to reuse the destination register of the operation
as the index register if it is not otherwise referenced. this results
in the index chain to use a single register for index and result and
leaves registers free to be used for something usefull instead.

for 6c, try to avoid R13 as well as BP index base register.

5 years ago8c: skip 64-bit regpair allocation for OINDEX nodes in cgen64()
cinap_lenrek [Mon, 24 Jun 2019 17:25:13 +0000 (19:25 +0200)]
8c: skip 64-bit regpair allocation for OINDEX nodes in cgen64()

OINDEX can only return TLONG result on 386 so give it
a register instead of a regpair and let gmove() handle
the conversion.

5 years agoape: revert rename() change
cinap_lenrek [Sun, 23 Jun 2019 20:35:14 +0000 (22:35 +0200)]
ape: revert rename() change

new implementation gets stuck in a infinite loop. backing
this out for now.

5 years agoTurn on warnings when building libap.
Ori Bernstein [Fri, 21 Jun 2019 17:00:58 +0000 (10:00 -0700)]
Turn on warnings when building libap.

For ape, we never enabled warnings in cflags.
Turning it on brings up a lot of warnings. Most are noise,
but a few caught unused variables and trunctaions of pointers.
to smaller integers (int, long).

A few warnings remain.

5 years agogs: apply mitigations against CVE-2017-8291 (thanks jsmoody)
cinap_lenrek [Fri, 21 Jun 2019 16:57:20 +0000 (18:57 +0200)]
gs: apply mitigations against CVE-2017-8291 (thanks jsmoody)

To reproduce:
gs -q -dNOPAUSE -dSAFER '-sDEVICE=ppmraw' '-sOutputFile=/dev/null' <<.
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: -0 -0 100 100

/size_from  10000      def
/size_step    500      def
/size_to   65000      def
/enlarge    1000      def

%/bigarr 65000 array def

0
size_from size_step size_to {
    pop
    1 add
} for

/buffercount exch def

/buffersizes buffercount array def

0
size_from size_step size_to {
    buffersizes exch 2 index exch put
    1 add
} for
pop

/buffers buffercount array def

0 1 buffercount 1 sub {
    /ind exch def
    buffersizes ind get /cursize exch def
    cursize string /curbuf exch def
    buffers ind curbuf put
    cursize 16 sub 1 cursize 1 sub {
        curbuf exch 255 put
    } for
} for

/buffersearchvars [0 0 0 0 0] def
/sdevice [0] def

enlarge array aload

{
    .eqproc
    buffersearchvars 0 buffersearchvars 0 get 1 add put
    buffersearchvars 1 0 put
    buffersearchvars 2 0 put
    buffercount {
        buffers buffersearchvars 1 get get
        buffersizes buffersearchvars 1 get get
        16 sub get
        254 le {
            buffersearchvars 2 1 put
            buffersearchvars 3 buffers buffersearchvars 1 get get put
            buffersearchvars 4 buffersizes buffersearchvars 1 get get 16 sub put
        } if
        buffersearchvars 1 buffersearchvars 1 get 1 add put
    } repeat

    buffersearchvars 2 get 1 ge {
        exit
    } if
    %(.) print
} loop

.eqproc
.eqproc
.eqproc
sdevice 0
currentdevice
buffersearchvars 3 get buffersearchvars 4 get 16#7e put
buffersearchvars 3 get buffersearchvars 4 get 1 add 16#12 put
buffersearchvars 3 get buffersearchvars 4 get 5 add 16#ff put
put

buffersearchvars 0 get array aload

sdevice 0 get
16#3e8 0 put

sdevice 0 get
16#3b0 0 put

sdevice 0 get
16#3f0 0 put

currentdevice null false mark /OutputFile (%pipe%echo gotce)
.putdeviceparams
1 true .outputpage
.rsdparams
%{ } loop
0 0 .quit
%asdf

.

5 years agocwfs: remove orphaned lrand.c
cinap_lenrek [Thu, 20 Jun 2019 12:15:20 +0000 (14:15 +0200)]
cwfs: remove orphaned lrand.c

5 years agocwfs: remove old some assert() debugging
cinap_lenrek [Thu, 20 Jun 2019 12:06:29 +0000 (14:06 +0200)]
cwfs: remove old some assert() debugging

5 years agobcm, kw, omap, teg2: implement setregisters()
cinap_lenrek [Thu, 20 Jun 2019 11:17:36 +0000 (13:17 +0200)]
bcm, kw, omap, teg2: implement setregisters()

5 years agocwfs: fix root access time qid path comparsion
cinap_lenrek [Thu, 20 Jun 2019 11:15:26 +0000 (13:15 +0200)]
cwfs: fix root access time qid path comparsion

5 years agoupas/smtp: handle temporary authentication failures
cinap_lenrek [Thu, 20 Jun 2019 10:13:51 +0000 (12:13 +0200)]
upas/smtp: handle temporary authentication failures

under heavy load, factotum can return a "too much activity" error,
which upas/smtpd and upas/smtp should consider a temporary error
instead of a permanent one.

5 years agorc-httpd: serve markdown with text/plain content-type
Alex Musolino [Thu, 20 Jun 2019 06:56:03 +0000 (16:26 +0930)]
rc-httpd: serve markdown with text/plain content-type

5 years agopc64: actually fix it, what was i THINKING
cinap_lenrek [Wed, 19 Jun 2019 22:36:51 +0000 (00:36 +0200)]
pc64: actually fix it, what was i THINKING

5 years agopc64: fix compiler warning in rebootjump() entry calculation
cinap_lenrek [Wed, 19 Jun 2019 22:32:54 +0000 (00:32 +0200)]
pc64: fix compiler warning in rebootjump() entry calculation

5 years agostdio: fix putc(), plan9 version
cinap_lenrek [Wed, 19 Jun 2019 22:04:58 +0000 (00:04 +0200)]
stdio: fix putc(), plan9 version

5 years agoape: fix stdio putc() macro, avoiding "result of operation not used" warning
cinap_lenrek [Wed, 19 Jun 2019 21:59:25 +0000 (23:59 +0200)]
ape: fix stdio putc() macro, avoiding "result of operation not used" warning

moving _IO_CHMASK masking on the right hand side fixes it.

5 years agocc: remove nullwarn() from OCAST codegen, zap void casts
cinap_lenrek [Wed, 19 Jun 2019 21:50:33 +0000 (23:50 +0200)]
cc: remove nullwarn() from OCAST codegen, zap void casts

implicit casts would cause spurious "result of operation not used"
warnings such as ape's stdio putc() macro.

make (void) casts non-ops when the casted expression has no
side effects. this avoid spurious warning with ape's assert()
macro.

5 years agocwfs: properly handle 64 bit qid path
cinap_lenrek [Wed, 19 Jun 2019 20:58:16 +0000 (22:58 +0200)]
cwfs: properly handle 64 bit qid path

for historical reasons, kenfs stores directory entries in pre 9p2000
format with directories having the QPDIR bit 31 set in the qid path.

however, the 64 bit fileserver allows 64 bit qid paths.

given that we do not support pre 9p2000 clients and do not rely on
the QPDIR, but want to keep the block check tags consistent, we will
*INVERT* the QPDIR bit in directory entry qid paths for directories.

this preserves the on-disk semantics (for < 31 bit qmax) but does
not complicate qid generation and recovery. also makes it easy to
convert between directory entry qid and 9p format.

5 years agopcc: back out -+ flag removal to allow gracefull upgrade path with new pcc but old cpp
cinap_lenrek [Wed, 19 Jun 2019 13:15:35 +0000 (15:15 +0200)]
pcc: back out -+ flag removal to allow gracefull upgrade path with new pcc but old cpp

5 years agoAlways turn on the -+ flag in cpp
Ori Bernstein [Wed, 19 Jun 2019 05:47:15 +0000 (22:47 -0700)]
Always turn on the -+ flag in cpp

C99 comments have been the default in compilers for something like 20 years
now. This means we don't need to remember to turn it on when porting software,
and gets rid of cryptic errors about unterminated character constants when
someone writes something like:

// Didn't need to...

We still accept the flag to avoid breaking mkfiles, but we do nothing with it.

This also removes the documentation, since the option does nothing now.

5 years agoImport compiler warnings and bugfixes from Charles.
Ori Bernstein [Wed, 19 Jun 2019 05:17:19 +0000 (22:17 -0700)]
Import compiler warnings and bugfixes from Charles.

This change imports a few warnings and minor fixes from Charles branch
here: https://bitbucket.org/plan9-from-bell-labs/plan9.

The changes included here:

changeset:   1374:9185dc017be0
summary:     declare castucom; move a declaration into order;
             use cast instead of ULL suffix
changeset:   1353:5fe8380b1818
summary:     supporting functions:
             1. castucom to match unlikely mask operation;
                2. be sure to snap both sides of pointer subtraction completely;
             3. add extra operators as side-effect free
changeset:   1352:90058c092d66
summary:     1. correct result type for mixed-mode assignment operators
             2. detect divide by zero (erik);
             3. detect masks misformed by sign-extension;
             4. diagnose mixed old/new prototypes

5 years agomerge
cinap_lenrek [Tue, 18 Jun 2019 11:29:29 +0000 (13:29 +0200)]
merge

5 years ago8c, 6c: fix INDEX node #reg calculation
cinap_lenrek [Tue, 18 Jun 2019 11:28:15 +0000 (13:28 +0200)]
8c, 6c: fix INDEX node #reg calculation

5 years agoDelete dead code.
Ori Bernstein [Tue, 18 Jun 2019 04:12:35 +0000 (21:12 -0700)]
Delete dead code.

Nothing is using (or even building) bound.[ch]

5 years agorc-httpd: set charset=utf-8 for all text/* content types
Alex Musolino [Mon, 17 Jun 2019 03:47:16 +0000 (13:17 +0930)]
rc-httpd: set charset=utf-8 for all text/* content types

5 years agorc-httpd: only emit charset option for text/plain content type
Alex Musolino [Mon, 17 Jun 2019 03:43:40 +0000 (13:13 +0930)]
rc-httpd: only emit charset option for text/plain content type

5 years agoAdd test for pow.c
Ori Bernstein [Mon, 17 Jun 2019 01:21:52 +0000 (18:21 -0700)]
Add test for pow.c

5 years agoHandle NaN and Inf edge cases as specified by posix, instead of barfing.
Ori Bernstein [Sun, 16 Jun 2019 22:55:55 +0000 (15:55 -0700)]
Handle NaN and Inf edge cases as specified by posix, instead of barfing.

We're not a posix system, but the posix spec is a good reference
for what we should do.

Thanks Geoff for the inspiration for this patch.

5 years agomerge
cinap_lenrek [Fri, 14 Jun 2019 08:32:26 +0000 (10:32 +0200)]
merge

5 years agodevdtracy: make machlocks and dtktab static
cinap_lenrek [Fri, 14 Jun 2019 08:30:50 +0000 (10:30 +0200)]
devdtracy: make machlocks and dtktab static

5 years agobcm64: implement dtracy support
cinap_lenrek [Fri, 14 Jun 2019 08:28:30 +0000 (10:28 +0200)]
bcm64: implement dtracy support

5 years agovmx(1): update BUGS
aiju [Tue, 11 Jun 2019 11:36:20 +0000 (11:36 +0000)]
vmx(1): update BUGS

5 years agosnoopy(8): add support for dhcp classless static routes option
Alex Musolino [Tue, 11 Jun 2019 05:57:12 +0000 (15:27 +0930)]
snoopy(8): add support for dhcp classless static routes option

To complement the new cl-routes field, the bootp static routes option has been
renamed to cf-routes and the network/gateway pairs are separated with a right
arrow.

5 years agosnoopy(8): avoid extra spaces in dhcp filter output
Alex Musolino [Tue, 11 Jun 2019 05:49:18 +0000 (15:19 +0930)]
snoopy(8): avoid extra spaces in dhcp filter output

5 years agosnoopy(8): include dhcp.h instead of replicating bootp/dhcp options enum
Alex Musolino [Tue, 11 Jun 2019 05:48:27 +0000 (15:18 +0930)]
snoopy(8): include dhcp.h instead of replicating bootp/dhcp options enum

5 years agofile(1): recognise unified diff output
Alex Musolino [Sat, 8 Jun 2019 06:26:03 +0000 (15:56 +0930)]
file(1): recognise unified diff output

5 years agorc-httpd(8): avoid duplicate log output in dir-index handler
Alex Musolino [Wed, 5 Jun 2019 06:34:50 +0000 (16:04 +0930)]
rc-httpd(8): avoid duplicate log output in dir-index handler

Delay calling do_log until just before emitting the response.  This avoids
calling do_log before potentially handing control to the static-index
handler, which also calls do_log.

5 years agoRemove trailing whitespace.
Ori Bernstein [Wed, 5 Jun 2019 05:47:07 +0000 (22:47 -0700)]
Remove trailing whitespace.

5 years agoLost a trailing \n
Ori Bernstein [Wed, 5 Jun 2019 05:42:10 +0000 (22:42 -0700)]
Lost a trailing \n

5 years agoMake 'g' grep recursively by default.
Ori Bernstein [Wed, 5 Jun 2019 05:36:32 +0000 (22:36 -0700)]
Make 'g' grep recursively by default.

5 years agoplumber: loop will go out of bounds when *++s == '\0'; replace with strstr
BurnZeZ [Fri, 31 May 2019 22:15:53 +0000 (22:15 +0000)]
plumber: loop will go out of bounds when *++s == '\0'; replace with strstr

5 years agossh: work around github.com's broken cipher negotiation code (thanks Ori_B)
cinap_lenrek [Mon, 27 May 2019 00:11:16 +0000 (02:11 +0200)]
ssh: work around github.com's broken cipher negotiation code (thanks Ori_B)

key exchange with git@github.com fails as they appear to try to
negotiate a mac algorithm even tho we use an AEAD cipher which
does not use a mac algorithm.

the work around is to supply a dummy mac algorithm that they
can negotiate to make them happy.

5 years ago/sys/src/cmd/mkfile: fix PCONLY exclude (thanks stefan)
cinap_lenrek [Fri, 24 May 2019 20:52:20 +0000 (22:52 +0200)]
/sys/src/cmd/mkfile: fix PCONLY exclude (thanks stefan)

5 years agoawk: no need to call getargv() twice to get the value for FILENAME
cinap_lenrek [Fri, 24 May 2019 15:25:44 +0000 (17:25 +0200)]
awk: no need to call getargv() twice to get the value for FILENAME

5 years agogs: fix missing type check in ztype (thanks jsmoody)
cinap_lenrek [Fri, 24 May 2019 12:17:18 +0000 (14:17 +0200)]
gs: fix missing type check in ztype (thanks jsmoody)

to reproduce:

gs <<.
null [[][][][][][][][][][][][][][][]] .type
.

5 years agogs: apply fixes for CVE-2018-16509 (thanks jsmoody)
cinap_lenrek [Thu, 23 May 2019 12:59:28 +0000 (14:59 +0200)]
gs: apply fixes for CVE-2018-16509 (thanks jsmoody)

5 years agodevip: if the server does not support TCP ws option, disable window scaling (thanks...
cinap_lenrek [Wed, 22 May 2019 20:20:31 +0000 (22:20 +0200)]
devip: if the server does not support TCP ws option, disable window scaling (thanks joe9)

if the server responds without a window scale option in
its syn-ack, disable window scaling alltogether as both
sides need to understand the option.

5 years agoupas/fs: remove read timeout via alarm(2) in pop3resp
Alex Musolino [Mon, 20 May 2019 05:30:14 +0000 (15:00 +0930)]
upas/fs: remove read timeout via alarm(2) in pop3resp

The alarm note is not handled by upas/fs, so if and when it did fire,
the pop3 client process would terminate rendering the entire fs
unresponsive.

5 years agovmx: handle build arch exclude in /sys/src/cmd/mkfile
cinap_lenrek [Sun, 19 May 2019 15:11:57 +0000 (17:11 +0200)]
vmx: handle build arch exclude in /sys/src/cmd/mkfile

5 years agobcm, bcm64: fix cache operations for dma and emmc
cinap_lenrek [Sun, 19 May 2019 14:54:50 +0000 (16:54 +0200)]
bcm, bcm64: fix cache operations for dma and emmc

always clean AND invalidate caches before dma read,
never just invalidate as the buffer might not be
aligned to cache lines...

we have to invalidate caches again *AFTER* the dma
read has completed. the processor can bring in data
speculatively into the cache while the dma in in
flight.

5 years agosshnet(4): ... and incoming TCP calls
cinap_lenrek [Sat, 18 May 2019 10:45:57 +0000 (12:45 +0200)]
sshnet(4): ... and incoming TCP calls

5 years agomerge
cinap_lenrek [Fri, 17 May 2019 17:01:14 +0000 (19:01 +0200)]
merge

5 years agobcm64: remove unneccesary tlb flush on mmuidmap()
cinap_lenrek [Fri, 17 May 2019 16:57:05 +0000 (18:57 +0200)]
bcm64: remove unneccesary tlb flush on mmuidmap()

5 years agobcm64: no need to flush instruction cache when switching TTBR0
cinap_lenrek [Fri, 17 May 2019 16:56:34 +0000 (18:56 +0200)]
bcm64: no need to flush instruction cache when switching TTBR0

5 years agobcm64: switch to 64k page size
cinap_lenrek [Fri, 17 May 2019 16:35:14 +0000 (18:35 +0200)]
bcm64: switch to 64k page size

5 years ago7l: don't hardcode 4k pagesize, use INITRND
cinap_lenrek [Fri, 17 May 2019 16:14:10 +0000 (18:14 +0200)]
7l: don't hardcode 4k pagesize, use INITRND

5 years agomerge
cinap_lenrek [Thu, 16 May 2019 23:53:27 +0000 (01:53 +0200)]
merge

5 years agomkone: fix man target (thanks Amavect)
cinap_lenrek [Thu, 16 May 2019 23:51:28 +0000 (01:51 +0200)]
mkone: fix man target (thanks Amavect)

Amavect wrote:
> mkone and mkmany have backwards targets for installing man pages.
> This patch makes 'mk man' actually work for mkfiles that include mkone.
> mkmany is not easily fixed without breaking changes.
> It may go without saying that external repos should write their own mkfiles.

5 years agodraw(3): memlorigin
23hiro [Wed, 15 May 2019 18:24:39 +0000 (20:24 +0200)]
draw(3): memlorigin

5 years agobcm64: generalize mmu code
cinap_lenrek [Wed, 15 May 2019 14:19:20 +0000 (16:19 +0200)]
bcm64: generalize mmu code

make user page table list heads arrays so we can
index into the right level avoiding the special
cases for differen PTLEVELS.

5 years agobcm64: fix mmu0clear() mistake from previous commit
cinap_lenrek [Wed, 15 May 2019 11:24:34 +0000 (13:24 +0200)]
bcm64: fix mmu0clear() mistake from previous commit

5 years agonusb(2): remove startdevs() reference, document getdev() (thanks BurnZeZ)
cinap_lenrek [Tue, 14 May 2019 07:06:09 +0000 (09:06 +0200)]
nusb(2): remove startdevs() reference, document getdev() (thanks BurnZeZ)

5 years agobcm: add cache invalidate before accessing prop buffer
cinap_lenrek [Mon, 13 May 2019 17:21:14 +0000 (19:21 +0200)]
bcm: add cache invalidate before accessing prop buffer

5 years agobcm64: implement reboot support
cinap_lenrek [Mon, 13 May 2019 17:20:21 +0000 (19:20 +0200)]
bcm64: implement reboot support

5 years agobcm, bcm64: preserve memsize across reboots, avoid trashing atags while parsing cmdline
cinap_lenrek [Mon, 13 May 2019 17:12:41 +0000 (19:12 +0200)]
bcm, bcm64: preserve memsize across reboots, avoid trashing atags while parsing cmdline

we override atag memory on reboot, so preserve
the memsize learned from atag as *maxmem plan9
variable. the global memsize variable is not
needed anymore.

avoid trashing the following atag when zero
terminating the cmdline string.

zero memory after plan9.ini variables.

5 years agodevip: do not lock selftab in ipselftabread(), remove unused fields from Ipself
cinap_lenrek [Sat, 11 May 2019 23:20:21 +0000 (01:20 +0200)]
devip: do not lock selftab in ipselftabread(), remove unused fields from Ipself

the Ipselftab is designed to not require locking on read
operation. locking the selftab in ipselftabread() risks
deadlock when accessing the user buffer creates a fault.

remove unused fields from the Ipself struct.

5 years agomemdraw(2): remove references to iprint()
BurnZeZ [Sat, 11 May 2019 15:28:18 +0000 (15:28 +0000)]
memdraw(2): remove references to iprint()

5 years agodevip: reset speed and delay on bind, adjust burst on mtu change, ifc->m nil check...
cinap_lenrek [Sat, 11 May 2019 15:22:33 +0000 (17:22 +0200)]
devip: reset speed and delay on bind, adjust burst on mtu change, ifc->m nil check, consistent error strings

initialize the rate limits when the device gets
bound, not when it is created. so that the
rate limtis get reset to default when the ifc
is reused.

adjust the burst delay when the mtu is changed.
this is to make sure that we allow at least one
full sized packet burst.

make a local copy of ifc->m before doing nil
check as it can change under us when we do
not have the ifc locked.

specify Ebound[] and Eunbound[] error strings
and use them consistently.

5 years agodevip: make sure ifc is bound in add6 ctl command
cinap_lenrek [Sat, 11 May 2019 12:54:10 +0000 (14:54 +0200)]
devip: make sure ifc is bound in add6 ctl command

5 years agodevip: remove unused c->car qlock, avoid potential deadlock in ipifcregisterproxy()
cinap_lenrek [Sat, 11 May 2019 12:01:26 +0000 (14:01 +0200)]
devip: remove unused c->car qlock, avoid potential deadlock in ipifcregisterproxy()

remove references to the unused Conv.car qlock.

ipifcregisterproxy() is called with the proxy
ifc wlock'd, which means we cannot acquire the
rwlock of the interfaces that will proxy for us
because it is allowed to rlock() multiple ifc's
in any order. to get arround this, we use canrlock()
and skip the interface when we cannot acquire the
lock.

the ifc should get wlock'd only when we are about
to modify the ifc or its lifc chain. that is when
adding or removing addresses. wlock is not required
when we addresses to the selfcache, which has its
own qlock.

5 years agodevip: avoid media bind/unbind kproc reader startup race, simplify etherbind
cinap_lenrek [Sat, 11 May 2019 05:22:34 +0000 (07:22 +0200)]
devip: avoid media bind/unbind kproc reader startup race, simplify etherbind

mark reader process pointers with (void*)-1 to mean
not started yet. this avoids the race condition when
media unbind happens before the kproc has set its
Proc* pointer. then we would not post the note and
the reader would continue running after unbind.

etherbind can be simplified by reading the #lX/addr
file to get the mac address, avoiding the temporary
buffer.

5 years agotimezones: add India (thanks joe9)
23hiro [Fri, 10 May 2019 23:23:59 +0000 (01:23 +0200)]
timezones: add India (thanks joe9)

5 years agobcm64: use exclusive monitor on nrdy to wake up idlehands()
cinap_lenrek [Fri, 10 May 2019 12:05:04 +0000 (14:05 +0200)]
bcm64: use exclusive monitor on nrdy to wake up idlehands()

when the exclusive monitor is cleared, a event is generated
which we can use to wake up idlehands. that way we do not
need to wait for the next timer interrupt until a cpu takes
work from the run queue.

5 years agoape: fix malloc to deal with more than 4GB of memory on 64 bit systems
cinap_lenrek [Fri, 10 May 2019 10:10:02 +0000 (12:10 +0200)]
ape: fix malloc to deal with more than 4GB of memory on 64 bit systems

5 years agolibc: fix return value for arm64 memset() and memove()
cinap_lenrek [Thu, 9 May 2019 10:40:03 +0000 (12:40 +0200)]
libc: fix return value for arm64 memset() and memove()

5 years agolibc: use MOVP instruction for arm64 memmove() and memset()
cinap_lenrek [Thu, 9 May 2019 09:40:54 +0000 (11:40 +0200)]
libc: use MOVP instruction for arm64 memmove() and memset()

5 years agobcm64: use MOVP instruction for saving and restoring registers
cinap_lenrek [Thu, 9 May 2019 09:11:45 +0000 (11:11 +0200)]
bcm64: use MOVP instruction for saving and restoring registers

5 years agolibmach: remove newline
cinap_lenrek [Thu, 9 May 2019 08:27:17 +0000 (10:27 +0200)]
libmach: remove newline

5 years agolibmach: support for MOVP instruction disassembly for arm64
cinap_lenrek [Thu, 9 May 2019 08:24:37 +0000 (10:24 +0200)]
libmach: support for MOVP instruction disassembly for arm64

5 years ago7l: implement MOVP instruction
cinap_lenrek [Thu, 9 May 2019 08:23:23 +0000 (10:23 +0200)]
7l: implement MOVP instruction

5 years agolibc: provide arm64 assembly versions for memmove() and memset()
cinap_lenrek [Thu, 9 May 2019 00:32:09 +0000 (02:32 +0200)]
libc: provide arm64 assembly versions for memmove() and memset()

just a first approximation, uses unaligned 8 byte loads and stores.
MOVP not yet implemented by the linker. no ZVA cache magic yet.