valgrind.patch 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. --- valgrind-2.1.1.orig/coregrind/vg_syscalls.c 2004-02-24 17:07:10.000000000 -0700
  2. +++ valgrind-2.1.1/coregrind/vg_syscalls.c 2004-04-16 18:13:11.000000000 -0600
  3. @@ -3231,6 +3245,93 @@
  4. case CDROM_CLEAR_OPTIONS: /* 0x5321 */
  5. break;
  6. + /* Stuff added by Erik Andersen for general device probing/handling */
  7. +#define BLKSSZGET _IO(0x12,104)
  8. + case BLKSSZGET:
  9. + SYSCALL_TRACK( pre_mem_write, tid, "ioctl(BLKSSZGET)", arg3,
  10. + sizeof(int));
  11. + break;
  12. +#undef _IOR
  13. +#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
  14. +#define BLKGETSIZE64 _IOR(0x12,114,sizeof(uint64_t))
  15. + case BLKGETSIZE64:
  16. + SYSCALL_TRACK( pre_mem_write, tid, "ioctl(BLKGETSIZE64)", arg3,
  17. + sizeof(uint64_t));
  18. + break;
  19. +#define HDIO_GETGEO 0x0301 /* get device geometry */
  20. + case HDIO_GETGEO:
  21. + {
  22. + struct hd_geometry {
  23. + unsigned char heads;
  24. + unsigned char sectors;
  25. + unsigned short cylinders;
  26. + unsigned long start;
  27. + };
  28. +
  29. + SYSCALL_TRACK( pre_mem_write, tid, "ioctl(HDIO_GETGEO)", arg3,
  30. + sizeof(struct hd_geometry));
  31. + }
  32. + break;
  33. +#define HDIO_GET_IDENTITY 0x030d /* get IDE identification info */
  34. +#define struct_hd_driveid_size 256 /* ATA6 specifies words 0-255 */
  35. + case HDIO_GET_IDENTITY:
  36. + SYSCALL_TRACK( pre_mem_write, tid, "ioctl(HDIO_GET_IDENTITY)", arg3,
  37. + struct_hd_driveid_size);
  38. + break;
  39. +#define SCSI_IOCTL_GET_IDLUN 0x5382
  40. + case SCSI_IOCTL_GET_IDLUN:
  41. + {
  42. + struct scsi_idlun
  43. + {
  44. + int mux4;
  45. + int host_unique_id;
  46. +
  47. + };
  48. +
  49. + SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_GET_IDLUN)", arg3,
  50. + sizeof(struct scsi_idlun));
  51. + }
  52. + break;
  53. +#define SCSI_IOCTL_SEND_COMMAND 1
  54. + case SCSI_IOCTL_SEND_COMMAND:
  55. + SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_SEND_COMMAND)", arg3,
  56. + ((2 * sizeof(unsigned int)) + 6 + 512));
  57. + break;
  58. +#define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
  59. + case SCSI_IOCTL_GET_BUS_NUMBER:
  60. + SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_GET_BUS_NUMBER)", arg3,
  61. + sizeof(int));
  62. + break;
  63. +#define SCSI_IOCTL_PROBE_HOST 0x5385
  64. + case SCSI_IOCTL_PROBE_HOST:
  65. + {
  66. + int xxxx;
  67. + char *array = (char*)arg3;
  68. + xxxx = array[0] + (array[1]<<8) + (array[2]<<16) + (array[3]<<24);
  69. + SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_PROBE_HOST)", arg3,
  70. + sizeof(int));
  71. + }
  72. + break;
  73. +#define BLKFLSBUF _IO(0x12,97)
  74. + case BLKFLSBUF:
  75. + break;
  76. +#define BLKRRPART _IO(0x12,95)
  77. + case BLKRRPART:
  78. + break;
  79. +#define MTIOCTOP _IO(0x6d,0x1)
  80. + case MTIOCTOP:
  81. + {
  82. + struct mtop
  83. + {
  84. + short int mt_op; /* Operations defined below. */
  85. + int mt_count; /* How many of them. */
  86. + };
  87. + SYSCALL_TRACK( pre_mem_write, tid, "ioctl(MTIOCTOP)", arg3,
  88. + sizeof(struct mtop));
  89. + }
  90. + break;
  91. +
  92. +
  93. /* We don't have any specific information on it, so
  94. try to do something reasonable based on direction and
  95. size bits. The encoding scheme is described in
  96. --- valgrind-2.1.1.orig/coregrind/vg_libpthread.c 2004-03-08 08:57:17.000000000 -0700
  97. +++ valgrind-2.1.1/coregrind/vg_libpthread.c 2004-04-16 17:58:31.000000000 -0600
  98. @@ -3175,6 +3175,8 @@
  99. pthread_mutex). So basically, this is completely broken on recent
  100. glibcs. */
  101. +#ifndef __UCLIBC__
  102. +
  103. #undef _IO_flockfile
  104. void _IO_flockfile ( _IO_FILE * file )
  105. {
  106. @@ -3192,6 +3194,7 @@
  107. weak_alias(_IO_funlockfile, funlockfile);
  108. #endif
  109. +#endif
  110. /* This doesn't seem to be needed to simulate libpthread.so's external
  111. interface, but many people complain about its absence. */