the maketab helper program was generated in parallel, which
had a dependency to y.tab.h which lead to yacc running
twice in parallel.
this removes the dependency to y.tab.h in the virtual
maketab.$objtype target to prevent this race condition.
the dependency to y.tab.h is resolved in the main mk at the
$cputype.maketab target which serializes with the other
targets.
the page attribute table was initialized in mmuinit(), which is
too late for bootscreen(). So now we check for PAT support and
insert the write-combine entry early in cpuidentify().
this might have been the cause of some slow EFI framebuffers on
machines with overlapping or insufficient MTRR entries.
at the _cas0 label, the linker would generate spurious stack
adjustment before the return:
atexitdont+0x84 0x000000000003614c CLREX $0xf
atexitdont+0x88 0x0000000000036150 MOVW R31,R0
atexitdont+0x8c 0x0000000000036154 MOV (SP)16!,R30 <- ????????????
atexitdont+0x90 0x0000000000036158 RETURN
the work arround is to move the code into its own cas0
text symbol.
this fixes impossible cwfs crashes in srvi().
When passing an absolute file path to yacc, we would skip
initializing inpath, leaving it null. This would cause Bopen
to die. We would similarly fail to report an error if we tried
to get the current working directory, and then die when
constructing inpath.
This fixes both cases.
as with recent changes, cc's malloc() could make the hunk pointer
misaligned. in the the compilers, the hunk pointer is used directly
by the lexer with no effort to to keep the hunk pointer aligned.
alloc/malloc still return aligned pointers, but hunk itself can
be on a odd address after allocation of a odd sized amount of bytes.
however, in the linkers, this assumption appears to be differnet. as
most allocations mostly allocate padded structures. however, symbol
lookup allocates strings on byte-size ganularity and the cc's malloc
would misalign the hunk pointer after the malloc() call. while the
rest of the code assumed hunk pointer was always aligned.
this change removes all the hunk pointer fiddling from the linker,
and we just call malloc() (which will use the fast implmenentation
of cc, and should not really make much of a performance difference).
We're missing type flags for:
hh: char
ll: vlong
z: size_t
t: ptrdiff_t
j: intmax_t
The lack of '%lld' was causing us to fail when parsing
timezone files. This brings us in line with the specifiers
in the C99 standard, section 7.19.6.2p11
ipiput4() and ipiput6() are called with the incoming interface rlocked
while ipoput4() and ipoput6() also rlock() the outgoing interface once
a route has been found. it is common that the incoming and outgoing
interfaces are the same recusive rlocking().
the deadlock happens when a reader holds the rlock for the incoming interface,
then ip/ipconfig tries to add a new address, trying to wlock the interface.
as there are still active readers on the ifc, ip/ipconfig process gets queued
on the inteface RWlock.
now the reader finds the outgoing route which has the same interface as the
incoming packet and tries to rlock the ifc again. but now theres a writer
queued, so we also go to sleep waiting four outselfs to release the lock.
the solution is to never wait for the outgoing interface rlock, but instead
use non-queueing canrlock() and if it cannot be acquired, discard the packet.
do not touch s->map on SG_PHYSICAL type segments as they do
not have a pte map (s->mapsize == 0 && s->map == nil).
also remove the SG_PHYSICAL switch in freepte(), this is never
reached.
the calculation for the control endpoint0 output device context
missed the context size scaling shift, resulting in botched
stall handling as we would not read the correct endpoint status
value.
note, this calculation only affected control endpoint 0, which
was handled separately from all other endpoints.
When a match() fails, we need to unget the character we
tried to match against, rather than leaving it consumed.
Also, we can't break out of a conversion before we reach
the end of a format string, because things like the '%n'
conversion do not consume anything, and should still be
handled.
As said in the code comment:
Elecom trackball report descriptor lies by
omission, failing to mention all its buttons.
We patch the descriptor with a correct count
which lets us parse full reports. Tested with:
Elecom HUGE (M-HT1DRBK, M-HT1URBK)
The descriptor fixup is adapted from Linux kernel:
drivers/hid/hid-elecom.c
in which a more detailed account of why and how this
works may be found.
A followup change to nusb/kb will be needed to expose
these additional events for potential remapping.
spectacular bug. cmpswap() had a sign extension bug
using sign extending MOV to load the old compare
value and LDXRW using zero extension while the CMP
instruction compared 64 bit registers.
this caused cmpswap with negative old value always
to fail.
interestingly, libc's version of this function was
fine.
C99 requires that if intXX_t types are defined, int_fastxx_t and
int_leastxx_t types are defined as well. We define all three to
be identical (intXX_t == int_fastXX_t == int_leastXX_t).
This makes the flagfmt parser more robust and accepting
a looser input language — namely by allowing whitespace
around specifier fields and ignoring any empty fields.
Long flagfmts can thus be pleasingly displayed:
flagfmt='
a, b, c, C:cache,
m:mtpt mountpoint,
s:srvn srvname'
The mount() and bind() syscalls return -1 on error,
and the mountid sequence number on success.
The manpage states that the mountid sequence number
is a positive integer, but the kernels implementation
currently uses a unsigned 32-bit integer and does not
guarantee that the mountid will not become negative.
Most code just cares about the error, so test for
the -1 error value only.