Library mcertikos.devdrivers.IoApicGenLink

Require Import LinkTemplate.
Require Import DIoApic.
Require Import IoApicGen.
Require Import IoApicGenLinkSource.
Require Import DSerial.
Require Import DSerialCSource.
Require Import DSerialCode.

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

  Lemma init_correct:
    init_correct_type DIoApic_module dserial dioapic.
  Proof.
    init_correct.
  Qed.

  Lemma link_correct_aux:
    link_correct_aux_type DIoApic_module dserial dioapic.
  Proof.
    link_correct_aux.
    - link_cfunction
        ioapic_init_spec_ref
        DSerialCode_ioapic_init.DSERIALCODE.ioapic_init_code_correct.
    - link_cfunction
        ioapic_enable_spec_ref
        DSerialCode_ioapic_enable.DSERIALCODE.ioapic_enable_code_correct.
    - link_cfunction
        ioapic_mask_spec_ref
        DSerialCode_ioapic_mask.DSERIALCODE.ioapic_mask_code_correct.
    - link_cfunction
        ioapic_unmask_spec_ref
        DSerialCode_ioapic_unmask.DSERIALCODE.ioapic_unmask_code_correct.
    - apply passthrough_correct.
  Qed.

  Theorem cl_backward_simulation:
    cl_backward_simulation_type DIoApic_module dserial dioapic.
  Proof.
    cl_backward_simulation init_correct link_correct_aux.
  Qed.

  Theorem make_program_exists:
    make_program_exist_type DIoApic_module dserial dioapic.
  Proof.
    make_program_exists link_correct_aux.
  Qed.
End WITHCOMPCERTIKOS.