Commit graph

6330 commits

Author SHA1 Message Date
aiju ec1976eb05 fplot: add support for readout with middle mouse button 2018-11-30 17:32:10 +00:00
aiju 5b2f81a567 fplot: color different curves 2018-11-30 16:58:01 +00:00
aiju f102882990 fplot: compute y range correctly when used with multiple graphs 2018-11-30 16:12:02 +00:00
cinap_lenrek 55f067553a upas: get rid of broken validatesender example, remove redundant upas/misc and setup target 2018-11-28 21:12:11 +01:00
mischief cd933b2a9c hgwebfs: read to eof by default to match urllib2 behavior 2018-11-28 11:34:52 -08:00
cinap_lenrek 099da8cb82 devip: fix arpread, dont return partial entries 2018-11-28 12:41:18 +01:00
cinap_lenrek 243c25fd8f upas/fs: avoid switch on vlong breaking build (thanks k0ga) 2018-11-26 21:36:51 +01:00
cinap_lenrek 3484b7c23a upas/fs: another mistake ... 2018-11-26 21:29:33 +01:00
cinap_lenrek f75b4fddb3 upas/fs: fix broken body.ext in walk (thanks sl) 2018-11-26 20:15:30 +01:00
cinap_lenrek da9f1ccc28 libmach: change amd64 szreg to 8 (thanks charles forsyth) 2018-11-24 22:38:00 +01:00
aiju 6e6beff85d delete old NOTICE file 2018-11-24 15:22:17 +00:00
cinap_lenrek 434de8db8d snap: use Mach->szaddr as the width of the stack pointer (fixes snap on amd64)
to read the value of the stack pointer register, snap
used Machdata->szreg to determine the width of the
SP register in the Ureg structure. however, the value
does not match the Ureg.sp type for a number of architectures
(mips2, amd64) and it is unclear if this was an oversight
as it is rarely used (snap is indeed the only user) or
if it was intended for a different purpose.

so we use szaddr instead which matches the stack pointer
width in the Ureg and fixes the truncated stack issue on
amd64.
2018-11-22 20:27:27 +01:00
cinap_lenrek 6bd0764167 snap: add debug flag, make debug less verbose 2018-11-22 15:09:54 +01:00
cinap_lenrek 9d471caaae snap: check for overflows, cleanup error handling 2018-11-22 12:44:15 +01:00
cinap_lenrek 3363693205 snap: consequently use ulong for page index and count 2018-11-22 10:31:30 +01:00
cinap_lenrek 5692788724 snap: be more conservative taking stack snapshot
include up to 8k below the stack to get some more context.

don't assume stack is at least 16K.
2018-11-22 10:30:45 +01:00
cinap_lenrek 1f464e0013 upas/fs: keep messages *marked* for deletion in the index 2018-11-22 08:55:13 +01:00
cinap_lenrek 5a5d3e0414 upas/fs: allow msgincref() with mb->refs == 0
this can happen when the on the final sync when the mailbox
is being freed:

freembox -> mboxdecref -> syncmbox -> wridxfile -> pridx -> insurecache -> msgincref
2018-11-22 08:49:41 +01:00
cinap_lenrek 1dcf853fc0 upas/fs: checkfid() might be called with uninitialized fid, ignore 2018-11-21 21:48:55 +01:00
cinap_lenrek 5d2bffc26f upas/fs: fix walk 2018-11-21 17:32:36 +01:00
cinap_lenrek 70f700699a upas/fs: don't enter mailbox into hashtree when it is being freed
syncmbox() used to enter the mailbox into the hash tree to
update the qid.vers. this is wrong when we are doing the final
sync before freeing the mailbox as the hash reference has already
been removed by freemailbox().

also avoid adding hash entries for mails for the about to be
freed mailbox in cachehash().
2018-11-21 16:19:51 +01:00
cinap_lenrek 5ef10e1642 mp(2): fix spelling 2018-11-21 02:08:15 +01:00
cinap_lenrek 39a7be7ea3 mp(2): clarify mptoa() and mpfmt() default base 2018-11-21 01:15:43 +01:00
cinap_lenrek 8e50556f14 upas/fs: rework the refcounting, use 64bit qid path, add checks
add function to check the refcounts for Mailbox and Message on a fid

