summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-16 05:28:50 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-16 05:28:50 +0000
commit73aa7f049bcc615f1a09dae29ec9a89cacd27420 (patch)
treea9ce2d363c2d51598f6c323d1113bc38d54e5acd
parent19efd9ec947b56397e24195144bddd8a89a16fd1 (diff)
downloadedk2-73aa7f049bcc615f1a09dae29ec9a89cacd27420.zip
edk2-73aa7f049bcc615f1a09dae29ec9a89cacd27420.tar.gz
edk2-73aa7f049bcc615f1a09dae29ec9a89cacd27420.tar.bz2
merge the generation of SecMain into the whole build process.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5491 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--BaseTools/Conf/build_rule.template2
-rw-r--r--BaseTools/Conf/tools_def.template4
-rw-r--r--UnixPkg/Sec/SecMain.c12
-rw-r--r--UnixPkg/Sec/SecMain.inf8
-rw-r--r--UnixPkg/Sec/UnixThunk.c8
-rw-r--r--UnixPkg/UnixPkg.dsc4
6 files changed, 20 insertions, 18 deletions
diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
index e981caa..bf667d2 100644
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -219,7 +219,7 @@
"$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) $(LIBS) ${src}
<Command.GCC>
- "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) ${src} -\)
+ "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) ${src} -\) $(DLINK2_FLAGS)
[Build.Dynamic-Library-File]
<InputFile>
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 76cbec5..a8413ee 100644
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -497,14 +497,14 @@ RELEASE_WINDDK3790x1830_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT
*_ELFGCC_IA32_CC_PATH = DEF(ELFGCC_BIN)/gcc
*_ELFGCC_IA32_SLINK_PATH = DEF(ELFGCC_BIN)/ar
*_ELFGCC_IA32_DLINK_PATH = DEF(ELFGCC_BIN)/ld
+*_ELFGCC_IA32_DLINK2_PATH = DEF(ELFGCC_BIN)/ld
*_ELFGCC_IA32_ASM_PATH = DEF(ELFGCC_BIN)/gcc
*_ELFGCC_IA32_PP_PATH = DEF(ELFGCC_BIN)/gcc
*_ELFGCC_IA32_VFRPP_PATH = DEF(ELFGCC_BIN)/gcc
*_ELFGCC_*_MAKE_PATH = make
-*_ELFGCC_*_MAKE_FLAGS = -i
*_ELFGCC_IA32_CC_FLAGS = -m32 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -c -include $(DEST_DIR_DEBUG)/AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
-*_ELFGCC_*_DLINK_FLAGS = -melf_i386 -nostdlib --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT)
+*_ELFGCC_*_DLINK_FLAGS = -melf_i386 -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT)
#*_ELFGCC_*_DLINK_FLAGS = -melf_i386 -nostdlib -n -q -Ttext 0x220 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT)
*_ELFGCC_*_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
*_ELFGCC_*_PP_FLAGS = -m32 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
diff --git a/UnixPkg/Sec/SecMain.c b/UnixPkg/Sec/SecMain.c
index bfa44e7..2f2a1d2 100644
--- a/UnixPkg/Sec/SecMain.c
+++ b/UnixPkg/Sec/SecMain.c
@@ -53,17 +53,17 @@ EFI_PEI_PE_COFF_LOADER_PROTOCOL_INSTANCE mPeiEfiPeiPeCoffLoaderInstance = {
-EFI_PEI_PE_COFF_LOADER_PROTOCOL *gPeiEfiPeiPeCoffLoader = &mPeiEfiPeiPeCoffLoaderInstance.PeCoff;
+EFI_PEI_PE_COFF_LOADER_PROTOCOL *gPeiEfiPeiPeCoffLoader = &mPeiEfiPeiPeCoffLoaderInstance.PeCoff;
-UNIX_PEI_LOAD_FILE_PPI mSecNtLoadFilePpi = { SecWinNtPeiLoadFile };
+UNIX_PEI_LOAD_FILE_PPI mSecNtLoadFilePpi = { SecWinNtPeiLoadFile };
-PEI_UNIX_AUTOSCAN_PPI mSecNtAutoScanPpi = { SecWinNtPeiAutoScan };
+PEI_UNIX_AUTOSCAN_PPI mSecNtAutoScanPpi = { SecWinNtPeiAutoScan };
-PEI_UNIX_THUNK_PPI mSecWinNtThunkPpi = { SecWinNtWinNtThunkAddress };
+PEI_UNIX_THUNK_PPI mSecWinNtThunkPpi = { SecWinNtWinNtThunkAddress };
-EFI_PEI_PROGRESS_CODE_PPI mSecStatusCodePpi = { SecPeiReportStatusCode };
+EFI_PEI_PROGRESS_CODE_PPI mSecStatusCodePpi = { SecPeiReportStatusCode };
-UNIX_FWH_PPI mSecFwhInformationPpi = { SecWinNtFdAddress };
+UNIX_FWH_PPI mSecFwhInformationPpi = { SecWinNtFdAddress };
TEMPORARY_RAM_SUPPORT_PPI mSecTemporaryRamSupportPpi = {SecTemporaryRamSupport};
diff --git a/UnixPkg/Sec/SecMain.inf b/UnixPkg/Sec/SecMain.inf
index 37152b0..f3c00e8 100644
--- a/UnixPkg/Sec/SecMain.inf
+++ b/UnixPkg/Sec/SecMain.inf
@@ -18,7 +18,7 @@
INF_VERSION = 0x00010005
BASE_NAME = SecMain
FILE_GUID = f43be88c-8985-11db-8f78-0040d02b1835
- MODULE_TYPE = SEC
+ MODULE_TYPE = USER_DEFINED
VERSION_STRING = 1.0
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
@@ -73,4 +73,8 @@
gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareFdSize
[BuildOptions.common]
- GCC:*_*_IA32_DLINK_FLAGS =
+ GCC:*_*_IA32_DLINK_FLAGS = -o $(BIN_DIR)/SecMain.exe -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o -L/usr/X11R6/lib -lXext -lX11 /usr/lib/crtn.o
+ GCC:*_*_*_DLINK2_FLAGS = -lc
+ GCC:*_*_IA32_CC_FLAGS = -m32 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -idirafter/usr/include -c -include $(DEST_DIR_DEBUG)/AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ GCC:*_*_IA32_PP_FLAGS = -m32 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
+ GCC:*_*_IA32_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
diff --git a/UnixPkg/Sec/UnixThunk.c b/UnixPkg/Sec/UnixThunk.c
index 500568a..44dfb16 100644
--- a/UnixPkg/Sec/UnixThunk.c
+++ b/UnixPkg/Sec/UnixThunk.c
@@ -58,6 +58,7 @@ VOID
SetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs))
{
struct itimerval timerval;
+ UINT32 remainder;
if (!settimer_initialized) {
struct sigaction act;
@@ -73,9 +74,10 @@ SetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs))
printf ("SetTimer: gettimeofday error %s\n", strerror (errno));
}
}
- timerval.it_value.tv_sec = PeriodMs / 1000;
- timerval.it_value.tv_usec = (PeriodMs % 1000) * 1000;
- timerval.it_value.tv_sec = PeriodMs / 1000;
+ timerval.it_value.tv_sec = DivU64x32(PeriodMs, 1000);
+ DivU64x32Remainder(PeriodMs, 1000, &remainder);
+ timerval.it_value.tv_usec = remainder * 1000;
+ timerval.it_value.tv_sec = DivU64x32(PeriodMs, 1000);
timerval.it_interval = timerval.it_value;
if (setitimer (ITIMER_REAL, &timerval, NULL) != 0) {
diff --git a/UnixPkg/UnixPkg.dsc b/UnixPkg/UnixPkg.dsc
index 7db8d82..77fa2eb 100644
--- a/UnixPkg/UnixPkg.dsc
+++ b/UnixPkg/UnixPkg.dsc
@@ -490,7 +490,3 @@
<LibraryClasses>
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
}
-
-[BuildOptions]
- DEBUG_*_IA32_DLINK_FLAGS = --shared
- *_*_IA32_CC_FLAGS = -idirafter/usr/include