blob: c1f5d9dd546f2038eafdc0c48fbf3553f7ce92b8 [file] [log] [blame]
J-Alves09f13f52023-10-19 16:33:56 +01001Project Structure
2=================
3
4The Hafnium repository contains Hafnium source code, along with testing code related to integration
5tests, and unit tests.
6To aid with the integration tests, the repository also contains a small client library
7for partitions and prebuilt binaries of tools needed for the build and running the tests.
8The build system is supported by `gn`_.
9
10Each platform has a single associated architecture.
11
12The source tree is organised as follows:
13
14::
15
16 ├── build
17 ├── docs
18 ├── driver
19 │   └── linux
20 ├── inc
21 │   ├── hf
22 │   │   ├── arch
Karl Meakinec3358a2024-12-16 15:38:21 +000023 │   │   ├── plat
24 └── ffa
J-Alves09f13f52023-10-19 16:33:56 +010025 │   ├── system
26 │   └── vmapi
27 │   └── hf
28 ├── kokoro
29 ├── prebuilts
30 ├── project
31 ├── src
32 │   ├── arch
Karl Meakinec3358a2024-12-16 15:38:21 +000033 └── ffa
J-Alves09f13f52023-10-19 16:33:56 +010034 ├── test
35 │   ├── arch
36 │   ├── hftest
37 │   ├── inc
38 │   ├── linux
39 │   └── vmapi
40 ├── third_party
41 ├── tools
42 ├── vmlib
43 └── out
44
45- `build`: Common GN configuration, build scripts, and linker script.
46
47- `docs`: Documentation.
48
49- `driver/linux`: Linux kernel driver for Hafnium as the hypervisor, in the primary VM (More
50 details see legacy :ref:`Hypervisor` documentation).
51
52- `inc`: Header files.
53
54 - `hf`: internal to Hafnium.
55
56 - `arch`: Architecture-dependent modules, which have a common interface
57 but separate implementations per architecture. This includes details
58 of CPU initialisation, exception handling, timers, page table management,
59 and other system registers.
60
61 - `plat`: Platform-dependent modules, which have a common interface but
62 separate implementations per platform. This includes details of the boot
63 flow, and a UART driver for the debug log console.
64
Karl Meakinec3358a2024-12-16 15:38:21 +000065 - `ffa`: Interface for FF-A features.
66
J-Alves09f13f52023-10-19 16:33:56 +010067 - `system`: which are included by the `stdatomic.h` which we use from
68 Android Clang but not really needed, so we use dummy empty versions.
69
70 - `vmapi/hf`: for the interface exposed to partitions.
71
72- `kokoro`: Scripts and configuration for continuous integration and presubmit checks.
73
74- `prebuilts`: Prebuilt binaries needed for building Hafnium or running tests.
75
76- `project`: Configuration and extra code for each project.
77 A project is a set of one or more platforms (see above) that are built
78 together. Hafnium comes with the `reference` project
79 for running it on some common emulators and development boards. To port
80 Hafnium to a new board, you can create a new project under this directory
81 with the platform or platforms you want to add, without affecting the core
82 Hafnium code.
83
84- `src`: Source code for Hafnium itself in C and assembly, and unit tests in C++.
85
86 - `arch`: Implementation of architecture-dependent modules.
87
Karl Meakinec3358a2024-12-16 15:38:21 +000088 - `ffa`: Abstraction over SPMC/hypervisor specific implementation details of FF-A features.
89
J-Alves09f13f52023-10-19 16:33:56 +010090- `test`: Integration tests
91
92 - `arch`: Tests for components of Hafnium that need to be run on a real architecture.
93
94 - `hftest`: A simple test framework that supports running tests standalone on bare
95 metal, in partitions under Hafnium. Also as user-space binaries under Linux, but these are
96 not yet integrated with system where Hafnium is the SPMC.
97
98 - `linux`: Tests which are run in a Linux partition under Hafnium as normal world hypervisor.
99
100 - `vmapi`: Tests which are run in minimal test partitions under Hafnium.
101
102 - `arch`: Tests which are rely on specific architectural details such as the GIC version.
103
104 - `primary_only`: Tests which run only a single (primary) partition.
105
106 - `primary_with_secondaries`: Test which run with a primary partition and one
107 or more secondary partitions to test how they interact.
108
109- `third_party`: Third party code needed for building Hafnium.
110
111- `vmlib`: A small client library for partitions running under Hafnium.
112
113- `out`: Output directory for the build artifacts.
114
115--------------
116
117*Copyright (c) 2023, Arm Limited. All rights reserved.*
118
119.. _gn: https://gn.googlesource.com/gn/