buildrootschalter/sources/valgrind.patch

158 lines
5.7 KiB
Diff
Raw Normal View History

2003-08-17 12:20:48 +02:00
diff -urN valgrind-20030725.orig/coregrind/vg_intercept.c valgrind-20030725/coregrind/vg_intercept.c
--- valgrind-20030725.orig/coregrind/vg_intercept.c 2003-07-13 13:20:57.000000000 -0600
2003-10-19 09:36:18 +02:00
+++ valgrind-20030725/coregrind/vg_intercept.c 2003-10-13 15:06:33.000000000 -0600
2003-08-17 12:20:48 +02:00
@@ -827,8 +827,10 @@
void VG_(__libc_freeres_wrapper)( void )
{
int res;
+#ifndef __UCLIBC__
extern void __libc_freeres(void);
__libc_freeres();
+#endif
VALGRIND_MAGIC_SEQUENCE(res, 0 /* default */,
VG_USERREQ__LIBC_FREERES_DONE, 0, 0, 0, 0);
/*NOTREACHED*/
diff -urN valgrind-20030725.orig/coregrind/vg_libpthread.c valgrind-20030725/coregrind/vg_libpthread.c
--- valgrind-20030725.orig/coregrind/vg_libpthread.c 2003-07-10 18:02:07.000000000 -0600
2003-10-19 09:36:18 +02:00
+++ valgrind-20030725/coregrind/vg_libpthread.c 2003-10-13 15:06:33.000000000 -0600
2003-08-17 12:20:48 +02:00
@@ -3124,6 +3124,8 @@
/* I've no idea what these are, but they get called quite a lot.
Anybody know? */
+#ifndef __UCLIBC__
+
#undef _IO_flockfile
void _IO_flockfile ( _IO_FILE * file )
{
@@ -3139,6 +3141,7 @@
}
weak_alias(_IO_funlockfile, funlockfile);
+#endif
/* This doesn't seem to be needed to simulate libpthread.so's external
interface, but many people complain about its absence. */
diff -urN valgrind-20030725.orig/coregrind/vg_syscalls.c valgrind-20030725/coregrind/vg_syscalls.c
--- valgrind-20030725.orig/coregrind/vg_syscalls.c 2003-07-24 15:00:03.000000000 -0600
2003-10-19 09:36:18 +02:00
+++ valgrind-20030725/coregrind/vg_syscalls.c 2003-10-13 16:35:33.000000000 -0600
@@ -2427,6 +2427,119 @@
2003-08-17 12:20:48 +02:00
KERNEL_DO_SYSCALL(tid,res);
break;
+ /* Stuff added by Erik Andersen for general device probing/handling */
+#define BLKSSZGET _IO(0x12,104)
+ case BLKSSZGET:
2003-10-19 09:36:18 +02:00
+ SYSCALL_TRACK( pre_mem_write, tid, "ioctl(BLKSSZGET)", arg3,
+ sizeof(int));
2003-08-17 12:20:48 +02:00
+ KERNEL_DO_SYSCALL(tid,res);
+ if (!VG_(is_kerror)(res) && res == 0)
+ VG_TRACK( post_mem_write,arg3, sizeof(int));
+ break;
+#define BLKGETSIZE64 _IOR(0x12,114,sizeof(unsigned long long*))
+ case BLKGETSIZE64:
2003-10-19 09:36:18 +02:00
+ SYSCALL_TRACK( pre_mem_write, tid, "ioctl(BLKGETSIZE64)", arg3,
+ sizeof(unsigned long long));
2003-08-17 12:20:48 +02:00
+ KERNEL_DO_SYSCALL(tid,res);
+ if (!VG_(is_kerror)(res) && res == 0)
+ VG_TRACK( post_mem_write,arg3, sizeof(unsigned long long));
+ break;
2003-10-19 09:36:18 +02:00
+#define HDIO_GETGEO 0x0301 /* get device geometry */
2003-08-17 12:20:48 +02:00
+ case HDIO_GETGEO:
+ {
+ struct hd_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ unsigned long start;
+ };
+
2003-10-19 09:36:18 +02:00
+ SYSCALL_TRACK( pre_mem_write, tid, "ioctl(HDIO_GETGEO)", arg3,
2003-08-17 12:20:48 +02:00
+ sizeof(struct hd_geometry));
+ KERNEL_DO_SYSCALL(tid,res);
+ if (!VG_(is_kerror)(res) && res == 0)
+ VG_TRACK( post_mem_write,arg3, sizeof(struct hd_geometry));
+ }
+ break;
2003-10-19 09:36:18 +02:00
+#define HDIO_GET_IDENTITY 0x030d /* get IDE identification info */
+#define struct_hd_driveid_size 256 /* ATA6 specifies words 0-255 */
2003-08-17 12:20:48 +02:00
+ case HDIO_GET_IDENTITY:
2003-10-19 09:36:18 +02:00
+ SYSCALL_TRACK( pre_mem_write, tid, "ioctl(HDIO_GET_IDENTITY)", arg3,
+ struct_hd_driveid_size);
2003-08-17 12:20:48 +02:00
+ KERNEL_DO_SYSCALL(tid,res);
+ if (!VG_(is_kerror)(res) && res == 0)
2003-10-19 09:36:18 +02:00
+ VG_TRACK( post_mem_write,arg3, struct_hd_driveid_size);
2003-08-17 12:20:48 +02:00
+ break;
2003-10-19 09:36:18 +02:00
+#define SCSI_IOCTL_GET_IDLUN 0x5382
2003-08-17 12:20:48 +02:00
+ case SCSI_IOCTL_GET_IDLUN:
+ {
+ struct scsi_idlun
+ {
+ int mux4;
+ int host_unique_id;
+
+ };
+
2003-10-19 09:36:18 +02:00
+ SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_GET_IDLUN)", arg3,
2003-08-17 12:20:48 +02:00
+ sizeof(struct scsi_idlun));
+ KERNEL_DO_SYSCALL(tid,res);
+ if (!VG_(is_kerror)(res) && res == 0)
+ VG_TRACK( post_mem_write,arg3, sizeof(struct scsi_idlun));
+ }
+ break;
2003-10-19 09:36:18 +02:00
+#define SCSI_IOCTL_SEND_COMMAND 1
2003-08-17 12:20:48 +02:00
+ case SCSI_IOCTL_SEND_COMMAND:
2003-10-19 09:36:18 +02:00
+ SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_SEND_COMMAND)", arg3,
2003-08-17 12:20:48 +02:00
+ ((2 * sizeof(unsigned int)) + 6 + 512));
+ KERNEL_DO_SYSCALL(tid,res);
+ if (!VG_(is_kerror)(res) && res == 0)
+ VG_TRACK( post_mem_write,arg3, ((2 * sizeof(unsigned int)) + 6 + 512));
+ break;
2003-10-19 09:36:18 +02:00
+#define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
2003-08-17 12:20:48 +02:00
+ case SCSI_IOCTL_GET_BUS_NUMBER:
2003-10-19 09:36:18 +02:00
+ SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_GET_BUS_NUMBER)", arg3,
2003-08-17 12:20:48 +02:00
+ sizeof(int));
+ KERNEL_DO_SYSCALL(tid,res);
+ if (!VG_(is_kerror)(res) && res == 0)
+ VG_TRACK( post_mem_write,arg3, sizeof(int));
+ break;
2003-10-19 09:36:18 +02:00
+#define SCSI_IOCTL_PROBE_HOST 0x5385
2003-08-17 12:20:48 +02:00
+ case SCSI_IOCTL_PROBE_HOST:
+ {
+ int xxxx;
+ char *array = (char*)arg3;
+ xxxx = array[0] + (array[1]<<8) + (array[2]<<16) + (array[3]<<24);
2003-10-19 09:36:18 +02:00
+ SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_PROBE_HOST)", arg3,
2003-08-17 12:20:48 +02:00
+ sizeof(int));
+ KERNEL_DO_SYSCALL(tid,res);
+ if (!VG_(is_kerror)(res) && res == 0)
+ VG_TRACK( post_mem_write,arg3, sizeof(int));
+ }
+ break;
+#define BLKFLSBUF _IO(0x12,97)
+ case BLKFLSBUF:
+ KERNEL_DO_SYSCALL(tid,res);
+ break;
+#define BLKRRPART _IO(0x12,95)
+ case BLKRRPART:
+ KERNEL_DO_SYSCALL(tid,res);
+ break;
2003-10-19 09:36:18 +02:00
+#define MTIOCTOP _IO(0x6d,0x1)
2003-08-17 12:20:48 +02:00
+ case MTIOCTOP:
2003-10-19 09:36:18 +02:00
+ {
+ struct mtop
+ {
+ short int mt_op; /* Operations defined below. */
+ int mt_count; /* How many of them. */
+ };
+ SYSCALL_TRACK( pre_mem_write, tid, "ioctl(MTIOCTOP)", arg3,
+ sizeof(struct mtop));
+ KERNEL_DO_SYSCALL(tid,res);
+ if (!VG_(is_kerror)(res) && res == 0)
+ VG_TRACK( post_mem_write,arg3, sizeof(struct mtop));
+ }
2003-08-17 12:20:48 +02:00
+ break;
+
/* We don't have any specific information on it, so
try to do something reasonable based on direction and
size bits. The encoding scheme is described in