Commit Graph

6783 Commits (088ec01b1e0840add9823a7d44ba2ed639889937)

Author SHA1 Message Date
cinap_lenrek f6ef250871 /sys/lib/dist/mkfile: storage vendors idea of 2GB is deflating 2019-08-24 16:29:00 +02:00
cinap_lenrek bcf988aff1 bcm64: deal with discontinuous memory regions, avoid virtual memory aliasing, implement vmap() proper
on the 2GB and 4GB raspberry pi 4 variants, there are two
memory regions for ram:

[0x00000000..0x3e600000)
[0x40000000..0xfc000000)

the framebuffer is somewhere at the end of the first
GB of memory.

to handle these, we append the region base and limit
of the second region to *maxmem= like:

*maxmem=0x3e600000 0x40000000 0xfc000000

the mmu code has been changed to have non-existing
ram unmapped and mmukmap() now uses small 64K pages
instead of 512GB pages to avoid aliasing (framebuffer).

the VIRTPCI mapping has been removed as we now have
a proper vmap() implementation which assigns vritual
addresses automatically.
2019-08-23 21:39:20 +02:00
cinap_lenrek e6d22570a8 bcm: invalidate cache on Fbinfo after firmware completion 2019-08-22 02:54:06 +02:00
cinap_lenrek aca0293f0b bcm: flush out early boot messages on uart and screen initialization
make early boot messages available by writing out
kmesg.buf after uart and screen initialization.
2019-08-22 02:52:21 +02:00
cinap_lenrek a70b93a356 /sys/lib/acid/kernel: fix procstk() for arm64, set kdir for arm/arm64 to bcm/bcm64 2019-08-21 19:34:24 +02:00
cinap_lenrek b4cb19235e bcm: set XN bits for kernel device mappings 2019-08-21 18:28:01 +02:00
cinap_lenrek 6280c0f17b bcm64: do not use OTP_BOOTMODE_REG to determine OSC frequency (thanks richard miller)
the register does not seem to be accessible on the Rpi 3b.
so instead hardcode oscfreq in the Soc structure.
2019-08-19 16:42:20 +02:00
cinap_lenrek a611fe20e1 disk/format: implement long name support 2019-08-19 01:09:24 +02:00
cinap_lenrek ac98922f44 add missing device tree file for raspberry pi 4 2019-08-18 22:19:29 +02:00
cinap_lenrek 534be5aeb3 add raspberry pi 4 kernel and bootloader to pi3.img target 2019-08-18 21:43:04 +02:00
cinap_lenrek f35d5ee5b0 bcm64: add support for more than 1GB of ram (untested)
this adds a 4GB KMAP window into the kernel address space
so we can access all physical ram on raspberry pi 4 for
user pages.

note that kernel memory above KZERO is still limited
to 1GB because of DMA restrictions.
2019-08-18 21:16:30 +02:00
cinap_lenrek 3fc8d1bdae bcm64: add driver for emmc2 controller 2019-08-18 18:50:24 +02:00
cinap_lenrek bc8c31dbd5 bcm: fix typo in gpio.c on unused AFedge0 constant 2019-08-16 19:35:46 +02:00
cinap_lenrek 031f5756ab bcm64: poll gisb arbiter for asynchronous bus errors 2019-08-16 19:24:00 +02:00
cinap_lenrek 54becb8466 ethergenet: remove debugging
the hangs where caused by missing NX bits on the mmio mappings,
so the debug code is not needed anymore.
2019-08-16 19:22:28 +02:00
cinap_lenrek 3bf49f1814 bcm64: set XN bits for kernel device mappings 2019-08-16 19:05:04 +02:00
cinap_lenrek ffd99348f3 cc: use 7 octal digits for 21 bit runes 2019-08-12 19:15:02 +02:00
cinap_lenrek 675870f9b1 libauth: do not set errstr in auth_rpc() for ARdone result (thanks majiru) 2019-08-02 19:06:23 +02:00
cinap_lenrek 05f9a66fd4 bcm, bcm64: add vcore support for raspberry pi 3 GPIO expander 2019-07-28 11:39:57 +02:00
cinap_lenrek 8630bd35a6 bcm, bcm64: add BCM2711 support for gpiopull(), fix gpiomeminit(), cleanup
according to the following linux change, BCM2711 uses a different
method for changing pullup/down mode:

abcfd09286 (diff-cf078559c38543ac72c5db99323e236d)

gpiomeminit() was broken, using virtual address for the gpio physseg
instead of the physical one.

