diff --git a/TODO b/TODO index 583177e4a7..7801c545aa 100644 --- a/TODO +++ b/TODO @@ -173,9 +173,11 @@ o Task/Scheduler (sched/) NOTE: glibc behaves this way unless __thread is defined then, in that case, it behaves like NuttX (using TLS to save the thread local errno). - Status: Closed. The existing solution is better (although its - incompatibilities could show up in porting some code). - Priority: Low + Status: Closed. The existing solution is better and compatible with + thread-aware GLIBC (although its incompatibilities could show + up in porting some code). I will retain this issue for + referencei only. + Priority: N/A Title: SCALABILITY Description: Task control information is retained in simple lists. This diff --git a/drivers/sensors/bmp180.c b/drivers/sensors/bmp180.c index d18d14e9ab..5b4ae52645 100644 --- a/drivers/sensors/bmp180.c +++ b/drivers/sensors/bmp180.c @@ -318,7 +318,7 @@ static int bmp180_checkid(FAR struct bmp180_dev_s *priv) devid = bmp180_getreg8(priv, BMP180_DEVID); sninfo("devid: 0x%02x\n", devid); - if (devid != (uint16_t) DEVID) + if (devid != (uint16_t)DEVID) { /* ID is not Correct */ diff --git a/sched/irq/irq_procfs.c b/sched/irq/irq_procfs.c index bbfb76df17..1c20b0e4aa 100644 --- a/sched/irq/irq_procfs.c +++ b/sched/irq/irq_procfs.c @@ -181,7 +181,23 @@ static int irq_callback(int irq, FAR struct irq_info_s *info, #endif leave_critical_section(flags); - /* Don't bother if count == 0 */ + /* Don't bother if count == 0. + * + * REVISIT: There is a logic problem with skipping if the count is zero. + * Normally this is a good thing because it makes the output concise. + * However, it can be a problem under certain conditions: + * + * It may take multiple passes through the IRQ table to enumerate the + * interrupts if the number of interrupts reported is large or if the size + * of the user buffer is small. If a count is zero it will be skipped on + * the first time through but if it becomes non-zero on the second time + * through, the output will be corrupted. Similarly if the count is non- + * zero the first time through and zero the second. + * + * A proper fix would require keep better track of where we left off + * between passes. Current that position is remembered only by the + * byte offset into the pseudo-file, f_pos. + */ if (copy.count == 0) { @@ -210,7 +226,7 @@ static int irq_callback(int irq, FAR struct irq_info_s *info, } else { - uint64_t intcount = (uint64_t)intpart * elapsed / TICK_PER_SEC; + uint64_t intcount = ((uint64_t)intpart * elapsed) / TICK_PER_SEC; fracpart = (unsigned int) (((copy.count - intcount) * TICK_PER_SEC * 1000) / elapsed); } @@ -225,7 +241,6 @@ static int irq_callback(int irq, FAR struct irq_info_s *info, { count = (unsigned long)copy.count; } - #else # error Missing logic #endif @@ -270,10 +285,8 @@ static int irq_open(FAR struct file *filep, FAR const char *relpath, finfo("Open '%s'\n", relpath); - /* PROCFS is read-only. Any attempt to open with any kind of write - * access is not permitted. - * - * REVISIT: Write-able proc files could be quite useful. + /* This PROCFS file is read-only. Any attempt to open with write access + * is not permitted. */ if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) diff --git a/sched/sched/sched_sporadic.c b/sched/sched/sched_sporadic.c index 83349097ed..8b55a3fce0 100644 --- a/sched/sched/sched_sporadic.c +++ b/sched/sched/sched_sporadic.c @@ -140,8 +140,8 @@ static int sporadic_set_lowpriority(FAR struct tcb_s *tcb) * * In order to do this we would need to know the highest priority from * among all tasks waiting for the all semaphores held by the sporadic - * task. Perhaps that information could be retained by the priority - * inheritance logic for use here? + * task. That information could be retained by the priority inheritance + * logic of sem_holder.c for use here. */ if (tcb->sched_priority > tcb->base_priority)