use the full 64 bit of the qid.path, so we can use the full 32 bit for the id

instead of only maintaining refcount for the top message, msgincref() now
adds a reference to all its parent messages including self and top message.
then we can check in recursive delmessage() that all the parts have a zero
refcount.

remove the Fid.mtop field, it was never used.

make sure deletion and flag changes only affect the top message.

cachefree(): only look for top message in lru. sub-parts are never
added to the cache.

use the nparts field when reading sub-part of existing message, so
that we parse the index right in case the number of parts somehow
changed.

messages marked as Deleted but still in inbox should be written
to the index.
2018-11-21 00:37:35 +01:00
aiju 7a8e875668 games/md: fix mkfile 2018-11-20 09:22:04 +00:00
aiju 99d2e68a6a games/md: use cpu.c from blit 2018-11-20 09:20:46 +00:00
aiju af810c9871 games/blit: clean up cpu.c and make it pass tests 2018-11-20 09:18:20 +00:00
cinap_lenrek 4dee686ca5 pc, pc64: park application processors in rebootcode with mmu off
instead of having application processors spin in mpshutdown()
with mmu on, and be subject to reboot() overriding kernel text
and modifying page tables, park the application processors in
rebootcode idle loop with the mmu off.
2018-11-19 18:42:01 +01:00
cinap_lenrek b04ed2ae52 vt(1): vt doesnt exit when the host process exits as claimed (thanks driusan) 2018-11-18 21:28:56 +01:00
cinap_lenrek 485a3301e6 cc: fix wrong "useless or misleading comparison" warning
to reproduce:

 	u8int x, y;

 	x = 0xff;
 	y = 0xc0;
 	if((s8int)(x & y) >= 0)
 		print("help\n");

compiles correctly but prints a warning

warning: test.c:11 useless or misleading comparison: UINT >= 0

the issue is that compar() unconditionally skipped over
all left casts ignoring the case when a cast would sign
extend the value.

the new code only skips over the cast when the original
type with is smaller than the cast result or when they
are equal width and types have same signedness. so the
effective left hand side type is the last truncation
or sign extension.
2018-11-18 20:42:45 +01:00
cinap_lenrek b6251bff91 rc: implement $"x in terms of Xdol() and new Xqw() instruction
to get $"1 right, remove Xqdol() and instead implement it in
terms of Xdol() instruction and use the new Xqw() instruction
to quote the resulting list.
2018-11-18 04:56:48 +01:00
cinap_lenrek 196da4ec6f devip: fix swapped tcp snd.scale and recv.scale in tcpstate() format (thanks joe9) 2018-11-18 04:14:41 +01:00
cinap_lenrek 064ea89caa libdraw: avoid deadlock for mouse ioproc sending on resizec
a deadlock has been observed with samterm (thanks burnzez),
that shows the mouse ioproc being stuck in sending on the
resize channel, while the mouse consumer is stuck in a
readmouse() loop wanting a rectangle to be drawn by the
user:

recv(v=0x42df50)+0x28 /sys/src/libthread/channel.c:321
readmouse(mc=0x42df50)+0x54 /sys/src/libdraw/mouse.c:34
getrect(.ret=0x41bce0,but=0x4,mc=0x42df50)+0x62 /sys/src/libdraw/getrect.c:49
	r=0x41bc70
	rc=0x41bc70
getr(rp=0x41bce0)+0x24 /sys/src/cmd/samterm/main.c:244
	p=0x6b000004f6
	r=0x2
sweeptext(new=0x0,tag=0x2d)+0x12 /sys/src/cmd/samterm/menu.c:208
	r=0x2
	t=0x42df50
inmesg(type=0x2,count=0x2)+0x1ab /sys/src/cmd/samterm/mesg.c:136
	m=0x10000002d
	l=0x2d00001b00
	i=0x43829000000001
	t=0x438290
	lp=0x42e050
rcv()+0x7a /sys/src/cmd/samterm/mesg.c:77
threadmain(argv=0x7ffffeffef90)+0x173 /sys/src/cmd/samterm/main.c:63

