user As the PR hints, it is not enough to have kern.expose_address=1
to see kernel addresses, we also need to have the PK_KMEM bit set
which we achieve by installing sockstat setgid kmem and opening
and closing /dev/mem. (/usr/src/sys/kern/kern_proc.c:311). It is
unfortunate that we need to give the program more privilege, to
prove to the kernel that we have the privilege to see the data.
config_finalize will call all config_finalize_register functions until
all registered functions return 0. rf_autoconfig currently returns 1
which means tegra124_cpu_init_cpufreq would get called multiple times.
Use sigaction() without SA_RESTART -- signal() implies SA_RESTART so
we never got the EINTR.
While here, reduce the timeout to something more reasonable so we
don't waste 20min of testbed time if anything goes wrong and the
one-second alarm doesn't fire.
A string like OP_DEPENDS|OP_OPTIONAL|OP_PRECIOUS is much easier to read
and understand than the bit pattern 00000089.
The implementation in enum.h looks really bloated and ugly, but using
this API is as simple and natural as possible. That's the trade-off.
In enum.h, I thought about choosing the numbers in the macros such that
it is always possible to combine two of them in order to reach an
arbitrary number, because of the "part1, part2" in the ENUM__SPEC macro.
The powers of 2 are not these numbers, as 7 cannot be expressed as the
sum of two of them. Neither are the fibonacci numbers since 12 cannot
be expressed as the sum of 2 fibonacci numbers. I tried to find a
general pattern to generate these minimal 2-sum numbers, but failed.
In ixgbe_handle_mod():
switch (hw->mac.type) {
case ixgbe_mac_82599EB:
cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
IXGBE_ESDP_SDP2;
break;
case ixgbe_mac_X550EM_x:
case ixgbe_mac_X550EM_a:
cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
IXGBE_ESDP_SDP0;
break;
default:
break;
}
so I had thought that IXGBE_ESDP_SDP0 bit is 1 on cage is full.
In reality, at least, X550EM_A's SFP+ cage is 0 on cage is full.
So invert the logic of ixgbe_sfp_cage_full() on X550EM_A
status updates by picking up a new status different from the tested
status. This left addresses in the DETACHED state although the
link status is already UP again.
addresses PR/kern 55538
Now there is one paragraph per case, as opposed to the highly condensed
code from before.
In the cases of :ts\n and :ts\t, the variables for number parsing are no
longer in the code path, which makes the code easier to understand for
humans. Not sure what the compilers made out of it.
The assignment "base = 0" has gone since it was redundant. An integer
that starts with 0 is always interpreted as octal by strtol, no matter
if the base is 8 or 0.
The comment about "unescaped $'s that aren't before the delimiter" was
wrong, as the code didn't contain the "aren't before the delimiter"
part. By splitting the code into paragraphs, the larger structure
becomes easily visible. Having a few short comments in the right place
is more helpful than a big block of text.