1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 30_iopl.dpatch by Jelmer Vernooij <jelmer@samba.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: picprog: Don't use iopl() on architectures that don't have it.
8
diff -ur picprog-1.9.0/picport.cc picprog-1.9.0-j/picport.cc
9
--- picprog-1.9.0/picport.cc 2008-06-05 08:07:55.000000000 +0200
10
+++ picprog-1.9.0-j/picport.cc 2008-09-29 16:17:43.000000000 +0200
14
#include <sys/ioctl.h>
23
+#if defined(__i386__) || defined(__x86_64__)
31
// Not root. Cannot use realtime scheduling.
36
disable_interrupts = 0;
38
+ disable_interrupts = 0;
42
// When computing the delay loops, we do not want the cpu's to change.
45
struct timeval tv1, tv2;
46
gettimeofday (&tv1, 0);
47
+#if defined(__i386__) or defined(__x86_64__)
48
if (tsc_1000ns > 1 && disable_interrupts)
49
asm volatile("pushf; cli");
51
set_clock_data (1, b); // set data, clock up
53
set_clock_data (0, b); // clock down
54
+#if defined(__i386__) or defined(__x86_64__)
55
if (tsc_1000ns > 1 && disable_interrupts)
58
gettimeofday (&tv2, 0);
60
// We may have spent a long time in an interrupt or in another task
63
struct timeval tv1, tv2;
64
gettimeofday (&tv1, 0);
65
+#if defined(__i386__) or defined(__x86_64__)
66
if (tsc_1000ns > 1 && disable_interrupts)
67
asm volatile("pushf; cli");
69
set_clock_data (1, 1); // clock up
71
set_clock_data (0, 1); // set data up, clock down
72
+#if defined(__i386__) or defined(__x86_64__)
73
if (tsc_1000ns > 1 && disable_interrupts)
76
gettimeofday (&tv2, 0);
78
// We may have spent a long time in an interrupt or in another task
79
diff -ur picprog-1.9.0/testport.cc picprog-1.9.0-j/testport.cc
80
--- picprog-1.9.0/testport.cc 2007-11-13 19:21:24.000000000 +0100
81
+++ picprog-1.9.0-j/testport.cc 2008-09-29 16:11:50.000000000 +0200
85
#include <sys/ioctl.h>