casaroli opened a new pull request, #21570:
URL: https://github.com/apache/nuttx/pull/21570

   ## Summary
   
   With `CONFIG_LIBC_FLOATINGPOINT` on, `/proc/uptime` computes its one number 
in `double`. On a CPU with no FPU this pulls in soft-float code that the rest 
of the image may not need. The integer path gives the same format: at least 7 
digits, a point and 2 digits, rounded to the nearest hundredth. This PR deletes 
the `double` path, so all configurations use the integer path.
   
   ## Impact
   
   The format of `/proc/uptime` stays: `%7" PRIu64 ".%02u`. 
`LIBC_PRINTF_LONG_LONG` stays on with `FS_PROCFS` also in the Minimal profile, 
so `PRIu64` prints a number in all profiles. No Kconfig change, no ABI change.
   
   The open PR #20460 ("fs/procfs: add formatted read helper") rewrites the 
same `uptime_read()`. The two changes are independent, and the one that merges 
second needs a rebase: #20460 moves the `CONFIG_LIBC_FLOATINGPOINT` 
`#if`/`#else` block and its declarations into `uptime_format()`, and this PR 
deletes the `double` side of that block.
   
   Image text, `nucleo-f072rb:nsh` (Cortex-M0, flat), arm-none-eabi-gcc 15.3:
   
   | | master | this PR | change |
   |---|---:|---:|---:|
   | `LIBC_FLOATINGPOINT` on | 97,923 | 97,839 | -84 |
   | `LIBC_FLOATINGPOINT` off (the default of the board) | 86,963 | 86,963 | 0 |
   
   With floating point on, `__aeabi_l2d` is no longer linked. `__aeabi_ddiv` 
and `__aeabi_ui2d` stay, because `printf()` uses them for `%f`.
   
   ## Testing
   
   A test program, `procuptime.c`, reads `/proc/uptime` and checks the format 
(spaces, digits, a point, 2 digits, a newline). On `qemu-armv8a:knsh` (kernel 
build, arm64, HVF, floating point on) with `CONFIG_DEBUG_SCHED` off: master `   
   0.01`, this PR `      0.02`, both pass.
   
   ostest on `qemu-armv8a:knsh` and `qemu-armv8a:nsh` (flat): exit status 0 on 
both.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to