priv-vars.h 734 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef __GBLIBC_PRIV_VARS_H_
  2. #define __GBLIBC_PRIV_VARS_H_
  3. #include <list.h>
  4. #include <stdint.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. struct mem {
  9. uint32_t sz;
  10. uint32_t flag;
  11. };
  12. #define FILE_READ (1 << 0)
  13. #define FILE_WRITE (1 << 1)
  14. #define FILE_ERROR (1 << 2)
  15. #define FILE_EOF (1 << 3)
  16. void** __start_brk_location(void);
  17. void** __curr_brk_location(void);
  18. list_head* __io_files_location(void);
  19. size_t* __environ_size_location(void);
  20. #undef start_brk
  21. #define start_brk (*__start_brk_location())
  22. #undef curr_brk
  23. #define curr_brk (*__curr_brk_location())
  24. #undef iofiles
  25. #define iofiles (*__io_files_location())
  26. #undef environ_size
  27. #define environ_size (*__environ_size_location())
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif