libc/strfmon - Partly revert previous
One of the changes was to some "half done" code that I had forgotten
when the recent changes were committed -- it worked fine as it was,
but was a bit odd ... the code was calling a func for parsing a string,
which would stop at the \0 which terminates it ... but the function
wanted to be told what the max number of bytes it was allowed to consume
would be, just in case there might be no \0. The original code
simply inserted an "easily big enough" constant - since the \0
wasn't ever going to be missing (string came from an earlier strdup()).
But, for other (related) reasons, the length of the string was being
calculated (strlen()) anyway - so rather than do that, and test it,
and then just throw away the length, the length could be captured,
and used instead of the constant. I had written the code (like, one
variable declaration, and an assignment ... not challenging) to
do that, but hadn't gotten around to using the value saved as the
arg to the function which could use it.
[23 lines not shown]
sys/dev/pci/arcmsr.c -- better fix than previous
Instead of converting a uint32_t * into an integer, doing int arith
on it, and then converting it back to a unit32_t * again, just do simple
pointer arithmetic on the unit32_t * (scaling the integer being added
by sizeof(unit32_t)).
This avoids errors: "cast to pointer from integer of different size"
uptrdiff_t (previous fix) would work, but just doing pointer arith
as it is intended to work is so much simpler & cleaner.
nb: compile tested only, I don't have that kind of hardware, nor do
I run 32 bit kernels.
Fix subnet mask extraction from address quad dot mask notation
when a rule has an address in 192.168.64.7/255.255.255.0
which is to be converted to block notation /24, it is expected
to reduce the count of trailing zeros from maximum masks for each family.
ensure the mask is set to max_mask to avoid it from crashing when using
that notation. also make noise when mask is bigger than expected.
/40 on a rule should make noise and not silently seg fault.
tests included in rump
reviewd by martin
Support a bunch of newer cards with interface differences. Thanks
to Areca for providing the updated driver. Adaptation for NetBSD
and testing on multiple releases and cards by myself.
I have disable the bioctl interface for now as it doesn't work
reliably. I have documentation from Areca, so should be able to
improve the support some day. However, I did fix a latent buffer
overflow in the bioctl interface.
x68k: Improve SGR (CSI <n> m) processing.
Convert parameters into numerical values before processing them,
instead of using a character-based state machine.
This makes unsupported parameters to be appropriately ignored.
imx7d: fix remaining clock table errors
The i2c1-4 root gates used bit 0, which is inside POST_PODF, instead
of bit 28, so enabling an I2C clock halved it.
usdhc2_pre_div and usdhc3_pre_div had the USDHC1_ROOT_PRE_DIV id.
pll_enet_250m_clk was defined twice.
imx6ccm: wait for busy on dividers with a busy bit too
Wait for the busy bit after setting the rate of a busy divider, as
was already done for busy muxes.
Add a timeout of about 10ms to the busy wait and return ETIMEDOUT.
Tested on QEMU sabrelite.
imx7d: fix UART clock definitions
The uart1-7 root gates used bit 18, which is inside PRE_PODF, instead
of bit 28, so enabling a UART clock changed its divider (24MHz became
4.8MHz on QEMU).
uart5_pre_div and uart5_post_div pointed at the uart4 register (0xb100)
instead of 0xb180.
imx_ccm: fix div set_rate never selecting the maximum divider
The search loop stopped one short of the field's maximum value.
Tested on QEMU mcimx7d-sabre: requesting 3MHz from 24MHz now gives
/8 (3MHz) instead of /7 (3.43MHz).
imx6ccm: fix panic in set_parent on muxes with a busy bit
The KASSERTs in imxccm_clk_mux_wait() were inverted, so with DIAGNOSTIC
set_parent on periph/periph2 (i.MX6Q, i.MX6SX) panicked.
Tested on QEMU sabrelite with assigned-clock-parents on periph.
imx_ccm: fix infinite loop in div set_rate with IMX_DIV_SET_RATE_PARENT
imx_ccm_div_set_rate() passed the clock itself to clk_set_rate() instead
of its parent, so the call came back into the same function and looped
forever, hanging the kernel.
This only affects dividers with IMX_DIV_SET_RATE_PARENT set. Reproduced
and verified the fix on QEMU mcimx7d-sabre with a DT that sets
assigned-clock-rates.