On Apr 3, 2014, at 10:45 AM, Reza Jelveh <reza.jel...@tuhh.de> wrote:

> On 02/04/14 13:41, Reza Jelveh wrote:
>> On 02/04/14 01:22, Andrew Fish wrote:
>>> I’ve been meaning to add an Xcode5 target that has the different arg to the 
>>> template file. What OS version are you running on? I’m on OS X 10.9.2. 
>> i'm using 10.9.2, i have xcode 5, but yes, I was using xcode 4.6 binutils
>> since i'm on gentoo prefix, and stock xcode 5 doesn't work. i just tried it.
>>> 
>>> I’ve not seen an issue with Xcode 5 and Xcode 5.1 tools. 
>> xcode 5 definitely fails with missing retf here. if I don't patch the cctools
>> i need to patch exceptionhandler.s to use lret instead, and then it'll fail
>> with:
>> 
>> ld: illegal text-relocation to '_CommonInterruptEntry' in 
>> /Users/timebomb/git/gsoc/edk2/Build/OvmfX64/DEBUG_XCLANG/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/DxeCpuExceptionHandlerLib.lib(ExceptionHandlerAsm.obj)
>>  from 'Exception0Handle' in 
>> /Users/timebomb/git/gsoc/edk2/Build/OvmfX64/DEBUG_XCLANG/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/DxeCpuExceptionHandlerLib.lib(ExceptionHandlerAsm.obj)
>>  for architecture x86_64 
>> 
>> downloading 5.1 atm.
>> 
> 
> my bad, the iowrite/ioread issue is actually a toolchain issue as you said.
> 
> Can you help me with this commoninterruptentry problem? 
> 
> Could it be that you have a different ExceptionHandlerAsm.S ? 
> 

Seems folks are always trying to be creative in this area …..

For X64 Xcode does not support relocations. So you need to write RIP relative 
code. 

.asm
REPEAT  32
    db      6ah        ; push  #VectorNum
    db      ($ - AsmIdtVectorBegin) / ((AsmIdtVectorEnd - AsmIdtVectorBegin) / 
32) ; VectorNum
    push    rax
    mov     rax, CommonInterruptEntry
    jmp     rax
ENDM

.S
Exception0Handle:
    .byte   0x6a    #  push #VectorNum
    .byte   0
    pushq   %rax
    .byte   0x48, 0xB8
    .quad   ASM_PFX(CommonInterruptEntry)
    jmp     *%rax

.Andrew get you started idea, I’ve not test this. 

Exception0Handle:
    pushb   0      // The .asm macro needs to repeat so I’m guessing that is 
driving the db/.byte
    pushq   %rax
    leaq    ASM_PFX(CommonInterruptEntry)(%rip), %rax // 7 byte instruction. 
    jmp     *%rax
    nop              // I’m not sure if it safe to change the size of these 
entries. 
    nop
    nop

Thanks,

Andrew Fish


> Thanks,
> Reza
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to