Messages in this thread | | | Date | Fri, 20 Aug 1999 00:05:37 +0200 | From | Jakub Jelinek <> | Subject | Re: [patch] the other __raw_writel's |
| |
On Thu, Aug 19, 1999 at 05:47:26PM -0400, Jeff Garzik wrote: > Linus, > > The following patch against 2.3.14 adds __raw_writel and friends to the > other arches. The return and arg types in the Sparc code are weird, but > I stuck with it for my variants.
Take care, they are wrong. long is 64bit on sparc64, don't be confused by read long when it is in fact a 32bit read.
> diff -urN /g/vanilla/v2.3.14/linux/include/asm-sparc64/io.h linux/include/asm-sparc64/io.h > --- /g/vanilla/v2.3.14/linux/include/asm-sparc64/io.h Sat May 15 14:12:10 1999 > +++ linux/include/asm-sparc64/io.h Thu Aug 19 15:21:15 1999 > @@ -109,6 +109,38 @@ > : "r" (l), "r" (addr), "i" (ASI_PL)); > } > > +extern __inline__ unsigned long __raw_readb(unsigned long addr) ^^^^^^^^ int > +{ > + return *(volatile unsigned char*)addr; > +} > + > +extern __inline__ unsigned long __raw_readw(unsigned long addr) ^^^^^^^^ int > +{ > + return *(volatile unsigned short*)addr; > +} > + > +extern __inline__ unsigned long __raw_readl(unsigned long addr) ^^^^^^^^^ int > +{ > + return *(volatile unsigned long*)addr; ^^^^^^ int > +} > + > +extern __inline__ void __raw_writeb(unsigned short b, unsigned long addr) ^^^^^^^ char > +{ > + *(volatile unsigned char*)addr = b; > +} > + > +extern __inline__ void __raw_writew(unsigned short b, unsigned long addr) > +{ > + *(volatile unsigned short*)addr = b; > +} > + > +extern __inline__ void __raw_writel(unsigned int b, unsigned long addr) > +{ > + *(volatile unsigned long*)addr = b; ^^^^^ int
Cheers, Jakub ___________________________________________________________________ Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz Administrator of SunSITE Czech Republic, MFF, Charles University ___________________________________________________________________ UltraLinux | http://ultra.linux.cz/ | http://ultra.penguin.cz/ Linux version 2.3.13 on a sparc64 machine (1343.49 BogoMips) ___________________________________________________________________
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |