]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
ioctls for /dev/rtc (Fredrik Kuivinen)
authorJulian Seward <jseward@acm.org>
Sat, 27 Apr 2002 02:20:14 +0000 (02:20 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 27 Apr 2002 02:20:14 +0000 (02:20 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@162

coregrind/vg_unsafe.h
vg_syscall_mem.c
vg_unsafe.h

index c83db8d5cac2c182b1188dae6a13178da89df62a..6e362ad2304a0d84173f6ab709cdfc7f071ce56a 100644 (file)
@@ -62,6 +62,7 @@
 
 #include <asm/ioctls.h>   /* for stuff for dealing with ioctl :( */
 #include <sys/soundcard.h> /* for various soundcard ioctl constants :( */
+#include <linux/rtc.h>     /* for RTC_* ioctls */
 
 #include <termios.h>
 #include <pty.h>
index 0f9faa8e9d9c419872292db1e0826698daa969ca..931dec5addcc569cc7976181623b8bab5727a0c0 100644 (file)
@@ -1687,6 +1687,37 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
                                 arg3, sizeof(int));
                KERNEL_DO_SYSCALL(tid,res);
                break;
+
+            /* Real Time Clock (/dev/rtc) ioctls */
+            case RTC_UIE_ON:
+            case RTC_UIE_OFF:
+            case RTC_AIE_ON:
+            case RTC_AIE_OFF:
+            case RTC_PIE_ON:
+            case RTC_PIE_OFF:
+            case RTC_IRQP_SET:
+               KERNEL_DO_SYSCALL(tid,res);
+               break;
+            case RTC_RD_TIME:
+            case RTC_ALM_READ:
+               must_be_writable(tst, "ioctl(RTC_RD_TIME/ALM_READ)", arg3,
+                                sizeof(struct rtc_time));
+               KERNEL_DO_SYSCALL(tid,res);
+               if (!VG_(is_kerror) && res == 0)
+                  make_readable(arg3, sizeof(struct rtc_time));
+               break;
+            case RTC_ALM_SET:
+               must_be_readable(tst, "ioctl(RTC_ALM_SET)", arg3,
+                                sizeof(struct rtc_time));
+               KERNEL_DO_SYSCALL(tid,res);
+               break;
+            case RTC_IRQP_READ:
+               must_be_writable(tst, "ioctl(RTC_IRQP_READ)", arg3,
+                                sizeof(unsigned long));
+               KERNEL_DO_SYSCALL(tid,res);
+               if(!VG_(is_kerror) && res == 0)
+                   make_readable(arg3, sizeof(unsigned long));
+               break;
           
             /* We don't have any specific information on it, so
                try to do something reasonable based on direction and
index c83db8d5cac2c182b1188dae6a13178da89df62a..6e362ad2304a0d84173f6ab709cdfc7f071ce56a 100644 (file)
@@ -62,6 +62,7 @@
 
 #include <asm/ioctls.h>   /* for stuff for dealing with ioctl :( */
 #include <sys/soundcard.h> /* for various soundcard ioctl constants :( */
+#include <linux/rtc.h>     /* for RTC_* ioctls */
 
 #include <termios.h>
 #include <pty.h>