cleanup the code, avoid repetition by declaring static u32int *regs
variable. make local variable names consistent.
2019-07-27 20:00:53 +02:00
cinap_lenrek ea2a5a33ca bcm64: fix wrong prescaler for generic timer on rpi4
the raspberry pi 4 uses 54 instead of 19.2 MHz crystal.
detect which frequency is used by reading OTP bootmode
register:

https://www.raspberrypi.org/documentation/hardware/raspberrypi/otpbits.md

Bit 1: sets the oscillator frequency to 19.2MHz
2019-07-27 17:59:25 +02:00
cinap_lenrek 834f670349 ethergenet: fix flow control negotiation 2019-07-25 17:44:47 +02:00
cinap_lenrek 1717368f64 bcm, bcm64: clean dma destination buffer before issuing dma in case of non cache-line-size aligned buffer 2019-07-25 13:55:17 +02:00
cinap_lenrek 706926f818 bcm64: add config for raspberry pi 4 2019-07-25 09:12:40 +02:00
cinap_lenrek 3bc4e5a6d5 bcm64: work in progress genet ethernet driver for raspberry pi 4 2019-07-25 09:11:53 +02:00
cinap_lenrek 2a4c767c41 bcm64: reorganize virtual memory map for rapberry pi4 2019-07-25 09:10:07 +02:00
cinap_lenrek 4200778861 bcm64: update io.h for pci express and raspberry pi 4 2019-07-25 09:08:35 +02:00
cinap_lenrek 6d9edeeb67 bcm64: add pci express driver for raspberry pi 4 2019-07-25 09:04:50 +02:00
cinap_lenrek 676ef0ca0b bcm64: add gic interrupt controller driver for raspberry pi 4 2019-07-25 09:02:47 +02:00
cinap_lenrek 10b456ff44 bcm64: add gisb arbiter driver to catch bus timeouts 2019-07-25 09:01:44 +02:00
cinap_lenrek 811b80cae1 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.
2019-07-25 08:58:58 +02:00
cinap_lenrek dfea95b3c2 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.
2019-07-25 08:52:46 +02:00
cinap_lenrek 5a0c2e2d17 bcm, bcm64: add dmaflush() function and make virtio size and virtual address configurable in Soc.virtio and Soc.iosize 2019-07-25 08:41:37 +02:00
cinap_lenrek 4983adfa2c 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.
2019-07-25 08:19:12 +02:00
cinap_lenrek a6a1806c17 usbxhci: implement portable dma flush operations and move to port/ 2019-07-17 10:30:06 +02:00
cinap_lenrek 19a883ce7a usbehci: introduce dmaflush() function to handle portable cache invalidation for device drivers 2019-07-17 10:24:50 +02:00
cinap_lenrek a4688b0322 merge 2019-07-11 07:49:52 +02:00
cinap_lenrek a1a6f26110 kernel: move common ethermii to port/ 2019-07-11 07:47:39 +02:00
cinap_lenrek 7111de631c devuart: make sure uart is enabled in uartkick() 2019-07-11 07:45:34 +02:00
Alex Musolino 51550ba3d2 walk(1): add history section 2019-07-02 23:34:31 +09:30
Alex Musolino 32a2737823 tinc(8): add history section 2019-07-02 22:24:10 +09:30
cinap_lenrek 54f9b36720 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)
2019-07-02 05:34:13 +02:00
cinap_lenrek b2c7a8d84a 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.
2019-06-28 18:12:13 +02:00
cinap_lenrek 6118d77858 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;
}
2019-06-24 20:09:04 +02:00
cinap_lenrek 4cffc04364 8c, 6c: LEA x, R; MOV (R), R -> MOV x, R 2019-06-24 19:38:46 +02:00
cinap_lenrek 345714dd56 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.
2019-06-24 19:36:01 +02:00
cinap_lenrek 9f6967ed7e 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.
2019-06-24 19:25:13 +02:00
cinap_lenrek 7d3cc1c55a ape: revert rename() change
new implementation gets stuck in a infinite loop. backing
this out for now.
2019-06-23 22:35:14 +02:00
Ori Bernstein d4bc9052be 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.
2019-06-21 10:00:58 -07:00
cinap_lenrek 0af7d1fe35 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

