blob: 17399dccc32b999b8d0a26c4f58d85fcea42b6b7 [file] [log] [blame]
Andrew Sculla9c172d2019-04-03 14:10:00 +01001/*
2 * Copyright 2019 The Hafnium Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "hf/panic.h"
18
19#include <stdarg.h>
20
21#include "hf/dlog.h"
22
23/**
24 * Blocks the hypervisor.
25 *
26 * TODO: Determine if we want to omit strings on non-debug builds.
27 */
28noreturn void panic(const char *fmt, ...)
29{
30 va_list args;
31
32 /* TODO: Block all CPUs. */
33
34 dlog("Panic: ");
35
36 va_start(args, fmt);
37 vdlog(fmt, args);
38 va_end(args);
39
40 dlog("\n");
41
42 for (;;) {
43 }
44}