so avoid blocking in the mouse ioproc by using nbsend()
instead of send() for writing to the resize channel.
2018-11-18 03:37:04 +01:00
mischief a25418fddc devbridge: fix runt packets going through the bridge (thanks cinap)
linux will send small, unpadded arp packets which may arrive over
wifi, so allow small packets into the bridge and pad any packets that
are too small when going out.
2018-11-17 17:23:56 -08:00
aiju fbfa249c63 games/c64: make keyboard table more readable 2018-11-17 09:48:46 +00:00
mischief 744867de34 ether82563: ignore i82753 checksums, fixes T60 ethernet 2018-11-14 11:33:52 -08:00
cinap_lenrek 06783edd7a nusb/kb: multitouch support (touchscreens, stylus)
touchscreens signal multiple contact points (X/Y) in
the hid descriptor separated by being nested in separate
collections. the contact point is identified by a
optional contact id. if omited, we use the collection
index and report id.

so we collect all the items (X/Y, buttons, wheel) from
separate collections in Hidslot structures and in the
end combine all the slots together.

buttons are or'ed together while absolute X/Y is applied
when it changed. relative X/Y deltas get added together.

thanks to kivik and Glats for testing.
2018-11-14 09:12:34 +01:00
cinap_lenrek 8a7f897b30 nusb/kb: revert multitouch, breaks some mice... 2018-11-13 03:34:19 +01:00
cinap_lenrek b5ea1cc4be upa/imap4d: ignore messages without digest info 2018-11-12 20:43:25 +01:00
cinap_lenrek 3b51df75b5 disk/mkfs: remove unused cputype variable (thanks kvik) 2018-11-12 16:54:59 +01:00
cinap_lenrek 8c57331b9b merge 2018-11-12 08:53:29 +01:00
cinap_lenrek 9de1403358 nusb/kb: lilu dallas multitouch 2018-11-12 08:52:01 +01:00
aiju c247ce1c33 add dtracy to mkfile 2018-11-11 10:10:30 +00:00
aiju e15b1b8930 add dtracy.h 2018-11-10 20:01:19 +00:00
aiju a7f5ecaf63 dtracy: missing break in dteverify 2018-11-10 14:01:42 +00:00
aiju e6d99771e5 adding dtracy (crude early version) 2018-11-10 13:46:16 +00:00
cinap_lenrek 8c097ae84a ssh: handle unknown MSG_CHANNE_REQUEST messages 2018-11-08 22:35:45 +01:00
cinap_lenrek 2a266430e3 ssh: handle MSG_GOBAL_REQUEST
respond to MSG_GLOBAL_REQUEST with MSG_REQUEST_FAILURE
as stated by rfc4254 when server wants a reply.

failing todo so breaks some proprietary keep-alive schemes.
2018-11-08 22:00:07 +01:00
cinap_lenrek 615f43b76e ip/dhcpd: Add swap server support in dhcpd (thanks k0ga) 2018-11-08 21:15:07 +01:00
cinap_lenrek 85afec4c2f bcm: intrenable() can happen from any cpu in case of dma interrupts 2018-11-08 20:26:32 +01:00
cinap_lenrek b7aedbb366 libdraw: cannot happen 2018-11-08 16:56:34 +01:00
cinap_lenrek df7fcc6cac libdraw: fix gengetwindow()
- fix fd leak in winname read() <= 0 case
- avoid freeing d->image (was by freeimage((*scrp)->image))
- dont leak screen and window in fullscreen mode
2018-11-07 22:01:18 +01:00
cinap_lenrek c0d21d35b1 bcm: cleanup timer code
- calculate hardcoded constants for more clarity
- avoid unneccesary modification of cntpns ctl register
- revert enabling IRQcntpns for cpu0
- remove unused Localintpending register offset constant
2018-11-07 17:02:09 +01:00
cinap_lenrek 385f52183c bcm: simplify irq handling by having per cpu Vctl chain 2018-11-07 16:49:50 +01:00
cinap_lenrek b0d226705c bcm: speed up co-processor operations by avoiding i+d cache flush on each operation
coproc.c generated the instrucitons anew each time,
requiering a i+d cache flush for each operation.

instead, we can speed this up like this:

given that the coprocessor registers are per cpu, we can
assume that interrupts have already been disabled by
the caller to prevent a process switch to another cpu.

