2.2.15, lowlatency, and speakup

Jeremy Hall jhall at UU.NET
Sat Jun 3 10:27:31 EDT 2000


Hi,

They did the following to vt_buffer.h.


diff -ruN linux-2.2.15/include/linux/vt_buffer.h linux-2.2.15-LL/include/linux/vt_buffer.h
--- linux-2.2.15/include/linux/vt_buffer.h	Wed Mar  8 10:13:29 2000
+++ linux-2.2.15-LL/include/linux/vt_buffer.h	Wed Mar  8 10:47:31 2000
@@ -19,25 +19,129 @@
 #include <asm/vga.h>
 #endif
 
+#define VT_DOUBLEBUF 1
+
 #ifndef VT_BUF_HAVE_RW
-#define scr_writew(val, addr) (*(addr) = (val))
-#define scr_readw(addr) (*(addr))
-#define scr_memcpyw(d, s, c) memcpy(d, s, c)
-#define scr_memmovew(d, s, c) memmove(d, s, c)
-#define VT_BUF_HAVE_MEMCPYW
-#define VT_BUF_HAVE_MEMMOVEW
-#define scr_memcpyw_from(d, s, c) memcpy(d, s, c)
-#define scr_memcpyw_to(d, s, c) memcpy(d, s, c)
-#define VT_BUF_HAVE_MEMCPYF
+
+#if VT_DOUBLEBUF
+
+extern unsigned long vga_vram_base, vga_vram_end;
+
+extern inline unsigned short * __v2m(const unsigned short * s, int cons)
+{
+	struct vc_data *c;
+	unsigned short * __res;
+
+	c = vc_cons[cons].d;
+
+	if (*c->vc_display_fg == c) {
+		__res = (unsigned short *)(c->vc_videobuf+
+			((unsigned long)(s) - vga_vram_base));
+		/*
+		 * debugging hacks:
+		 */
+		if (((unsigned int)s < vga_vram_base) ||
+			((unsigned int)s > vga_vram_end)) {
+//			printk("P1:<%p->%p(%p)>?\n", s, __res, (void *)&&__y);
+			__res = (unsigned short *)(s);
+		} else {
+			if ((__res < (unsigned short *)c->vc_videobuf) || (__res >= (unsigned short *)(c->vc_videobuf+128*1024))) {
+//				printk("P2:<%p->%p(%p)>?\n", s, __res, (void *)&&__y);
+				__res = (unsigned short *)(s);
+			}
+		}
+	} else
+		__res = (unsigned short *)(s);
+	return __res;
+}
+
+#define v2m(x) __v2m(x,currcons)
+
+// #define v2m(x) ({ unsigned short * __res; if (vc_cons[currcons].d->vc_videobuf) __res = (unsigned short *)(vc_cons[currcons].d->vc_videobuf+((unsigned long)(x)-vc_cons[currcons].d->vc_origin)); else { extern int magic_flag; magic_flag++; __res = (unsigned short *)(x); } __res; })
+// #define v2m(x) ({ unsigned short * __res; __res = (unsigned short *)(vc_cons[currcons].d->vc_videobuf+((unsigned long)(x)-vga_vram_base)); __res; })
+
+#if 1
+extern inline void __scr_writew(u16 val, u16 *addr, int currcons)
+{
+	*addr = val;
+	*(v2m(addr)) = val;
+}
+#define scr_writew(val, addr) __scr_writew(val, addr, currcons)
+
+# define scr_readw(addr) ({*(v2m(addr));})
+#else
+# define scr_writew(val, addr) ({*(addr) = (val); })
+# define scr_readw(addr) ({*(addr);})
+#endif
+
+extern inline void __scr_memcpyw(void * d, void * s,
+		 unsigned int c, int currcons)
+{
+	memcpy(v2m(d), v2m(s), c);
+	memcpy(d, v2m(d), c);
+}
+#define scr_memcpyw(d, s, c) __scr_memcpyw(d, s, c, currcons)
+
+extern inline void __scr_memmovew(void * d, void * s,
+		 unsigned int c, int currcons)
+{
+	memmove(v2m(d), v2m(s), c);
+	memcpy(d, v2m(d), c);
+}
+# define scr_memmovew(d, s, c) __scr_memmovew(d, s, c, currcons)
+# define VT_BUF_HAVE_MEMCPYW
+# define VT_BUF_HAVE_MEMMOVEW
+extern inline void __scr_memcpyw_to(void * d, void * s,
+		unsigned int c, int currcons)
+{
+	memcpy(v2m(d), s, c);
+	memcpy(d, s, c);
+}
+# define scr_memcpyw_to(d, s, c) __scr_memcpyw_to(d, s, c, currcons)
+# define scr_memcpyw_from(d, s, c) ({ memcpy(d, v2m(s), c);})
+# define VT_BUF_HAVE_MEMCPYF
+
+# define scr_writew_nonbuffered(val, addr) ({*(addr) = (val); })
+# define scr_readw_nonbuffered(addr) ({*(addr);})
+# define scr_memcpyw_nonbuffered(d, s, c) ({ memcpy(d, s, c); })
+# define scr_memmovew_nonbuffered(d, s, c) ({ memmove(d, s, c); })
+# define VT_BUF_HAVE_MEMCPYW
+# define VT_BUF_HAVE_MEMMOVEW
+# define scr_memcpyw_from_nonbuffered(d, s, c) ({ memcpy(d, s, c);})
+# define scr_memcpyw_to_nonbuffered(d, s, c) ({ memcpy(d, s, c);})
+# define VT_BUF_HAVE_MEMCPYF
+#else
+
+# define scr_writew(val, addr) ({*(addr) = (val); })
+# define scr_readw(addr) ({*(addr);})
+# define scr_memcpyw(d, s, c) ({ memcpy(d, s, c); })
+# define scr_memmovew(d, s, c) ({ memmove(d, s, c); })
+# define VT_BUF_HAVE_MEMCPYW
+# define VT_BUF_HAVE_MEMMOVEW
+# define scr_memcpyw_from(d, s, c) ({ memcpy(d, s, c);})
+# define scr_memcpyw_to(d, s, c) ({ memcpy(d, s, c);})
+# define VT_BUF_HAVE_MEMCPYF
+#endif
+
 #endif
 
 #ifndef VT_BUF_HAVE_MEMSETW
-extern inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
+extern inline void __scr_memsetw(u16 *s, u16 c,
+				 unsigned int count, int currcons)
 {
 	count /= 2;
 	while (count--)
 		scr_writew(c, s++);
 }
+#define scr_memsetw(s,c,count) __scr_memsetw(s,c,count,currcons)
+extern inline void scr_memsetw_nonbuffered(u16 *s, u16 c,
+				 unsigned int count)
+{
+	count /= 2;
+	while (count--)
+		scr_writew_nonbuffered(c, s++);
+}
+
 #endif
 
 #ifndef VT_BUF_HAVE_MEMCPYW
diff -ruN linux-2.2.15/ipc/shm.c linux-2.2.15-LL/ipc/shm.c

In the new year, Kirk Reiser wrote:
> Hi:  Did you save copies of your patching output for either or both
> the low latency patch or speakup patch?  I would check carefully to
> see if something like a hunk failed during the patching process.  I
> don't know other than that.  The scr_readw macro is pretty important
> so I can't imagine them replacing it with something else.  It would
> break a lot more than speakup.
> 
>   Kirk
> 
> -- 
> 
> Kirk Reiser				The Computer Braille Facility
> e-mail: kirk at braille.uwo.ca		University of Western Ontario
> phone: (519) 661-3061
> 
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 





More information about the Speakup mailing list