blob: 07b8aa56ee770d946b1bf9fa086b0ece1170ea79 [file] [log] [blame]
eric_tian804405e2008-06-30 05:08:49 +00001/*++
2
3Copyright (c) 2006 - 2008, Intel Corporation
4All rights reserved. This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12Module Name:
13
14 UnixStuff.c
15
16Abstract:
17
18 Tiano PEIM to abstract construction of firmware volume in a Unix environment.
19
20Revision History
21
22--*/
23
24#include "PiPei.h"
25#include <Ppi/UnixThunk.h>
26#include <Library/DebugLib.h>
27#include <Library/PeimEntryPoint.h>
28#include <Library/HobLib.h>
29#include <Library/PeiServicesLib.h>
30#include <Library/PeiServicesTablePointerLib.h>
31
32EFI_STATUS
33EFIAPI
34PeimInitializeUnixStuff (
qhuang8f0532872008-12-03 06:20:14 +000035 IN EFI_PEI_FILE_HANDLE FileHandle,
36 IN CONST EFI_PEI_SERVICES **PeiServices
eric_tian804405e2008-06-30 05:08:49 +000037 )
38/*++
39
40Routine Description:
41
42 Perform a call-back into the SEC simulator to get Unix Stuff
43
44Arguments:
45
46 PeiServices - General purpose services available to every PEIM.
47
48Returns:
49
50 None
51
52--*/
53// TODO: FfsHeader - add argument and description to function comment
54{
55 EFI_STATUS Status;
56 EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;
57 PEI_UNIX_THUNK_PPI *PeiUnixService;
58 VOID *Ptr;
59
60 DEBUG ((EFI_D_ERROR, "Unix Stuff PEIM Loaded\n"));
61
62 Status = (**PeiServices).LocatePpi (
63 PeiServices,
64 &gPeiUnixThunkPpiGuid, // GUID
65 0, // INSTANCE
66 &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR
67 (VOID **)&PeiUnixService // PPI
68 );
69 ASSERT_EFI_ERROR (Status);
70
71 Ptr = PeiUnixService->UnixThunk ();
72
73 BuildGuidDataHob (
74 &gEfiUnixThunkProtocolGuid, // Guid
75 &Ptr, // Buffer
76 sizeof (VOID *) // Sizeof Buffer
77 );
78 return Status;
79}