Re: About inb, outb, .... !

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



#if !defined(CONFIG_MULTIQUAD) || defined(STANDALONE)
#define __OUT(s,s1,x) \
__OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port)); } \
__OUT1(s##_p,x) __OUT2(s,s1,"w") __FULL_SLOW_DOWN_IO : : "a" (value), "Nd" (port));} 
#else
/* Make the default portio routines operate on quad 0 */
#define __OUT(s,s1,x) \
__OUT1(s##_local,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port)); } \
__OUT1(s##_p_local,x) __OUT2(s,s1,"w") __FULL_SLOW_DOWN_IO : : "a" (value), "Nd" (port));} \
__OUTQ(s,s,x) \
__OUTQ(s,s##_p,x) 
#endif /* !CONFIG_MULTIQUAD || STANDALONE */

#define __IN1(s) \
static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v;

#define __IN2(s,s1,s2) \
__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"

#if !defined(CONFIG_MULTIQUAD) || defined(STANDALONE)
#define __IN(s,s1,i...) \
__IN1(s) __IN2(s,s1,"w") : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \
__IN1(s##_p) __IN2(s,s1,"w") __FULL_SLOW_DOWN_IO : "=a" (_v) : "Nd" (port) ,##i ); return _v; } 
#else
/* Make the default portio routines operate on quad 0 */
#define __IN(s,s1,i...) \
__IN1(s##_local) __IN2(s,s1,"w") : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \
__IN1(s##_p_local) __IN2(s,s1,"w") __FULL_SLOW_DOWN_IO : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \
__INQ(s,s) \
__INQ(s,s##_p) 
#endif /* !CONFIG_MULTIQUAD || STANDALONE */

#define __INS(s) \
static inline void ins##s(unsigned short port, void * addr, unsigned long count) \
{ __asm__ __volatile__ ("rep ; ins" #s \
: "=D" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }

#define __OUTS(s) \
static inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
{ __asm__ __volatile__ ("rep ; outs" #s \
: "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }

#define RETURN_TYPE unsigned char
__IN(b,"")
#undef RETURN_TYPE
#define RETURN_TYPE unsigned short
__IN(w,"")
#undef RETURN_TYPE
#define RETURN_TYPE unsigned int
__IN(l,"")
#undef RETURN_TYPE

__OUT(b,"b",char)
__OUT(w,"w",short)
__OUT(l,,int)

__INS(b)
__INS(w)
__INS(l)

__OUTS(b)
__OUTS(w)
__OUTS(l)

#endif

----- Original Message ----- 
From: "Anticipating a Reply" <ruxyz@yahoo.com>
To: "John Levon" <levon@movementarian.org>
Cc: "Usman S. Ansari" <uansari@yahoo.com>; "Iqbal" <iqbal@naturesoft.net>; "Linux Kernel Newbie" <kernelnewbies@nl.linux.org>
Sent: Monday, January 27, 2003 1:04 PM
Subject: Re: About inb, outb, .... !


> Hi !
> 
>   Well I looked into the file
> /usr/src/linux/include/asm-i386/io.h
> 
>   It only has the comment that the outb, inb, outb_p,
> inb_p are defined here , but I did not
> find it there .
> 
>   Please send me the part which defines them .
> 
> Thanks ! 
> 
>  --- John Levon <levon@movementarian.org> wrote: > On
> Sat, Jan 25, 2003 at 09:43:59AM +0000,
> > Anticipating a Reply wrote:
> > 
> > >  Sorry ! But I could not find the definition 
> > > of outb, inb, outb_p, inb_p , etc  for 
> > > x-86 architecture .
> > 
> > include/asm-i386/io.h
> > 
> > regards
> > john
> > -- 
> > " It is quite humbling to realize that the storage
> > occupied by the longest line
> > from a typical Usenet posting is sufficient to
> > provide a state space so vast
> > that all the computation power in the world can not
> > conquer it."
> > - Dave Wallace
> 
> ________________________________________________________________________
> Missed your favourite TV serial last night? Try the new, Yahoo! TV.
>        visit http://in.tv.yahoo.com
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 
> 
> 

zޖwn'iy!^Wvmdzޔ
܆+ކiY)ƊGg{zmzY

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux