Guest User

5d3 v1.2.1 function stubs

a guest
Jul 24th, 2013
170
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /** \file
  2.  * Entry points into the firmware image.
  3.  *
  4.  * These are the functions that we can call from our tasks
  5.  * in the Canon 1.2.1 firmware for the 5D Mark III.
  6.  *
  7.  */
  8. /*
  9.  * Copyright (C) 2012 Magic Lantern Team
  10.  *
  11.  * This program is free software; you can redistribute it and/or
  12.  * modify it under the terms of the GNU General Public License
  13.  * as published by the Free Software Foundation; either version 2
  14.  * of the License, or (at your option) any later version.
  15.  *
  16.  * This program is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  * GNU General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU General Public License
  22.  * along with this program; if not, write to the
  23.  * Free Software Foundation, Inc.,
  24.  * 51 Franklin Street, Fifth Floor,
  25.  * Boston, MA  02110-1301, USA.
  26.  */
  27.  
  28. .text
  29.  
  30. #define NSTUB(addr,name) \
  31.     .global name; \
  32.     .extern name; \
  33.     name = addr
  34.  
  35. #define XSTUB(addr,name) \
  36.     .global STUB_##name; \
  37.     .extern STUB_##name; \
  38.     STUB_##name = addr
  39.  
  40. NSTUB( ROMBASEADDR, firmware_entry )
  41.  
  42. #define RAM_OFFSET 0xFF9EE160 // some functions are copied to RAM at around ff0c009c; they have to be called from RAM...
  43.  
  44. /** Startup **/
  45. NSTUB(0xFF0C1CA0, cstart)
  46. NSTUB(0xFFA0A5A8 - RAM_OFFSET, bzero32)
  47. NSTUB(0xFF9F1018 - RAM_OFFSET, create_init_task)
  48. NSTUB(0xFF0C52A0, init_task)
  49. NSTUB(   0x46930, additional_version)
  50.  
  51. /** Misc **/
  52. NSTUB(0xC0220000, camera_engine)
  53. NSTUB(0xFF135FEC, LoadCalendarFromRTC)
  54. NSTUB(0xFFA04154 - RAM_OFFSET, vsnprintf)
  55.  
  56. /** File I/O **/
  57. NSTUB(0xFF30E3D0, _FIO_CreateFile)
  58. NSTUB(0xFF30E314, _FIO_Open) // or OpenFile?
  59. NSTUB(0xFF30E774,  FIO_CloseFile)
  60. NSTUB(0xFF30E524,  FIO_ReadFile)
  61. NSTUB(0xFF30E6C4,  FIO_WriteFile)
  62. NSTUB(0xFF30E8F0, _FIO_GetFileSize)
  63. NSTUB(0xFF30E47C, _FIO_RemoveFile)
  64. NSTUB(0xFF30EFD0, _FIO_CreateDirectory)
  65. NSTUB(0xFF30F34C, _FIO_FindFirstEx)
  66. NSTUB(0xFF30F68C,  FIO_FindNextEx)
  67. NSTUB(0xFF30F76C,  FIO_CleanupAfterFindNext_maybe) // proper name: FindClose
  68.  
  69. /** Bitmap **/
  70. NSTUB(   0x42D30, bmp_vram_info )                 // look in SetBitmapVramAddress - as in 60D
  71. NSTUB(   0x42D48, LCD_Palette) // in InitializeBitmapDisplayDevice, right after 0xc0f14800
  72.  
  73. /** Debug messages **/
  74. NSTUB(   0x24A70, dm_names)
  75. NSTUB(0xFF9F3CF0 - RAM_OFFSET, DryosDebugMsg)
  76. NSTUB(0xFF9F4058 - RAM_OFFSET, dm_set_store_level)
  77. NSTUB(0xFF9F3FF0 - RAM_OFFSET, dm_set_print_level)
  78.  
  79. /** Task sleep **/
  80. NSTUB(0xFF9F6BBC - RAM_OFFSET, msleep)
  81.  
  82. /** Semaphores **/
  83. NSTUB(0xFF9F6580 - RAM_OFFSET, create_named_semaphore)
  84. NSTUB(0xFF9F66E0 - RAM_OFFSET, take_semaphore)
  85. NSTUB(0xFF9F67CC - RAM_OFFSET, give_semaphore)
  86.  
  87. /** Recursive locks **/
  88. NSTUB(0xFF9FA504 - RAM_OFFSET, CreateRecursiveLock)
  89. NSTUB(0xFFA02B18 - RAM_OFFSET, AcquireRecursiveLock) // AJ_KernelDry_KerRLock.c
  90. NSTUB(0xFFA02C2C - RAM_OFFSET, ReleaseRecursiveLock) // AJ_KernelDry_KerRLock.c_p2
  91.  
  92. /** Message queues **/
  93. NSTUB(0xFF9FA31C - RAM_OFFSET, msg_queue_create)
  94. NSTUB(0xFFA029CC - RAM_OFFSET, msg_queue_post)
  95. NSTUB(0xFFA027E0 - RAM_OFFSET, msg_queue_receive)
  96.  
  97. /** Tasks **/
  98. NSTUB(0xFF9F6C70 - RAM_OFFSET, task_create)
  99. NSTUB(   0x23d00, task_dispatch_hook )
  100. NSTUB(0xFF9FBF88 - RAM_OFFSET, task_trampoline)
  101.  
  102. /** Task info **/
  103. NSTUB(   0x25024, task_max)
  104. NSTUB(0xFF9F068C - RAM_OFFSET, get_current_task)
  105. NSTUB(0xFFA07A78 - RAM_OFFSET, is_taskid_valid) // AJ_task_trampoline_related_p10
  106. NSTUB(0xFF9FEA94 - RAM_OFFSET, get_obj_attr) // AJ_checks_if_Process_id_created_by_Dryos
  107.  
  108. /** Interrupts **/
  109. NSTUB(0xFF0C1174, cli_save)
  110. NSTUB(0xFF0C1188, sei_restore)
  111.  
  112. /** Eventprocs (call by name) **/
  113. NSTUB(0xFF13B768, call)
  114.  
  115. /** GUI **/
  116. NSTUB(0xFF0DED24, GUI_Control)
  117. NSTUB(0xFF18B6E4, SetGUIRequestMode)
  118. NSTUB(0xFF0DE950, gui_main_task)
  119. NSTUB(   0x24120, gui_main_struct)
  120. NSTUB(0xFF0DF38C, gui_init_end)
  121. NSTUB(0xFF1A7BD4, gui_massive_event_loop)
  122. NSTUB(   0x321C8, gui_task_list)
  123.  
  124. /** Dialog API **/
  125. NSTUB(0xFF455740, CreateDialogBox)
  126. NSTUB(0xFF454710, DeleteDialogBox)
  127. NSTUB(0xFF45646C, dialog_redraw)
  128. NSTUB(0xFF359164, dialog_set_property_str)
  129. NSTUB(0xFF475EB8, RedrawDisplay)
  130.  
  131. /** Dialog handlers **/
  132. NSTUB(0xFF663C30, LiveViewLevelApp_handler)
  133. NSTUB(0xFF62E384, LiveViewWbApp_handler)
  134. NSTUB(0xFF4BA6C8, LiveViewApp_handler)
  135. NSTUB(0xFF36DE00, PlayMain_handler)
  136. NSTUB(0xFF4D63DC, PlayMovieGuideApp_handler)
  137. NSTUB(0xFF4A671C, ErrCardForLVApp_handler) // not sure
  138. NSTUB(0xFF4A7260, ErrForCamera_handler) // ERR70, ERR80 etc (DlgErrForCamera.c, AJ_DIALOG.HANDLER_DlgErrForCamera.c)
  139. NSTUB(0xFF4B6228, HideUnaviFeedBack_maybe) // look for StartUnaviFeedBackTimer
  140. NSTUB(0xFF4C12EC, ShootOlcApp_handler) // AJ_DIALOG.HANDLER_DlgShootOlcInfo.c
  141.  
  142. /** Properties **/
  143. NSTUB(0xFF123024, prop_register_slave)
  144. NSTUB(0xFF1238A0, _prop_cleanup)
  145. NSTUB(0xFF1237D4, prop_deliver)
  146. NSTUB(0xFF123218, _prop_request_change)
  147. NSTUB(0xFF1239FC, _prop_get_value) // unsafe
  148.  
  149. /** Memory allocation **/
  150. NSTUB(0xFF0C8180, malloc)
  151. NSTUB(0xFF0C81D8, free) // see "can't malloc"
  152. NSTUB(0xFF9F7B00 - RAM_OFFSET, AllocateMemory)
  153. NSTUB(0xFF9F7E9C - RAM_OFFSET, FreeMemory)
  154. NSTUB(0xFFA060FC - RAM_OFFSET, alloc_dma_memory)
  155. NSTUB(0xFFA06130 - RAM_OFFSET, free_dma_memory)
  156. NSTUB(0xFF9F78A0 - RAM_OFFSET, GetMemoryInformation)
  157.  
  158. /** ExMem **/
  159. NSTUB(0xFF13C210, AllocateMemoryResource) // m_pfAllocMemoryCBR
  160. NSTUB(0xFF13C25C, AllocateContinuousMemoryResource) // m_pfContAllocMemoryCBR
  161. NSTUB(0xFF13C374, FreeMemoryResource) // m_pfFreeMemoryCBR
  162. NSTUB(0xFF0F0970, AllocateMemoryResourceForSingleChunk)
  163.  
  164. NSTUB(0xFF9F9330 - RAM_OFFSET, GetFirstChunkFromSuite)
  165. NSTUB(0xFF9F9ACC - RAM_OFFSET, GetNextMemoryChunk)
  166. NSTUB(0xFF9F8D08 - RAM_OFFSET, GetMemoryAddressOfMemoryChunk)
  167.  
  168. /** Engio **/
  169. NSTUB(0xFF290F98, _engio_write)
  170. NSTUB(0xFF290D1C, shamem_read) // AJ_0x8FB0_engio_struct_n_R0_manipulation_to_get_ptr
  171. NSTUB(0xFF290C80, _EngDrvOut) // AJ_EngDrvOut_1xVar_to_ShadowStruct
  172.  
  173. /** PTP **/
  174. NSTUB(0xFF3FDD94, ptp_register_handler)
  175.  
  176. /** Audio **/
  177. NSTUB(0xFF137038, _audio_ic_read)
  178. NSTUB(0xFF136F80, _audio_ic_write) // str:Reg_0x_02X_Data_04x
  179.  
  180. /** ASIF **/
  181. NSTUB(0xFF1379E8, PowerAudioOutput)
  182. NSTUB(0xFF10E7F4, StartASIFDMADAC)
  183. NSTUB(0xFF10E63C, StartASIFDMAADC)
  184. NSTUB(0xFF10E8CC, StopASIFDMADAC)
  185. NSTUB(0xFF10ED70, SetNextASIFADCBuffer)
  186. NSTUB(0xFF10EE24, SetNextASIFDACBuffer)
  187. NSTUB(0xFF137A80, SetSamplingRate )
  188. NSTUB(0xFF137180, SetAudioVolumeOut)
  189.  
  190. /** experimental EDMAC research **/
  191. NSTUB(0xFF9F8F84 - RAM_OFFSET, CreateMemorySuite)
  192. NSTUB(0xFF9F8D7C - RAM_OFFSET, DeleteMemorySuite)
  193.  
  194.  
  195. /** EDMAC routines */
  196. NSTUB(0xFFA00758 - RAM_OFFSET, SetEDmac)
  197. NSTUB(0xFFA00A70 - RAM_OFFSET, StartEDmac)
  198. //NSTUB(0xFFA00C98 - RAM_OFFSET, PopEDmac)  //~ idk, ported anyways.
  199. NSTUB(0xFFA00C04 - RAM_OFFSET, PopEDmac)
  200. NSTUB(0xFFA00BBC - RAM_OFFSET, AbortEDmac)
  201. NSTUB(0xFFA00804 - RAM_OFFSET, ConnectWriteEDmac)
  202. NSTUB(0xFFA008C8 - RAM_OFFSET, ConnectReadEDmac)
  203.  
  204. /** keep the old name until all are refcatored **/
  205. NSTUB(0xFFA00C5C - RAM_OFFSET, EDMAC_RegisterCompleteCBR)
  206.  
  207. /** register/unregister CBR names **/
  208. NSTUB(0xFFA00C5C - RAM_OFFSET, RegisterEDmacCompleteCBR)
  209. NSTUB(0xFFA00D44 - RAM_OFFSET, RegisterEDmacAbortCBR)
  210. NSTUB(0xFFA00DD8 - RAM_OFFSET, RegisterEDmacPopCBR)
  211. NSTUB(0xFFA00C98 - RAM_OFFSET, UnregisterEDmacCompleteCBR)
  212. NSTUB(0xFFA00D80 - RAM_OFFSET, UnregisterEDmacAbortCBR)
  213. NSTUB(0xFFA00E14 - RAM_OFFSET, UnregisterEDmacPopCBR)
  214.  
  215.  
  216. NSTUB(0xFF5810A0, PackMem_RegisterEDmacCompleteCBRForMemorySuite)
  217. NSTUB(0xFF58113C, PackMem_RegisterEDmacPopCBRForMemorySuite)
  218. NSTUB(0xFF580DB4, PackMem_SetEDmacForMemorySuite)
  219. NSTUB(0xFF580FD0, PackMem_PopEDmacForMemorySuite)
  220. NSTUB(0xFF580EC8, PackMem_StartEDmac)
  221.  
  222. /**** NOT UPDATED FOR 1.2.1 ****/
  223. /** Making the card bootable (not working on 5D3) **/
  224. // NSTUB(0xff6ab324, cfReadBlk)
  225. // NSTUB(   0x20890, cf_device) idk...
  226. // NSTUB(0xff6b16ac, sdReadBlk)
  227. // NSTUB(   0x399D4, sd_device)
  228. // NSTUB(0xff5bb2c8, fsuDecodePartitionTable) // AJ_fsuGetPart_related
  229.  
  230. /** Unused **/
  231. // NSTUB(0x23D08, pre_isr_hook)
  232. // NSTUB(0x23D0C, post_isr_hook)
  233. // NSTUB(0xff181314, ENCODE_StartEncodeJpeg)
  234. // NSTUB(0xFF9EB650 - RAM_OFFSET, dma_memcpy)
  235. // NSTUB(0xFF195084, GUI_SetRollingPitchingLevelStatus) // has side effects
  236. // NSTUB(0xff1064c8, PD_RemoteRelease)
  237. // NSTUB(0xff144a3c, copy_malloc_info_maybe)
  238. // NSTUB(0xff9b1be0 - RAM_OFFSET, LightMeasure_n_Callback_r0) - looks a bit different, disabling for now
  239. // NSTUB(0xFF0DEE48, GUI_ChangeMode)
  240. // NSTUB(0xff19d7e8, GUI_GetFirmVersion)
  241. // NSTUB(0xff44a668, ctrlman_dispatch_event)
  242. // NSTUB(0xff2f3f8c, MuteOff_0)
  243. // NSTUB(0xff2f3f44, MuteOn_0)
  244. // NSTUB(0xff12e110, SetBitmapVramAddress)
  245. // NSTUB(0xff44a7b8, gui_task_create)
  246. // NSTUB(0xFF44A870, gui_task_destroy)
  247. // NSTUB(0xff4b09e4, LiveViewApp_handler_BL_JudgeBottomInfoDispTimerState)
  248. // NSTUB(0xff4b1cc4, LiveViewApp_handler_end) // start of next function
  249. // NSTUB(0xff13b630, register_func)
  250. // NSTUB(0xFF9E9AC0 - RAM_OFFSET, GetSizeOfMemoryChunk)
  251. // NSTUB(0xFF9E9A90 - RAM_OFFSET, GetRemainOfMemoryChunk)
  252. // NSTUB(0xFF9E9ED8 - RAM_OFFSET, GetNumberOfChunks)
  253. // NSTUB(0xFF9E9DF8 - RAM_OFFSET, GetSizeOfMemorySuite)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×