cinap_lenrek [Fri, 21 Jun 2013 00:27:10 +0000 (02:27 +0200)]
ndb/dns: avoid duplicate entries for db records
dnauthdb() would relabel expired rr's as rr->db == 0 to make
them get garbage collected by dnage(). but this doesnt work
due to dn->keep and also causes the deduplication to fail on
rrattach() as rrattach1() handles rr->dn/rr->auth as separate
name spaces.
this causes duplicate entries in the rr's when ndb gets
gets changed. to fix, we just delete the expired (removed from
ndb) rr's immidiately in dnauthdb() instead of trying trick
dnage() to garbage collect it.
cinap_lenrek [Thu, 20 Jun 2013 00:30:17 +0000 (02:30 +0200)]
disable tscticks in pc kernel (for now)
doesnt seem to be reliable. also, separate tsc frequency measurement
and cpu loopconst measurement. turned out with *notsc=, the simplcycles()
calls would mess up loopconst.
cinap_lenrek [Tue, 18 Jun 2013 21:23:41 +0000 (23:23 +0200)]
libdraw: avoid moving cursor if we dont have to for menuhit
depending on the font, poping the menu would move your cursor
one pixel down each time (due to division). this is annoying
when using a trackpoint and trying to repeat some operation
over 9000 times.
the cursor should only be moved when the menu is repositioned
to contain it on the screen.
cinap_lenrek [Tue, 18 Jun 2013 20:02:07 +0000 (22:02 +0200)]
devshr: fix wstat, style
- same problem with wstat, if we error then owner has been already updated...
- avoid smalloc while holding qlock in wstat, do it before
- pikeshedd style...
- wstat would half update the Srv data structure if name was too long
- srvname() walked the linked srv list without holding srv qlock
- dont access sp->chan while not holding srv qlock in srvopen()
- dont modify sp->owner while not holding srv qlock in srvcreate()
- avoid smalloc() allocations while holding srv qlock
- style pikeshedding, sorry
cinap_lenrek [Mon, 17 Jun 2013 06:05:04 +0000 (08:05 +0200)]
page: use resizewin() to change window size for gif display
resizewin() has some extra logic making sure the rect doesnt get too big.
rio would otherwise refuse to create the window and the operation will fail
completely.
cinap_lenrek [Mon, 17 Jun 2013 00:28:10 +0000 (02:28 +0200)]
ip/ethermedium: drop short packets instead of producing negative size blocks
on usb ethernet, it can happen that we read truncated packets smaller
than the ethernet header size. this produces a warning in pullupblock()
later like: "pullup negative length packet, called from 0xf0199e46"
cinap_lenrek [Tue, 4 Jun 2013 20:11:01 +0000 (22:11 +0200)]
libaml: various fixes found by plhk
- fix bogus execution of Else{} blocks
- always allocate Env in amleval()
- add Sleep() and Stall() instructions
- keep package size for packages with empty body
cinap_lenrek [Mon, 3 Jun 2013 21:49:06 +0000 (23:49 +0200)]
time: fix -older t for relative times to current time (thanks arisawa for pointing out)
from test(1):
f -older t True if file f is older than (modified before)
time t. If t is a integer followed by the letters
y(years), M(months), d(days), h(hours),
m(minutes), or s(seconds), it represents current
time minus the specified time. If there is no
letter, it represents seconds since epoch. You
can also concatenate mixed units. For example,
3d12h means three days and twelve hours ago.
this means *without* [y M d h m s] unit, t is *absolute* time
in seconds since epoch.
ppatience0 [Sat, 1 Jun 2013 21:14:50 +0000 (17:14 -0400)]
readgif, readjpg: fix incorrect malloc arguments: use sizeof(Rawimage*) instead of sizeof(Rawimage**) and 2*sizeof(Rawimage*) instead of sizeof(Header)
readtga: switch calloc arguments: nelem is supposed to first, elsize second
cinap_lenrek [Sat, 1 Jun 2013 16:51:47 +0000 (18:51 +0200)]
8c: apply charles forsyth's 8c-cgen64-mul-savereg patch (from sources)
If 64-bit multiply has to save both AX and DX, it could load the wrong value
into DX; also, biggen shouldn't allocate either AX or DX as temporaries
when using the template for MUL.
cinap_lenrek [Sat, 1 Jun 2013 14:14:53 +0000 (16:14 +0200)]
inst/ndbsetup: allow setting sysname more than once
In the installation, if you run the ndbsetup task n times (n > 1),
the installed /lib/ndb/local will have n sys= entries.
The problem is that ndb(8) will use the first sys= entry found, but
one would expect that the last configuration in the ndbsetup task
would be the active one.
Remove any previous entry in ndbsetup before adding new one.
cinap_lenrek [Thu, 30 May 2013 21:26:21 +0000 (23:26 +0200)]
kernel: do all fp state fork from procfork() (like pc kernel)
this simplifies the arm ports and keeps all the stuff in one place
instead of spreading it thru notify(), trap() and syscall() functions
and prevents useless fp state copying for kernel procs.
also make sure to save fp in notify while still splhi().
cinap_lenrek [Thu, 30 May 2013 21:16:22 +0000 (23:16 +0200)]
pc kernel: simulate FXSAVE/FXRSTOR tag-byte from x87 tag-word, copy fp state across fork
the tag-word is not compatible between x87 and sse, have to convert
properly for emulation to work.
we now copy fp state across fork (again!) to preserve FCW and MXCSR
registers. this might not be neccesary as we could probably just
get the current value for the curren process and avoid the fpsave()
call, but become conservative again.
ppatience0 [Mon, 27 May 2013 04:26:19 +0000 (00:26 -0400)]
mothra: clicking on the url scroll bar, snarfing, or saving a hit when no urls have been loaded (right after running mothra) would crash. this was due to use of w->url and selection when they are actually nil.
to fix this, make genwww return 0 if w->url is nil and output an error message when attempting to access selection if it's nil. the problem with the w->url fix is that after clicking on the url scroll bar, an empty url history row could be highlighted by clicking on it. fix this by making sure lp->lo is not less than zero.
cinap_lenrek [Tue, 28 May 2013 21:41:54 +0000 (23:41 +0200)]
kernel: sysrfork abortion
when we fail to fork resources for the child due to resource
exhaustion, make the half forked child process call pexit()
to free the resources that where allocated and error out.