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:
Gregory Nutt
2018-11-24 15:07:12 -06:00
parent 85c31fd4a2
commit 807d5bb4ae
7 changed files with 42 additions and 16 deletions
+8 -3
View File
@@ -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