Library mcertikos.devdrivers.HandlerCxtGenLink

***********************************************************************
*                                                                     *
*            The CertiKOS Certified Kit Operating System              *
*                                                                     *
*                   The FLINT Group, Yale University                  *
*                                                                     *
*  Copyright The FLINT Group, Yale University.  All rights reserved.  *
*  This file is distributed under the terms of the Yale University    *
*  Non-Commercial License Agreement.                                  *
*                                                                     *
*********************************************************************** 

Require Import LinkTemplate.
Require Import DHandlerCxt.
Require Import HandlerCxtGen.
Require Import HandlerCxtGenLinkSource.
Require Import DHandlerAsm.

Section WITHCOMPCERTIKOS.
  Context `{compcertikos_prf: CompCertiKOS} `{real_params_prf: RealParams}.

  Lemma init_correct:
    init_correct_type DHandlerCxt_module dhandlerasm dhandlercxt.
  Proof.
    init_correct.
  Qed.

  Lemma link_correct_aux:
    link_correct_aux_type DHandlerCxt_module dhandlerasm dhandlercxt.
  Proof.
    let M := fresh "M" in
    let HM := fresh "H" M in
    intros M HM.
    inv_link_impl HM; subst.
    eapply layer_link_new_glbl_both.
    unfold dhandlercxt.
    apply oplus_sim_monotonic.
    apply passthrough_correct.
    apply L64_auto_sim.
  Qed.

  Theorem cl_backward_simulation:
    cl_backward_simulation_type DHandlerCxt_module dhandlerasm dhandlercxt.
  Proof.
    cl_backward_simulation init_correct link_correct_aux.
  Qed.

  Theorem make_program_exists:
    make_program_exist_type DHandlerCxt_module dhandlerasm dhandlercxt.
  Proof.
    make_program_exists link_correct_aux.
  Qed.
End WITHCOMPCERTIKOS.