casaroli commented on code in PR #21354:
URL: https://github.com/apache/nuttx/pull/21354#discussion_r4453584109
##########
drivers/misc/dev_mem.c:
##########
@@ -96,21 +97,20 @@ static ssize_t devmem_read(FAR struct file *filep, FAR char
*buffer,
size_t buflen)
{
FAR struct memory_region_s *region = filep->f_inode->i_private;
- uintptr_t src = filep->f_pos;
uintptr_t start;
uintptr_t end;
ssize_t len;
int i;
for (i = 0; region[i].start != 0 && region[i].end != 0; i++)
{
- start = MAX(src, region[i].start);
+ start = region[i].start + filep->f_pos;
Review Comment:
Each region now adds `f_pos` to its own start, and the first matching region
wins. With the default regions, read() at offset N always hits .text, so .data
and .bss cannot be read, and write() at the same offset goes to .data: write(0)
then read(0) return different memory. mmap() still uses absolute addresses, and
master already supports lseek(SEEK_SET/SEEK_CUR) with absolute addresses
through the VFS default.
Fix: keep `f_pos` as the absolute address, as in master and in mmap(), and
only add the SEEK_END case if you need it.
##########
drivers/note/Kconfig:
##########
@@ -16,6 +16,17 @@ config DRIVERS_NOTE_MAX
---help---
sched_note supports the maximum number of drivers
+config DRIVERS_NOTE_CPUID
+ int "Note CPU ID"
+ depends on UP
Review Comment:
There is no Kconfig symbol `UP` in the tree, so `depends on UP` hides this
option for every config and the new `#ifdef` in note_driver.c is dead code.
Fix: use `depends on !SMP`, or drop the commit.
--
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]