Commit graph

2856 commits

Author SHA1 Message Date
cinap_lenrek f87baec1d0 make auto negotiation work on 82562et (thanks mischief!)
the diver used to skip auto negotiation when
auto-negotiation enable (bit 12 in command register)
was clear.

setting the bit now, which makes auto negotiation work.

we skip auto negotiation only when it was already enabled
and status regiser indicates completion (bit 9).
2013-11-01 23:39:41 +01:00
cinap_lenrek b41bf07867 fix format compiler warning 2013-10-31 15:51:15 +01:00
cinap_lenrek 7e2e5b7a6f kernel: add support for multiboot memory map 2013-10-31 15:50:25 +01:00
BurnZeZ 1259fe5c38 libplumb: search for plumber only at /mnt/plumb, and don't try to mount $plumbsrv if the search fails 2013-10-31 04:26:01 -04:00
BurnZeZ 9a1e762dcc smtp: fix free on uninitialized pointer 2013-10-30 03:12:53 -04:00
cinap_lenrek 7211fd7ce7 fix devshr related panic caused by Mount.to being nil (thanks mischief!)
the shr mount is linked into the Mhead with m->to initially nil. only
after the the server has been attached is m->to set. just check for
it in createdir().
2013-10-30 21:24:44 +01:00
cinap_lenrek 6d4e9f11b7 init: dont rely on path containing dot 2013-10-30 00:38:12 +01:00
mischief b35df8dd22 vt: discard unhandle OSC escapes, and use nelem instead of sizeof for title buffer 2013-10-28 02:13:35 -07:00
BurnZeZ 96c1e08f48 libjson: fix missing buffer free, slight cleanup 2013-10-28 03:17:53 -04:00
BurnZeZ a8e8b650f3 libjson: dynamically allocate buffer 2013-10-28 23:21:07 -04:00
cinap_lenrek 82f4c1c0b4 rsa2ssh: fix the megashit 2013-10-28 09:20:07 +01:00
mischief 8c9e7ded17 auth/rsa2ssh: add SSH2 RSA output format (from plan9port) 2013-10-27 18:50:14 -07:00
mischief 420ed37c57 cmd/vt: fix xterm function keys 2013-10-27 18:40:21 -07:00
cinap_lenrek 4ea791806c libjson: fix mistake... (harmless) 2013-10-28 01:24:03 +01:00
cinap_lenrek ffd3421cf0 libjson: fix for 21 bit runes, implement utf-16 surrogates 2013-10-28 01:19:01 +01:00
BurnZeZ abb8ce3878 libjson: fix mistake in unicode handler (thanks cinap) 2013-10-27 19:29:02 -04:00
BurnZeZ b1bc8b5c2b libjson: handle unicode escapes 2013-10-27 15:52:35 -04:00
BurnZeZ 2dc7e311f4 make libjson from /sys/src/cmd/btc/json.c 2013-10-27 15:44:33 -04:00
cinap_lenrek 632b7adffb vt: remove defunct hp terminal emulation 2013-10-27 19:09:13 +01:00
cinap_lenrek b831ec005b vt: utf-8 support 2013-10-27 19:05:40 +01:00
cinap_lenrek 4a9f900726 mkfiles: do not rely on path containing the . element
when executing generated binaries and helper scripts,
always execute them as ./name instead of relying that
path contsins the dot.
2013-10-26 20:22:01 +02:00
cinap_lenrek 744dbd6bb8 merge 2013-10-26 01:18:23 +02:00
cinap_lenrek 1ca07d817b ndb/common: update ip for d.root-servers.net 2013-10-26 01:11:18 +02:00
cinap_lenrek 946026dc9a merge 2013-10-26 00:58:46 +02:00
cinap_lenrek 384adf4c89 ndb/common: dont use bell-labs dns servers for rfc1980 zones 2013-10-26 00:56:51 +02:00
stanley lieber 424e9d1636 fortunes: etymology: various 2013-10-25 14:46:35 -04:00
cinap_lenrek 8cdade591e kernel: dont spawn closeprocs from closechanq
make closeproc() spawn more procs on demand insead of
doing it from closechanq(). this avoids the palloc lock
checks and simplifies the logic.
2013-10-25 19:51:46 +02:00
cinap_lenrek c7c7e7ee2a kernel: disable freelist page caching for executables run from uncached mount
the image cache has the property of keeping a channel
for the executable binary arround which prevents the
mountpoint from going away.

this can easily be reproduced by running:

@{rfork n; ramfs; cp /bin/echo /tmp; /tmp/echo}

observe how ramfs stays arround until the image is
reclaimed. the echo binary is also cached but is
unreachable from any namespace.

we now restrict the caching to mounts that use the client
cache (-C flag) only. this should always be the case
for /bin. places where this isnt the case might observe
a performance regression.
2013-10-25 02:42:35 +02:00
cinap_lenrek b66c4a6232 kernel: keep one closeproc arround in case we are unable to fork a new one
closechanq() is unable to fork a new closeproc when palloc
is locked. so we spawn a closeproc early in chandevinit()
and make sure theres always one process arround to handle
the queue.
2013-10-25 01:54:09 +02:00
cinap_lenrek 3142af56d8 newuser: make lib/profile read drawterms /dev/secstore when available 2013-10-23 23:44:25 +02:00
cinap_lenrek 43eed8d824 factotum: update rsa for ssh2 (sync with sources) 2013-10-22 18:55:00 +02:00
cinap_lenrek 95c865a497 acme: attempt to fix tag lines collapsing to zero height on window move (issue 189)
we'r getting a rectangle taller than a single line from
coladd() which causes textresize() to collapse the tag
text to zero height.

should probably fix coladd() instead.
2013-10-20 22:38:35 +02:00
cinap_lenrek 8ceb100fa4 nusb/ether: new driver interface with kernel inspired Block buffers
introduce kernel inspured Block structure with
read/write pointers to pass packets arround.

the intend is to avoid copying when adding/removing
frame headers and simplifying the drivers.

the driver now calls etheriq() directly allowing it to
queue multiple packets in one pass without having
to keep state.

transmit gets a buffer passed that has room for
frame headers and trailers so no copying is needed.

blocks are refcounted avoiding another copy when
passed to only one receive queue (common case).

receive queues are now limited to 100KB avoiding
buffer bloat.

Dq* a memory leak in destroyfid has been fixed.

lots of minor cleanups.
2013-10-18 18:41:27 +02:00
cinap_lenrek 5bfaf253d3 keyboard(6): new <compose>x sequence, 21 bit runes. 2013-10-17 19:02:50 +02:00
cinap_lenrek 46f5ac0cd4 html2ms: fix compiler warning for debug code 2013-10-17 18:50:46 +02:00
cinap_lenrek 1015ae8ea8 kbdfs: implement <compoxe>x to enter variable length unicode as suggested by erik quanstro
from: http://9fans.net/archive/2013/04/327

since <compose>x is not yet entrenched, i have a suggestion for ease of
input.  suppose <compose>x were redefined so the syntax were
"<compose>x[0-9a-f]+;".  in the case that 6 hex digits are entered, then
the ";" is not necessary.

