freebsd-skq/sys/boot/efi/include
Marcel Moolenaar 155dbcacfb Change the startup code to fix a memory leak and to allow us to
accept load options (=command line options).

The call graph changes from *entry*->efi_main->efi_init, where
efi_main is the EFI equivalent of main to *entry*->efi_main->main,
where main is what you'd expect. efi_main now is what efi_init was.
The prototype of main follows that of C. The first argument is argc
and the second is argv. There is no third argument.
Allocation of heap pages is now handled by the EFI library and it
now deallocates the pages when main() returns or when exit() is
called. This allows us to safely return to the boot manager (or
EFI shell) without leaks. EFI applications are responsible to free
all memory themselves.

Handling of the load options is a bit tricky. There are either no
load options, load options in ASCII or load options in Unicode.
The EFI library will translate the ASCII options to Unicode options
as to simplify user code. Since the load options are passed as a
single string (if present) and main() accepts argc and argv, the
startup code also has to split the string into words and build the
argv vector. Here the trickiness starts. When the loader is started
from the EFI shell, argv[0] will automaticly load the program name.
In all other cases (ie through the boot manager), this is not the
case. Unfortunately, there's no trivial way to check. Hence, a
set of conditions is checked to determine if we need to fill in
argv[0] ourselves or not. This checking is not perfect. There are
known cases where it fails to do the right thing. The logic works
for most expected cases, though. This includes the case where no
options are given.

Approved by: re (blanket)
2002-12-10 06:22:25 +00:00
..
i386 An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
ia64 An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efi_nii.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efi.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efiapi.h Add the GUID of the DIG64 HCDP table. 2002-12-08 20:47:44 +00:00
eficon.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efidebug.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efidef.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efidevp.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efierr.h
efifpswa.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efifs.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efilib.h Change the startup code to fix a memory leak and to allow us to 2002-12-10 06:22:25 +00:00
efinet.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efipart.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efiprot.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efipxebc.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efiser.h An almost mechanical sweep to replace C++ style comments with C 2002-05-19 03:17:22 +00:00
efistdarg.h
README

/* $FreeBSD$ */

Files in this directory and subdirectories are subject to the following
copyright unless superceded or supplemented by additional specific license
terms found in the file headers of individual files.

Copyright (c) 1998-2000 Intel Corporation

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL INTEL BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL
OTHER INFORMATION ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO
WARRANTIES, AND ARE SUBJECT TO CHANGE WITHOUT NOTICE.