1 https://sources.debian.org/data/main/p/picprog/1.9.1-3/debian/patches/20_iopl.patch
3 Description: Avoid some functions in some architectures
4 Upstream uses iopl() function and other architecture-dependent
5 codes. This patch adds building switches to avoid them in
7 Author: Koichi Akabe <vbkaisetsu@gmail.com>
8 Last-Update: 2011-11-30
10 --- picprog-1.9.1.orig/picport.cc
11 +++ picprog-1.9.1/picport.cc
15 #include <sys/ioctl.h>
18 +#if defined(__i386__) || defined(__x86_64__)
27 // Not root. Cannot use realtime scheduling.
32 disable_interrupts = 0;
34 + disable_interrupts = 0;
38 // When computing the delay loops, we do not want the cpu's to change.
41 struct timeval tv1, tv2;
42 gettimeofday (&tv1, 0);
43 +#if defined(__i386__) or defined(__x86_64__)
44 if (tsc_1000ns > 1 && disable_interrupts)
45 asm volatile("pushf; cli");
47 set_clock_data (1, b); // set data, clock up
49 set_clock_data (0, b); // clock down
50 +#if defined(__i386__) or defined(__x86_64__)
51 if (tsc_1000ns > 1 && disable_interrupts)
54 gettimeofday (&tv2, 0);
56 // We may have spent a long time in an interrupt or in another task
59 struct timeval tv1, tv2;
60 gettimeofday (&tv1, 0);
61 +#if defined(__i386__) or defined(__x86_64__)
62 if (tsc_1000ns > 1 && disable_interrupts)
63 asm volatile("pushf; cli");
65 set_clock_data (1, 1); // clock up
67 set_clock_data (0, 1); // set data up, clock down
68 +#if defined(__i386__) or defined(__x86_64__)
69 if (tsc_1000ns > 1 && disable_interrupts)
72 gettimeofday (&tv2, 0);
74 // We may have spent a long time in an interrupt or in another task