Minor documentation improvements.
[pub/USBasp.git] / Bootloaders / MassStorage / BootloaderAPITable.S
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2011.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 #if AUX_BOOT_SECTION_SIZE > 0
32
33 #warning Using a AUX bootloader section in addition to the defined bootloader space (see documentation).
34
35 ; Trampoline to jump over the AUX bootloader section to the start of the bootloader,
36 ; on devices where an AUX bootloader section is used.
37 .section .boot_aux_trampoline, "ax"
38 .global Boot_AUX_Trampoline
39 Boot_AUX_Trampoline:
40 jmp BOOT_START_ADDR
41
42 #endif
43
44 ; Trampolines to actual API implementations if the target address is outside the
45 ; range of a rjmp instruction (can happen with large bootloader sections)
46 .section .apitable_trampolines, "ax"
47 .global BootloaderAPI_Trampolines
48 BootloaderAPI_Trampolines:
49
50 BootloaderAPI_ErasePage_Trampoline:
51 jmp BootloaderAPI_ErasePage
52 BootloaderAPI_WritePage_Trampoline:
53 jmp BootloaderAPI_WritePage
54 BootloaderAPI_FillWord_Trampoline:
55 jmp BootloaderAPI_FillWord
56 BootloaderAPI_ReadSignature_Trampoline:
57 jmp BootloaderAPI_ReadSignature
58 BootloaderAPI_ReadFuse_Trampoline:
59 jmp BootloaderAPI_ReadFuse
60 BootloaderAPI_ReadLock_Trampoline:
61 jmp BootloaderAPI_ReadLock
62 BootloaderAPI_WriteLock_Trampoline:
63 jmp BootloaderAPI_WriteLock
64 BootloaderAPU_UNUSED1:
65 ret
66 BootloaderAPU_UNUSED2:
67 ret
68 BootloaderAPU_UNUSED3:
69 ret
70 BootloaderAPU_UNUSED4:
71 ret
72 BootloaderAPU_UNUSED5:
73 ret
74
75
76
77 ; API function jump table
78 .section .apitable_jumptable, "ax"
79 .global BootloaderAPI_JumpTable
80 BootloaderAPI_JumpTable:
81
82 rjmp BootloaderAPI_ErasePage_Trampoline
83 rjmp BootloaderAPI_WritePage_Trampoline
84 rjmp BootloaderAPI_FillWord_Trampoline
85 rjmp BootloaderAPI_ReadSignature_Trampoline
86 rjmp BootloaderAPI_ReadFuse_Trampoline
87 rjmp BootloaderAPI_ReadLock_Trampoline
88 rjmp BootloaderAPI_WriteLock_Trampoline
89 rjmp BootloaderAPU_UNUSED1 ; UNUSED ENTRY 1
90 rjmp BootloaderAPU_UNUSED2 ; UNUSED ENTRY 2
91 rjmp BootloaderAPU_UNUSED3 ; UNUSED ENTRY 3
92 rjmp BootloaderAPU_UNUSED4 ; UNUSED ENTRY 4
93 rjmp BootloaderAPU_UNUSED5 ; UNUSED ENTRY 5
94
95
96
97 ; Bootloader table signatures and information
98 .section .apitable_signatures, "ax"
99 .global BootloaderAPI_Signatures
100 BootloaderAPI_Signatures:
101
102 .long BOOT_START_ADDR ; Start address of the bootloader
103 .word 0xDF30 ; Signature for the MS class bootloader, V1
104 .word 0xDCFB ; Signature for a LUFA class bootloader