Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: "P.Copeland" <copeland@redhat.com>
To: alan@redhat.com
Subject: linux2.4.0-test4 failures + fixes
Date: 2000/07/10	[thread overview]
Message-ID: <3969F97A.4C304C36@redhat.com> (raw)

(Alpha)
Two places that I've found broken in 2.4.0-test4

1) OSF partition handling (MAJOR)
2) the USB ov511 module (minor)

OSF partition handling relies on the include/linux/poll.h define KFDS_NR

in 2.4.0-test3 this was defined as follows

---
/*
 * For the kernel fd_set we use a fixed set-size for allocation
purposes.
 * This set-size doesn't necessarily bear any relation to the size the
user
 * uses, but should preferably obviously be larger than any possible
user
 * size (NR_OPEN bits).
 *
 * We need 6 bitmaps (in/out/ex for both incoming and outgoing), and we
 * allocate one page for all the bitmaps. Thus we have 8*PAGE_SIZE bits,

 * to be divided by 6. And we'd better make sure we round to a full
 * long-word (in fact, we'll round to 64 bytes).
 */


#define KFDS_64BLOCK ((PAGE_SIZE/(6*64))*64)
#define KFDS_NR (KFDS_64BLOCK*8 > NR_OPEN ? NR_OPEN : KFDS_64BLOCK*8)
---

This has disappeared from the kernel entirely in the test3->test4
patches
so the following happens

osf_sys.c: In function `osf_select':
osf_sys.c:1079: `KFDS_NR' undeclared (first use in this function)
osf_sys.c:1079: (Each undeclared identifier is reported only once
osf_sys.c:1079: for each function it appears in.)
make[1]: *** [osf_sys.o] Error 1
make[1]: Leaving directory `/usr/src/linux/arch/alpha/kernel'
make: *** [_dir_arch/alpha/kernel] Error 2

I don't undestand the rationale for removing the two defines though
unless they got zapped as a logical extension of getting rid of
kernel_fd_set
        typedef unsigned long kernel_fd_set[KFDS_NR/__NFDBITS];


2) The ov511 driver.

Using /lib/modules/2.4.0-test4/usb/ov511.o
/lib/modules/2.4.0-test4/usb/ov511.o: unresolved symbol __fixdfsi

gcc in it's infinite wisdom compiles up the module and assumes floating
point
A dissasembly of the module shows a .global definition for fixdfsi but
no
associated code,.. very peculiar, fixdfsi() is simply not used

From the dissassembly this seems related to the section in ov511.c +1020

1020:   const double brightness = 1.0; /* 0->black; 1->full scale */
1021:   const double saturation = 1.0; /* 0->greyscale; 1->full color */

1022:   const double fixScale = brightness * 256 * 256;

I was under the distinct impression that floating point operations were
not
allowed in the kernel due to the FPU interrupt handling.
Line 1022 would seem to violate that and I suspect gcc, spotting real
numbers,
decides to include the math library routine fixdfsi to handle 64bit->
32bit
conversions even though it is not used.

As the math used is 'magic' and fixed this was the reason why I sent you
the
change of double to int patch last time since 1*256*256 = 65536 = FFFF
and
fits in an int

Phil    (running Linux Alpha 2.4.0-test4 #7 Mon Jul 10 10:25:54 EDT 2000
alpha unknown)
=--=


--- linux-2.4.0-test4/drivers/usb/ov511.c       Mon Jul 10 09:51:40 2000

+++ linux/drivers/usb/ov511.c   Mon Jul 10 11:52:17 2000
@@ -1017,9 +1017,9 @@
 ov511_move_420_block(int yTL, int yTR, int yBL, int yBR, int u, int v,
        int rowPixels, unsigned char * rgb)
 {
-       const double brightness = 1.0; /* 0->black; 1->full scale */
-       const double saturation = 1.0; /* 0->greyscale; 1->full color */

-       const double fixScale = brightness * 256 * 256;
+       const int brightness = 1.0; /* 0->black; 1->full scale */
+       const int saturation = 1.0; /* 0->greyscale; 1->full color */
+       const int fixScale = brightness * 256 * 256;
        const int rvScale = (int)(1.402 * saturation * fixScale);
        const int guScale = (int)(-0.344136 * saturation * fixScale);
        const int gvScale = (int)(-0.714136 * saturation * fixScale);
--- linux-2.4.0-test4/include/linux/poll.h      Mon Jul 10 09:54:46 2000

+++ linux/include/linux/poll.h  Mon Jul 10 09:25:49 2000
@@ -38,6 +38,24 @@
                __pollwait(filp, wait_address, p);
 }

+/*
+ * For the kernel fd_set we use a fixed set-size for allocation
purposes.
+ * This set-size doesn't necessarily bear any relation to the size the
user
+ * uses, but should preferably obviously be larger than any possible
user
+ * size (NR_OPEN bits).
+ *
+ * We need 6 bitmaps (in/out/ex for both incoming and outgoing), and we

+ * allocate one page for all the bitmaps. Thus we have 8*PAGE_SIZE
bits,
+ * to be divided by 6. And we'd better make sure we round to a full
+ * long-word (in fact, we'll round to 64 bytes).
+ */
+
+
+#define KFDS_64BLOCK ((PAGE_SIZE/(6*64))*64)
+#define KFDS_NR (KFDS_64BLOCK*8 > NR_OPEN ? NR_OPEN : KFDS_64BLOCK*8)
+
+
 static inline void poll_initwait(poll_table* pt)
 {
        pt->error = 0;





                 reply	other threads:[~2000-07-10  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox