lkml.org 
[lkml]   [2022]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V5 04/16] rv/include: Add deterministic automata monitor definition via C macros
From
On 7/17/22 17:18, Tao Zhou wrote:
>> +static int task_mon_slot_##name = RV_PER_TASK_MONITOR_INIT; \
> In patch1, RV_PER_TASK_MONITOR_INIT is defined as:
>
> #define RV_PER_TASK_MONITORS 1
> #define RV_PER_TASK_MONITOR_INIT (RV_PER_TASK_MONITORS)
>
> RV_PER_TASK_MONITOR_INIT is 1 now, seems not the index of the first only
> element in vector. Now no map here, one task has one monitor though if I
> am not wrong.
> So task_mon_slot_##name must be defined to the index of first element.
> Modify the macro definition of RV_PER_TASK_MONITOR_INIT to the index of
> first element in vector.
>
> #define RV_PER_TASK_MONITOR_INIT (RV_PER_TASK_MONITORS) - 1

nop, (RV_PER_TASK_MONITORS) is an invalid vector value, so we can detect things like:
disabling a disabled monitor.

(I forgot to reset it when disabling a monitor... added)

-- Daniel

\
 
 \ /
  Last update: 2022-07-18 09:55    [W:0.290 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site