load_kernel.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef load_kernel_h
  2. #define load_kernel_h
  3. /*-------------------------------------------------------------------------
  4. * Filename: load_kernel.h
  5. * Version: $Id: load_kernel.h,v 1.3 2002/01/25 01:34:11 nyet Exp $
  6. * Copyright: Copyright (C) 2001, Russ Dill
  7. * Author: Russ Dill <Russ.Dill@asu.edu>
  8. * Description: header for load kernel modules
  9. *-----------------------------------------------------------------------*/
  10. /*
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 2 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25. *
  26. */
  27. /* this struct is very similar to mtd_info */
  28. struct part_info {
  29. u32 size; /* Total size of the Partition */
  30. /* "Major" erase size for the device. Naïve users may take this
  31. * to be the only erase size available, or may use the more detailed
  32. * information below if they desire
  33. */
  34. u32 erasesize;
  35. /* Where in memory does this partition start? */
  36. char *offset;
  37. /* used by jffs2 set to NULL */
  38. void *jffs2_priv;
  39. /* private filed used by user */
  40. void *usr_priv;
  41. };
  42. struct part_info*
  43. jffs2_part_info(int part_num);
  44. struct kernel_loader {
  45. /* Return true if there is a kernel contained at src */
  46. int (* check_magic)(struct part_info *part);
  47. /* load the kernel from the partition part to dst, return the number
  48. * of bytes copied if successful, zero if not */
  49. u32 (* load_kernel)(u32 *dst, struct part_info *part, const char *kernel_filename);
  50. /* A brief description of the module (ie, "cramfs") */
  51. char *name;
  52. };
  53. #define ldr_strlen strlen
  54. #define ldr_strncmp strncmp
  55. #define ldr_memcpy memcpy
  56. #define putstr(x) printf("%s", x)
  57. #define mmalloc malloc
  58. #define UDEBUG printf
  59. #define putnstr(str, size) printf("%*.*s", size, size, str)
  60. #define ldr_output_string(x) puts(x)
  61. #define putLabeledWord(x, y) printf("%s %08x\n", x, (unsigned int)y)
  62. #define led_blink(x, y, z, a)
  63. #endif /* load_kernel_h */