Library mcertikos.devdrivers.HandlerOpGenLink

Require Import LinkTemplate.
Require Import DHandlerOp.
Require Import HandlerOpGen.
Require Import HandlerOpGenSpec.
Require Import HandlerOpGenLinkSource.
Require Import DHandlerCxt.
Require Import DHandlerCxtCSource.
Require Import DHandlerCxtCode.

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

  Lemma init_correct:
    init_correct_type DHandlerOp_module dhandlercxt dhandlerop.
  Proof.
    init_correct.
  Qed.

  Lemma link_correct_aux:
    link_correct_aux_type DHandlerOp_module dhandlercxt dhandlerop.
  Proof.
    link_correct_aux.
    - link_cfunction
        serial_intr_disable_aux_spec_ref
        DHandlerCxtCode_serial_intr.DHANDLERCXTCODE.serial_intr_disable_code_correct.
    - link_cfunction
        serial_intr_enable_aux_spec_ref
        DHandlerCxtCode_serial_intr_enable.DHANDLERCXTCODE.serial_intr_enable_code_correct.
    - apply passthrough_correct.
  Qed.

  Theorem cl_backward_simulation:
    cl_backward_simulation_type DHandlerOp_module dhandlercxt dhandlerop.
  Proof.
    cl_backward_simulation init_correct link_correct_aux.
  Qed.

  Theorem make_program_exists:
    make_program_exist_type DHandlerOp_module dhandlercxt dhandlerop.
  Proof.
    make_program_exists link_correct_aux.
  Qed.
End WITHCOMPCERTIKOS.