.
2019-06-21 18:57:20 +02:00
cinap_lenrek b767b2ce23 cwfs: remove orphaned lrand.c 2019-06-20 14:15:20 +02:00
cinap_lenrek d8a8ac237a cwfs: remove old some assert() debugging 2019-06-20 14:06:29 +02:00
cinap_lenrek 4d96bacd35 bcm, kw, omap, teg2: implement setregisters() 2019-06-20 13:17:36 +02:00
cinap_lenrek 07af9be3a9 cwfs: fix root access time qid path comparsion 2019-06-20 13:15:26 +02:00
cinap_lenrek 56e71d5260 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.
2019-06-20 12:13:51 +02:00
cinap_lenrek 2d83ae8fb2 pc64: actually fix it, what was i THINKING 2019-06-20 00:36:51 +02:00
cinap_lenrek a40364218d pc64: fix compiler warning in rebootjump() entry calculation 2019-06-20 00:32:54 +02:00
cinap_lenrek 4b4d68487c stdio: fix putc(), plan9 version 2019-06-20 00:04:58 +02:00
cinap_lenrek ef1bcc7338 ape: fix stdio putc() macro, avoiding "result of operation not used" warning
moving _IO_CHMASK masking on the right hand side fixes it.
2019-06-19 23:59:25 +02:00
cinap_lenrek 63191949b9 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.
2019-06-19 23:50:33 +02:00
cinap_lenrek 159f96c534 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.
2019-06-19 22:58:16 +02:00
cinap_lenrek 8561a84307 pcc: back out -+ flag removal to allow gracefull upgrade path with new pcc but old cpp 2019-06-19 15:15:35 +02:00
Ori Bernstein 94fb8869df 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.
2019-06-18 22:47:15 -07:00
Ori Bernstein ff344562db 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
2019-06-18 22:17:19 -07:00
cinap_lenrek f360729664 merge 2019-06-18 13:29:29 +02:00
cinap_lenrek 3bb5168c6f 8c, 6c: fix INDEX node #reg calculation 2019-06-18 13:28:15 +02:00
Ori Bernstein 84076e3716 Delete dead code.
Nothing is using (or even building) bound.[ch]
2019-06-17 21:12:35 -07:00
Ori Bernstein 873a7716e0 Add test for pow.c 2019-06-16 18:21:52 -07:00
Ori Bernstein 37a5e86bf0 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.
2019-06-16 15:55:55 -07:00
cinap_lenrek 55f018df8a merge 2019-06-14 10:32:26 +02:00
cinap_lenrek 8d36cd8d8a devdtracy: make machlocks and dtktab static 2019-06-14 10:30:50 +02:00
cinap_lenrek f42e53655e bcm64: implement dtracy support 2019-06-14 10:28:30 +02:00
aiju 9a9403bb66 vmx(1): update BUGS 2019-06-11 11:36:20 +00:00
Alex Musolino 39a435ee1c 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.
2019-06-11 15:27:12 +09:30
Alex Musolino d904a57e17 snoopy(8): avoid extra spaces in dhcp filter output 2019-06-11 15:19:18 +09:30
Alex Musolino 396844787c snoopy(8): include dhcp.h instead of replicating bootp/dhcp options enum 2019-06-11 15:18:27 +09:30
Alex Musolino 26dc73c763 file(1): recognise unified diff output 2019-06-08 15:56:03 +09:30
Ori Bernstein 033c2812c2 Make 'g' grep recursively by default. 2019-06-04 22:36:32 -07:00
BurnZeZ 12e136332a plumber: loop will go out of bounds when *++s == '\0'; replace with strstr 2019-05-31 22:15:53 +00:00
cinap_lenrek ed3a3c4dd4 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.
2019-05-27 02:11:16 +02:00
cinap_lenrek 569f936660 /sys/src/cmd/mkfile: fix PCONLY exclude (thanks stefan) 2019-05-24 22:52:20 +02:00
cinap_lenrek d7684982e8 awk: no need to call getargv() twice to get the value for FILENAME 2019-05-24 17:25:44 +02:00
cinap_lenrek c9a1045d49 gs: fix missing type check in ztype (thanks jsmoody)
to reproduce:

