1//===-------- UEFI implementation of an exit function ------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===-----------------------------------------------------------------===//
8
9#include "src/__support/OSUtil/exit.h"
10#include "config/uefi.h"
11#include "include/llvm-libc-types/EFI_SYSTEM_TABLE.h"
12#include "src/__support/macros/config.h"
13
14namespace LIBC_NAMESPACE_DECL {
15namespace internal {
16
17[[noreturn]] void exit(int status) {
18 app.system_table->BootServices->Exit(__llvm_libc_efi_image_handle, status, 0,
19 nullptr);
20 __builtin_unreachable();
21}
22
23} // namespace internal
24} // namespace LIBC_NAMESPACE_DECL
25

source code of libc/src/__support/OSUtil/uefi/exit.cpp