Move hypervisor specific arch code to a subdirectory.

Change-Id: I8783ebff6e98d4dce8008dbdbf59b88fe4d98e3b
diff --git a/src/BUILD.gn b/src/BUILD.gn
index cdc0771..5ca57ab 100644
--- a/src/BUILD.gn
+++ b/src/BUILD.gn
@@ -61,7 +61,7 @@
     ":fdt",
     ":memiter",
     ":std",
-    "//src/arch/${plat_arch}",
+    "//src/arch/${plat_arch}/hypervisor",
     plat_console,
   ]
 
diff --git a/src/arch/aarch64/BUILD.gn b/src/arch/aarch64/BUILD.gn
index e92f4c3..58072b8 100644
--- a/src/arch/aarch64/BUILD.gn
+++ b/src/arch/aarch64/BUILD.gn
@@ -16,27 +16,6 @@
   include_dirs = [ "." ]
 }
 
-# Hypervisor specific code.
-source_set("aarch64") {
-  sources = [
-    "cpu_entry.S",
-    "exceptions.S",
-    "hypervisor_entry.S",
-    "plat_entry.S",
-  ]
-
-  sources += [
-    "handler.c",
-    "offsets.c",
-  ]
-
-  deps = [
-    ":arch",
-    ":entry",
-    ":smc",
-  ]
-}
-
 # Implementation of the arch interface for aarch64.
 source_set("arch") {
   sources = [
diff --git a/src/arch/aarch64/hypervisor/BUILD.gn b/src/arch/aarch64/hypervisor/BUILD.gn
new file mode 100644
index 0000000..c98b888
--- /dev/null
+++ b/src/arch/aarch64/hypervisor/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright 2019 The Hafnium Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Hypervisor specific code.
+source_set("hypervisor") {
+  public_configs = [ "//src/arch/aarch64:config" ]
+  sources = [
+    "cpu_entry.S",
+    "exceptions.S",
+    "hypervisor_entry.S",
+    "plat_entry.S",
+  ]
+
+  sources += [
+    "handler.c",
+    "offsets.c",
+  ]
+
+  deps = [
+    "//src/arch/aarch64:arch",
+    "//src/arch/aarch64:entry",
+    "//src/arch/aarch64:smc",
+  ]
+}
diff --git a/src/arch/aarch64/cpu_entry.S b/src/arch/aarch64/hypervisor/cpu_entry.S
similarity index 100%
rename from src/arch/aarch64/cpu_entry.S
rename to src/arch/aarch64/hypervisor/cpu_entry.S
diff --git a/src/arch/aarch64/exceptions.S b/src/arch/aarch64/hypervisor/exceptions.S
similarity index 100%
rename from src/arch/aarch64/exceptions.S
rename to src/arch/aarch64/hypervisor/exceptions.S
diff --git a/src/arch/aarch64/handler.c b/src/arch/aarch64/hypervisor/handler.c
similarity index 100%
rename from src/arch/aarch64/handler.c
rename to src/arch/aarch64/hypervisor/handler.c
diff --git a/src/arch/aarch64/hypervisor_entry.S b/src/arch/aarch64/hypervisor/hypervisor_entry.S
similarity index 100%
rename from src/arch/aarch64/hypervisor_entry.S
rename to src/arch/aarch64/hypervisor/hypervisor_entry.S
diff --git a/src/arch/aarch64/offsets.c b/src/arch/aarch64/hypervisor/offsets.c
similarity index 100%
rename from src/arch/aarch64/offsets.c
rename to src/arch/aarch64/hypervisor/offsets.c
diff --git a/src/arch/aarch64/offsets.h b/src/arch/aarch64/hypervisor/offsets.h
similarity index 100%
rename from src/arch/aarch64/offsets.h
rename to src/arch/aarch64/hypervisor/offsets.h
diff --git a/src/arch/aarch64/plat_entry.S b/src/arch/aarch64/hypervisor/plat_entry.S
similarity index 100%
rename from src/arch/aarch64/plat_entry.S
rename to src/arch/aarch64/hypervisor/plat_entry.S
diff --git a/src/arch/fake/BUILD.gn b/src/arch/fake/BUILD.gn
index f2b22af..6eee2b8 100644
--- a/src/arch/fake/BUILD.gn
+++ b/src/arch/fake/BUILD.gn
@@ -14,7 +14,6 @@
 
 source_set("fake") {
   sources = [
-    "cpu.c",
     "mm.c",
     "timer.c",
   ]
diff --git a/src/arch/fake/hypervisor/BUILD.gn b/src/arch/fake/hypervisor/BUILD.gn
new file mode 100644
index 0000000..b6435ed
--- /dev/null
+++ b/src/arch/fake/hypervisor/BUILD.gn
@@ -0,0 +1,22 @@
+# Copyright 2019 The Hafnium Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source_set("hypervisor") {
+  sources = [
+    "cpu.c",
+  ]
+  deps = [
+    "//src/arch/fake",
+  ]
+}
diff --git a/src/arch/fake/cpu.c b/src/arch/fake/hypervisor/cpu.c
similarity index 100%
rename from src/arch/fake/cpu.c
rename to src/arch/fake/hypervisor/cpu.c