not only would this allow for entering 21-bit runes, it would also allow for
short sequences to be entered more easily.

- erik
2013-10-17 18:39:44 +02:00
cinap_lenrek c501fe6936 factotum: fix mschap password (utf-8 to utf-16) conversion
using strlen() gives the number of bytes in the utf-8 string.
could use utflen() instead, but decided to just go in a loop
and get rid of the counters all together.

UTF-16 surrogates are not handled.
2013-10-17 15:31:07 +02:00
cinap_lenrek 0b3ad2b562 libc: updated acid files for 21 bit rune change 2013-10-17 12:53:01 +02:00
cinap_lenrek a5e9641906 change Rune from ushort to uint for to 21 bit runes (thanks mischief!)
big big change. requires rebuilding 8c first and then rebuild
everything.
2013-10-17 12:02:45 +02:00
cinap_lenrek e30f50283c 9p(2): correct usage for srvrelease()/srvacquire()
the process is *NOT* allowed to exit after a srvrelease() as
it still holds a reference (srv->rref) preventing the srv
from beging freed/ended (listensrv) before srvacquire().
2013-10-17 08:26:05 +02:00
cinap_lenrek 52fc6d50d4 nusb/ether: fix wrong size check causing odd sized packets to be discarded (thanks mischief!)
ethernet packets with sizes that where not multiples of 4 where
discarded because the check uses the smsc frame size instead of
the payload size. when a usb read returns just one packet, theres
no next frame header and the calculated frame size is bigger than
the usb read which caused the whole packet to be discarded as invalid.

thanks to mischief for testing and debugging!
2013-10-16 16:42:40 +02:00
cinap_lenrek 965bb2d248 nusb/disk: handle blocking usb access with srv released
usb is bound after /dev, so a hanging usb device will hang
access to /dev. we avoid this by releasing the srv, which
allows the fs to still handle reads and walks of the
directories.

ios are serialized by a qlock in the Umsc structure.
2013-10-16 12:26:56 +02:00
cinap_lenrek 1cd4579cdc cwfs: fix putbuf(nil) in error case of cmd_check() 2013-10-16 07:21:12 +02:00
cinap_lenrek 87e187b09c fdisk: fix struct padding for amd64 (from erik quanstros fdisk-64-bit-table patch)
small little patch to help fdisk work properly on 64-bit machines.
sizeof(Table) is 4 bytes too big.
2013-10-16 04:34:58 +02:00
cinap_lenrek 0f994b1b09 aux/statusbar: emit final newline in textmode when finished
bad:
term% echo 1 1 | aux/statusbar -t x
|###########################################################| 100% term%

vs.

good:
term% echo 1 1 | aux/statusbar -t x
|###########################################################| 100%
term%
2013-10-12 03:18:44 +02:00
cinap_lenrek 0460e4be7d cwfs: add checktag() call for cache bucket in dumpblock(), fix error strings 2013-10-11 10:17:17 +02:00
cinap_lenrek 5982c50fa4 cwfs: more checking for cfsdump(), cleanup Tsuper hack in cwrecur()
add checktag and nil checks in cfsdump() making sure to notice
when the roroot directory structures is corrupted.

cwrecur() used tag == Tsuper to indicate that this is the first
level recursive invocation. this is confusing as we really expect
Tdir tag in that case for the root directory. instead, we now
pass the correct tag (Tdir) and use cw->depth > 1 to see if we
are past the root.

the block tag was only checked when the block was not in
the memory cache. check the tag always!
2013-10-11 06:01:55 +02:00
cinap_lenrek 7f57d5d9c5 unzip/zipfs: handle optional data descriptor signature in trailer 2013-10-10 07:42:13 +02:00
cinap_lenrek 3b99a60154 mothra: handle <input type=image> 2013-10-10 23:59:19 +02:00
cinap_lenrek f72da96f28 exportfs: start filter in separate rendezvous group 2013-10-08 20:58:55 +02:00
cinap_lenrek bc18faccde libpanel: fix memory corruption bug in plinitentry(), add pl_erealloc() 2013-10-08 19:58:55 +02:00
cinap_lenrek 1c1bef69aa libc: remove doprint 2013-10-08 19:23:53 +02:00
cinap_lenrek 50e3c936fa ip/torrent: check piece offset, vlong cast 2013-10-08 08:12:05 +02:00
cinap_lenrek 3c2b09c9dc ip/torrent: more checking, backoff from piece on hash error 2013-10-08 07:55:26 +02:00
cinap_lenrek 8046234275 kbdfs: implement keyboard mouse buttons with /dev/mousein 2013-10-07 06:49:34 +02:00
cinap_lenrek 8aeddcf5bb vncs: create dummy /dev/mousein and /dev/mousectl files
this should prevent accidential fiddeling with the kernels
mouse driver.
2013-10-07 06:37:40 +02:00
cinap_lenrek 6c6bd66ed1 devmouse: differential handling of /dev/mousein buttons 2013-10-07 06:34:24 +02:00
cinap_lenrek ad1111cb3e exportfs: fix more filedescriptor leaks
just closing the pipe isnt enough, we have to
close all remaining file descriptors except sfd
before executing sub exportfs.
2013-10-07 23:18:37 +02:00
cinap_lenrek 6197758ec1 exportfs: fix openmount() rfork flags and filedescriptor leak, silence of on initstr error
fork child exportfs with new rendezvous group.
fix missing close of pipe filedescriptors on error.
fix missing close of other end of pipe in child.

dont bark when we get eof on the first init string read.
this condition can happen when unmount opens and
immidiately closes a exported srv file.
2013-10-06 04:42:46 +02:00
cinap_lenrek cb8eac54ed 5l: apply richard millers 5l-incfloat patch (from sources)
Generate correct ARM vfp code for x++ where x is single precision float.
Example test program (link with '5l -f'): void _main() { float x; x++;}
2013-10-06 01:49:15 +02:00
cinap_lenrek 3da35f028f rio: gone windows gone wrong (fix missing recv(x->flushc, nil) when gone but request flushing) 2013-10-05 22:55:10 +02:00
cinap_lenrek 6187e219da mothra: avoid intermediate rc shell processes, use rfork(RFREND) to isolate rendezvous group 2013-10-04 21:11:56 +02:00
cinap_lenrek 0b42409cf4 page: avoid intermediate rc shell processes with using exec, move newwindow() before forking namespace
use exec to avoid intermediate rc processes.

avoid capturing old namespace in the waiting process by doing the
newwindow() call before it.
2013-10-04 21:10:33 +02:00
cinap_lenrek d160232747 mothra: run page in own note group, close unneeded filedescriptors after forking
running page in own note group avoids killing it when we
exit mothra.

copypaste dupfds() function from page and use it to close
unneeded file descriptors.
2013-10-04 16:08:19 +02:00
cinap_lenrek 8c1d4604db page: close stdout, reopen stdout/stderr for external viewer and removed useless RFNAMEG flag
we are not using stdout (fd=1) and it, so dup nullfd over it.
this drops the old window reference when using with -w flag.

