Require compcert.cfrontend.Ctypes.
Require compcert.cfrontend.Clight.
Set Implicit Arguments.
Definition is_defchar (mv: memval) :=
match mv with
| Byte _ => True
| _ => False
end.
Inductive extcall_storebytes_sem
(F V: Type) (ge: Genv.t F V): list memval -> list val -> mem -> trace -> val -> mem -> Prop :=
| extcall_storebytes_sem_intro: forall (b: block) (ofs: int) bytes m m',
Zlength bytes > 0 ->
Forall is_defchar bytes ->
Mem.storebytes m b (Int.unsigned ofs) bytes = Some m' ->
extcall_storebytes_sem ge bytes (Vptr b ofs :: nil) m E0 Vundef m'.

Lemma storebytes_sem_inject_comm:
forall F V (ge: Genv.t F V) m1 m1' m2 bytes b ofs j b' delta,
Mem.storebytes m1 b (Int.unsigned ofs) bytes = Some m1' ->
Zlength bytes > 0 ->
Forall is_defchar bytes ->
meminj_preserves_globals ge j ->
Mem.inject j m1 m2 ->
j b = Some (b', delta) ->
exists m2',
Mem.storebytes m2 b' (Int.unsigned (Int.add ofs (Int.repr delta))) bytes = Some m2' /\
Mem.inject j m1' m2' /\
Mem.unchanged_on (loc_unmapped j) m1 m1' /\
Mem.unchanged_on (loc_out_of_reach j m1) m2 m2'.