va_server.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* va_server.h - kernel crash dump file translation library
  2. *
  3. * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
  4. * Copyright (C) 2002, 2003, 2004, 2005 David Anderson
  5. * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. All rights reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * 10/99, Dave Winchell, Initial release for kernel crash dump support.
  18. * 11/12/99, Dave Winchell, Add support for in memory dumps.
  19. */
  20. #include "vas_crash.h"
  21. extern int vas_page_size;
  22. extern u_long vas_base_va;
  23. int va_server_init(char *crash_file, u_long *start, u_long *end, u_long *stride);
  24. int va_server_init_v1(char *crash_file, u_long *start, u_long *end, u_long *stride);
  25. int vas_lseek(u_long position, int whence);
  26. int vas_lseek_v1(u_long position, int whence);
  27. size_t vas_read(void *buf_in, size_t count);
  28. size_t vas_read_v1(void *buf_in, size_t count);
  29. size_t vas_write(void *buf_in, size_t count);
  30. size_t vas_write_v1(void *buf_in, size_t count);
  31. void vas_free_data(u_long va);
  32. void vas_free_data_v1(u_long va);
  33. /* in-memory formats */
  34. struct map_hdr {
  35. struct crash_map_entry *map; /* array of map entries */
  36. int blk_size; /* blocksize for this map */
  37. };
  38. struct map_hdr_v1 {
  39. u_long start_va;
  40. u_long end_va;
  41. struct crash_map_entry_v1 *map; /* array of map entries */
  42. int map_entries; /* entries in array pointed to by map */
  43. u_long va_per_entry; /* va covered by each map_entry */
  44. int blk_offset; /* add this to start_blk in map_entry
  45. * this allows relocation of compressed data
  46. * while using original maps
  47. */
  48. int blk_size; /* blocksize for this map */
  49. struct map_hdr_v1 *next;
  50. };
  51. extern int clean_exit(int);