the RFNAMEG flag isnt needed because we are calling newwindow()
which forks the namespace for us.

reopen stdin/stdout for the external viewer to the new window.
2013-10-04 16:03:41 +02:00
cinap_lenrek 0be917ff4d libdraw: make newwindow() unmount the old window
newwindow() used to mount the new window directly on /dev, resulting
in the old window and the new one being mounted over each other.

we now try to unmount the old window from /dev first, mount new
window to /mnt/wsys (replacing the old) and then bind /mnt/wsys
before /dev.

if theres no /mnt/wsys, just mount window directly before /dev.
2013-10-04 15:57:05 +02:00
cinap_lenrek 40cf5957e0 add sdp(3) from sources 2013-10-04 13:52:22 +02:00
cinap_lenrek 9bcdfac3be merge 2013-10-04 02:27:53 +02:00
cinap_lenrek 5c4756974b page: dont tell rio our pid
$wsys might be from a remote system so pid will not work.

new rio errors out on mouse/cons instead.
2013-10-04 02:26:40 +02:00
cinap_lenrek fe03ec0e21 rio: gone windows, window resize, rectonscreen, goodrect
dont rely on postnote to shutdown client. instead, make reads on
cons, kbd and mouse error. when we mount a window system over
exportfs, the pid useless and even dangerous! pid should be
only used by clients forked by rio itself.

fix bug in resized(), goodrect() takes rect in screen coordinates!

make rectonscreen() fix window size if the window doesnt fit
on the screen.

