7373 ctx.emit (Events. Lock (verifier_atomic, true ))
7474
7575 let special (ctx : (unit, _, _, _) ctx ) lv f arglist : D.t =
76+ let is_activated a = List. mem a (GobConfig. get_string_list " ana.activated" ) in (* TODO: proper LibraryFunctions group selection *)
7677 let remove_rw x = x in
7778 let unlock remove_fn =
7879 match f.vname, arglist with
@@ -82,6 +83,11 @@ struct
8283 ctx.split () [Events. Unlock (remove_fn e)]
8384 ) (eval_exp_addr (Analyses. ask_of_ctx ctx) arg);
8485 raise Analyses. Deadcode
86+ | "LAP_Se_SignalSemaphore" , [Lval arg; _] when is_activated " arinc" || is_activated " extract_arinc" ->
87+ List. iter (fun e ->
88+ ctx.split () [Events. Unlock (remove_fn e)]
89+ ) (eval_exp_addr (Analyses. ask_of_ctx ctx) (Cil. mkAddrOf arg));
90+ raise Analyses. Deadcode
8591 | _ -> failwith " unlock has multiple arguments"
8692 in
8793 let desc = LF. find f in
@@ -96,6 +102,9 @@ struct
96102 | "spin_lock_irqsave" , [arg; _] ->
97103 (* print_endline @@ "Mutex `Lock "^f.vname;*)
98104 lock ctx rw failing nonzero_return_when_aquired (Analyses. ask_of_ctx ctx) lv arg
105+ | "LAP_Se_WaitSemaphore" , [Lval arg; _; _] when is_activated " arinc" || is_activated " extract_arinc" ->
106+ (* print_endline @@ "Mutex `Lock "^f.vname;*)
107+ lock ctx rw failing nonzero_return_when_aquired (Analyses. ask_of_ctx ctx) lv (Cil. mkAddrOf arg)
99108 | _ -> failwith " lock has multiple arguments"
100109 end
101110 | Unlock _, " __raw_read_unlock"
0 commit comments