EFI: Initial test EFI application
[haiku.git] / src / system / boot / platform / efi / start.c
blobfe36d5c63f9b619e225636b1c09a5cf4ae317204
1 /*
2 * Copyright (c) 2011, Intel Corporation
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
14 * distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27 * OF THE POSSIBILITY OF SUCH DAMAGE.
29 #include "efibind.h"
30 #include "efidef.h"
31 #include "efidevp.h"
32 #include "eficon.h"
33 #include "efiprot.h"
34 #include "efiapi.h"
35 #include "efierr.h"
37 static const CHAR16 *exampleText = L"Example EFI Application. Press any key!";
39 EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systemTable);
41 /**
42 * efi_main - The entry point for the EFI application
43 * @image: firmware-allocated handle that identifies the image
44 * @SystemTable: EFI system table
46 EFI_STATUS
47 efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systemTable)
49 UINTN index;
50 EFI_EVENT event = systemTable->ConIn->WaitForKey;
52 SIMPLE_TEXT_OUTPUT_INTERFACE *conOut = systemTable->ConOut;
53 conOut->OutputString(conOut, (CHAR16*)exampleText);
55 systemTable->BootServices->WaitForEvent(1, &event, &index);
57 return EFI_SUCCESS;