cinap_lenrek [Sun, 18 Nov 2018 19:42:45 +0000 (20:42 +0100)]
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.
cinap_lenrek [Sun, 18 Nov 2018 03:56:48 +0000 (04:56 +0100)]
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.
cinap_lenrek [Sun, 18 Nov 2018 02:37:04 +0000 (03:37 +0100)]
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:
mischief [Sun, 18 Nov 2018 01:23:56 +0000 (17:23 -0800)]
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.
cinap_lenrek [Wed, 14 Nov 2018 08:12:34 +0000 (09:12 +0100)]
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.
cinap_lenrek [Wed, 7 Nov 2018 15:48:14 +0000 (16:48 +0100)]
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.
cinap_lenrek [Sun, 4 Nov 2018 18:48:27 +0000 (19:48 +0100)]
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
// 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);
}
cinap_lenrek [Wed, 31 Oct 2018 18:48:16 +0000 (19:48 +0100)]
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)
cinap_lenrek [Sun, 28 Oct 2018 05:16:10 +0000 (06:16 +0100)]
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
cinap_lenrek [Sun, 28 Oct 2018 05:09:05 +0000 (06:09 +0100)]
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
qwx [Sat, 20 Oct 2018 22:11:39 +0000 (00:11 +0200)]
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.
mischief [Fri, 12 Oct 2018 15:34:17 +0000 (08:34 -0700)]
truetypefs: fall back to width if advance is zero
combining marks will have zero advance, but it results in zero-width
glyphs in subfonts. fall back to width so something meaningful is
rendered even if its not combined properly.
cinap_lenrek [Wed, 10 Oct 2018 00:45:11 +0000 (02:45 +0200)]
hget: do a HEAD request to check if the file is already complete (thanks miscief)
when we continue a download, make sure the file isnt already
complete, as otherwise the server might respond with a 416
as the range request will out of range.