Symbols.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* -*- mode:c; c-file-style:"k&r"; c-basic-offset: 4; tab-width:4; indent-tabs-mode:nil; mode:auto-fill; fill-column:78; -*- */
  2. /* vim: set ts=4 sw=4 et tw=78 fo=cqt wm=0: */
  3. #include "pal.h"
  4. #include "pal_debug.h"
  5. #define symbol_addr(sym) \
  6. ({ void * _sym; \
  7. asm volatile ("movq " #sym "@GOTPCREL(%%rip), %0" \
  8. : "=r"(_sym)); \
  9. _sym; })
  10. #define print_symbol(sym) pal_printf(#sym " = %p\n", symbol_addr(sym))
  11. int main (int argc, char ** argv, char ** envp)
  12. {
  13. print_symbol(DkVirtualMemoryAlloc);
  14. print_symbol(DkVirtualMemoryFree);
  15. print_symbol(DkVirtualMemoryProtect);
  16. print_symbol(DkProcessCreate);
  17. print_symbol(DkProcessExit);
  18. print_symbol(DkProcessSandboxCreate);
  19. print_symbol(DkStreamOpen);
  20. print_symbol(DkStreamWaitForClient);
  21. print_symbol(DkStreamRead);
  22. print_symbol(DkStreamWrite);
  23. print_symbol(DkStreamDelete);
  24. print_symbol(DkStreamMap);
  25. print_symbol(DkStreamUnmap);
  26. print_symbol(DkStreamSetLength);
  27. print_symbol(DkStreamFlush);
  28. print_symbol(DkSendHandle);
  29. print_symbol(DkReceiveHandle);
  30. print_symbol(DkStreamAttributesQuery);
  31. print_symbol(DkStreamAttributesQuerybyHandle);
  32. print_symbol(DkStreamAttributesSetbyHandle);
  33. print_symbol(DkStreamGetName);
  34. print_symbol(DkStreamChangeName);
  35. print_symbol(DkThreadCreate);
  36. print_symbol(DkThreadDelayExecution);
  37. print_symbol(DkThreadYieldExecution);
  38. print_symbol(DkThreadExit);
  39. print_symbol(DkThreadResume);
  40. print_symbol(DkSetExceptionHandler);
  41. print_symbol(DkExceptionReturn);
  42. print_symbol(DkMutexCreate);
  43. print_symbol(DkMutexRelease);
  44. print_symbol(DkNotificationEventCreate);
  45. print_symbol(DkSynchronizationEventCreate);
  46. print_symbol(DkEventSet);
  47. print_symbol(DkEventClear);
  48. print_symbol(DkObjectsWaitAny);
  49. print_symbol(DkObjectClose);
  50. print_symbol(DkSystemTimeQuery);
  51. print_symbol(DkRandomBitsRead);
  52. print_symbol(DkInstructionCacheFlush);
  53. print_symbol(DkSegmentRegister);
  54. print_symbol(DkMemoryAvailableQuota);
  55. print_symbol(DkCreatePhysicalMemoryChannel);
  56. print_symbol(DkPhysicalMemoryCommit);
  57. print_symbol(DkPhysicalMemoryMap);
  58. return 0;
  59. }