X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkUnixPkg%2FSec%2FUnixThunk.c;h=834498082dc160dac671ac8fbebbd7beac5db9b5;hp=c1988faf591095da13a1f24bc54c0103c80cd5b5;hb=6d2f1f24c3b53f664c1e61409f30b586e43f300b;hpb=8ba2f4413a21d5dd3d4833aa097b918aa5cfb8a7 diff --git a/EdkUnixPkg/Sec/UnixThunk.c b/EdkUnixPkg/Sec/UnixThunk.c index c1988faf59..834498082d 100644 --- a/EdkUnixPkg/Sec/UnixThunk.c +++ b/EdkUnixPkg/Sec/UnixThunk.c @@ -1,44 +1,45 @@ -/*++ - -Copyright (c) 2004 - 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - UnixThunk.c - -Abstract: - - Since the SEC is the only program in our emulation we - must use a Tiano mechanism to export APIs to other modules. - This is the role of the EFI_UNIX_THUNK_PROTOCOL. - - The mUnixThunkTable exists so that a change to EFI_UNIX_THUNK_PROTOCOL - will cause an error in initializing the array if all the member functions - are not added. It looks like adding a element to end and not initializing - it may cause the table to be initaliized with the members at the end being - set to zero. This is bad as jumping to zero will crash. - - - gUnix is a a public exported global that contains the initialized - data. - ---*/ - -#include "SecMain.h" +/*++ + +Copyright (c) 2004 - 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + UnixThunk.c + +Abstract: + + Since the SEC is the only program in our emulation we + must use a Tiano mechanism to export APIs to other modules. + This is the role of the EFI_UNIX_THUNK_PROTOCOL. + + The mUnixThunkTable exists so that a change to EFI_UNIX_THUNK_PROTOCOL + will cause an error in initializing the array if all the member functions + are not added. It looks like adding a element to end and not initializing + it may cause the table to be initaliized with the members at the end being + set to zero. This is bad as jumping to zero will crash. + + + gUnix is a a public exported global that contains the initialized + data. + +--*/ + +#include "SecMain.h" #include "Library/UnixLib.h" #include #include #include #include #include - +#include +#include static int settimer_initialized; static struct timeval settimer_timeval; static void (*settimer_callback)(UINT64 delta); @@ -155,8 +156,8 @@ GetErrno(void) extern EFI_STATUS UgaCreate(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo, CONST CHAR16 *Title); -EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = { - EFI_UNIX_THUNK_PROTOCOL_SIGNATURE, +EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = { + EFI_UNIX_THUNK_PROTOCOL_SIGNATURE, msSleep, /* Sleep */ exit, /* Exit */ SetTimer, @@ -187,9 +188,16 @@ EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = { fsync, chmod, utime, - + tcflush, UgaCreate, -}; - - -EFI_UNIX_THUNK_PROTOCOL *gUnix = &mUnixThunkTable; + perror, + ioctl, + fcntl, + cfsetispeed, + cfsetospeed, + tcgetattr, + tcsetattr +}; + + +EFI_UNIX_THUNK_PROTOCOL *gUnix = &mUnixThunkTable;