All of the global data in the gMD structure is initialized to 0, NULL, or\r
SIG_DFL; as appropriate.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available under\r
the terms and conditions of the BSD License that accompanies this distribution.\r
The full text of the license may be found at\r
#include <stdio.h>\r
#include <stdlib.h>\r
#include <string.h>\r
+#include <time.h>\r
#include <MainData.h>\r
-#include <sys/EfiSysCall.h>\r
+#include <unistd.h>\r
\r
extern int main( int, char**);\r
extern int __sse2_available;\r
char **\r
ArgvConvert(UINTN Argc, CHAR16 **Argv)\r
{\r
- size_t AVsz; /* Size of a single nArgv string */\r
+ ssize_t AVsz; /* Size of a single nArgv string, or -1 */\r
UINTN count;\r
char **nArgv;\r
char *string;\r
nArgvSize = Argc;\r
/* Determine space needed for narrow Argv strings. */\r
for(count = 0; count < Argc; ++count) {\r
- AVsz = wcstombs(NULL, Argv[count], ARG_MAX);\r
+ AVsz = (ssize_t)wcstombs(NULL, Argv[count], ARG_MAX);\r
if(AVsz < 0) {\r
Print(L"ABORTING: Argv[%d] contains an unconvertable character.\n", count);\r
exit(EXIT_FAILURE);\r
for(count = 0; count < Argc; ++count) {\r
nArgv[count] = string;\r
AVsz = wcstombs(string, Argv[count], nArgvSize);\r
- string[AVsz] = 0; /* NULL terminate the argument */\r
DEBUG((DEBUG_INFO, "Cvt[%d] %d \"%s\" --> \"%a\"\n", (INT32)count, (INT32)AVsz, Argv[count], nArgv[count]));\r
- string += AVsz + 1;\r
- nArgvSize -= AVsz + 1;\r
+ string += AVsz;\r
+ nArgvSize -= AVsz;\r
if(nArgvSize < 0) {\r
Print(L"ABORTING: Internal Argv[%d] conversion error.\n", count);\r
exit(EXIT_FAILURE);\r
errno = 0;\r
EFIerrno = 0;\r
\r
-#ifdef NT32dvm\r
- gMD->ClocksPerSecond = 1; // For NT32 only\r
- gMD->AppStartTime = 1; // For NT32 only\r
-#else\r
- gMD->ClocksPerSecond = (clock_t)GetPerformanceCounterProperties( NULL, NULL);\r
- gMD->AppStartTime = (clock_t)GetPerformanceCounter();\r
-#endif /* NT32 dvm */\r
+ gMD->ClocksPerSecond = 1;\r
+ gMD->AppStartTime = (clock_t)((UINT32)time(NULL));\r
\r
// Initialize file descriptors\r
mfd = gMD->fdarray;\r