Advertisement
Guest User

stub.s

a guest
Nov 29th, 2014
135
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 11.69 KB
  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.0.0 firmware for the 100D.
  6.  *
  7.  *
  8.  * // COMMENTED OUT = NEED TO FIND
  9.  *
  10.  */
  11. /*
  12.  * Copyright (C) 2012 Magic Lantern Team
  13.  *
  14.  * This program is free software; you can redistribute it and/or
  15.  * modify it under the terms of the GNU General Public License
  16.  * as published by the Free Software Foundation; either version 2
  17.  * of the License, or (at your option) any later version.
  18.  *
  19.  * This program is distributed in the hope that it will be useful,
  20.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22.  * GNU General Public License for more details.
  23.  *
  24.  * You should have received a copy of the GNU General Public License
  25.  * along with this program; if not, write to the
  26.  * Free Software Foundation, Inc.,
  27.  * 51 Franklin Street, Fifth Floor,
  28.  * Boston, MA  02110-1301, USA.
  29.  */
  30.  
  31. #include <stub.h>
  32.  
  33. .text
  34.  
  35. NSTUB( ROMBASEADDR, firmware_entry )
  36.  
  37. #define RAM_OFFSET 0xFFA97810 //~ Subtract 0x1900 from assert_0 at ROM:FFA99110.
  38.  
  39. /** Startup **/
  40. NSTUB(0xFF0C1BD0,  cstart)
  41. NSTUB(0xFFAF5BB8 - RAM_OFFSET,  bzero32)
  42. NSTUB(0xFFA9A738 - RAM_OFFSET,  create_init_task)
  43. NSTUB(0xFF0C56C0,  init_task)
  44. //NSTUB(   0x119c884,  additional_version)                      // just after string: "***** PROP_ARTIST size = 0[%d]"
  45.  
  46. /** Misc **/
  47. //NSTUB(0xC0220000,  camera_engine)
  48. NSTUB(0xFF13AB60,  LoadCalendarFromRTC)                 // TODO: verify
  49. NSTUB(0xFFAD03A0 - RAM_OFFSET,  vsnprintf)
  50.  
  51. /** File I/O **/
  52. //Done and finished!
  53. NSTUB(0x12a014c, _FIO_CreateFile)
  54. NSTUB(0x12a0100, _FIO_OpenFile)                            // or OpenFile?
  55. NSTUB(0x12a0354,  FIO_CloseFile)
  56. NSTUB(0xFF33E5B0,  FIO_SeekSkipFile)
  57. NSTUB(0x12a0198,  FIO_SeekFile)
  58. NSTUB(0x12a0308,  FIO_ReadFile)
  59. NSTUB(0x12a02bc,  FIO_WriteFile)
  60. NSTUB(0x12a11cc, _FIO_GetFileSize)
  61. NSTUB(0x12a039c, _FIO_RemoveFile)
  62. //NSTUB(0x12a09b4,  FIO_RenameFile)
  63. NSTUB(0x12a05b0, _FIO_CreateDirectory)
  64. //RemoveDirectory 12a05f0
  65. NSTUB(0x12a0630, _FIO_FindFirstEx)
  66. NSTUB(0x12a0678,  FIO_FindNextEx)
  67. NSTUB(0x12a0764,  FIO_FindClose)                           // proper name: FindClose
  68.  
  69. /** Bitmap **/
  70. NSTUB(   0x8ED9C,  bmp_vram_info)                           // look in SetBitmapVramAddress - as in 60D
  71. //NSTUB(   0x8D59C,  LCD_Palette)                             // in InitializeBitmapDisplayDevice, right after 0xc0f14800
  72. NSTUB( 0x8D59C, LCD_Palette)  // TerminateBitmapDisplayDevice
  73.  
  74. /** Debug messages **/
  75. NSTUB(   0x66108,  dm_names)                                // first 'LDR R4, =foo' in any debug function with string "./DbgMgr/DbgMgr.c"
  76. NSTUB(0xFFA9C284 - RAM_OFFSET,  DryosDebugMsg)
  77. //NSTUB(0xFFA9C5F0 - RAM_OFFSET,  dm_set_store_level)
  78. //NSTUB(0xFFA9C588 - RAM_OFFSET,  dm_set_print_level)
  79.  
  80. /** Task sleep **/
  81. NSTUB(0xFFA9F144 - RAM_OFFSET,  msleep)
  82.  
  83. /** ResLock **/
  84. NSTUB(0xFF2B602C,  CreateResLockEntry)
  85.  
  86. /** Semaphores **/
  87. NSTUB(0xFFA9EB08 - RAM_OFFSET,  create_named_semaphore)
  88. NSTUB(0xFFA9EC68 - RAM_OFFSET,  take_semaphore)
  89. NSTUB(0xFFA9ED54 - RAM_OFFSET,  give_semaphore)
  90.  
  91. /** Recursive locks **/
  92. NSTUB(0xFFAA2DFC - RAM_OFFSET,  CreateRecursiveLock)
  93. NSTUB(0xFFACED0C - RAM_OFFSET,  AcquireRecursiveLock)       // AJ_KernelDry_KerRLock.c
  94. NSTUB(0xFFACEE20 - RAM_OFFSET,  ReleaseRecursiveLock)       // AJ_KernelDry_KerRLock.c_p2
  95.  
  96. /** Message queues **/
  97. NSTUB(0xFFAA2C14 - RAM_OFFSET,  msg_queue_create)
  98. NSTUB(0xFFACEBC0 - RAM_OFFSET,  msg_queue_post)
  99. NSTUB(0xFFACE9D4 - RAM_OFFSET,  msg_queue_receive)
  100.  
  101. /** Tasks **/
  102. NSTUB(0xFFA9F1F8 - RAM_OFFSET,  task_create)
  103. NSTUB(   0x652C0,  task_dispatch_hook)
  104. NSTUB(0xFFAA4880 - RAM_OFFSET,  task_trampoline)
  105.  
  106. /** Task info **/
  107. NSTUB(   0x6676C,  task_max)               // TODO: verify, likely wrong
  108. NSTUB(0xFFA99DAC - RAM_OFFSET,  get_current_task)
  109. NSTUB(0xFFAE3694 - RAM_OFFSET,  is_taskid_valid)            // AJ_task_trampoline_related_p10
  110. //NSTUB(0xFFAA7330 - RAM_OFFSET,  get_obj_attr)               // AJ_checks_if_Process_id_created_by_Dryos
  111.  
  112. ///** Interrupts **/
  113. //NSTUB(0xFF0C10B0,  cli_save)
  114. //NSTUB(0xFF0C10C4,  sei_restore)
  115.  
  116. /** Eventprocs (call by name) **/
  117. NSTUB(0xFF143278,  call)
  118.  
  119. /** ExMem **/
  120. //NSTUB(0x1146e64,  AllocateContinuousMemoryResource)        // m_pfContAllocMemoryCBR
  121. //NSTUB(0x1146e18,  AllocateMemoryResource)                  // m_pfAllocMemoryCBR
  122. NSTUB(0xFFAA1D4C - RAM_OFFSET,  CreateMemorySuite)
  123. NSTUB(0xFFAA199C - RAM_OFFSET,  DeleteMemorySuite)
  124. //NSTUB(0x1146e18,  FreeMemoryResource)                      // m_pfFreeMemoryCBR
  125. //NSTUB(0xFF9FB990 - RAM_OFFSET,  GetFirstChunkFromSuite)
  126. //NSTUB(0xFF9FB368 - RAM_OFFSET,  GetMemoryAddressOfMemoryChunk)
  127. //NSTUB(0xFF9FC12C - RAM_OFFSET,  GetNextMemoryChunk)
  128. NSTUB(0xFFAA0D88 - RAM_OFFSET,  CreateMemoryChunk)
  129. NSTUB(0xFFAA159C - RAM_OFFSET,  AddMemoryChunk)
  130.  
  131. /** SRM JobMem **/
  132. NSTUB(0xFF0E6494,  SRM_AllocateMemoryResourceFor1stJob)
  133. NSTUB(0xFF0EA030,  SRM_FreeMemoryResourceFor1stJob)
  134.  
  135. /** GUI **/
  136. NSTUB(0x10d6348,  GUI_Control) //changed
  137. NSTUB(0x1196be8,  SetGUIRequestMode) //changed
  138. NSTUB(0xFF0D5F74,  gui_main_task)
  139. NSTUB(   0x6557C,  gui_main_struct)                         // in gui_main_task
  140. NSTUB(0xFF0D69EC,  gui_init_end)
  141. //NSTUB(0xFF1B2C88,  gui_massive_event_loop)
  142. NSTUB(   0x761C0, gui_task_list) // TODO: verify
  143. //NSTUB(0x14bc2c4 - RAM_OFFSET,  gui_task_list) //changed              // by string "DispatchingStackPointer != SIZE_OF_DISPATCHING_STACK -2"
  144.  
  145. /** Dialog API **/
  146. //NSTUB(0xFF4BE61C,  CreateDialogBox)
  147. //NSTUB(0xFF4BD5B4,  DeleteDialogBox)
  148. NSTUB(0xFF4BE8D8,  dialog_redraw)
  149. NSTUB(0xFF5345C4,  dialog_set_property_str)
  150. //NSTUB(0xFF4E1F80,  RedrawDisplay)
  151.  
  152. /** Dialog handlers **/
  153. //NSTUB(0xFF6B4DD8,  LiveViewLevelApp_handler)
  154. //NSTUB(0xFF623240,  LiveViewWbApp_handler)                   // absent in 100d?!
  155. NSTUB(0xFF541510,  LiveViewApp_handler)
  156. NSTUB(0xFF3AE880,  PlayMain_handler)                        // TODO: verify
  157. NSTUB(0xFF55F944,  PlayMovieGuideApp_handler)               // TODO: verify
  158. NSTUB(0xFF525714,  ErrCardForLVApp_handler)                 // TODO: verify
  159. NSTUB(0xFF5267D8,  ErrForCamera_handler)                    // ERR70, ERR80 etc (DlgErrForCamera.c, AJ_DIALOG.HANDLER_DlgErrForCamera.c)
  160.                                                             // TODO: verify. FF5265E8?
  161. //NSTUB(0xFF53B5A4,  HideUnaviFeedBack_maybe)                 // look for StartUnaviFeedBackTimer
  162. NSTUB(0xFF54E650,  ShootOlcApp_handler)                     // AJ_DIALOG.HANDLER_DlgShootOlcInfo.c
  163.                                                             // TODO: verify
  164.  
  165. /** Properties **/
  166. NSTUB(0xFF127F14,  prop_register_slave)
  167. NSTUB(0xFF12874C, _prop_cleanup)
  168. //NSTUB(0xFF128680,  prop_deliver)
  169. NSTUB(0xFF128104, _prop_request_change)
  170. //NSTUB(0xFF12886C, _prop_get_value)                          // unsafe
  171.  
  172. /** Memory allocation **/
  173. NSTUB(0xFF0C8FC8,  _malloc)
  174. NSTUB(0xFF0C9020,  _free)                                    // see "can't malloc"
  175. NSTUB(0xFFAA0088 - RAM_OFFSET,  _AllocateMemory)
  176. NSTUB(0x120328c - RAM_OFFSET,  _FreeMemory)
  177. NSTUB(0xFFAD2348 - RAM_OFFSET,  _alloc_dma_memory)
  178. NSTUB(0xFFAD237C - RAM_OFFSET,  _free_dma_memory)
  179. NSTUB(0xFFA9FE28 - RAM_OFFSET,  GetMemoryInformation)
  180. NSTUB(0xFFA9FDD4 - RAM_OFFSET,  GetSizeOfMaxRegion)
  181.  
  182. /** ExMem **/
  183. NSTUB(0x1146e18,  AllocateMemoryResource)                  // m_pfAllocMemoryCBR
  184. NSTUB(0x1146e68,  AllocateContinuousMemoryResource)        // m_pfContAllocMemoryCBR
  185. NSTUB(0x1146f7c,  FreeMemoryResource)                      // m_pfFreeMemoryCBR
  186.  
  187. NSTUB(0xFFAA16B8 - RAM_OFFSET,  GetFirstChunkFromSuite)   // TODO: verify
  188. NSTUB(0xFFAA23BC - RAM_OFFSET,  GetNextMemoryChunk)
  189. NSTUB(0xFFAA1334 - RAM_OFFSET,  GetMemoryAddressOfMemoryChunk)
  190.  
  191. /** Engio **/
  192. //NSTUB(0xFF2B2254, _engio_write)
  193. NSTUB(0xFF2B1FD8,  shamem_read)                             // AJ_0x8FB0_engio_struct_n_R0_manipulation_to_get_ptr
  194. NSTUB(0xFF2B1F3C, _EngDrvOut)                               // AJ_EngDrvOut_1xVar_to_ShadowStruct
  195.  
  196. /** PTP **/
  197. //NSTUB(0xFF296974,  ptp_register_handler)
  198.  
  199. /** GUI timers **/
  200. NSTUB(0xFF531AB8,  CancelDateTimer)                         // Look for "CancelDateTimer" or "StopDateTimer" (7D)
  201. NSTUB(0xFFAA41D8 - RAM_OFFSET,  SetTimerAfter)
  202. NSTUB(0xFF9F79D8 - RAM_OFFSET,  SetHPTimerAfterNow)
  203. NSTUB(0xFFA9D9F0 - RAM_OFFSET,  SetHPTimerNextTick)
  204. NSTUB(0xFFAA43D8 - RAM_OFFSET,  CancelTimer) // TODO: verify .. wrong on 5D3 already?
  205.  
  206. /** Audio **/
  207. //NSTUB(0xFF136F5C, _audio_ic_read)                           // needs work
  208. //NSTUB(0xFF136EA4, _audio_ic_write)
  209.  
  210. /** ASIF **/
  211. ////~ idk, audio stuff changed like usual. should be mostly right.
  212. //NSTUB(0xFF2AE580,  PowerAudioOutput)
  213. //NSTUB(0xFF1127AC,  StartASIFDMADAC)
  214. //NSTUB(0xFF1123D8,  StartASIFDMAADC)
  215. //NSTUB(0xFF112A2C,  StopASIFDMADAC)
  216. //NSTUB(0xFF112E70,  SetNextASIFADCBuffer)
  217. //NSTUB(0xFF113058,  SetNextASIFDACBuffer)
  218. //NSTUB(0xFF1187B0,  SetSamplingRate)
  219. //NSTUB(0xFF1370A4,  SetAudioVolumeOut)
  220.  
  221. ///** EDMAC routines */
  222. //NSTUB(0xFFACC1AC - RAM_OFFSET,  SetEDmac)
  223. //NSTUB(0xFFACC558 - RAM_OFFSET,  StartEDmac)
  224. ////NSTUB(0x12B38, PopEDmac)
  225. //NSTUB(0xFFACC8C4 - RAM_OFFSET,  PopEDmac)
  226. //NSTUB(0xFFACC87C - RAM_OFFSET,  AbortEDmac)
  227. //NSTUB(0xFFACC30C - RAM_OFFSET,  ConnectWriteEDmac)
  228. //NSTUB(0xFFACC3D0 - RAM_OFFSET,  ConnectReadEDmac)
  229.  
  230. ///** register/unregister CBR names **/
  231. //NSTUB(0xFFACC91C - RAM_OFFSET,  RegisterEDmacCompleteCBR)
  232. //NSTUB(0xFFACC9B0 - RAM_OFFSET,  RegisterEDmacAbortCBR)
  233. //NSTUB(0xFFACCA44 - RAM_OFFSET,  RegisterEDmacPopCBR)
  234. //NSTUB(0xFFACC958 - RAM_OFFSET,  UnregisterEDmacCompleteCBR)
  235. //NSTUB(0xFFACC9EC - RAM_OFFSET,  UnregisterEDmacAbortCBR)
  236. //NSTUB(0xFFACCA80 - RAM_OFFSET,  UnregisterEDmacPopCBR)
  237.  
  238.  
  239. //NSTUB(0xFF60842C,  PackMem_RegisterEDmacCompleteCBRForMemorySuite)
  240. //NSTUB(0xFF6084C8,  PackMem_RegisterEDmacPopCBRForMemorySuite)
  241. //NSTUB(0xFF608140,  PackMem_SetEDmacForMemorySuite)
  242. //NSTUB(0xFF60835C,  PackMem_PopEDmacForMemorySuite)
  243. //NSTUB(0xFF608254,  PackMem_StartEDmac)
  244.  
  245.  
  246.  
  247. /** Making the card bootable (not working on 5D3) **/
  248. //NSTUB(0xFF64BB20,  cfReadBlk)
  249. // NSTUB(   0x20890, cf_device) idk...
  250. //NSTUB(0xFF652028,  sdReadBlk)
  251. NSTUB(   0x7FB50,  sd_device)
  252. NSTUB(0xFF4F64AC,  fsuDecodePartitionTable)                 // AJ_fsuGetPart_related
  253.  
  254. //NSTUB(0xFF2B11EC,  mvrFixQScale)
  255. //NSTUB(   0x6BCE4,  mvr_config)
  256. //NSTUB(0xFF2B0CE4,  mvrSetDefQScale)
  257. //NSTUB(0xFF139008,  NormalDisplay)
  258. //NSTUB(0xFF138FCC,  MirrorDisplay)
  259. //NSTUB(0xFF138F90,  ReverseDisplay)
  260. NSTUB(0xFF70B978,  LiveViewShutterApp_handler)   // TODO: verify
  261.  
  262.  
  263. /** EVERYTHING BELOW IS UNTOUCHED FROM 5D3 **/
  264. /** Unused **/
  265. // NSTUB(0x23D08, pre_isr_hook)
  266. // NSTUB(0x23D0C, post_isr_hook)
  267. // NSTUB(0xff181314, ENCODE_StartEncodeJpeg)
  268. // NSTUB(0xFF9EB650 - RAM_OFFSET, dma_memcpy)
  269. // NSTUB(0xFF195084, GUI_SetRollingPitchingLevelStatus) // has side effects
  270. // NSTUB(0xff1064c8, PD_RemoteRelease)
  271. // NSTUB(0xff144a3c, copy_malloc_info_maybe)
  272. // NSTUB(0xff9b1be0 - RAM_OFFSET, LightMeasure_n_Callback_r0) - looks a bit different, disabling for now
  273. // NSTUB(0xFF0DEE48, GUI_ChangeMode)
  274. // NSTUB(0xff19d7e8, GUI_GetFirmVersion)
  275. // NSTUB(0xff44a668, ctrlman_dispatch_event)
  276. // NSTUB(0xff2f3f8c, MuteOff_0)
  277. // NSTUB(0xff2f3f44, MuteOn_0)
  278. // NSTUB(0xff12e110, SetBitmapVramAddress)
  279. // NSTUB(0xff44a7b8, gui_task_create)
  280. // NSTUB(0xFF44A870, gui_task_destroy)
  281. // NSTUB(0xff4b09e4, LiveViewApp_handler_BL_JudgeBottomInfoDispTimerState)
  282. // NSTUB(0xff4b1cc4, LiveViewApp_handler_end) // start of next function
  283. // NSTUB(0xff13b630, register_func)
  284. // NSTUB(0xFF9E9AC0 - RAM_OFFSET, GetSizeOfMemoryChunk)
  285. // NSTUB(0xFF9E9A90 - RAM_OFFSET, GetRemainOfMemoryChunk)
  286. // NSTUB(0xFF9E9ED8 - RAM_OFFSET, GetNumberOfChunks)
  287. // NSTUB(0xFF9E9DF8 - RAM_OFFSET, GetSizeOfMemorySuite)
Advertisement
RAW Paste Data Copied
Advertisement