diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-06-15 16:02:19 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-06-15 16:02:19 +0000 |
commit | 4da2ba9f1c5e91895416960649b25709f1079ded (patch) | |
tree | 1eac37817864c64d84bd3dc1914bd2a16a82410e /Bootloaders/DFU/BootloaderAPITable.S | |
parent | c4ebddd27ab964e55f4c7a1ae098f3f2c8ef47a6 (diff) | |
download | lufa-4da2ba9f1c5e91895416960649b25709f1079ded.tar.gz lufa-4da2ba9f1c5e91895416960649b25709f1079ded.tar.bz2 lufa-4da2ba9f1c5e91895416960649b25709f1079ded.zip |
Modify CDC and DFU bootloaders so that the various BootloaderAPI components are in unique sections and mapped explicitly - this will ensure the API and signature entries are always linked at the correct explicit address.
Diffstat (limited to 'Bootloaders/DFU/BootloaderAPITable.S')
-rw-r--r-- | Bootloaders/DFU/BootloaderAPITable.S | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/Bootloaders/DFU/BootloaderAPITable.S b/Bootloaders/DFU/BootloaderAPITable.S index 18ae390fc..cad8f71f6 100644 --- a/Bootloaders/DFU/BootloaderAPITable.S +++ b/Bootloaders/DFU/BootloaderAPITable.S @@ -28,41 +28,44 @@ this software. */ -; Bootloader API Jump Table -.section .apitable, "ax" - ; Trampolines to actual API implementations if the target address is outside the ; range of a rjmp instruction (can happen with large bootloader sections) -.org 0 -BootloaderAPI_ErasePage_Trampoline: - jmp BootloaderAPI_ErasePage -BootloaderAPI_WritePage_Trampoline: - jmp BootloaderAPI_WritePage -BootloaderAPI_FillWord_Trampoline: - jmp BootloaderAPI_FillWord -BootloaderAPI_ReadSignature_Trampoline: - jmp BootloaderAPI_ReadSignature -BootloaderAPI_ReadFuse_Trampoline: - jmp BootloaderAPI_ReadFuse -BootloaderAPI_ReadLock_Trampoline: - jmp BootloaderAPI_ReadLock -BootloaderAPI_WriteLock_Trampoline: - jmp BootloaderAPI_WriteLock -BootloaderAPU_UNUSED1: - ret -BootloaderAPU_UNUSED2: - ret -BootloaderAPU_UNUSED3: - ret -BootloaderAPU_UNUSED4: - ret -BootloaderAPU_UNUSED5: - ret +.section .apitable_trampolines, "ax" +.global BootloaderAPI_Trampolines +BootloaderAPI_Trampolines: + + BootloaderAPI_ErasePage_Trampoline: + jmp BootloaderAPI_ErasePage + BootloaderAPI_WritePage_Trampoline: + jmp BootloaderAPI_WritePage + BootloaderAPI_FillWord_Trampoline: + jmp BootloaderAPI_FillWord + BootloaderAPI_ReadSignature_Trampoline: + jmp BootloaderAPI_ReadSignature + BootloaderAPI_ReadFuse_Trampoline: + jmp BootloaderAPI_ReadFuse + BootloaderAPI_ReadLock_Trampoline: + jmp BootloaderAPI_ReadLock + BootloaderAPI_WriteLock_Trampoline: + jmp BootloaderAPI_WriteLock + BootloaderAPU_UNUSED1: + ret + BootloaderAPU_UNUSED2: + ret + BootloaderAPU_UNUSED3: + ret + BootloaderAPU_UNUSED4: + ret + BootloaderAPU_UNUSED5: + ret + + ; API function jump table -.org (96 - 32) +.section .apitable_jumptable, "ax" .global BootloaderAPI_JumpTable BootloaderAPI_JumpTable: + rjmp BootloaderAPI_ErasePage_Trampoline rjmp BootloaderAPI_WritePage_Trampoline rjmp BootloaderAPI_FillWord_Trampoline @@ -76,10 +79,13 @@ BootloaderAPI_JumpTable: rjmp BootloaderAPU_UNUSED4 ; UNUSED ENTRY 4 rjmp BootloaderAPU_UNUSED5 ; UNUSED ENTRY 5 + + ; Bootloader table signatures and information -.org (96 - 8) -BootloaderAPI_Signatures: +.section .apitable_signatures, "ax" .global BootloaderAPI_Signatures +BootloaderAPI_Signatures: + .long BOOT_START_ADDR ; Start address of the bootloader .word 0xDFB1 ; Signature for the DFU class bootloader, V1 .word 0xDCFB ; Signature for a LUFA class bootloader |