2 -- Copyright (C) 2013 Reto Buerki <reet@codelabs.ch>
3 -- Copyright (C) 2013 Adrian-Ken Rueegsegger <ken@codelabs.ch>
5 -- This program is free software: you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation, either version 3 of the License, or
8 -- (at your option) any later version.
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program. If not, see <http://www.gnu.org/licenses/>.
25 with SK.Interrupt_Tables;
30 with SK.Scheduling_Info;
32 with SK.Subjects_Events;
33 with SK.Subjects_Interrupts;
34 with SK.Subjects_MSR_Store;
35 with SK.Tau0_Interface;
42 --D This package implements kernel initialization which is the initial entry
43 --D point from the early boot code into the SPARK kernel implementation. It
44 --D also contains the VM exit handler procedure which implements the main
45 --D kernel processing loop.
49 -- Kernel initialization.
50 procedure Initialize (Subject_Registers : out CPU_Registers_Type)
53 (Input => (CPU_Info.APIC_ID, CPU_Info.CPU_ID, CPU_Info.Is_BSP,
54 MCE.State, VMX.Exit_Address, MCU.State),
55 In_Out => (Crash_Audit.State, FPU.State, Interrupt_Tables.State,
56 IO_Apic.State, MP.Barrier, Scheduler.State,
57 Scheduling_Info.State, Subjects.State,
58 Subjects_Events.State, Subjects_Interrupts.State,
59 Subjects_MSR_Store.State, Timed_Events.State,
60 VMX.VMCS_State, Skp.IOMMU.State, X86_64.State)),
61 Post => MCE.Valid_State,
64 Link_Name => "sk_initialize";
67 procedure Handle_Vmx_Exit (Subject_Registers : in out CPU_Registers_Type)
70 (Input => (CPU_Info.APIC_ID, CPU_Info.CPU_ID, CPU_Info.Is_BSP,
71 Interrupt_Tables.State, MCE.State, Tau0_Interface.State,
73 In_Out => (Crash_Audit.State, FPU.State, IO_Apic.State, MP.Barrier,
74 Scheduler.State, Scheduler.Group_Activity_Indicator,
75 Subjects.State, Scheduling_Info.State,
76 Subjects_Events.State, Subjects_Interrupts.State,
77 Subjects_MSR_Store.State, Timed_Events.State,
78 VMX.VMCS_State, X86_64.State)),
79 Pre => MCE.Valid_State,
82 Link_Name => "handle_vmx_exit";