Gentoo Archives: gentoo-commits

From: "Robert Buchholz (rbu)" <rbu@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-misc/lcd4linux/files: lcd4linux-0.10.1_rc2-nordtsc.patch digest-lcd4linux-0.10.1_rc2-r2 lcd4linux-0.9.11-modular-x.patch digest-lcd4linux-0.9.11
Date: Fri, 26 Oct 2007 09:40:54
Message-Id: E1IlLgL-0003I0-9j@stork.gentoo.org
1 rbu 07/10/26 09:40:45
2
3 Added: lcd4linux-0.10.1_rc2-nordtsc.patch
4 digest-lcd4linux-0.10.1_rc2-r2
5 Removed: lcd4linux-0.9.11-modular-x.patch
6 digest-lcd4linux-0.9.11
7 Log:
8 Fix compilation with linux-headers, clean up old.
9 (Portage version: 2.1.3.14)
10
11 Revision Changes Path
12 1.1 app-misc/lcd4linux/files/lcd4linux-0.10.1_rc2-nordtsc.patch
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-misc/lcd4linux/files/lcd4linux-0.10.1_rc2-nordtsc.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-misc/lcd4linux/files/lcd4linux-0.10.1_rc2-nordtsc.patch?rev=1.1&content-type=text/plain
16
17 Index: lcd4linux-0.10.1_rc2-nordtsc.patch
18 ===================================================================
19 kMessage-ID: <47011930.60100@××××××××××.at>
20 Date: Mon, 01 Oct 2007 17:58:40 +0200
21 From: Michael Reinelt <michael@××××××××××.at>
22 Subject: [Lcd4linux-devel] asm/msr.h inclusion and RDTSC stuff removed
23
24 Hi there,
25
26 I just committed a changeset where I removed the whole RDTSC delay loop
27 stuff, and therefore lcd4linux does no longer need asm/msr.h
28
29 Instead, a gettimeofday() delay loop will be used when necessary.
30
31 The rdtsc stuff worked fine, but had two major disadvantages: It did not
32 work with variable CPU frequencies, and latest kernels do no longer
33 offer the rdtsc() macro.
34
35 The changeset has been committed to trunk, and will be backported to the
36 0.10.1 branch as soon as I get some positive feedback 8or at least I
37 don't get any negative feedback)
38
39
40 bye, Michael
41
42 --
43 Michael Reinelt <michael@××××××××××.at>
44 http://home.pages.at/reinelt
45 GPG-Key 0xDF13BA50
46 ICQ #288386781
47
48 Index: configure.in
49 ===================================================================
50 --- lcd4linux-0.10.1-RC2/configure.in.orig
51 +++ lcd4linux-0.10.1-RC2/configure.in
52 @@ -99,7 +99,6 @@ AC_HEADER_STDC
53 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/vfs.h syslog.h termios.h unistd.h])
54 AC_CHECK_HEADERS(sys/io.h asm/io.h)
55 AC_CHECK_HEADERS(linux/parport.h linux/ppdev.h)
56 -AC_CHECK_HEADERS(asm/msr.h)
57
58 # Checks for typedefs, structures, and compiler characteristics.
59 AC_C_CONST
60 Index: udelay.c
61 ===================================================================
62 --- lcd4linux-0.10.1-RC2/udelay.c.orig
63 +++ lcd4linux-0.10.1-RC2/udelay.c
64 @@ -55,11 +55,6 @@
65 #include <string.h>
66 #include <sys/time.h>
67
68 -#ifdef HAVE_ASM_MSR_H
69 -#define u32 unsigned int
70 -#include <asm/msr.h>
71 -#endif
72 -
73
74 #include "debug.h"
75 #include "cfg.h"
76 @@ -67,79 +62,10 @@
77 #include "udelay.h"
78
79
80 -static unsigned int ticks_per_usec = 0;
81 -
82 -
83 -static void getCPUinfo(int *hasTSC, double *MHz)
84 -{
85 - int fd;
86 - char buffer[4096], *p;
87 -
88 - *hasTSC = 0;
89 - *MHz = -1;
90 -
91 - fd = open("/proc/cpuinfo", O_RDONLY);
92 - if (fd == -1) {
93 - error("udelay: open(/proc/cpuinfo) failed: %s", strerror(errno));
94 - return;
95 - }
96 - if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
97 - error("udelay: read(/proc/cpuinfo) failed: %s", strerror(errno));
98 - close(fd);
99 - return;
100 - }
101 - close(fd);
102 -
103 - p = strstr(buffer, "flags");
104 - if (p == NULL) {
105 - info("udelay: /proc/cpuinfo has no 'flags' line");
106 - } else {
107 - p = strstr(p, "tsc");
108 - if (p == NULL) {
109 - info("udelay: CPU does not support Time Stamp Counter");
110 - } else {
111 - info("udelay: CPU supports Time Stamp Counter");
112 - *hasTSC = 1;
113 - }
114 - }
115 -
116 - p = strstr(buffer, "cpu MHz");
117 - if (p == NULL) {
118 - info("udelay: /proc/cpuinfo has no 'cpu MHz' line");
119 - } else {
120 - if (sscanf(p + 7, " : %lf", MHz) != 1) {
121 - error("udelay: parse(/proc/cpuinfo) failed: unknown 'cpu MHz' format");
122 - *MHz = -1;
123 - } else {
124 - info("udelay: CPU runs at %f MHz", *MHz);
125 - }
126 - }
127 -
128 -}
129 -
130
131 void udelay_init(void)
132 {
133 -#ifdef HAVE_ASM_MSR_H
134 -
135 - int tsc;
136 - double mhz;
137 -
138 - getCPUinfo(&tsc, &mhz);
139 -
140 - if (tsc && mhz > 0.0) {
141 - ticks_per_usec = ceil(mhz);
142 - info("udelay: using TSC delay loop, %u ticks per microsecond", ticks_per_usec);
143 - } else
144 -#else
145 - error("udelay: The file 'include/asm/msr.h' was missing at compile time.");
146 - error("udelay: Even if your CPU supports TSC, it will not be used!");
147 - error("udelay: You *really* should install msr.h and recompile LCD4linux!");
148 -#endif
149 - {
150 - ticks_per_usec = 0;
151 - info("udelay: using gettimeofday() delay loop");
152 - }
153 + info("udelay: using gettimeofday() delay loop");
154 }
155
156
157 @@ -172,37 +98,17 @@ unsigned long timing(const char *driver,
158 void ndelay(const unsigned long nsec)
159 {
160
161 -#ifdef HAVE_ASM_MSR_H
162 -
163 - if (ticks_per_usec) {
164 + struct timeval now, end;
165
166 - unsigned int t1, t2;
167 - unsigned long tsc;
168 -
169 - tsc = (nsec * ticks_per_usec + 999) / 1000;
170 -
171 - rdtscl(t1);
172 - do {
173 - rep_nop();
174 - rdtscl(t2);
175 - } while ((t2 - t1) < tsc);
176 -
177 - } else
178 -#endif
179 -
180 - {
181 - struct timeval now, end;
182 -
183 - gettimeofday(&end, NULL);
184 - end.tv_usec += (nsec + 999) / 1000;
185 - while (end.tv_usec > 1000000) {
186 - end.tv_usec -= 1000000;
187 - end.tv_sec++;
188 - }
189 -
190 - do {
191 - rep_nop();
192 - gettimeofday(&now, NULL);
193 - } while (now.tv_sec == end.tv_sec ? now.tv_usec < end.tv_usec : now.tv_sec < end.tv_sec);
194 + gettimeofday(&end, NULL);
195 + end.tv_usec += (nsec + 999) / 1000;
196 + while (end.tv_usec > 1000000) {
197 + end.tv_usec -= 1000000;
198 + end.tv_sec++;
199 }
200 +
201 + do {
202 + rep_nop();
203 + gettimeofday(&now, NULL);
204 + } while (now.tv_sec == end.tv_sec ? now.tv_usec < end.tv_usec : now.tv_sec < end.tv_sec);
205 }
206
207
208
209 1.1 app-misc/lcd4linux/files/digest-lcd4linux-0.10.1_rc2-r2
210
211 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-misc/lcd4linux/files/digest-lcd4linux-0.10.1_rc2-r2?rev=1.1&view=markup
212 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-misc/lcd4linux/files/digest-lcd4linux-0.10.1_rc2-r2?rev=1.1&content-type=text/plain
213
214 Index: digest-lcd4linux-0.10.1_rc2-r2
215 ===================================================================
216 MD5 a64c40feb74862cb4a91281bc7737f72 lcd4linux-0.10.1-RC2.tar.gz 386188
217 RMD160 5f4465d20c26e43aea79150cad00141d63bb784d lcd4linux-0.10.1-RC2.tar.gz 386188
218 SHA256 9e69ded08dc9a8c75f36a3c020e7aa96b90313d91b2f58add6d4dfff1f8861b0 lcd4linux-0.10.1-RC2.tar.gz 386188
219
220
221
222 --
223 gentoo-commits@g.o mailing list