improve goodrect() to check for windows outside of the screen or
bigger than screen without borders visible.
2013-10-04 02:17:53 +02:00
ppatience0 7c28d33d4b io.h: change indentation from spaces to tabs 2013-10-03 17:15:11 -04:00
ppatience0 9eab198d05 ether83815: fix `auto neg timed out' error with sis 900 rev 635.
the openbsd sis(4) driver does not actually go through the rest
of softreset() with sis cards. also, rev 635 reads the mac address
differently, so copy-paste code from openbsd to handle that.
2013-10-03 17:13:08 -04:00
cinap_lenrek 60e3d2782b merge 2013-10-03 17:31:55 +02:00
cinap_lenrek 7ad47f1083 tarfs: make file name safe, canonical and free of . and .. (from sources) 2013-10-03 17:30:03 +02:00
cinap_lenrek f163d0014a libmach: fix wrong formating for arm LDRH/STRH/LDRSB/LDRSH (MOVHU/MOVBU) instructions 2013-10-02 20:52:13 +02:00
ppatience0 225cc4af5c nusb/ether: add rtl8150 driver, remove unused includes 2013-10-02 02:25:43 -04:00
stanley lieber 805fe4660e fortunes: I think we're done here. 2013-10-02 18:02:49 -04:00
cinap_lenrek 6c758d94bf vt: dont pollute the outer environment (thanks mischief!) 2013-10-02 02:25:50 +02:00
cinap_lenrek e55d105159 bootrc: +x 2013-10-02 02:01:43 +02:00
cinap_lenrek 505bc9b491 lib9p/hjfs: use x != ~0 instead (type)~x conditionals to work arround arm compiler issue 2013-10-02 01:36:05 +02:00
cinap_lenrek da2d0ee780 audiohda: allow manual pin routing, more verbose audiostat, initial mute of al widgets
the automatic routing from jack to dac/adc sometimes gets us
a path thats not audible. manually specifying a route path
gets us arround these. the syntax is just a comma separated
list of node ids in the "pin" and "inpin" audioctl commands
instead of a single pin node id.

to find alternative paths, audiostat now lists all the widgets;
not just the pins; and ther input connections.

initially mute all pins and amps of all function groups.
connectpath() and disconnectpath() will mute and unmute
the widgets as required later.
2013-09-29 15:44:26 +02:00
stanley lieber 82362507f7 pkg/list: handle more directory listings 2013-09-28 01:57:31 -04:00
cinap_lenrek c9bbe34bf6 pc kernel: make syscall() return thru forkret() to handle exceptions
forkret() labels the instructions that can raise exceptions
so they can be handled in trap(). this can happen when
segment descriptors get invalidated.
2013-09-27 19:24:45 +02:00
stanley lieber 64f44612f2 fortunes: I gave up, back to 9front. -- Aram 2013-09-26 12:22:09 -04:00
cinap_lenrek d9ca084282 tcs: eleminate ambigous html entity runes. 2013-09-26 15:16:12 +02:00
cinap_lenrek 81f726b2b4 audioac97: remove i/o bar magic, fix ac97mixreset busywait-forever timeout
the standard is i/o bar 0 is the mixer and bar 1 is status/control.
the magic with the bar sizes made it fail in qemu. so removing it
for now as all devices seen so far comply to the standard.

if we ever see a sis7012 where this might be swaped uncomment the i=0;

the busywait timeout is too long in ac97mixreset() because rd/wr
have a timeout on ther own. just remove the busy looping and do
a one second delay after mixer reset. (tested with t23)
2013-09-26 23:34:06 +02:00
cinap_lenrek 7265a09524 merge 2013-09-25 20:27:34 +02:00
cinap_lenrek cdc2c30e99 reverting semaphore lock changes from sources (r41ccd6d221da, rb28756e5ba29)
semaphore locks have much higher overhead than initially presented
in the "Semaphores in Plan9" paper. until the reason for it has been
found out i will revert the changes.
2013-09-26 22:24:31 +02:00
jpathy cafcffb1dc fix null dereference crash in mothra 2013-09-24 15:50:35 -07:00
cinap_lenrek 62b3eea271 syssem*: eleminate redundant validaddr() checks
validaddr looks up the segments for an address range
and checks the flags and if the address range lies
within bounds on the segments.

as we'r going to lookup the segment in the syssem*
syscalls anyway, we can do the checks ourselfs avoiding
the double segment array lookups.

the implication of this tho is that now a semaphore cannot
span multiple segments. but this would be highly unusual
given that segments are page aligned.
2013-09-24 01:52:20 +02:00
cinap_lenrek 365fd745d6 9bootfat: only check for fat at block 0 on floppy drives (thanks aap)
smart boot manager has a "FAT" signature in its mbr causing
9bootfat to "detect" it as a fat filesystem and then fails
to find plan9.ini.

there shouldnt be a fat filesystem on harddrives at block 0, only
on floppy drives. but some bioses use floppy drive numbers
for usb harddrives so still check for a partition table.

thanks aap for debugging this.
2013-09-23 21:12:41 +02:00
cinap_lenrek b4cdfc6c55 devproc: check for p->dot == nil, run closeproc with up->dot = up->slash
p->dot can be nil when process exits (see pexit())

set closeprocs dot to up->slash so it will show up
right in devproc.
2013-09-22 19:49:59 +02:00
cinap_lenrek 99167104f9 audiohda: vmware support (thanks dreadlorde) 2013-09-22 18:26:52 +02:00
cinap_lenrek e4942b78fd mkfs(8): also list -U option in table 2013-09-22 03:30:04 +02:00
cinap_lenrek d3b8ded315 rootstub: create directories for mips 2013-09-21 21:21:18 +02:00
cinap_lenrek 4fc4033611 merge 2013-09-21 20:06:53 +02:00
cinap_lenrek f811708ffc ape: change tas/sleep locks to cas/semacquire/semrelease locks (from sources) 2013-09-21 19:55:52 +02:00
cinap_lenrek 3d05e77ca1 libc: change tas/sleep locks to cas/semacquire/semrelease locks (from sources)
spinlocks have been changed to use the new semacquire/semrelease
syscalls in combination with atomic compare and swap operations.
2013-09-21 19:53:27 +02:00
cinap_lenrek 041e4852d2 tcs: add html5 rune entities 2013-09-21 22:17:40 +02:00
cinap_lenrek 0d41eadd03 hget(1): usage for webpaste 2013-09-20 17:46:25 +02:00
cinap_lenrek 65653a1840 pushssl(2), pushtls(2): clarify filedescriptor closing 2013-09-20 17:44:14 +02:00
cinap_lenrek 4e015eb5c7 merge 2013-09-20 17:41:51 +02:00
cinap_lenrek 91ce0a07ca hpost: dont emit /bin/hpost but just hpost
just emiting "hpost" makes it simpler to override it as a
rc function.
2013-09-20 17:39:33 +02:00
stanley lieber 565a4d478e rename /rc/bin/ok to /rc/bin/webpaste 2013-09-20 11:32:42 -04:00
cinap_lenrek 5e2478ccbb acid: handle buffer overflow with ridiculous long symbol names (thanks mischief)
go seems to accidently creates ridiculous long symbol names
causing acid to crash.
2013-09-20 16:02:10 +02:00
cinap_lenrek 9c2fb9602d merge 2013-09-20 15:00:49 +02:00
cinap_lenrek 539fe6990f 5c: apply richard millers 5c-nan-cmp patch (from sources)
On ARM, it turns out that comparisons with NaN can be made to do the
right thing with no code penalty, by a more careful selection of
condition code values in the subsequent conditional branch.  The
meaning of the CC bits in the PSR is subtly different when they've
been copied from the floating point status register.

Suggested patch is 5c-nan-cmp (works on both vfp and emulated arm7500).
2013-09-20 14:58:43 +02:00
stanley lieber 8aeb7a926e rc-httpd(8): fix typo (thanks, _trav) 2013-09-20 03:09:40 -04:00
stanley lieber 25e5507c57 pkg(1): fix for plan9.bell-labs.com; update repository list 2013-09-18 15:25:18 -04:00
stanley lieber 4d9ce0fb3c add /rc/bin/ok, tool for okturing.com pastebin 2013-09-18 15:03:50 -04:00
cinap_lenrek 171aafcc22 faces: fix callerpc for realloctag in erealloc (thanks qrstuv) 2013-09-18 09:53:20 +02:00
cinap_lenrek 8556b8dae1 libevent: drop queued mouse events
the changeset r541ead66e8af:

"libdraw: make ebread() return buffer immidiately if available"

makes mouse sluggish when the program cant keep up as mouse
events queue up. this more or less restores the original
behaviour but only for mouse events.
2013-09-18 01:54:22 +02:00
cinap_lenrek 34cd9dc4c4 kernel: reset up->setargs on sysexec(), fix race with devproc
up->setargs wasnt reset in sysexec(). also, up->args should only
be exchanged/freed under up->debug qlock. otherwise double free
could happen.
2013-09-18 01:07:06 +02:00
cinap_lenrek 8a7a6f778d ether8169, etherdp83820, ethervt6102: fix snprint READSTR bugs (thanks pap)
should probably use seprint() instead.
2013-09-17 03:08:32 +02:00
cinap_lenrek ad993a2618 rio: translate window when scaling results in bad window rect on screen resize
when the screen is resized, we scale the windows to
match the new screen size. when the screen is too
small tho, the scaled down window rect might result
in a bad window rect. before, we kept the window
in its original position and size making it possible
to move a window out of the screen by resizing its
outer rio.

now, if we get a bad rectangle after scaling, we
just tralslate position to the new scaled r.min
point but preserve its orginal size. this keeps
the window always accessible.
2013-09-17 01:30:35 +02:00
cinap_lenrek 2fd6c5e0f6 faces: fix minor image memory leak 2013-09-17 00:45:11 +02:00
cinap_lenrek 29f4de5f53 rio: fix Xfidwrite memory leak on flush 2013-09-16 17:28:49 +02:00
cinap_lenrek 15c7d856bc apm: fix wrong segment load, zero segment registers
we loaded APMDSEG instead of APMDSEL into DS. (ouch!)

its not really clear why we loaded DS (wong) in the
first place as bios is supposed to do this. for the
machines where this worked it could have no effect
anyway because it was wrong so removing the DS load
and just zero all segment registers.
2013-09-16 16:23:51 +02:00
cinap_lenrek b5aab82488 libauth: add sanity check for auth_proxy write size 2013-09-16 03:56:53 +02:00
cinap_lenrek eee51d7720 aux/statusbar, aux/statusmsg: dont fork in background for window, cleanup 2013-09-16 02:10:18 +02:00
cinap_lenrek c24dd620f9 e820: handle duplicate and overlapping e820 entries, handle overflows
new algorithm:

sort entries by top address first. then for each entry we use:

base = max(base, last)

so we'll never map the same addresses twice.
2013-09-16 23:36:06 +02:00
cinap_lenrek c3a8711d12 kbdfs: set exit status 2013-09-15 16:22:21 +02:00
cinap_lenrek f8cbd5d12f nusb/serial: set exit status 2013-09-15 16:21:43 +02:00
cinap_lenrek 319bb17e1c vncs: fix cmdpid fork bug
we cannot do:

cmdpid = rfork(... RFMEM);

because cmdpid is a global variable in the data segment
and hence shared between parent and child process. use a
temporary variable on the stack.
2013-09-15 16:04:32 +02:00
cinap_lenrek e220636fd3 vncv: fix missing free for window label 2013-09-15 15:14:12 +02:00
cinap_lenrek 474c2c8a2c upas/fs: fix potential filedescriptor leaks 2013-09-15 14:45:57 +02:00
cinap_lenrek 1d4fff69c6 pmmc: add support for Ricoh 5U23 SD/MMC controller 2013-09-15 01:24:08 +02:00
cinap_lenrek 56836bfdbd tls: fix various tlsClient()/tlsServer() related bugs
- TLSconn structure on stack but not initialized (zeroed)
- original filedescriptor double closed in error case
- original filedescriptor leaked in success case
- leaked TLSconn.sessionID and TLSconn.cert
- clarify in pushtls(2) and pushssl(2)
2013-09-14 19:19:08 +02:00
cinap_lenrek be5992955d acme: use threadexitsall() to tear down mouse and keyboard procs on error 2013-09-11 21:23:45 +02:00
cinap_lenrek 6c5deb9b50 pci: fix compiler warning about unused variables 2013-09-09 00:51:36 +02:00
cinap_lenrek 8aff0e5be6 mp/pci: msi support for hypertransport platform 2013-09-09 00:44:08 +02:00
cinap_lenrek 058188117b dossrv(4): remove reference to a:, b:, c:, d: and 9fat: 2013-09-08 20:59:09 +02:00
cinap_lenrek 699ea8bd1f cpu, ratrace, trace: remove unused #include <bio.h> 2013-09-08 20:34:58 +02:00
cinap_lenrek 9fd0b3bad1 md5sum, srv: remove unused #include <bio.h> 2013-09-08 19:52:44 +02:00
cinap_lenrek 9e695e5321 merge 2013-09-08 19:30:27 +02:00
cinap_lenrek eae48ac606 sha1sum: remove unused #include <bio.h> (thanks BurnZeZ) 2013-09-08 19:25:55 +02:00
stanley lieber 8c86eb0079 fortunes: "Not here, not here the darkness, in this twittering world." -- T.S. Eliot 2013-09-07 22:48:28 -04:00
cinap_lenrek b8c0243773 archacpi: make pcibusno() work on non pci bridges (fixes pciaddr()), distribute irqs in setuplink(), remove debug prints 2013-09-08 02:33:25 +02:00
cinap_lenrek 0182cc9db8 acme: avoid useless tagline/window redraw if not needed
window resize is only neccesary if tagline changed.
2013-09-07 20:07:00 +02:00
cinap_lenrek ebf2c5cd69 mk: handle rc blocks in shell quote
this is so we cna handle:

foo = `{echo `{echo bar}}

thanks to erik and friedrich psiorz on 9fans for
bringing the issue up.
2013-09-07 18:42:40 +02:00
cinap_lenrek 12596736e9 libaml: fix formating 2013-09-07 16:22:35 +02:00
cinap_lenrek ad1edf7541 libaml: fix uninitialized variable in getle(), make amleval() work with buildin methods 2013-09-07 16:14:08 +02:00
cinap_lenrek 1b32bd5f0f libaml: use FP->env to access method arguments instead of FP->arg in evalosi() 2013-09-07 14:50:17 +02:00
cinap_lenrek dba77caa35 archacpi: implement amldelay(), remove unused variable in setuplink() 2013-09-07 14:41:08 +02:00
cinap_lenrek cf166c3850 libaml: amldelay(), _OSI(), fix bug in Load() (from plhk's acpi patch)
export amldelay() for microsecond sleeps.

implement _OSI() method.

fix rwreg argument in evalload()
2013-09-07 14:40:24 +02:00
cinap_lenrek 81618e61df libc: set malloctag for runesmprint() 2013-09-06 16:55:13 +02:00
cinap_lenrek 1eb2c757e7 scram: remove amlalloc()/amlfree()
these are now part of libaml but can still be overridden
when needed.
2013-09-06 16:54:02 +02:00
cinap_lenrek 616eb1f9ba archacpi: experimental handling of interrupt link devices, io access 2013-09-06 16:50:43 +02:00
cinap_lenrek 9add5b765f libaml: new io interface, add amlnew()/amltake()/amldrop(), late binding names, FindSetLeftBit/FindSetRightBit
new io interface was added. user defines amlmapio() and amlunmapio() functions
that will fill out Amlio structure with function pointers to read/write
routines for a particular region.

amlnew() function added allowing the creation of aml objects like buffers
or packages. these can be passed to amleval() with b, p or * format.

amltake()/amldrop() exclude an aml object from garbage collection.

on load, names are not always resolvable until the whole table is loaded.
for this, we create n objects that are just name strings. after load, we
recursively traverse the namespace and resolve them (see fixnames()).

the FindSetLeftBit and FindSetRightBit opcodes got implemened.
2013-09-06 16:48:27 +02:00
cinap_lenrek 95fac5e873 libhtml: fix potential linked list corruption
the difficulty is freeing items while parsing because items might already
be linked into various linked lists like in docinfo.images or form.fiels.
so we link images, tables and formfields to the docinfo as the final step
of getitems() pass using the new recursive function linkitems(). as only
reachable items get linked theres no danger of dangeling pointers.
2013-09-05 00:55:58 +02:00
cinap_lenrek cca9a1b523 abaco: fix memory leaks 2013-09-04 21:27:59 +02:00
cinap_lenrek 32236b4957 libhtml: fix memory leaks 2013-09-04 21:27:15 +02:00
cinap_lenrek 425338fd1f webfs: add exits(0) to main() 2013-09-03 21:27:48 +02:00
cinap_lenrek c1562daee0 libhtml: fix double free of form action 2013-09-02 23:18:46 +02:00
cinap_lenrek b14138c2ae 9bootfat: always try plan9 partition even when not marked active, fix bug
always look for 9fat in plan9 partition even tho the partition
is *not* maked active. marking partitions active is not
recommended anymore with grub so this makes life easier for
some people. multiple plan9 partitions on a single drive
is not supported.

have to copy partition table as buf gets trashed when reading
first block of fat partition. it worked only when the first
fat partition found (the one marked active) was the right one,
but conffat() can fail.
2013-09-01 21:18:11 +02:00
ppatience0 243cb68011 jpg(1), jpg: add -y flag to usage
png: colorspace will never be CYCbCr (this is no
doubt from copy-pasting from jpg)

tif: everyone else uses colorspace as a function
argument, so we will too

readtif, writetif: credit paul bourke
2013-08-31 13:39:51 -04:00
cinap_lenrek f104cc9d79 usbehci: portreset timing
assert port reset for 50ms, not 10ms.
2013-08-30 16:00:03 +02:00
mveety f459320bb4 removed unused variable resize in wind.c 2013-08-28 23:05:52 -04:00
mveety ba7c22f781 Added the p9p acme patch the allows multiline tags (thanks rsc and lf94). 2013-08-28 23:01:23 -04:00
cinap_lenrek 12ecb3e568 usbehci: fix portreset.
Port Reset R/W. 1=Port is in Reset. 0=Port is not in Reset. Default = 0. When
software writes a one to this bit (from a zero), the bus reset sequence as defined in the
USB Specification Revision 2.0 is started. Software writes a zero to this bit to terminate
the bus reset sequence. Software must keep this bit at a one long enough to ensure the
reset sequence, as specified in the USB Specification Revision 2.0, completes. Note:
when software writes this bit to a one, it must also write a zero to the Port Enable bit.
Note that when software writes a zero to this bit there may be a delay before the bit
status changes to a zero. The bit status will not read as a zero until after the reset
has completed.
2013-08-27 19:01:41 +02:00
cinap_lenrek d76eccaf88 imap4d: apply djc's patch to fix search (from /n/sources/patch/imap4d-cistrcmp)
Fix SEARCH command in imap4d by replacing the cistrstr typo with cistrcmp.
2013-08-27 00:34:17 +02:00
cinap_lenrek 43d3c87294 devproc: properly handle exclusive refcount for /proc/trace 2013-08-27 23:57:17 +02:00
cinap_lenrek 84109a3159 devshr, devaudio: openmode()/devopen() error handling 2013-08-27 23:27:46 +02:00
cinap_lenrek 52a84514ac devmouse: fix openmode() handling
openmode() can raise error with invalid mode passed, but we already
incremented the exclusive mouse refcount at that point! call openmode()
early to avoid this.
2013-08-27 23:26:30 +02:00
cinap_lenrek 244d2ee84b devkbd: fix wrong refcount on open error
only decrement refcount when file was successfully opend
on clunk, fix refcount when devopen() errors.
2013-08-27 23:23:29 +02:00
cinap_lenrek 5e37e6361c etheriwl: recover from rfkill toggle or firmware crash
spawn a kernel process to check the broken state of the controller.
if the firmware crashed, or rfkill was toggled we will reset and
reboot the firmware. also power down the card when rfkill is off.
2013-08-25 18:50:14 +02:00
ppatience0 334054e0e7 nusb/ether: add aue driver for admtek pegasus usb ethernet adapter 2013-08-24 19:18:15 -04:00
cinap_lenrek 808480f76b usbehci, usbuhci: paranoia
double the td abort delay and make sure the tsleep() isnt
shortened by a pending note. in that case, tsleep() would
raise error(Eintr); immidiately and would not sleep the
requested amount potentially cauing us to release active
dma memory too early! so we wrap the tsleep() call in a
while(waserror()) so we will at least wait the Abortdelay
amount if error is raised.

also, only try to idle the still active td's.

do not copy data in epio() when there was an error, theres
no reason to touch user buffer in that case.

for uhci, we also check that theres not more data in the
buffers than requested to avoid overflowing user buffer
in epio(). this should not happen but we'r paranoid.

for ehci, we also halt the queue head first in aborttds().
mark the queue heads as Qfree after unlinking and remove
some silly nil checks that are impossible.
2013-08-25 22:03:02 +02:00
stanley lieber 1556afae40 2c(1), torrent(1), uhtml(1), kbd(3), cwfs(4), hgfs(4), cifsd(8), cryptsetup(8), hjfs(8), kbdfs(8), realemu(8), wpa(8): fix spelling, typos 2013-08-23 15:48:52 -04:00
stanley lieber eca2dbed8b audio(1), hget(1), nusb(4), page(1): fix spelling, typos 2013-08-23 11:27:30 -04:00
stanley lieber d2ac298a80 webfs(4): read the whole man page before committing corrections 2013-08-23 11:15:52 -04:00
stanley lieber e1dfd6defe webfs(4): fix typo 2013-08-23 11:07:59 -04:00
stanley lieber 4ac8d862c1 webfs(4): correct typo 2013-08-22 17:58:51 -04:00
stanley lieber 89c964d0a4 fortunes: seems that so much is up on the net, it is hard to comprehend it all. 2013-08-22 12:15:29 -04:00
stanley lieber e112160105 file(1): recognize AAC audio files, from sources 2013-08-22 12:14:57 -04:00
cinap_lenrek e5095cca49 wifi: remove pool.h include 2013-08-20 19:48:39 +02:00
cinap_lenrek 9a3a722dde rc: flush environment variables (update /env) before fork
on races... normal forks will all share the /env environment but
not the in memory variables of rc. so when we would normally fork
whoever does an exec (flush) first will override what the values of the
/env variables are, *independent* of the variables that where
actually modified *in* the process.

when we flush *before* fork, then at least both processes start out
with marked clean in memory variables and the processes will flush
only the things they actually change.
2013-08-20 23:56:15 +02:00
cinap_lenrek d8cd5d197d rio: position keyboard window (-k) at the bottom of the screen 2013-08-20 23:48:18 +02:00
cinap_lenrek a0bc81f0be bitsy/keyboard: dont resize our own window
the resizing fails if run with rio in rio. dont try
to be too clever.
2013-08-20 23:36:04 +02:00
cinap_lenrek dda7b2c49f wpa: repeat rsne setup after deassociation (roamng between access points)
the "auth" ctl command only sets the rsne of the current selected
access point. so on deassociation, we wait for the connection to
the potentially new access point and then setup new rsne before
processing eapol messages.
2013-08-19 16:07:07 +02:00
stanley lieber 232dad19ad fortunes: GitHub is down...uh...now what? 2013-08-15 12:12:26 -04:00
cinap_lenrek 3c3a573562 libsec: only send client cert when we have one (fix regression from r6e976b2004dd) 2013-08-15 00:29:42 +02:00
cinap_lenrek c23a2f6a79 libc: Prevent infinite recursion when modf is called with NaN or Inf argument. (apply richard millers / modf-nan patch from sources) 2013-08-14 18:49:45 +02:00
cinap_lenrek 508b53a29a libdraw: fix leftover processes or programs failing to restore window labels when receiving interrupt note
fix the default note handler for event programs. only handle non system
notes or notes in the slave processes. for interrupt in the main process,
just call exits() which will do the cleanup and restore window label
properly.

this makes completely overriding the note handler in gping and
stats uneccesary.
2013-08-13 21:46:13 +02:00
cinap_lenrek df9597ecde resample: fix XRGB32 color channel handling 2013-08-12 19:28:10 +02:00
cinap_lenrek 1b58ec9279 esd: enlightenment sound daemon
this program allows one to stream audio from linux/windows
to plan9 /dev/audio. sometimes handy to augment vnc sessions
with sound.
2013-08-12 03:43:42 +02:00
cinap_lenrek d4f39b35bf games/doom: remove useless allocation of screen[0] buffer
screens 0-3 are already initialized by V_Init().
2013-08-12 00:40:09 +02:00
cinap_lenrek 762093d212 games/juggle, games/catclock: keep up with queued mouse events
many queued mouse events delay eresize() because
new ebread() takes from the queue first before attempting
to read from the event pipe. this is a waste of memory, so
just process (dequeue) all the events as long as there are
any on each iteration.
2013-08-12 00:08:51 +02:00
cinap_lenrek 883ded7b49 catclock: protect black border with clip rectangle and dont print when window is too small 2013-08-12 23:31:53 +02:00
cinap_lenrek 09d3dbc741 ether6105m: increase timeouts for Soekris 5501s (from sources) 2013-08-11 18:32:42 +02:00
cinap_lenrek 5fce388abf create /sys/lib/ssl 2013-08-11 18:23:22 +02:00
cinap_lenrek bf10f672ec vt: fix off by one memory corruption
account for the final 0 byte in host_buf.
2013-08-11 08:34:34 +02:00
cinap_lenrek 09d465a976 libdraw: make ebread() return buffer immidiately if available, cleanup
this reduces number of syscalls and improves performance for vt
2013-08-11 08:31:53 +02:00
cinap_lenrek 62bd2ae8b9 libdraw: fix ekbd() memory leak 2013-08-11 08:22:21 +02:00
cinap_lenrek 4e3a8e41fb tm2sec: assume local timezone when Tm.zone[0] == 0 (fixes dossrv, zipfs timestamps)
from the manual:

Tm2sec converts a broken-down time to seconds since the
start of the epoch.  It ignores wday, and assumes the local
time zone if zone is not GMT.

so we can assume localtime if Tm.zone is not set to GMT.

all code that wants no localtime conversion should set
Tm.zone explicitely to GMT. (see previous commits)

tm2sec() now does the reverse of localtime() when Tm.zone[0] == 0
which seems to be what the calling code (dossrv, zipfs) assumes.
this also makes sense because theres no simple way todo it
outside of libc as theres otherwise no access to the timezone
structure with the daylight saving periods.
2013-08-11 02:19:02 +02:00
cinap_lenrek 9fb29e09ea cifs: fix timezone for timestamps
tm2sec() ignores tm.tzoff and will use the local timezone for
conversion. to make it work right, we convert the dos timestamp
as GMT and then correct timezone with the offset provided by the
server.
2013-08-11 01:36:03 +02:00
cinap_lenrek c7b56cfe58 auth(8) commands: fix uninitialized Tm.zone in getdate() 2013-08-11 23:21:13 +02:00
cinap_lenrek f536320698 TEQ with S bit = 0 would be pointless, so ARM uses this case to encode "miscellaneous"
instructions like BKPT, BX and BLX.  Decoding these correctly allows db/acid to
single step through BX and BLX on armv5t+, and to show a breakpoint instruction
as 'BKPT $#0' instead of 'TEQ R0@>R0,R0'.
2013-08-10 16:40:36 +02:00
cinap_lenrek bfe852b3a2 nusb/kb: *really* only send to mousein when mouse state actually changes (zero detlas, same buttons) 2013-08-10 08:47:43 +02:00
cinap_lenrek 2012ba4d03 revert previous commit... stupid idea 2013-08-10 08:37:13 +02:00
cinap_lenrek f887f71320 nusb/kb: only send to mousein when mouse state actually changes 2013-08-10 07:59:54 +02:00
cinap_lenrek dfe6118e30 rio: fix unused variable warning in wscroll() 2013-08-10 03:58:52 +02:00
cinap_lenrek 66531b005f rio: shorten overlong window labels 2013-08-10 03:54:55 +02:00
cinap_lenrek e71ff9dc18 mothra: log post data with debug flag, increase max token length from 1K to 4K 2013-08-09 18:23:08 +02:00
cinap_lenrek 0e8fecdad5 mothra: fix nil pointer dereference 2013-08-09 17:24:48 +02:00
cinap_lenrek 7c25ff0c11 sam: avoid thread stack overflow with 32bit runes (from sources) 2013-08-08 01:44:20 +02:00
cinap_lenrek a28bdd3e1f cwfs: fix out of order replies
using a shared reply queue and a pool of worker procs does
result in replies to be send out of order under some conditions.
the symptoms are mnt errors when interrupting requests (Rflush
arriving before the original requests response).

this change gives each connection its own reply queue and its
own srvo process. so now a connection consists of one reply
queue, a srvi process reading the connections file descriptor
and a srvo process reading the reply queue and writng replies
to the connections file descriptor.

the srvi processes live as long as the connection is established.
the srvo prcoesses live forever and are attached to the chan
(which gets reused).

to avoid excessive process creation, we limit the number of
connections to 30. srvchan() returns nil when all 30 network
channels are in use.
2013-08-08 01:07:01 +02:00
cinap_lenrek 3663ffeefa cwfs: use atomic compare and swap to avoid semacquire() syscalls in new queue implementation 2013-08-07 01:32:11 +02:00
stanley lieber 2c8f291db2 fortunes: God bless the people who employ you, they need the blessing. 2013-08-06 14:52:13 -04:00
cinap_lenrek 2f3f8d50c1 wikifmt: handle & as &amp; in anchor name, cleanup 2013-08-05 06:25:23 +02:00
cinap_lenrek 98c6d867fd wikifmt: more complete title to name= anchor translation 2013-08-05 06:17:24 +02:00
cinap_lenrek 684cf70857 rio: make sure flush replies are send only *after* the request got flushed or was replied
due to the xfid handlers clearing flushtag too early, xfidflush might respond too early
causing spurious replies send later by the handler. now, we clear the flushtag in
filsysrespond *after* the reply was send. xfidflush will wait for us on the active
qlock.
2013-08-05 04:21:34 +02:00
cinap_lenrek 1df707a0b2 unsticky scrollbars
scrollbars used to put the mouse on the scrollbar while scrolling. if latency
is high, this often results to the cursor jumping back. instead, make button 2
srolling work without needing the mouse to be inside the scrollbar and leave
the mouse position alone.
2013-08-05 00:25:40 +02:00
cinap_lenrek cdc0b89d81 fix this megashit 2013-08-05 22:31:37 +02:00
cinap_lenrek 755108a144 cwfs: remove reflock
queues allow multiple readers, reflock seems unneccesary.
2013-08-05 22:07:50 +02:00
cinap_lenrek e3d9591283 cwfs: faster queue implementation using semacquire() 2013-08-04 06:47:56 +02:00
cinap_lenrek 24349c52b4 rio: add ^B control sequence to move cursor to output point 2013-08-04 06:45:58 +02:00
cinap_lenrek a269ced358 apply richard millers arm debug fixes (from sources)
From richard:

A couple of patches applied yesterday should make debugging on ARM a
bit more reliable.  Using db or acid on ARM, you may have noticed that
a program being debugged would sometimes execute through a breakpoint
without stopping, or run away while being single stepped.  It turns out,
as often happens, that one symptom had two separate causes.  For details:
	/n/sources/patch/applied/5db-condcode/readme
	/n/sources/patch/applied/arm-bkpt-cond/readme

To take advantage of the patches, rebuild libmach.a, then acid and db.
On machines with a kw kernel (sheevaplug et al), you'll also want to
rebuild /arm/9plug; otherwise breakpoints will stop working at all.
The new 9plug will, however, still work with the old libmach; and
the bcm and teg2 kernels are already compatible with the new libmach.
2013-08-04 01:52:46 +02:00
cinap_lenrek 7dee88ec33 dns: ignore spam addresses from cname answers 2013-08-04 00:52:39 +02:00
cinap_lenrek 631ac3d2e2 page: maintain a lru list and do unloading from oldest to newest 2013-08-03 17:37:20 +02:00
cinap_lenrek 79b16616d7 libhtml: handle &apos; character reference
the &apos; is not strickly html, but can appear in xhtml files.
2013-08-03 05:45:40 +02:00
cinap_lenrek 041eb4b30d page: use less aggressive read ahead and keep track of image memory allocation 2013-08-03 04:11:24 +02:00
cinap_lenrek 3904a8357d do not limit kernelpercent IFF *imagemaxmb= is used on a cpu server
the heuristics that limits kernel memory on a cpu server to
a fixed amout (64MB + size for page tables) makes using devdraw
impractical.

if *imagemaxmb= is specified, we can assume that the draw device
will be used so we want to get a reasonable amount (30% default)
of kernel memory.
2013-08-02 17:52:51 +02:00
cinap_lenrek b0a470fa0d smtp: fix -t flag 2013-08-02 01:22:53 +02:00
cinap_lenrek 2353a35dc8 ether82567: determine phy number by probing phy id registers
link status not working on 82567 was due to wrong phy number
used. instead of hardcoding the phy numbers, probe the phys
by reading id1 and id2 registers (code stolen from ethermii).
2013-07-30 22:51:40 +02:00
cinap_lenrek 3b06ca8566 ether82563: make link status work for 82567
on the 82567, reading any phy register just gives 0 back.
however, the card works just fine and no action is required
to (re-)start auto negotiation. so we add maclproc() which just
reads the speed setting and link status from the mac status
register instead of reading the phy registers.

we'v probably seen this symptom on other cards (link: 0) like
82566. we should test if we can make link status work on
these cards as well by just using the maclproc().
2013-07-29 02:32:16 +02:00
cinap_lenrek c23715d268 ether82598, etherigbe: remove receive buffer pool optimization 2013-07-27 12:39:34 +02:00
cinap_lenrek 95b7745419 ether82563: fix mistake (missing buffer alignment) 2013-07-27 10:33:51 +02:00
cinap_lenrek b116a9ad33 ether82563: remove buffer pool optimizations
rx pool exhaustion causes the system to deadlock when netbooted.
queue management should (etheroq) already makes sure the systen
can keep up with the data thowing away buffers.
2013-07-27 09:25:36 +02:00
cinap_lenrek 2009d55643 ether82563, etheriwl, pmmc: fix potential multiprocessor races with wakeup
make sure that the wakeup enable conditions
are seen by different processors before sleep
is called.

the problems havnt been observed so far.
2013-07-26 04:37:32 +02:00
cinap_lenrek ac52599eef ether82563: avoid deadlock due to icansleep() trying to acquire Rbpool.Lock
icansleep() violates the lock ordering due to the following cases:

rbfree(): ilock(Rbpool.Lock) -> wakeup(): spli(), lock(Rbpool.Rendez)
sleep(): splhi(), lock(Rbpool.Rendez) -> icansleep(): ilock(Rbpool.Lock)

erik fixed this moving the wakeup() out of the ilock() in rbfree(),
but i think it is an error to try acquiering a ilock in sleeps wait
condition function in general.

so this is what we do:

in the icansleep() function, we check for the *real* event we care about;
that is, if theres a buffer available in the Rbpool. this is to handle
the case when rbfree() makes a buffer available *before* it sees us
setting p->starve = 1.

p->starve is now just used to gate rbfree() from calling wakeup() as
an optimization.

this might cause spurious wakeups but they are not a problem. missed
wakeups is the thing we have to prevent.
2013-07-26 01:51:03 +02:00
cinap_lenrek 2759b81dec ether82563: work arround for 82579LM on Lenovo X230
dont reset the the phy on reset as this causes the link
to be stuck at 10mbps.
2013-07-24 22:17:13 +02:00
ppatience0 9a5763624f etherrt2860: add rt3090 support and make style more consistent 2013-07-21 18:13:27 -04:00
ppatience0 776056dcd0 readtif, writetif: remove multiplication in inner loops of predict functions 2013-07-21 10:56:11 -04:00
cinap_lenrek 176569ca4d apply erik quanstros tcp-bdp patch (from sources)
this patch consists of two bits of work submitted as one
patch.

the first bit fixed a "pacing" problem, where a tcp connection
rate-limited by the reading process would experience 10%
of the expected throughput, and could even get into live
lock.  it was noticed at the time of this initial work that
the stack often sent tiny grams.  some good bits from nix'
original tcp were merged in.  the test program
	/n/sources/contrib/quanstro/tcptest.c
will verify that under most conditions, a reader-paced connection
now gets the expected throughput.  expected arguments
would be
	tcptest -s1 -n 5000 -l

the second bit is a first step in preparing tcp to handle
modest (1-2MB) bandwidth-delay products.  the strategy
was to completely implement NewReno.  the testing network
was a 7/35/70ms by 100Mbit wan emulator with 0/.05/.1% loss.
here are the performance comparisons from the changes after
the first round "old" to the submitted patch "new".  the
smallest improvement was 80%, the largest was 11x.

loss%	rtt	old	new
0.10	7	4.40	7.85
0.10	35	0.88	1.79
0.10	70	0.47	0.84
0.05	7	4.80	9.38
0.05	35	1.00	2.02
0.05	70	0.52	1.77
0.01	7	5.33	11.87
0.01	35	1.14	10.97
0.01	70	0.54	4.75
0.00	7	4.49	11.92
0.00	35	1.04	11.35
0.00	70	0.58	10.56

since the diff is not very easy to read, i wrote a small
paper detailing the changes

	http://www.quanstro.net/plan9/tcp/tcp.pdf

- erik
2013-07-21 14:41:51 +02:00
cinap_lenrek 638a822362 abaco: use faster resize instead of resample for image scaling 2013-07-21 00:55:56 +02:00
ppatience0 61c82d2bb8 readtif: simplify rounding in other places 2013-07-20 18:19:20 -04:00
ppatience0 171db68c3d readtif, writetif: simplify rounding 2013-07-20 18:00:34 -04:00
ppatience0 0fc3aa99a1 readtif: if getbit returns less than 0 during eol fill bits, return early 2013-07-20 16:56:29 -04:00
ppatience0 92b14e72b0 readtif, writetif: prevent buffer overflows in some corner cases 2013-07-20 16:42:33 -04:00
ppatience0 105155880c tojpg, totif: change flags to better match those of the decoders 2013-07-20 12:11:52 -04:00
ppatience0 360cabb858 readtif: fix many bugs
totif: add tiff encoder
2013-07-19 02:16:43 -04:00
ppatience0 24a5720bec writejpg: the call to Bflush() is unnecessary; free data before exiting in case of malloc error
writeppm: do not print a space after the last pixel
2013-07-19 01:07:15 -04:00
cinap_lenrek b0cd0020df mothra: use pldraw() to put cmd box on screen for alt display
the cmd box is not part of the alt display hirarchy. for command
typing to show the box in alt display, we call pldraw() on it
in eresized() to initialize its cmd->b image so it knows where to
draw itself on typing.
2013-07-18 20:56:19 +02:00
cinap_lenrek 4755fce1dc wpa: wait for bss to connect
waiting at the auth command is too late because we want to
read the brsne first to build the rsne used in the auth message.
2013-07-18 16:16:31 +02:00
cinap_lenrek b6122a4c42 wifi: make "auth" command non-blocking, let aux/wpa do the waiting for bss scan to complete. 2013-07-18 15:30:53 +02:00
cinap_lenrek 24e8c78cb2 cwfs: add rtmp flag for check command to remove temporary files after recover 2013-07-18 15:04:37 +02:00
cinap_lenrek 8ef9f7bbee mothra: restore usage fix, document -a option in manual 2013-07-18 11:18:31 +02:00
cinap_lenrek 26e93aa49c mothra: add -a flag to start in alt-display mode 2013-07-18 11:03:39 +02:00
stanley lieber 07b4aeeacc mothra: fix usage 2013-07-17 20:25:57 -04:00