gs <<.
null [[][][][][][][][][][][][][][][]] .type
.
2019-05-24 14:17:18 +02:00
cinap_lenrek e55778d67e gs: apply fixes for CVE-2018-16509 (thanks jsmoody) 2019-05-23 14:59:28 +02:00
cinap_lenrek 197ff3ac2f 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.
2019-05-22 22:20:31 +02:00
Alex Musolino d7aa56c073 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.
2019-05-20 15:00:14 +09:30
cinap_lenrek c35f95de2a vmx: handle build arch exclude in /sys/src/cmd/mkfile 2019-05-19 17:11:57 +02:00
cinap_lenrek c881e33e8e 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.
2019-05-19 16:54:50 +02:00
cinap_lenrek d667607c26 sshnet(4): ... and incoming TCP calls 2019-05-18 12:45:57 +02:00
cinap_lenrek a852f55b6c merge 2019-05-17 19:01:14 +02:00
cinap_lenrek d5e4558078 bcm64: remove unneccesary tlb flush on mmuidmap() 2019-05-17 18:57:05 +02:00
cinap_lenrek 2235660f86 bcm64: no need to flush instruction cache when switching TTBR0 2019-05-17 18:56:34 +02:00
cinap_lenrek 5c5c1b6666 bcm64: switch to 64k page size 2019-05-17 18:35:14 +02:00
cinap_lenrek e0c19ae048 7l: don't hardcode 4k pagesize, use INITRND 2019-05-17 18:14:10 +02:00
cinap_lenrek 18d67944be merge 2019-05-17 01:53:27 +02:00
cinap_lenrek 335e019746 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.
2019-05-17 01:51:28 +02:00
23hiro 3b00f089ee draw(3): memlorigin 2019-05-15 20:24:39 +02:00
cinap_lenrek b24ed2bfac 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.
2019-05-15 16:19:20 +02:00
cinap_lenrek 47d3e8fc63 bcm64: fix mmu0clear() mistake from previous commit 2019-05-15 13:24:34 +02:00
cinap_lenrek 704970074e nusb(2): remove startdevs() reference, document getdev() (thanks BurnZeZ) 2019-05-14 09:06:09 +02:00
cinap_lenrek adf96a529e bcm: add cache invalidate before accessing prop buffer 2019-05-13 19:21:14 +02:00
cinap_lenrek a3b5e3994f bcm64: implement reboot support 2019-05-13 19:20:21 +02:00
cinap_lenrek 3b36daa2bb 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.
2019-05-13 19:12:41 +02:00
cinap_lenrek 157d7ebdbd 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.
2019-05-12 01:20:21 +02:00
BurnZeZ bf4f158707 memdraw(2): remove references to iprint() 2019-05-11 15:28:18 +00:00
cinap_lenrek 333c320204 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.
2019-05-11 17:22:33 +02:00
cinap_lenrek 7186be0424 devip: make sure ifc is bound in add6 ctl command 2019-05-11 14:54:10 +02:00
cinap_lenrek 3a0d5f41a8 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.
2019-05-11 14:01:26 +02:00
cinap_lenrek a25819c43a 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.
2019-05-11 07:22:34 +02:00
cinap_lenrek db3bf8271b 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.
2019-05-10 14:05:04 +02:00
cinap_lenrek addb36ee48 ape: fix malloc to deal with more than 4GB of memory on 64 bit systems 2019-05-10 12:10:02 +02:00
cinap_lenrek a375c9ac38 libc: fix return value for arm64 memset() and memove() 2019-05-09 12:40:03 +02:00
cinap_lenrek 57e0786595 libc: use MOVP instruction for arm64 memmove() and memset() 2019-05-09 11:40:54 +02:00
cinap_lenrek 9d790238f2 bcm64: use MOVP instruction for saving and restoring registers 2019-05-09 11:11:45 +02:00
cinap_lenrek 1c0427e6dd libmach: remove newline 2019-05-09 10:27:17 +02:00
cinap_lenrek a065270fd7 libmach: support for MOVP instruction disassembly for arm64 2019-05-09 10:24:37 +02:00
cinap_lenrek e8cf753051 7l: implement MOVP instruction 2019-05-09 10:23:23 +02:00
cinap_lenrek 4e7fbabfc9 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.
2019-05-09 02:32:09 +02:00
cinap_lenrek 1046d3e30b bcm64: map framebuffer write-through to allow unaligned access 2019-05-09 02:17:50 +02:00
cinap_lenrek 5a934b56f5 wadfs: avoid comma operator after PBIT32() macros 2019-05-07 21:49:49 +02:00
cinap_lenrek fe1f6c1b3d plan9.ini(8), boot(8): clarify the use of $rootdir and $rootspec 2019-05-07 11:41:33 +02:00
cinap_lenrek 3a4a3faf29 nusb/usbd: work around devices that ignore the high byte of wLength in control transfer reads
there appear to be devices out there such as Realtek RTL2838UHIDIR
SDR that do not process control transfers correctly, ignoring the
high byte of the wLength field. to work around this, we specify an
odd number of bytes for read sizes >= 256 which keeps the low byte
0xFF.
2019-05-07 09:19:53 +02:00
Ori Bernstein ceed9b8853 Sand edges down on GBIT64()/PBIT64() macros.
Now, you can safely use them in unbraced if statements, and
with char*s.
2019-05-06 17:26:38 -07:00
cinap_lenrek 24544b80f5 dist/mkfile: add *.pi3.img target for ARM64 raspberry pi3 2019-05-06 18:29:09 +02:00
cinap_lenrek f22b4ecc77 bootrc: fix $rootdir and $rootspec handling (thanks lucio)
we did not interpret the $rootdir and $rootspec environment
variables right. $rootdir is what gets bound to / (usually /root)
and $rootspec is the mountspec of /root.
2019-05-05 17:02:37 +02:00
cinap_lenrek 75d44bc306 bcm: make sure fiq is on enabled on cpu0 2019-05-05 14:04:27 +02:00
cinap_lenrek de7190ba6b bcm64: provide idlehands() function 2019-05-05 13:59:03 +02:00
cinap_lenrek b0c402dfa6 bcm64: get rid of usb workaround delay 2019-05-05 13:57:48 +02:00
cinap_lenrek 4d96c40a47 usbdwc: enable Slowbuilkin workarround, improve split transaction timing, handle erroring sleep(), debugging
i'v been seeing the error condition described above in the
Slowbulkin comment. so i'm enabling the work arround which
seems to fix the lockup.

