mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Critical Section Monitor: Add low level timer support for simulation. Fix serial bugs and logic errors in initial implementation. Still does not work; takes assertions.
This commit is contained in:
@@ -304,19 +304,24 @@ static ssize_t critmon_read(FAR struct file *filep, FAR char *buffer,
|
||||
attr = (FAR struct critmon_file_s *)filep->f_priv;
|
||||
DEBUGASSERT(attr);
|
||||
|
||||
ret = 0;
|
||||
ret = 0;
|
||||
offset = filep->f_pos;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* Get the status for each CPU */
|
||||
|
||||
for (cpu = 0; cpu < CONFIG_SMP_NCPUS; cpu++)
|
||||
{
|
||||
ret += critmon_read_cpu(attr, buffer + ret, buflen -ret,
|
||||
&offset, cpu);
|
||||
ssize_t nbytes = critmon_read_cpu(attr, buffer + ret, buflen - ret,
|
||||
&offset, cpu);
|
||||
|
||||
ret += nbytes;
|
||||
if (ret > buflen)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
offset += nbytes;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user