osapi-os-loader.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. ** File: osapi-os-loader.h
  3. **
  4. ** Copyright (c) 2004-2006, United States government as represented by the
  5. ** administrator of the National Aeronautics Space Administration.
  6. ** All rights reserved. This software was created at NASAs Goddard
  7. ** Space Flight Center pursuant to government contracts.
  8. **
  9. ** This is governed by the NASA Open Source Agreement and may be used,
  10. ** distributed and modified only pursuant to the terms of that agreement.
  11. **
  12. ** Author: Alan Cudmore - Code 582
  13. **
  14. ** Purpose: Contains functions prototype definitions and variables declarations
  15. ** for the OS Abstraction Layer, Object file loader API
  16. **
  17. ** $Revision: 1.5 $
  18. **
  19. ** $Date: 2013/07/25 10:02:08GMT-05:00 $
  20. **
  21. ** $Log: osapi-os-loader.h $
  22. ** Revision 1.5 2013/07/25 10:02:08GMT-05:00 acudmore
  23. ** removed circular include "osapi.h"
  24. ** Revision 1.4 2010/11/12 12:00:18GMT-05:00 acudmore
  25. ** replaced copyright character with (c) and added open source notice where needed.
  26. ** Revision 1.3 2010/02/01 12:38:06EST acudmore
  27. ** added return code to OS_ModuleTableInit
  28. ** Revision 1.2 2008/06/20 15:13:43EDT apcudmore
  29. ** Checked in new Module loader/symbol table functionality
  30. ** Revision 1.1 2008/04/20 22:36:02EDT ruperera
  31. ** Initial revision
  32. ** Member added to project c:/MKSDATA/MKS-REPOSITORY/MKS-OSAL-REPOSITORY/src/os/inc/project.pj
  33. ** Revision 1.1 2008/02/07 11:08:24EST apcudmore
  34. ** Initial revision
  35. ** Member added to project d:/mksdata/MKS-OSAL-REPOSITORY/src/os/inc/project.pj
  36. **
  37. **
  38. */
  39. #ifndef _osapi_loader_
  40. #define _osapi_loader_
  41. /*
  42. ** Defines
  43. */
  44. /*
  45. ** Typedefs
  46. */
  47. typedef struct
  48. {
  49. uint32 valid;
  50. uint32 code_address;
  51. uint32 code_size;
  52. uint32 data_address;
  53. uint32 data_size;
  54. uint32 bss_address;
  55. uint32 bss_size;
  56. uint32 flags;
  57. } OS_module_address_t;
  58. typedef struct
  59. {
  60. int free;
  61. uint32 entry_point;
  62. uint32 host_module_id;
  63. char filename[OS_MAX_PATH_LEN];
  64. char name[OS_MAX_API_NAME];
  65. OS_module_address_t addr;
  66. } OS_module_record_t;
  67. /*
  68. ** Loader API
  69. */
  70. int32 OS_ModuleTableInit ( void );
  71. int32 OS_SymbolLookup (uint32 *symbol_address, char *symbol_name );
  72. int32 OS_SymbolTableDump ( char *filename, uint32 size_limit );
  73. int32 OS_ModuleLoad ( uint32 *module_id, char *module_name, char *filename );
  74. int32 OS_ModuleUnload ( uint32 module_id );
  75. int32 OS_ModuleInfo ( uint32 module_id, OS_module_record_t *module_info );
  76. #endif