we cache the instructions generated in a static append
only buffer and maintain separate end pointers for each
cpu.

the cache flushes only need to be done when new
operations have been added to the buffer.
2018-11-07 16:48:14 +01:00
aiju 17f0b2ce38 nusb/serial: fix wrong guard statement (thanks deuteron) 2018-11-06 12:05:15 +00:00
cinap_lenrek e76452a69f merge 2018-11-06 04:33:29 +01:00
cinap_lenrek a66be23396 dnstcp: temporarily switch on resolver mode so we can resolve the dnsslaves for axfr check 2018-11-06 04:31:48 +01:00
aiju 1d0f8a7e51 sed: only dollars as first address are a problem for -u 2018-11-05 20:17:48 +00:00
mischief a86de839ca rio(1): fix typo 2018-11-04 11:39:04 -08:00
mischief 52ad5b3ec5 mp(2): document mpfactorial 2018-11-04 11:37:13 -08:00
mischief 6df3f7bf38 libmp: declare mpfactorial 2018-11-04 11:37:02 -08:00
cinap_lenrek 0a681f38eb merge 2018-11-04 19:50:06 +01:00
cinap_lenrek 93e493f391 libaml: allow amlmapio() to re-enter the interpreter (can happen by pciadd() -> amleval())
- make frame base pointer variable
- in rwreg(), save/restore the interpreter state and allocate a Frame* on the stack
- add overflow checks for frame base pointer to xec() and amleval()
- gc() scans the whole stack from FP to the *real* bottom F0
2018-11-04 19:48:27 +01:00
aiju 0bd213b7b0 devvmx: remove bogus . direntry 2018-11-04 16:03:35 +00:00
cinap_lenrek 89c659d80b bcm: fix mysterious core clock resets under SMP (thanks richard miller)
reference: https://github.com/raspberrypi/firmware/issues/542

procsave(Proc* p)
{
	uvlong t;

	cycles(&t);
	p->pcycles += t;

// TODO: save and restore VFPv3 FP state once 5[cal] know the new registers.
	fpuprocsave(p);
	/*
	 * Prevent the following scenario:
	 *	pX sleeps on cpuA, leaving its page tables in mmul1
	 *	pX wakes up on cpuB, and exits, freeing its page tables
	 *  pY on cpuB allocates a freed page table page and overwrites with data
	 *  cpuA takes an interrupt, and is now running with bad page tables
	 * In theory this shouldn't hurt because only user address space tables
	 * are affected, and mmuswitch will clear mmul1 before a user process is
	 * dispatched.  But empirically it correlates with weird problems, eg
	 * resetting of the core clock at 0x4000001C which confuses local timers.
	 */
	if(conf.nmach > 1)
		mmuswitch(nil);
}
2018-11-04 16:00:32 +01:00
cinap_lenrek dd82b657c0 bcm: fix mistake in mkfile 2018-11-01 01:07:51 +01:00
cinap_lenrek 5608be398e bcm: fix /dev/reboot text/data corruption (thanks richard miller)
- clean dcache before turning off caches and mmu (rebootcode.s)
- use WFE and inter-core mailboxes for cpu startup (rebootcode.s)
- disable SMP during dcache invalidation before enabling caches and mmu (in armv7.s)
2018-10-31 19:48:16 +01:00
Alex Musolino 913be4e74a awk(1): fix append operator to avoid truncating file 2018-10-31 16:49:02 +10:30
cinap_lenrek 8e9d2434e9 bcm: provide /dev/cputemp in a format stats can understand 2018-10-28 07:10:27 +01:00
cinap_lenrek daf153009e merge 2018-10-28 06:17:34 +01:00
cinap_lenrek b715c39bfa bcm: simplify reboot code
- synchronize rebootcode installation
- handle the 1MB identity map in mmu.c (mmuinit1())
- do not overlap CONFADDR with rebootcode, the non boot
  processors are parked there.
