his change replaces our index format with a flat file, where
each line is in the form of:
T qid mode path
R qid mode path
A qid mode path
where T is a tracked file, R is a file that's flagged for
removal, and A is a path that is added but not yet committed.
Lines may be repeated, and the last line in the file is used
to represent the status of a path.
The QID is in the index so that we can short circuit reading
the full contents if the file has not been changed. The mode
is there to avoid stats and walks through the git repository.
If the qid is NOQID or the mode is 0, then the git repository
contents are consulted to decide if the file is the same.
Tested on the 9front repo:
Old walk:
@{cd / && time /sys/src/cmd/git/6.owalk -q}
0.08u 1.73s 2.82r /sys/src/cmd/git/6.owalk -q # status= DM
New walk:
@{cd / && time git/walk -q}
0.05u 0.02s 0.12r git/walk -q # status= RM
When we get a patch with a:
\ No newline at end of file
directive, we now apply it correctly,
removing the newline. We generalize
a bit, allowing any line to trim a
newline, giving a primitive form of
line splitting
Most of this code is imported
from inferno with some modifications.
This allows us to disassemble thumb and
mixed thumb/arm binaries. Source line lookup
is still not correct for either thumb or mixed
binaries due to bugs in tl compounded with the lack
of support for variable size mach.pcquant in libmach.
This means we can now boot kernels on arm64 EFI platforms.
As well, porting additional architectures to our EFI boot
should now be much simpler.
Due to the nature of EFI relocations, this is a peculiar
code environment for 7l and requires extra care. See
rebase for more information.
we would not swap all of the fields in the forward
and reverse modes for patch, which means that we
may accidentally make a hunk unfindable if the line
numbers matcch up correctly.
This does the reverse in a less ad-hoc way, just
swapping the forward and reverse hunks once in
one place. It also swaps all of them.
Medium.unbind() must run with ifc->conv unlocked
as mediumunbindifc() holds it while determining
if it should also unbind causing a potential
deadlock.
Note that ipifcnind() and Medium.bind() is run
with ifc->conv locked, delaying mediumunbindifc()
after ipifcbind() completes.
We use hand-crafted PE headers in assembler, but those are not
available on platforms such as arm64 which enforce a 4-byte
instruction alignment. Instead, take the same approach as
aout2uimage and perform conversion during build time.
when /rc/bin/sysupdate gets updated itself during a sysupdate,
rc gets confused when continuing reading the original file,
but it gets data from the updated file causing confusion.
the -b flag forces rc to read the original file as a whole
before starting execution preventing this issue.
updating this should be fine as the file has been shrunk
from 230 bytes to 224 bytes.
netdevmedium and ethermedium should unbind the interface
if one of the reader procs encounters an error,
such as a usb ethernet device being un-plugged.
netdevmedium already attempted something like this,
but without considering the locking as we need to
acquire the ipifc conv qlock for adjusting the
inuse ref counter.
this change adds a mediumunbindifc() function to
be used by the medium to unbind from its interface
asynchronously from its reader procs.
the call eigther succeeds (returning nil)
meaning the Medium.unbind function was executed
and the auxiolary structure has been freed,
or retunrs an error (when Medium.unbind was called
before) and we just clear our Proc* pointer.
some i2c controllers might be rather constrained and need
information like the sub-address size, which is contained
in the I2Cdev structure, so pass that to the bus->io function
instead of the I2Cbus pointer.