kernel.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* kernel.h: Routines to handle automatic insertion of section contents in kernel format
  2. Copyright (C) 2003 Sebastian Reichelt, Kevin Kofler
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software Foundation,
  13. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  14. #ifndef INSERT_KERNEL_H
  15. #define INSERT_KERNEL_H
  16. #include "../generic.h"
  17. #include "ins_def.h"
  18. #include "../data.h"
  19. #include "model/list.h"
  20. // Append relocation entries in the format required by kernels. If
  21. // TargetSection is NULL, insert all relocation entries that point to
  22. // unhandled sections. Otherwise, insert all relocation entries pointing
  23. // to this section.
  24. // Warning: Inserting relocs is special: Since the relocs are changed
  25. // during the process, they can be inserted only once.
  26. BOOLEAN InsertKernelRelocs (SECTION *Section, SECTION *TargetSection);
  27. // Append relocation entries to TargetSection in the format required by
  28. // kernels. If TargetSection is NULL, AlwaysTerminate specifies whether
  29. // to insert the two terminating zero bytes anyway.
  30. // Warning: Inserting relocs is special: Since the relocs are changed
  31. // during the process, they can be inserted only once.
  32. BOOLEAN InsertKernelSectionRefs (SECTION *Section, SECTION *TargetSection, BOOLEAN AlwaysTerminate);
  33. // Append ROM calls in the format required by kernels.
  34. BOOLEAN InsertKernelROMCalls (SECTION *Section);
  35. // Append RAM calls in the format required by kernels.
  36. BOOLEAN InsertKernelRAMCalls (SECTION *Section);
  37. // Append library calls in the format required by kernels.
  38. BOOLEAN InsertKernelLibraries (SECTION *Section);
  39. #ifdef FARGO_SUPPORT
  40. // Append library calls in the format required by Fargo v0.2.0.
  41. BOOLEAN InsertFargo020Libraries (SECTION *Section);
  42. #endif /* FARGO_SUPPORT */
  43. // Append exported symbols in the format required by kernels. If
  44. // TrailingZeroBytes is FALSE, use the Fargo v0.2.x format without
  45. // trailing zero bytes.
  46. BOOLEAN InsertKernelExports (SECTION *Section, BOOLEAN TrailingZeroBytes);
  47. #endif