Skip to contentSkip to conversation

fbcon diff

parisc-linux Matthew Wilcox 2 participants 3 messages Jun 18, 2001 – Jun 19, 2001

lore
Share & tools
lore
#0 lore raw

IMO, fbcon.h should look more like this:

Index: include/video/fbcon.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/video/fbcon.h,v retrieving revision 1.7

fbcon.h +7 -20
diff -u -p -r1.7 fbcon.h
@@ -205,19 +205,6 @@ extern int set_all_vcs(int fbidx, struct
 #define fb_writel sbus_writel
 #define fb_memset sbus_memset_io
 
-#elif defined(__hppa__) && !(USE_HPPA_IOREMAP)
-
-/* When we switch to ioremap() usage the following defines will
- * be removed and we'll use the arch-independend generic 
- * functions below instead. */
-#define fb_readb gsc_readb
-#define fb_readw gsc_readw
-#define fb_readl gsc_readl
-#define fb_writeb gsc_writeb
-#define fb_writew gsc_writew
-#define fb_writel gsc_writel
-#define fb_memset gsc_memset_io
-	
 #elif defined(__i386__) || defined(__alpha__)
 
 #define fb_readb __raw_readb
@@ -230,13 +217,13 @@ extern int set_all_vcs(int fbidx, struct
 
 #else
 
-#define fb_readb(addr) (*(volatile u8 *) (addr))
-#define fb_readw(addr) (*(volatile u16 *) (addr))
-#define fb_readl(addr) (*(volatile u32 *) (addr))
-#define fb_writeb(b,addr) (*(volatile u8 *) (addr) = (b))
-#define fb_writew(b,addr) (*(volatile u16 *) (addr) = (b))
-#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b))
-#define fb_memset memset
+#define fb_readb(addr) readb(addr)
+#define fb_readw(addr) readw(addr) 
+#define fb_readl(addr) readl(addr) 
+#define fb_writeb(b,addr) writeb(b,addr) 
+#define fb_writew(b,addr) writew(b,addr) 
+#define fb_writel(b,addr) writel(b,addr) 
+#define fb_memset(addr, c, len) memset_io((unsigned long)addr, c, len)
 
 #endif
 
Signature · 1 line
Revolutions do not require corporate support.
#1 lore raw

Hi Matthew,

I absolutely agree with you.

The part behind "#elif defined(__hppa__) && !(USE_HPPA_IOREMAP)" should and will go away anyway, but the change from direct memory addressing to readX()/writeX() modifies generic linux code, could break other arches and should IMHO be discussed with Geert, Alan Cox or Linus directly and not be changed reclusively in our tree.

Greetings,
Helge

Quoted 49 lines · Matthew Wilcox

IMO, fbcon.h should look more like this:

Index: include/video/fbcon.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/video/fbcon.h,v retrieving revision 1.7
diff -u -p -r1.7 fbcon.h

fbcon.h +7 -20
@@ -205,19 +205,6 @@ extern int set_all_vcs(int fbidx, struct
 #define fb_writel sbus_writel
 #define fb_memset sbus_memset_io
 
-#elif defined(__hppa__) && !(USE_HPPA_IOREMAP)
-
-/* When we switch to ioremap() usage the following defines will
- * be removed and we'll use the arch-independend generic
- * functions below instead. */
-#define fb_readb gsc_readb
-#define fb_readw gsc_readw
-#define fb_readl gsc_readl
-#define fb_writeb gsc_writeb
-#define fb_writew gsc_writew
-#define fb_writel gsc_writel
-#define fb_memset gsc_memset_io
-
 #elif defined(__i386__) || defined(__alpha__)
 
 #define fb_readb __raw_readb
@@ -230,13 +217,13 @@ extern int set_all_vcs(int fbidx, struct
 
 #else
 
-#define fb_readb(addr) (*(volatile u8 *) (addr))
-#define fb_readw(addr) (*(volatile u16 *) (addr))
-#define fb_readl(addr) (*(volatile u32 *) (addr))
-#define fb_writeb(b,addr) (*(volatile u8 *) (addr) = (b))
-#define fb_writew(b,addr) (*(volatile u16 *) (addr) = (b))
-#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b))
-#define fb_memset memset
+#define fb_readb(addr) readb(addr)
+#define fb_readw(addr) readw(addr)
+#define fb_readl(addr) readl(addr)
+#define fb_writeb(b,addr) writeb(b,addr)
+#define fb_writew(b,addr) writew(b,addr)
+#define fb_writel(b,addr) writel(b,addr)
+#define fb_memset(addr, c, len) memset_io((unsigned long)addr, c, len)
 
 #endif
#2 lore raw
Quoted 1 line · Helge Deller

I absolutely agree with you.

As Larry McVoy says, that's a great way to start an email :-)

Quoted 5 lines

The part behind "#elif defined(__hppa__) && !(USE_HPPA_IOREMAP)" should and will go away anyway, but the change from direct memory addressing to readX()/writeX() modifies generic linux code, could break other arches and should IMHO be discussed with Geert, Alan Cox or Linus directly and not be changed reclusively in our tree.

Certainly our tree should not be the only one making this change.

BTW, I figured out what the problem is with your ioremap change. You haven't modified read[bwlq], write[bwlq] to do non-absolute addressing. My original three ideas all called for making this change to {read,write}[bwl]
http://lists.parisc-linux.org/pipermail/parisc-linux/2001-March/011914.html

Signature · 1 line
Revolutions do not require corporate support.