- make REBOOTADDR physical address
2018-10-28 06:16:10 +01:00
cinap_lenrek 0fc2adb43d bcm: cleanup clock code
- disable local clock on interrupt to prevent accidents when reenabling
- always regitster local clock interrupt handler, even for cpu0
- simplify microdelay()
- don't mess with watchdog
2018-10-28 06:09:05 +01:00
cinap_lenrek f17a5cc2cf bcm: fix l2 cache maintenance routines for raspi3 (armv8)
armv8 has 16-way l2, so adjust shift for the set-way cache
tag format.
2018-10-28 06:05:43 +01:00
qwx d74fdfc022 misc small manpage fixes 2018-10-28 00:05:05 +02:00
cinap_lenrek 2ee4c08974 devuart: don't sleep in uartdrainoutput() when called splhi or without a process
uartdrainoutput() might be called in early initialization
from uartctl() without a process.
2018-10-27 20:00:12 +02:00
cinap_lenrek d81f4d4866 rc: skip searchpath for "", "." and ".." 2018-10-27 18:32:00 +02:00
cinap_lenrek d17a049c5b rc: use searchpath() logic to handle $cdpath 2018-10-26 10:25:23 +02:00
cinap_lenrek 1a55b8d1f0 rc: ignore $cdpath for # device rooted paths (thanks kivik) 2018-10-26 09:52:05 +02:00
23hiro 05021e0579 add Centrino Wireless-N 1030 (thanks lksmk from brazil) 2018-10-25 08:09:10 +02:00
cinap_lenrek b65a5a1ca5 /sys/lib/dist/mkfile: add pi.img target for raspi sdcard image 2018-10-22 00:16:04 +02:00
cinap_lenrek f059563b9d add /sys/src/boot/bcm/mkfile to download raspberry pi bootcode firmware 2018-10-22 00:15:39 +02:00
cinap_lenrek 8dfff00e50 nusb/serial: add support for CH340 serial converter 2018-10-21 17:24:33 +02:00
cinap_lenrek 21001d4294 merge 2018-10-21 03:44:16 +02:00
cinap_lenrek 2fd35e9bf8 kbdfs: don't get confused by broken utf8 2018-10-21 03:42:24 +02:00
qwx f5c6a870bf doom: fix music for patch wads
revert last change, which used games/wadfs to expose genmidi and music lumps.
replacements from patch wads were never seen that way.  instead, write genmidi
and music lumps to /tmp and play them from there.
2018-10-21 00:11:39 +02:00
cinap_lenrek b4eb667f02 acme: fix fd checks - initialize Window.rdselfd to -1 not 0 2018-10-20 23:57:50 +02:00
BurnZeZ 84e019aba3 fix misleading/wrong fd checks 2018-10-20 18:44:09 +00:00
cinap_lenrek 292cce2ad1 libdisk: catch null bytes in proto file, fix memory leaks 2018-10-20 20:32:22 +02:00
cinap_lenrek 5bb7240ee9 nusb/kb: work arround broken split transaction on raspi's dwc otg usb controller 2018-10-20 19:57:37 +02:00
cinap_lenrek 83e20b4df1 bcm: import changes for raspi2/3 from richard miller 2018-10-20 19:56:31 +02:00
cinap_lenrek 796e5e6000 nusbrc: support for raspi3 ethernet 2018-10-20 19:53:57 +02:00
cinap_lenrek 37dcb25eee kernel: fix allocb for BLOCKALIGN*2 >= Hdrspc 2018-10-20 19:52:54 +02:00
cinap_lenrek c4ec69045e devusb: use Enotconf[] string constant 2018-10-20 19:41:37 +02:00
cinap_lenrek 86a9f92f47 nusb/ether: add support for lan78xx (raspi3) (thanks richard miller) 2018-10-20 19:30:16 +02:00
cinap_lenrek 29865005f9 nusb/ether: tune buffer size parameters for SMSC ethernet (raspi) (thanks richard miller) 2018-10-20 19:29:18 +02:00
mischief 499478eb62 upas/fs: delete extra binaries 2018-10-18 08:46:44 -07:00
mischief 286ee3ba34 truetypefs(4): fix example path 2018-10-16 12:53:55 -07:00
mischief 717fa414af kbdfs(8): fix nit 2018-10-16 12:53:34 -07:00
aiju d6164606d9 ttf: SHZ also uses 0x36 2018-10-16 19:26:40 +00:00