More corrections...
I was also looking at the build breakage fixed by the previous commit.
I found another issue (non-build breaking) though:
Free the results from prom_getprop() in the newly added code, if a
subsequent malloc() fails (don't lose memory).
Also properly indent a line whose preceding condition shifted right
(existing code from previously, now not always executed).
Feel free to redo these changes some other (non build-breaking) way.
Fix up PROM's where reg is encoded as a 64-bit and a 32-bit value
(e.g. 00000400 0fc62020 00000010), but we want 2 x 64-bit values.
U45 with OBP 4.21.2 has jbus-i2c configured like this.
pidfile: Fix a few issues with error paths.
pidfile_unlock() returns -1 on error rather than EBADF which is now errno.
pidfile_read() now closes the opened fd on error if not pidfile_fd.
pidfile_lock() now closed pidfile_fd if failing to strdup to pidfile_path.
A long standing issue correctly setting FD_CLOEXEC has been resolved in the
case where O_CLOEXEC is not defined.
libroken: Rename static pidfile_path to rk_pidfile_path
This is odd because libroken uses pidfile(3) AND it's own pidfile system.
So potentially it's managing two pidfiles.
libutil.h owns the pidfile namespace (other OS expose other names which
may conflict) so rename the local vars to rk_pidfile_*.
pidfile: Add functionality for use in sandboxing
pidfile_fd() returns the file descriptor of the locked pidfile so it can
be limited in sandboxes like Capsicum.
pidfile_unremoveable() will avoid unlink(2) being called at program exit
to avoid tripping any sandboxes like Pledge which may restrict it or
it's just not reachable anymore if the program is in a chroot(2).
pidfile_path() returns the path of the locked pidfile so it can be removed
by a process than can reach it if pidfile_unremoveable() has been called.
pidfile_unlock() just releases the resources held by the locked pidfile.
This is lighter weight than pidfile_clean() as it avoids a lseek and read.
- Reduce delays for MII access.
- Fix multicast filter setup (and thus IPv6).
- Align MAC address setup code with other drivers.
- Create bus_dma map with BUS_DMA_ALLOCNOW to prevent failures
when loading the map.
eqos: More performance improvements.
- Move TX to a separate kthread and allow TX and RX to run under separate
locks. Lazily clean up TX descriptors instead of requesting an interrupt
for TX completions.
- Use the hardware watchdog to implement RX interrupt coalescing.
- Remove some redundant MMIO writes and bus_dma syncs.