in the split transaction case where we want to start the
transaction at frame start, acquire the ctlr lock *before*
checking if we are in the right frame number. so the start
will happen atomically. checking the software ctlr->sofchan
instead of checking the interrupt mask register seems to
be quicker.

setting the haint mask bit for the chan under ctlr lock
in chanio() instead of chanwait() avoids needing to acquire
the ctlr lock twice.

mask wakechan bits with busychan bitmap in interrupt handlers
so we will not try to wake up released chans by accident.

sleep() and tsleep() might get interrupted so we have to
release the split qlock in the split transaction case and
in all cases, make sure to halt the channel before release.

add some common debug functions to dump channel and controller
registers.
2019-05-05 13:34:02 +02:00
cinap_lenrek 21ce34bd7f libc: fix NaN check precedence bug in modf() (thanks BurnZeZ) 2019-05-05 00:26:17 +02:00
cinap_lenrek 1d82e3f42a acid: add arm64 support 2019-05-04 03:06:10 +02:00
cinap_lenrek 54838652fc rootstub: add /sys/lib/dist/ndb/dhcp/ 2019-05-03 23:59:27 +02:00
cinap_lenrek 70ea1310d1 pc kernel: remove countpagerefs() (thanks BurnZeZ)
forgot to commit this...
2019-05-03 23:52:49 +02:00
cinap_lenrek 0b5e782882 kernel: exec support for arm64 binaries 2019-05-03 23:15:42 +02:00
cinap_lenrek c6ad540af5 bcm64: add experimental work in progress arm64 kernel for raspberry pi 3 2019-05-03 23:14:57 +02:00
cinap_lenrek 1a7c224b3e bcm: don't call nil on PADDR() in dmaaddr(), return busdram dummy address 2019-05-03 22:53:09 +02:00
cinap_lenrek eb4bd4aa3e bcm: move fiq saved pc adjust into lexception.s so it can be shared with arm64 2019-05-03 22:02:07 +02:00
cinap_lenrek 3ca395a36c uartpl011: dont touch line control while uart is enabled 2019-05-03 21:34:20 +02:00
cinap_lenrek 4032db00a7 ktrace: arm64 support 2019-05-03 21:16:23 +02:00
cinap_lenrek c57c8919e3 arm64: add mkfile 2019-05-03 21:12:31 +02:00
cinap_lenrek db70c1d20d python: arm64 support 2019-05-03 21:11:17 +02:00
cinap_lenrek bbf532dba8 gs: arm64 support 2019-05-03 21:10:45 +02:00
cinap_lenrek 5f5caa6733 gs: avoid stupid shifts by casting to uint64_t 2019-05-03 21:10:01 +02:00
cinap_lenrek 2994fccbe1 ape: initial support for arm64 2019-05-03 21:06:46 +02:00
cinap_lenrek dfd915892a libthread: initial support for arm64 2019-05-03 21:03:12 +02:00
cinap_lenrek a3b9243f71 libmp: add dummy mkfile for arm64 2019-05-03 21:02:13 +02:00
cinap_lenrek a3beef2363 libsec: dummy mkfile for arm64 2019-05-03 21:01:29 +02:00
cinap_lenrek 14b69dcde0 libmach: initial arm64 support 2019-05-03 21:00:17 +02:00
cinap_lenrek 9920ecc04b libc: initial arm64 support 2019-05-03 20:57:30 +02:00
cinap_lenrek 59ff04ddb1 7l: add missing AFMOVD with EXT/AUTO/LOREG operands to optab 2019-05-01 13:11:20 +02:00