tags 492812 + patch
thanks

I've prepared a new NMU for picprog (versioned as 1.9.0-1.1) that
disables iopl() architectures platforms that don't have it rather than disabling
picprog completely. iopl() was introduced in a recent upstream release to make 
the 
timing a bit more reliable.

Kind Regards,

Jelmer

-- 
diff -u picprog-1.9.0/debian/changelog picprog-1.9.0/debian/changelog
--- picprog-1.9.0/debian/changelog
+++ picprog-1.9.0/debian/changelog
@@ -1,3 +1,10 @@
+picprog (1.9.0-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Avoiding iopl() on platforms that don't have it. (closes: #492812)
+
+ -- Jelmer Vernooij <[EMAIL PROTECTED]>  Mon, 29 Sep 2008 02:30:46 +0200
+
 picprog (1.9.0-1) unstable; urgency=low
 
   * New upstream release
diff -u picprog-1.9.0/debian/patches/00list picprog-1.9.0/debian/patches/00list
--- picprog-1.9.0/debian/patches/00list
+++ picprog-1.9.0/debian/patches/00list
@@ -2,0 +3 @@
+30_iopl.dpatch
only in patch2:
unchanged:
--- picprog-1.9.0.orig/debian/patches/30_iopl.dpatch
+++ picprog-1.9.0/debian/patches/30_iopl.dpatch
@@ -0,0 +1,89 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 30_iopl.dpatch by Jelmer Vernooij <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: picprog: Don't use iopl() on architectures that don't have it.
+
[EMAIL PROTECTED]@
+diff -ur picprog-1.9.0/picport.cc picprog-1.9.0-j/picport.cc
+--- picprog-1.9.0/picport.cc	2008-06-05 08:07:55.000000000 +0200
++++ picprog-1.9.0-j/picport.cc	2008-09-29 16:17:43.000000000 +0200
+@@ -33,7 +33,6 @@
+ #include <string>
+ 
+ #include <sys/ioctl.h>
+-#include <sys/io.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <time.h>
+@@ -44,6 +43,10 @@
+ #include <sysexits.h>
+ #include <string.h>
+ #include <sched.h>
++#if defined(__i386__) || defined(__x86_64__)
++#include <sys/io.h>
++#define HAVE_IOPL
++#endif
+ 
+ #include "picport.h"
+ 
+@@ -159,8 +162,12 @@
+     // Not root.  Cannot use realtime scheduling.
+     use_nanosleep = 0;
+   }
++#ifdef HAVE_IOPL
+   if (iopl (3))
+     disable_interrupts = 0;
++#else
++  disable_interrupts = 0;
++#endif
+ 
+ #ifdef CPU_SETSIZE
+   // When computing the delay loops, we do not want the cpu's to change.
+@@ -402,13 +409,17 @@
+ {
+   struct timeval tv1, tv2;
+   gettimeofday (&tv1, 0);
++#if defined(__i386__) or defined(__x86_64__)
+   if (tsc_1000ns > 1 && disable_interrupts)
+     asm volatile("pushf; cli");
++#endif
+   set_clock_data (1, b); // set data, clock up
+   delay (cable_delay);
+   set_clock_data (0, b); // clock down
++#if defined(__i386__) or defined(__x86_64__)
+   if (tsc_1000ns > 1 && disable_interrupts)
+     asm volatile("popf");
++#endif
+   gettimeofday (&tv2, 0);
+ 
+   // We may have spent a long time in an interrupt or in another task
+@@ -427,13 +438,17 @@
+ {
+   struct timeval tv1, tv2;
+   gettimeofday (&tv1, 0);
++#if defined(__i386__) or defined(__x86_64__)
+   if (tsc_1000ns > 1 && disable_interrupts)
+     asm volatile("pushf; cli");
++#endif
+   set_clock_data (1, 1); // clock up
+   delay (cable_delay);
+   set_clock_data (0, 1); // set data up, clock down
++#if defined(__i386__) or defined(__x86_64__)
+   if (tsc_1000ns > 1 && disable_interrupts)
+     asm volatile("popf");
++#endif
+   gettimeofday (&tv2, 0);
+ 
+   // We may have spent a long time in an interrupt or in another task
+diff -ur picprog-1.9.0/testport.cc picprog-1.9.0-j/testport.cc
+--- picprog-1.9.0/testport.cc	2007-11-13 19:21:24.000000000 +0100
++++ picprog-1.9.0-j/testport.cc	2008-09-29 16:11:50.000000000 +0200
+@@ -33,7 +33,6 @@
+ #include <string>
+ 
+ #include <sys/ioctl.h>
+-#include <sys/io.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <time.h>

Reply via email to