Library mcertikos.devdrivers.LApicGenLink

Require Import LinkTemplate.
Require Import DLApic.
Require Import LApicGen.
Require Import LApicGenLinkSource.
Require Import DIoApic.
Require Import DIoApicCSource.
Require Import DIoApicCode.

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

  Lemma init_correct:
    init_correct_type DLApic_module dioapic dlapic.
  Proof.
    init_correct.
  Qed.

  Lemma link_correct_aux:
    link_correct_aux_type DLApic_module dioapic dlapic.
  Proof.
    link_correct_aux.
    - link_cfunction
        lapic_init_spec_ref
        DIOAPICCODE.lapic_init_code_correct.
    - link_cfunction
        lapic_eoi_spec_ref
        DIOAPICCODE.lapic_eoi_code_correct.
    - apply passthrough_correct.
  Qed.

  Theorem cl_backward_simulation:
    cl_backward_simulation_type DLApic_module dioapic dlapic.
  Proof.
    cl_backward_simulation init_correct link_correct_aux.
  Qed.

  Theorem make_program_exists:
    make_program_exist_type DLApic_module dioapic dlapic.
  Proof.
    make_program_exists link_correct_aux.
  Qed.
End WITHCOMPCERTIKOS.