Chameleon

Chameleon Commit Details

Date:2015-05-23 12:06:08 (5 years 6 months ago)
Author:ErmaC
Commit:2698
Parents: 2697
Message:Switch order in pre-processors conditional directives.
Changes:
M/branches/ErmaC/Enoch/i386/libsaio/fake_efi.c

File differences

branches/ErmaC/Enoch/i386/libsaio/fake_efi.c
761761
762762
763763
764
764765
766
767
768
765769
766770
767771
768772
769773
770774
771
772
773
774775
775776
776777
......
818819
819820
820821
822
821823
824
825
826
827
828
829
830
831
822832
833
834
823835
824836
825837
......
830842
831843
832844
833
834
835
836
837
838
839
840
841
842
843
844845
845846
846847
//
UInt8 index = 0;
EFI_UINT16 PMTimerValue = 0;
#if RANDOMSEED
EFI_UINT32 randomValue = 0, cpuTick = 0;
EFI_UINT32 ecx = 0, edx = 0, esi = 0, edi = 0;
#else
EFI_UINT32 randomValue, tempValue, cpuTick;
EFI_UINT32 ecx, esi, edi = 0;
EFI_UINT32 rcx, rdx, rsi, rdi;
randomValue = tempValue = ecx = esi = edi = 0;// xor%ecx,%ecx
cpuTick = rcx = rdx = rsi = rdi = 0;
#else
EFI_UINT32 randomValue = 0, cpuTick = 0;
EFI_UINT32 ecx = 0, edx = 0, esi = 0, edi = 0;
#endif
// LEAF_1 - Feature Information (Function 01h).
if (Platform.CPU.CPUID[CPUID_1][2] & 0x40000000)// Checking ecx:bit-30
cpuTick = (EFI_UINT32) getCPUTick();// callq0x121a7
//printf("value: 0x%x\n", getCPUTick());
#if RANDOMSEED
ecx = (cpuTick >> 8);// mov%rax,%rcx
// shr$0x8,%rcx
edx = (cpuTick >> 0x10);// mov%rax,%rdx
// shr$0x10,%rdx
edi = esi;// mov%rsi,%rdi
edi = (edi ^ cpuTick);// xor%rax,%rdi
edi = (edi ^ ecx);// xor%rcx,%rdi
edi = (edi ^ edx);// xor%rdx,%rdi
seedBuffer[index] = (edi & 0xff);
#else
rcx = (cpuTick >> 8);// mov%rax,%rcx
// shr$0x8,%rcx
rdx = (cpuTick >> 0x10);// mov%rax,%rdx
rdi = (rdi ^ rdx);// xor%rdx,%rdi
seedBuffer[index] = (rdi & 0xff);// mov%dil,(%r15,%r12,1)
#else
ecx = (cpuTick >> 8);// mov%rax,%rcx
// shr$0x8,%rcx
edx = (cpuTick >> 0x10);// mov%rax,%rdx
// shr$0x10,%rdx
edi = esi;// mov%rsi,%rdi
edi = (edi ^ cpuTick);// xor%rax,%rdi
edi = (edi ^ ecx);// xor%rcx,%rdi
edi = (edi ^ edx);// xor%rdx,%rdi
seedBuffer[index] = (edi & 0xff);// mov%dil,(%r15,%r12,1)
#endif
edi = (edi & 0x2f);// and$0x2f,%edi
edi = (edi + esi);// add%esi,%edi

Archive Download the corresponding diff file

Revision: 2698