debugfs.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* Xtensa Debug-FileSystem definitions */
  2. /*
  3. * Copyright (c) 2005-2009 by Tensilica Inc. ALL RIGHTS RESERVED.
  4. * These coded instructions, statements, and computer programs are the
  5. * copyrighted works and confidential proprietary information of Tensilica Inc.
  6. * They may not be modified, copied, reproduced, distributed, or disclosed to
  7. * third parties in any manner, medium, or form, in whole or in part, without
  8. * the prior written consent of Tensilica Inc.
  9. */
  10. #ifndef __DEBUGFS_H__
  11. #define __DEBUGFS_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <unistd.h>
  16. #include <fcntl.h>
  17. #include <stdlib.h>
  18. int xt_dbfs_open(const char *pathname, int flags, mode_t mode);
  19. int xt_dbfs_ftruncate(int fd, off_t length);
  20. int xt_dbfs_truncate(const char * filename, off_t length);
  21. int xt_dbfs_creat(const char *pathname, mode_t mode);
  22. int xt_dbfs_errno(void);
  23. int xt_dbfs_lseek(int fd, off_t offset, int whence);
  24. ssize_t xt_dbfs_write(int fd, const void * buf, size_t bytes);
  25. ssize_t xt_dbfs_open_append_close(const char * filename, int align,
  26. const void * buf, size_t bytes);
  27. ssize_t xt_dbfs_read(int fd, void * buf, size_t bytes);
  28. int xt_dbfs_close(int fd);
  29. int xt_dbfs_unlink(const char *pathname);
  30. /* By default, this function is a wrapper around sbrk, and follows
  31. sbrk semantics:
  32. On success, it returns increment bytes of memory allocated from
  33. system memory.
  34. On failure, it returns 0xFFFFFFFF
  35. If you want to use a method of allocating memory other than sbrk,
  36. implement xt_dbfs_sbrk in your own sources, and the linker will
  37. automatically use that copy.
  38. */
  39. void * xt_dbfs_sbrk(int increment);
  40. #ifdef REPLACE_FS_WITH_DBFS
  41. #define open xt_dbfs_open
  42. #define close xt_dbfs_close
  43. #define creat xt_dbfs_creat
  44. #define lseek xt_dbfs_lseek
  45. #define write xt_dbfs_write
  46. #define read xt_dbfs_read
  47. #define close xt_dbfs_close
  48. #define unlink xt_dbfs_unlink
  49. #define rmdir NOT_IMPLEMENTED_IN_DBFS
  50. #define opendir NOT_IMPLEMENTED_IN_DBFS
  51. #define closedir NOT_IMPLEMENTED_IN_DBFS
  52. #define dirfs NOT_IMPLEMENTED_IN_DBFS
  53. #define readdir NOT_IMPLEMENTED_IN_DBFS
  54. #define scandir NOT_IMPLEMENTED_IN_DBFS
  55. #define seekdir NOT_IMPLEMENTED_IN_DBFS
  56. #define telldir NOT_IMPLEMENTED_IN_DBFS
  57. #define fcntl NOT_IMPLEMENTED_IN_DBFS
  58. #define dup2 NOT_IMPLEMENTED_IN_DBFS
  59. #define dup NOT_IMPLEMENTED_IN_DBFS
  60. #define flock NOT_IMPLEMENTED_IN_DBFS
  61. #define lockf NOT_IMPLEMENTED_IN_DBFS
  62. #define link NOT_IMPLEMENTED_IN_DBFS
  63. #define stat NOT_IMPLEMENTED_IN_DBFS
  64. #define fstat NOT_IMPLEMENTED_IN_DBFS
  65. #define lstat NOT_IMPLEMENTED_IN_DBFS
  66. #define chmod NOT_IMPLEMENTED_IN_DBFS
  67. #define fchmod NOT_IMPLEMENTED_IN_DBFS
  68. #define chmown NOT_IMPLEMENTED_IN_DBFS
  69. #define lchown NOT_IMPLEMENTED_IN_DBFS
  70. #define fchown NOT_IMPLEMENTED_IN_DBFS
  71. #endif
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75. #endif